Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, rightThe present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, andIt is not used in the restriction present invention.
The union ID that the embodiment of the present invention passes through acquisition wechat user;It is obtained and the union ID couple from serverThe binding information answered;Smart machine and its identification information to be visited are obtained from acquired binding information, and according to describedIdentification information obtains the status information and IP address of the smart machine to be visited from server;When the status information isWhen the smart machine to be visited is online, then http request is sent to the smart machine to be visited according to the IP addressMessage, and the identifying code that the smart machine to be visited is returned according to the http request message is received, use the verifyingCode accesses the smart machine to be visited;Smart machine is logged in and remotely accessed using wechat authorization to realize, and oneA wechat user can bind multiple and different smart machines, it is not necessary that special access account is in addition arranged, solve existing skillArt needs to be arranged for each smart machine individual server to manage the access account of different user and asking for encrypted messageTopic, has effectively saved resource.The embodiment of the present invention also provides corresponding devices, and which will be described in detail below.
Fig. 1 shows the implementation process of remote access method provided in an embodiment of the present invention.
In embodiments of the present invention, the remote access method be applied to intelligent terminal, including but not limited to smart phone,Tablet computer etc..Smart machine to be visited includes but is not limited to intelligent TV set, intelligent washing machine, intelligent refrigerator etc..
Wherein, user is smart machine setting bound secret in advance, and the bound secret is that server carries out bindingsWhen validating documents.Smart machine receives the bound secret of user setting, and the bound secret is sent to serverIt is stored.After wechat user starts wechat and pays close attention to wechat public's account, input under the wechat public account wait tie upThe identification information and bound secret of fixed smart machine.The intelligent terminal obtain smart machine to be bound identification information andBound secret;And the identification information of the smart machine to be bound and bound secret are sent to server together, with requestThe server carries out bindings.Herein, server first verifies whether the bound secret is the intelligence to be boundThe preset bound secret of equipment, and establish after being proved to be successful the identification information of the smart machine to be bound with it is described micro-Mapping relations between the union ID of credit household, to bind the wechat user and the smart machine to be bound.It is optionalThe union ID on ground, a wechat user can be bound with the identification information of multiple and different smart machines, an intelligenceThe identification information of equipment can also be bound with the union ID of multiple and different wechat users.When being remotely accessed,The corresponding smart machine bound then is obtained according to the union ID of wechat user.
Refering to fig. 1, the remote access method includes:
In step s101, the union ID of wechat user is obtained.
Herein, it is the wechat user distribution same micro- that the union ID of the wechat user, which is wechat server,Believe the identification information under open platform.As a preferable example of the invention, Fig. 2 shows provided in an embodiment of the present invention remoteThe specific implementation flow of step S101 in journey access method.Referring to Fig.2, the step S101 includes:
In step s 201, judge in local authorization database whether the union ID of the existing wechat user.
In embodiments of the present invention, when each user remotely accesses, i.e., user opens access software, first determines whether to useWhether the login at family is to first log into, and specially judges whether there is the wechat user's kept in local authorization databaseunion ID.If being stored with the union ID of wechat user in database, illustrates that this login does not first log into, execute stepRapid S202.Otherwise, if there is no the union ID of wechat user in local authorization database, illustrate that this logs on as stepping on for the first timeRecord executes step S203.
In step S202, the union ID is extracted from the local authorization database.
In step S203, wechat authorization interface is loaded, to prompt the wechat user to carry out wechat Authorized operation, andThe union ID that the wechat user is obtained after authorization stores the union ID into the local authorization database.
Herein, the embodiment of the present invention is integrated with the library file provided by wechat.When to first log into, then wechat is calledThe library file of offer pops up the interface at wechat authorization interface, and jumps to wechat authorization interface, with prompt the wechat user intoRow wechat Authorized operation;And after the wechat user carries out Authorized operation, the union ID of the wechat user is obtained, is depositedThe union ID is stored up into database.When logging on, then the wechat can be directly obtained from local authorization databaseThe union ID of user.
In step s 102, the union ID is sent to server, and obtains the binding letter that the server returnsIt ceases, includes all smart machines with union ID binding in the binding information.
Herein, the union ID of the wechat user is bound with the smart machine in advance.Specifically, detecingAfter measuring the wechat user concern wechat public account, user is prompted to input the identification information of smart machine to be bound and tie upDetermine password;The identification information of the smart machine to be bound and bound secret are sent to server together, described in requestWhether bound secret described in server authentication is preset bound secret, and the intelligence to be bound is established after being proved to be successfulMapping relations between the identification information of equipment and the union ID of the wechat user.
The embodiment of the present invention by the way that the union ID is sent to server, with inquire on the server it is all with it is describedThe smart machine of union ID binding.Since developer can possess multiple mobile applications, net under same wechat open platformIt stands mobile application, website application or public account of the application perhaps under the same wechat open platform of public platform, user'sUnion ID is unique.The union ID has unified different mobile applications under same wechat open platform, websiteUsing or public platform user identifier.Therefore, available open by same wechat to user according to the union IDSmart machine bound in different wechat public's accounts under platform, and a wechat user can bind multiple and different intelligenceEnergy equipment, greatly facilitates the management to access account.
In step s 103, according to user's selection obtained from the binding information of the acquisition smart machine to be visited andThe identification information is sent to the server by its identification information, receives the intelligence to be visited that the server returnsThe status information and IP address of energy equipment.
Herein, after receiving at least one smart machine with union ID binding of server return, intelligenceTerminal shows the smart machine of binding in the form of a list, and user can select intelligence to be visited to set from the listIt is standby.Intelligent terminal detects user's operation, selects to obtain smart machine and its corresponding identification information to be visited according to user, andAccording to the identification information to server inquiry and the status information and IP address of the smart machine to be visited.
In step S104, when the status information is that the smart machine to be visited is online, according to the IPLocation sends http request message to the smart machine to be visited, and receives the verifying that the smart machine to be visited returnsCode.
In step s105, the smart machine is accessed using the identifying code.
In embodiments of the present invention, smart machine can send one to server every specified time after connecting networkData packet.Server determines that smart machine is online by receiving the data packet;When server is more than not receive specified timeTo smart machine send data packet when, it is determined that the smart machine is offline.
If it is online to inquire the smart machine to be visited, intelligent terminal sends http request to the IP address and disappearsIt ceases, includes the union ID of the wechat user in the http request message, to carry out purview certification.The smart machineAfter embedded WebServer receives the union ID, the union ID is inquired on the server and whether is established with itself and is reflectedPenetrate relationship.If so, identifying code is returned to, to issue access authority.Herein, the identifying code is Token, i.e. access token.Each token has certain timeliness.The token received is dealt into intelligence to be visited and set by access, intelligent terminal every timeStandby, whether smart machine to be visited verifies this token expired, if expired or mistake, cannot access, if accessSuccess, then can refresh the timeliness of token.Herein, when intelligent terminal receives the Token that the smart machine to be visited returnsAfterwards, then the smart machine to be visited is accessed using the Token, i.e., visits every time to smart machine to be visitedThe Token is taken when asking operation to carry out permission identification.Smart machine to be visited by according to the timeliness of the Token comeJudge whether this access is effective.
In conclusion the embodiment of the present invention passes through the union ID of binding wechat account and the identification information of smart machine,It realizes and remotely accesses different smart machines using wechat authorization, and a wechat user is supported to bind multiple smart machines,Multiple wechat users bind same smart machine, facilitate more people's share media resources and manage smart machine jointly, are not necessarily toSpecial access account is set, efficiently solves the prior art and need that individual server is arranged for each smart machineThe problem of managing the account and encrypted message of different user, has saved resource.
Optionally, the remote access method further include:
If the binding information that the server returns can not be got, show that bindings indicate information, to guideIt states wechat user and carries out bindings between the union ID and smart machine.
When the smart machine information with union ID binding that the server returns can not be received, show to work asPreceding wechat user and unbound any smart machine, for example, paid close attention to specified wechat public account but do not carried out bindings, becauseThis, access software prompts user to carry out bindings, further, user can be prompted to enter the specified wechat public accountThe page specifies the guidance of wechat public's account to carry out bindings by preset bound secret according to this.Implement in the present inventionIn example, the bound secret is arranged on each smart machine by user, and the bound secret set is uploaded to server.When withAfter the specified wechat public's account of family concern, the mark letter of smart machine to be bound is inputted under the wechat public accountBreath and bound secret, and it is sent to server.Whether bound secret described in server authentication is the bound secret pre-set,If so, establishing the mapping relations of the union ID of wechat user and the identification information of the smart machine.Herein, sameThe union ID of wechat user can establish mapping relations with the identification information of multiple and different smart machines, and different wechats is usedThe union ID at family can also establish mapping relations with the identification information of the same smart machine.
Optionally, the status information and IP address for receiving the smart machine to be visited that the server returns itAfterwards, the method also includes:
When the status information is that the smart machine to be visited is offline, the offline prompt letter of display smart machineBreath.
Optionally, the remote access method further include:
When getting the request of wechat user cancellation and the binding of smart machine, by the identification information of the smart machineAnd the union ID of wechat user is sent to server, with request the server release the identification information of the smart machine withMapping relations between the union ID of the wechat user.
Correspondingly, at smart machine end, cancellation request can also be initiated.Server is according to cancellation request releasingMapping relations between the identification information of smart machine and the union ID of the wechat user, with cancel the smart machine withBinding between the wechat user.After the unmapped relationship of server, the wechat user for being cancelled binding be will be unable to remotelyAccess the smart machine.
The union ID that the embodiment of the present invention passes through acquisition wechat user;It is obtained and the union ID couple from serverThe binding information answered;Smart machine and its identification information to be visited are obtained from acquired binding information, and according to describedIdentification information obtains the status information and IP address of the smart machine to be visited from server;When the status information isWhen the smart machine to be visited is online, then http request is sent to the smart machine to be visited according to the IP addressMessage, and the identifying code that the smart machine to be visited is returned according to the http request message is received, use the verifyingCode accesses the smart machine;Smart machine is logged in and remotely accessed using wechat authorization to realize, and a wechat is usedFamily can bind multiple and different smart machines, and it is not necessary that special access account is in addition arranged, solving prior art needs isThe problem of individual server is arranged to manage the account and encrypted message of different user in each smart machine, effectively savesResource.
Fig. 3 shows the composed structure of remote access apparatus provided in an embodiment of the present invention, for ease of description, only showsPart related to the embodiment of the present invention.
In embodiments of the present invention, the remote access apparatus is as described in the examples remote for realizing above-mentioned Fig. 1 or Fig. 2Journey access method can be the unit of the software unit for being built in intelligent terminal, hardware cell or software and hardware combining.The intelligenceEnergy terminal includes but is not limited to smart phone, tablet computer etc..
Refering to Fig. 3, the remote access apparatus includes:
First obtains module 31, for obtaining the union ID of wechat user;
Second obtains module 32, for the union ID to be sent to server, and obtains what the server returnedBinding information includes all smart machines with union ID binding in the binding information;
Third obtains module 33, for according to user's selection obtain from the binding information smart machine to be visited andThe identification information is sent to the server by its identification information, receives the intelligence to be visited that the server returnsThe status information and IP address of energy equipment;
Access request module 34, for when the status information be the smart machine to be visited it is online when, according to instituteIt states IP address and sends http request message to the smart machine to be visited, and receive the smart machine to be visited and returnIdentifying code;
Access modules 35, for accessing the smart machine to be visited using the identifying code.
Further, the first acquisition module 31 includes:
Judging unit 311, for judge in local authorization database whether the union ID of the existing wechat user;
First acquisition unit 312 is when being, from the local authorization database for the judging result in judging unitExtract the union ID;
Second acquisition unit 313, for the judging result in judging unit be it is no when, load wechat authorization interface, to mentionShow that the wechat user carries out wechat Authorized operation, and obtains the union ID of the wechat user after authorization, it will be describedUnion ID is stored into the local authorization database.
Further, described device further include:
Binding module 36 prompts user defeated after detecting the specified wechat public's account of the wechat user concernEnter the identification information and bound secret of smart machine to be bound;By the identification information of the smart machine to be bound and bindingPassword is sent to server together, to request whether bound secret described in the server authentication is preset bound secret, andThe mapping relations between the identification information of the smart machine and the union ID of the wechat user are established after being proved to be successful;Wherein, the union ID is the mark letter under same wechat open platform that wechat server is the wechat user distributionBreath.
Further, described device further include:
First display module, if the binding information returned for that can not get the server, shows bindingsInformation is indicated, to guide the wechat user to carry out the bindings between the union ID and smart machine.
Further, described device further include:
Second display module, for when the status information is that the smart machine is offline, display smart machine to be offlinePrompt information.
It should be noted that the device in the embodiment of the present invention can be used to implement whole skills in above method embodimentThe function of art scheme, each functional module can be implemented according to the method in above method embodiment, specific implementationProcess can refer to the associated description in examples detailed above, and details are not described herein again.
The union ID that the embodiment of the present invention passes through acquisition wechat user;It is obtained and the union ID couple from serverThe binding information answered;Smart machine and its identification information to be visited are obtained from acquired binding information, and according to describedIdentification information obtains the status information and IP address of the smart machine to be visited from server;When the status information isWhen the smart machine to be visited is online, then http request is sent to the smart machine to be visited according to the IP addressMessage, and the identifying code that the smart machine to be visited is returned according to the http request message is received, use the verifyingCode accesses the smart machine to be visited;Smart machine is logged in and remotely accessed using wechat authorization to realize, and oneA wechat user can bind multiple and different smart machines, it is not necessary that special access account is in addition arranged, solve existing skillArt needs to be arranged for each smart machine individual server to manage the access account of different user and asking for encrypted messageTopic, has effectively saved resource.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosureMember and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actuallyIt is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technicianEach specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceedThe scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing descriptionIt with the specific work process of unit, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In several embodiments provided herein, it should be understood that disclosed remote access method and device, it canTo realize by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the module,The division of unit, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple unitsOr component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, instituteDisplay or the mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unitIndirect coupling or communication connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multipleIn network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme's.
In addition, each functional unit in each embodiment of the present invention, module can integrate in one processing unit,Can be each unit, module physically exists alone, can also be integrated in one unit with two or more units, moduleIn.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent productIt is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other wordsThe part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meterCalculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be aPeople's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are depositedThe various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyThose familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all containLid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.