Disclosure of Invention
In view of the above drawbacks, the technical problem to be solved by the present invention is to provide a method and a system for quickly establishing a connection between a mobile device and a large-screen device, so as to solve the problems of inconvenient use and poor security in the connection between the mobile device and the large-screen device in the prior art.
Therefore, the invention provides a method for quickly establishing connection between mobile equipment and large-screen equipment, which comprises the following steps:
the large-screen equipment automatically generates the large-screen equipment ID of the large-screen equipment, and automatically generates the AP name of the large-screen equipment according to the large-screen equipment ID;
generating a first connection password by adopting an encryption algorithm according to the AP name of the large-screen device;
the large-screen device sets a WIFI hotspot by using the AP name and the corresponding first connection password, and broadcasts;
the mobile equipment scans the WIFI hotspot to obtain the AP name;
and generating a second connection password by adopting an encryption algorithm the same as that of the large-screen equipment according to the AP name, and automatically connecting with the AP name by using the second connection password.
In the above method, preferably, the large screen device ID is 4 bits, and the method of generating the large screen device ID is as follows:
take the random number between (0, 65535) and convert it to a hexadecimal 4-bit character, the left side of less than 4 bits being zero-padded.
In the above method, preferably, the ID of the large-screen device is 4 bits, and is extracted from hardware information of the large-screen device, where the hardware information is a Mac address or a CPUID of the large-screen device.
In the above method, preferably, the large-screen device ID is regenerated by a reset button, and a new first connection password is generated according to an AP name of the large-screen device.
In the above method, the method for generating the first connection password and the second connection password is the same, and the specific method is as follows:
taking MD5 for the AP name, and then acquiring tail N characters;
selecting non-digits in the N characters, performing modulus extraction on the non-digits and 10, and converting the non-digits into 0-9 digits to replace the corresponding non-digits;
wherein N is any natural number from 8 to 16.
In the method, the mobile device selects the AP name with the maximum WIFI signal strength to connect according to the WIFI signal strength of the AP name.
The invention also provides a system for quickly establishing connection between the mobile equipment and the large-screen equipment, which comprises the following steps:
the server module is arranged on the large-screen equipment and started along with the large-screen equipment, and is used for automatically generating an AP (access point) name and a first connection password and setting a hotspot for broadcasting by using the AP name and the corresponding first connection password; the AP name comprises a large-screen device ID, and the first connection password is generated by adopting an encryption algorithm according to the AP name of the large-screen device;
and the client module is arranged on the mobile equipment and used for generating a second connection password according to the AP name of the large-screen equipment by adopting the same encryption algorithm as the large-screen equipment and automatically connecting with the AP name by using the second connection password.
In the above system, preferably, the server module includes:
the large-screen equipment ID generating unit is used for automatically generating a large-screen equipment ID;
the AP name generating unit is used for automatically generating the AP name of the large-screen equipment according to the ID of the large-screen equipment;
the first connection password generating unit is used for generating the first connection password by adopting an encryption algorithm according to the AP name of the large-screen device;
the client module comprises a second connection password generation unit and is used for generating a second connection password by adopting the same encryption algorithm as the first connection password generation unit according to the AP name of the large-screen device.
In the above system, preferably, the first connection password generating unit and the second connection password generating unit are the same and each include:
the MD5 calculating unit is used for taking MD5 from the AP name and then acquiring the last N characters;
the conversion unit is used for converting the non-numbers in the N characters into 0-9 numbers after modulus extraction with 10;
and the replacing unit is used for correspondingly replacing non-numbers in the N characters with the converted numbers to obtain the first connection password or the second connection password.
In the above system, preferably, the server module is provided with a reset button for regenerating an ID of the large-screen device, and the first connection password generating unit regenerates the first connection password by using an encryption algorithm according to the AP name of the large-screen device.
According to the technical scheme, the method and the system for quickly establishing the connection between the mobile equipment and the large-screen equipment solve the problems of inconvenience in use and poor safety in the prior art.
Compared with the prior art, the invention has the following beneficial effects:
when the mobile equipment is close to the large-screen equipment, the connection password is calculated by using the same encryption algorithm as the large-screen equipment, and then the mobile equipment is automatically connected with the large-screen equipment to complete operations such as screen sharing, file sharing, operation control and the like, so that the mobile equipment is convenient to use. And for the general public, the seen password combination is still complex and random, and cannot be guessed, so that the password security in most cases is ensured.
Detailed Description
The technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without any inventive step, are within the scope of the present invention.
The realization principle of the invention is as follows:
the large-screen equipment automatically generates the large-screen equipment ID of the large-screen equipment, and automatically generates the AP name by using the large-screen equipment ID;
generating a connection password by adopting an encryption algorithm according to the AP name of the large-screen device;
and the mobile equipment obtains a connection password by adopting the same encryption algorithm as that of the large-screen equipment according to the obtained AP name, and is connected with the AP name.
According to the scheme provided by the invention, as long as the AP name of the large-screen equipment is known, the connection password can be calculated by using the same encryption algorithm as that of the large-screen equipment, so that the large-screen equipment is automatically connected, the operations such as screen sharing, file sharing, operation control and the like are completed, and the use is convenient. And for the general public, the seen password combination is still complex and random, and cannot be guessed, so that the password security in most cases is ensured.
In order to make the technical solution and implementation of the present invention more clearly explained and illustrated, several preferred embodiments for implementing the technical solution of the present invention are described below.
It should be noted that the terms of orientation such as "inside, outside", "front, back" and "left and right" are used herein as reference objects, and it is obvious that the use of the corresponding terms of orientation does not limit the scope of protection of the present invention.
Example 1.
Referring to fig. 1, fig. 1 is a method for quickly establishing a connection between a mobile device and a large-screen device according to embodiment 1 of the present invention, where the method includes the following steps:
and step 110, starting the application of the AP server by the large-screen device, automatically generating the large-screen device ID of the large-screen device, and generating the AP name of the large-screen device according to the large-screen device ID.
According to the scheme, because a plurality of large-screen devices of the same brand, the same model or different brands possibly exist, in order to facilitate identification, the AP name is unique as much as possible.
For example, in the present application, the AP name may be formed by a brand model of the large-screen device and the large-screen device ID through a hyphen (e.g., _) connection.
For example: APXXX _ YYYY, where XXX may be the brand name of a large screen device and YYYY is the large screen device ID.
The large screen device ID may be selected to be composed of 4 digits or characters, and the generation of the large screen device ID may be implemented in various ways, for example: the information is generated at any time or extracted from the unique identifier (Mac address, CPU serial number and other information) of the large-screen device (the last 4 bits of the CPU serial number and the like).
And step 120, after the AP name of the large-screen device is generated, generating a first connection password by adopting an encryption algorithm according to the AP name of the large-screen device in the AP name. The first connection password cannot be manually modified and must be automatically generated.
And step 130, the large-screen device sets the WIFI hotspot by using the AP name and the corresponding first connection password, and broadcasts.
Step 140, the mobile device scans the WIFI hotspot to obtain an AP name of the large screen device.
And 150, the mobile equipment obtains a second connection password by adopting the same encryption algorithm as that of the large-screen equipment according to the AP name, and automatically connects with the AP name by using the second connection password.
Since the large screen device ID is the same and the encryption algorithm is the same, the first connection password and the second connection password are also the same.
For example: and the AP is named APXXX _ YYYY, the APXXX _ YYYY is calculated by adopting the same encryption algorithm as that of the large-screen device, so that a second connection password is obtained, and the second connection password is used for automatically connecting to the corresponding AP hotspot.
The AP names of the large-screen devices may have the same prefix, for example, APXXX _, so that when the mobile device connects automatically, only the AP hotspots with specific prefixes may be processed, thereby improving efficiency.
And the mobile device selects the large-screen device with the strongest WIFI signal (generally, the closest device) to connect according to the strength of the AP hotspot WIFI signal.
The following is a specific example of the application of the scheme in screen projection.
Firstly, a screen projection server application is built in a large-screen device end, the screen projection server application automatically runs after the large-screen device is started every time, and the AP name such as TXXX _ YYYYYY is set.
Wherein TXXXXX is the name of the large-screen device, YYYY is the ID of the large-screen device, and the TXXXXXXX is the name of the large-screen device, and YYYY is the ID of the large-screen device and consists of four random numbers or characters. The large screen device ID is generated by taking a random number between (0, 65535) and converting it into a hexadecimal 4-bit character, and zero padding is applied to the left side of less than 4 bits.
In the second step, the MD5 is taken for the large screen device ID "TXXXX _ YYYY" and then the last 8 characters are obtained, for example, the MD5 is taken for the large screen device ID to obtain 98471e6a322b130cd201801249611bf5, and the last 8 characters are 49611bf 5).
The non-digits (ASCII code <48 or >57) in the 8 characters are converted into 0-9 digits after being modulo with 10 respectively, and the digits in the original character string are not converted. If the non-number in 49611bf5 is b, f (the ACII code for letters is 98, 102), it is modulo 10 to number 8, 2, respectively.
And respectively replacing the corresponding non-numbers b and f with the converted 8 and 2 to obtain a final connection password of 49611825, namely, 49611825 as the first connection password of the large-screen equipment end.
And thirdly, the large-screen device sets the WIFI hotspot of the large-screen device by using the name TXXXXX _ YYYYY and the password 49611825.
If the first connection password needs to be replaced, a reset button on the large-screen device can be pressed to regenerate the large-screen device ID, and the second step is repeated to regenerate a new first connection password.
And fourthly, the large-screen equipment starts the network service broadcast AP name TXXXXX _ YYYYY.
And fifthly, a screen projection sending terminal application is built in the notebook computer, and the screen projection sending terminal application runs when a user needs to project a screen. (or automatically starting the resident computer to run in the background, continuously detecting the large-screen equipment, and reminding the user to connect after finding the hot spot of the nearby equipment).
And sixthly, searching peripheral Wifi signals by the screen-casting sending end application, and acquiring the AP name 'TXXXXX _ YYYYY' to perform connection attempt after finding a WIFI hotspot with a TXXX _ YYYYY character. (as if there are a plurality of WIFI hotspots, the WIFI hotspots can be ranked according to the WIFI signal strength, and the large-screen device with the strongest WIFI signal is preferentially connected).
Seventhly, the mobile device obtains MD5 for the AP name "TXXXX _ YYYY" to obtain a character string 98471e6a322b130cd201801249611bf5, then obtains the last 8 characters 49611bf5, modulo the non-numbers b, f in the 8 characters with 10 to be 0-9 digits 8, 2, and correspondingly replaces b and f to obtain a connection password 49611825, namely the second connection password is 49611825. The second connection password is the same as the first connection password.
And step eight, connecting the WIFI hotspot by using the AP name 'TXXXXX _ YYYYY' and a second connection password '49611825', so as to establish connection with the large-screen device.
The ninth step, the service of "containing TXXX string and equipment name" can be found in the network, and the connection request is sent in response to the service information.
And step ten, completing pairing after the large-screen server receives the connection request of the notebook computer.
And eleventh, performing Socket communication between the notebook and the large-screen equipment to realize the network wireless screen projection function.
On the basis of the method, the invention also provides a system for quickly establishing connection between the mobile equipment and the large-screen equipment, which comprises a server module 10 and a client module 20.
The server module 10 is disposed on the large-screen device 30 and is started with the large-screen device 30. The server module 10 is configured to automatically generate an AP name (e.g., APXXX _ YYYY) and a first connection password (e.g., 49611825), and set a hotspot to broadcast using the AP name and the corresponding first connection password; the AP name comprises a large-screen device ID, and the first connection password is generated by adopting an encryption algorithm according to the AP name of the large-screen device.
The client module 20 is disposed on the mobile device 40, and configured to generate a second connection password according to the AP name of the large-screen device by using the same encryption algorithm as that of the large-screen device, and automatically connect with the AP name (WIFI name APXXX _ YYYY, connection password 49611825) by using the second connection password.
Specifically, the server module 10 includes a large-screen device ID generating unit 11, an AP name generating unit 12, and a first connection password generating unit 13.
The large-screen device ID generating unit 11 is configured to automatically generate a large-screen device ID, the AP name generating unit is configured to automatically generate an AP name of the on-screen device according to the large-screen device ID, and the first connection password generating unit 13 is configured to generate a first connection password according to the AP name of the large-screen device by using an encryption algorithm.
The client module 20 includes a second connection password generation unit 21, configured to generate a second connection password according to the AP name of the large screen device by using the same encryption algorithm as that of the first connection password generation unit 13.
The first connection password generation unit and the second connection password generation unit are the same and respectively comprise an MD5 calculation unit, a conversion unit and a replacement unit. The MD5 calculation unit is used for selecting MD5 for the AP name and then acquiring the last N characters; the conversion unit is used for converting the non-numbers in the N characters into 0-9 numbers after modulus extraction with 10; the replacing unit is used for correspondingly replacing non-numbers in the N characters with the converted numbers to obtain the first connection password or the second connection password.
The functions of the modules and units are described in detail in the method, and are not described in detail herein.
With the above description of the specific embodiment, compared with the prior art, the trusted management method and system for the USB interface of the electronic device provided by the present invention have the following advantages:
firstly, the mobile device calculates a connection password by using the same encryption algorithm as that of the large-screen device, and then is automatically connected with the large-screen device to complete operations such as screen sharing, file sharing, operation control and the like, so that the mobile device is convenient to use. And for the general public, the seen password combination is still complex and random, and cannot be guessed, so that the password security in most cases is ensured.
And the second large-screen equipment Id is randomly generated, and an AP name is generated according to the random generation, so that the password can be conveniently reset.
And thirdly, a unique algorithm is adopted to generate the connection password, so that the safety is high, and the practical application can be ensured.
Fourthly, a unique algorithm is adopted to generate a digital connection password, and the use is convenient.
Finally, it should also be noted that the terms "comprises," "comprising," or any other variation thereof, as used herein, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The present invention is not limited to the above-mentioned preferred embodiments, and any structural changes made under the teaching of the present invention shall fall within the scope of the present invention, which is similar or similar to the technical solutions of the present invention.