The content of the invention
In consideration of it, it is an object of the invention to provide a kind of shared authentication method and system, smart machine and control method,
To realize information transfer being carried out by full-duplex channel between smart machine in network, and realize each intelligence in network
The mode of collaborative share certification.
According to foregoing invention purpose, the present invention provides a kind of shared authentication method, and the shared authentication method is applied to
In JXTA networks, the JXTA networks include several smart machines, and methods described includes:
S1, the first smart machine set up service channel, and monitor the of the second smart machine with same pipeline notice
One registration request, log-on message of first registration request comprising second smart machine;
S2, first smart machine generate and store the first authorization code according to the log-on message, and send described
One authorization code information is to the second smart machine;
S3, second smart machine send the comprising first authorization code first connection to the first smart machine again
Request, first smart machine generate according to first authorization code and store a Token (i.e. token, identity security are awarded
Power information) information, and a Token information is returned to second smart machine, second smart machine is according to described
First Token information generates the second connection request, connects and sets up full-duplex channel to first smart machine request.
Preferably, the shared authentication method also includes:
S4, second smart machine send second connection request to the 3rd smart machine, wherein, the 3rd intelligence
Energy equipment is registered to JXTA networks, and notices with the pipeline;
S5, the 3rd smart machine receive second connection request, send the second registration request to first intelligence
Energy equipment, second connection request include a Token information and the 3rd equipment itself log-on message;
S6, first smart machine verify the 3rd smart machine, and include to second smart machine return
2nd Token information of the 3rd smart machine;
S7, second smart machine generate and send the 3rd connection request to described according to the 2nd Token information
3rd smart machine, sets up full-duplex channel with the 3rd smart machine.
Preferably, also included before step S1:
After starting the JXTA networks, the smart machine node listing in the JXTA networks is searched for and obtains;
Send the pipeline and notice each smart machine into the JXTA networks.
Preferably, the first authorization code information includes the second smart machine mark, key information and log-on message.
According to foregoing invention purpose, present invention also offers a kind of smart machine control method, methods described includes:
First smart machine sends the first control information to second smart machine;
Second smart machine monitors first control information;
When first control information is received, the application program of itself is run according to first control information control.
Preferably, methods described also includes:
Second smart machine sends the second control information to first smart machine;
First smart machine monitors second control information;
When second control information is received, the application program of itself is run according to second control information control.
According to foregoing invention purpose, present invention also offers a kind of smart machine, the smart machine is positioned at comprising some
In the JXTA networks of the individual smart machine, including:
Authentication module, for monitoring the first registration request of the second smart machine with same pipeline notice, described the
Log-on message of one registration request comprising second smart machine, and the second smart machine is verified simultaneously according to the log-on message
Generate the first authorization code of storage;
Authentication module, for first authorization code is sent after verifying second smart machine to the second smart machine,
When second smart machine sends the first connection request comprising first authorization code again, authorize according to described first
Code generates and stores a Token information, and returns a Token information to second smart machine, second intelligence
Energy equipment generates the second connection request according to a Token information, connects and sets up to first smart machine request
Full-duplex channel;
The authentication module is additionally operable to when the second smart machine sends second connection request to the 3rd smart machine,
Checking comes from the second registration request of the 3rd smart machine;
The authentication module is additionally operable to return the letters of the 2nd Token comprising the 3rd smart machine to the second smart machine
Breath, second smart machine generate and send the 3rd connection request and set to the 3rd intelligence according to the 2nd Token information
It is standby, full-duplex channel is set up with the 3rd smart machine.
Preferably, the smart machine also includes:
First control module, for monitoring the control information of other smart machines, and when the control information is received, controls
The operation of itself application program.
Present invention also offers a kind of carry out the smart machine that full duplex is connected, the smart machine with above-mentioned smart machine
In the JXTA networks comprising several smart machines, including:
Registration request module, for generating the first registration request to the first smart machine requests verification;
Connection request module, for sending the first connection request comprising first authorization code to the first smart machine,
And the second connection request to the first smart machine and the 3rd smart machine, institute are generated and sent according to a Token information
State the 3rd smart machine and receive second connection request, the second registration request is sent to first smart machine, described the
Two registration requests include a Token information and the 3rd equipment itself log-on message, the first smart machine checking the
Three smart machines, and the 2nd Token information comprising the 3rd smart machine is returned to the second smart machine;
The connection request module is additionally operable to according to the 2nd Token information, generates and sends the 3rd connection request extremely
3rd smart machine, sets up full-duplex channel with the 3rd smart machine.
Preferably, the smart machine also includes:
Second control module, for monitoring the control information of other smart machines, and when the control information is received, controls
The operation of itself application program.
According to foregoing invention purpose, present invention also offers a kind of shared Verification System, the system includes as above arbitrary
Described some smart machines.
Compared with prior art, a kind of shared authentication method of the present invention and system, smart machine and control method, with
Lower beneficial effect:Bi-directional transmission of information is directly carried out by full-duplex channel, transmission control efficiency is improve and is reduced clothes
The cost of investment at business device end;Using full-duplex communication pattern, the efficiency of request sending mode more unidirectional than HTTP is higher with real-time;
Using Token information mechanisms, in the case where internet security is ensured, the access right of equipment in network node can be obtained,
Do not need man-to-man repeated authentication just realize automated log on, realize the shared authenticating party of each device node in network
Formula.
Specific embodiment
As referring in background technology, how based on the shared certification between smart machine in JXTA real-time performance networks
Mode and full-duplex channel connection, are questions of common concern.
Therefore, the present invention provides a kind of shared authentication method, and the shared authentication method is applied in JXTA networks, JXTA nets
Network includes several smart machines, and the first smart machine generates first according to the first registration request of the second smart machine and authorizes
Code, the second smart machine send the comprising the first authorization code first request and are connected to the first smart machine, the life of the first smart machine
Into and send Token (token) information to second smart machine, the second smart machine is sent comprising a Token information
The second connection request to the first smart machine, request connect and set up full-duplex channel;Second smart machine is to the 3rd intelligence
Equipment sends the second connection request, and the 3rd smart machine sends the second registration request to the first smart machine, the first smart machine
The 3rd smart machine is verified, and the 2nd Token information comprising the 3rd smart machine, the second intelligence is returned to the second smart machine
Equipment is generated and sent comprising the 2nd Token information the 3rd connection request to the 3rd smart machine, is set up with the 3rd smart machine
Full-duplex channel, it is achieved thereby that each smart machine is transmitted information by full-duplex channel in network, and realizes network
In the shared certification of each smart machine mode.
Below by way of specific instantiation and embodiments of the present invention are described with reference to the drawings, those skilled in the art can
The further advantage and effect of the present invention are understood easily by content disclosed in the present specification.The present invention also can be different by other
Instantiation implemented or applied, the every details in this specification also can based on different viewpoints with application, without departing substantially from
Various modifications and change are carried out under the spirit of the present invention.
Embodiments of the invention are the communication means based on JXTA networks.JXTA networks are made up of three different levels,
Ground floor is core layer, contains the Core Feature that being serviced is used;The second layer is service layer, there is provided the visit to JXTA agreements
The service of asking;Last application layer obtains JXTA networks using these services.Core layer contains the key concept of JXTA, such as right
Deng node, peer-group, bulletin, pipeline, end points and safety.Service layer includes inquiry, discovery, transfer.Application layer includes resource altogether
Enjoy, instant messaging, typical case's application such as collaborative work.Service layer is that upper strata is quoted and open existing strategy for convenience, for example
Inquiry, discovery, transfer etc., there is provided these services can mitigate the development effort of upper layer application, but whether every kind of service all must
Need, different applications can select the service for oneself needing, it is also possible to oneself develop again service completely.
Flow charts of the Fig. 1 for a kind of shared authentication method of one embodiment of the invention.As shown in figure 1, the shared certification
Method is applied in JXTA networks, and JXTA networks include several smart machines, and the method includes
S1, the first smart machine set up service channel, and monitor the of the second smart machine with same pipeline notice
One registration request, log-on message of first registration request comprising the second smart machine;
S2, the first smart machine generate and store the first authorization code according to the log-on message, and send the first authorization code letter
Cease to the second smart machine;
S3, the second smart machine send the first connection request comprising the first authorization code to the first smart machine again, the
One smart machine generates and stores a Token information according to the first authorization code, and returns a Token information to second intelligence
Energy equipment, the second smart machine generate the second connection request according to a Token information, to the first smart machine request connection simultaneously
Set up full-duplex channel.
Preferably, also include before step S1:
After starting JXTA networks, the first smart machine is searched for and obtains the smart machine node listing in the JXTA networks;
Send pipeline and notice each smart machine into the JXTA networks.
In JXTA networks, pipeline mechanism is main between peer-to-peer communication mechanism in JXTA.JXTA pipe services are carried
Supply to create and access the mechanism of pipeline, pipeline provides simple, indirectly connected asynchronous communication passage for two peer-to-peers.One right
Want to receive the message that other peer-to-peers are transmitted Deng body, just must first set up an input channel, then construct one and the pipe
Notice is finally issued by output channel and its notice that road is connected.Other peer-to-peers set up output channel after searching the notice,
The output channel can just send a message to corresponding input channel, realize the communication between peer-to-peer.
In the embodiment of step S1, after JXTA networks are started, the first smart machine is searched for and obtains the JXTA nets
Smart machine node listing in network, the JXTA module application programs in initialization JXTA networks in each smart machine node, should
JXTA modules include Jar bags, XML file etc..Then the first smart machine creates a service pipeline advertisement, and the advertisement is entered
Row is issued, so that the smart machine communicated in network finds, then according to this one input of service pipeline advertisement creation
Pipeline, the first smart machine are set up and complete service channel.Meanwhile, the first smart machine monitors its in network in the service channel
Its smart machine accesses the connection event of first smart machine.Second smart machine obtains the service pipeline of the first smart machine
Advertisement, and set up and complete service channel to send data, the second smart machine according to its one output channel of establishment.Second intelligence
Energy equipment sends first registration request to first smart machine by the service channel, while the first smart machine listens to this
First registration request, log-on message of first registration request comprising the second smart machine.
In the embodiment of step S2, the first smart machine receives the first registration request of the second smart machine, should
Log-on message of first registration request comprising the second smart machine, verifies the legitimacy of the second smart machine, after being verified, root
The corresponding first authorization code information of second smart machine is generated and is stored according to log-on message, and the first authorization code information includes this
The corresponding identification information of second smart machine, key information and log-on message, then send the first authorization code information to
Two smart machines.
In the specific implementation process of step S3, the second smart machine sends the first connection to the first smart machine again please
Ask, first connection request includes the corresponding first authorization code information of the second smart machine.First smart machine is awarded according to first
The validity of the second smart machine of weighted code Information Authentication.After first smart machine is verified, then believed according to the first authorization code
Cease and pass through JWT (JSON Web Token) licensing scheme and generate and store the corresponding Token information of the second smart machine,
And a Token information is back to into the second smart machine.After second smart machine receives a Token information, that is, possess
The access right of main smart machine.Second smart machine generates the second connection request according to a Token information, to the first intelligence
Device request connects and sets up full-duplex channel.Therefore, set up full duplex to lead between the first smart machine and the second smart machine
Road.
Flow charts of the Fig. 2 for a kind of shared authentication method of further embodiment of this invention.As shown in Fig. 2 the method is also wrapped
Include:
S1, the first smart machine set up service channel, and monitor the of the second smart machine with same pipeline notice
One registration request, log-on message of first registration request comprising the second smart machine;
S2, the first smart machine generate and store the first authorization code according to the log-on message, and send the first authorization code letter
Cease to the second smart machine;
S3, the second smart machine send the first connection request comprising the first authorization code to the first smart machine again, the
One smart machine generates and stores a Token information according to the first authorization code, and returns a Token information to second intelligence
Energy equipment, the second smart machine generate the second connection request according to a Token information, to the first smart machine request connection simultaneously
Set up full-duplex channel.
S4, the second smart machine send the second connection request to the 3rd smart machine, wherein, the 3rd smart machine is registered
To JXTA networks, and notice with pipeline;
S5, the 3rd smart machine receive the second connection request, send the second registration request to the first smart machine, and second connects
Request bag is connect containing a Token information and the 3rd equipment itself log-on message;
S6, the first smart machine verify the 3rd smart machine, and return comprising the 3rd smart machine to the second smart machine
The 2nd Token information;
S7, the second smart machine generate and send the 3rd connection request and set to the 3rd intelligence according to the 2nd Token information
It is standby, full-duplex channel is set up with the 3rd smart machine.
In the embodiment of step S1, after JXTA networks are started, the first smart machine is searched for and obtains the JXTA nets
Smart machine node listing in network, the JXTA module application programs in initialization JXTA networks in each smart machine node.So
First smart machine creates a service pipeline advertisement afterwards, and the advertisement is issued, for the intelligence communicated in network
Energy equipment finds that, then according to this service pipeline one input channel of advertisement creation, the first smart machine sets up the service of completing
Passage.Meanwhile, the first smart machine is monitored other smart machines in network in the service channel and accesses first smart machine
Connection event.Second smart machine obtains the service pipeline advertisement of the first smart machine, and creates an efferent duct according to it
Road is set up and completes service channel to send data, the second smart machine.Second smart machine sends the by the service channel
One registration request is to first smart machine, while the first smart machine listens to first registration request, first registration please
Seek the log-on message comprising the second smart machine.
In the embodiment of step S2, the first smart machine receives the first registration request of the second smart machine, should
Log-on message of first registration request comprising the second smart machine, verifies the legitimacy of the second smart machine, after being verified, root
The corresponding first authorization code information of second smart machine is generated and is stored according to log-on message, and the first authorization code information includes this
The corresponding identification information of second smart machine, key information and log-on message, then send the first authorization code information to
Two smart machines.
In the specific implementation process of step S3, the second smart machine sends the first connection to the first smart machine again please
Ask, first connection request includes the corresponding first authorization code information of the second smart machine.First smart machine is awarded according to first
The validity of the second smart machine of weighted code Information Authentication.After first smart machine is verified, then believed according to the first authorization code
Cease and pass through JWT (JSON Web Token) licensing scheme and generate and store the corresponding Token information of the second smart machine,
And a Token information is back to into the second smart machine.After second smart machine receives a Token information, that is, possess
The access right of main smart machine.Second smart machine generates the second connection request according to a Token information, to the first intelligence
Device request connects and sets up full-duplex channel.
In the specific implementation process of step S4 and S5, the second smart machine is sent out to the 3rd smart machine in JXTA networks
The second connection request is sent, wherein, the 3rd smart machine has already registered with JXTA networkings, and notices with pipeline, sets up and the
The heavy connection of pipe of one smart machine.3rd smart machine receives the second connection request, by the pipeline with the first smart machine
Passage sends the second registration request to the first smart machine, the second connection request include a Token information and the 3rd equipment from
Body log-on message.
In step s 6, after the first smart machine receives the second registration request of the 3rd smart machine, according to the second note
A Token information and the 3rd equipment itself log-on message that volume request bag contains, the second smart machine of checking and the 3rd intelligence set
Standby validity, after being verified, is then awarded according to the 3rd equipment itself log-on message and by JWT (JSON Web Token)
Power mechanism is generated and stores the corresponding 2nd Token information of the 3rd smart machine, and the 2nd Token information is back to the second intelligence
Can equipment.
In the specific implementation process of step S7, the second smart machine receives the second of the first smart machine transmission
Token information, then generates and sends the 3rd connection request to the 3rd smart machine, the second intelligence according to the 2nd Token information
Full-duplex channel is set up between the 3rd smart machine.Therefore, the shared authentication mode of each smart machine in JXTA networks, and
By directly communicating after certification.For example, a router, smart mobile phone and intelligence are included in JXTA networks
TV, smart mobile phone obtain the corresponding Token information that router sends.When the operating rights of smart mobile phone application intelligent television
When, it is not necessary to re-enter username and password and verified, it is only necessary to the corresponding Token information of smart mobile phone is sent to intelligence
TV application connects, the log-on message of the router authentication Token information and intelligent television, and after being verified, smart mobile phone is obtained
The corresponding Token information of intelligent television is obtained, it is hereby achieved that the operating rights of intelligent television, and smart mobile phone and intelligent television
Between set up full-duplex channel connection.
In sum, the smart machine in JXTA networks sets up full-duplex channel connection, carries out bi-directional transmission of information, improves
Transmission control efficiency;While communications are carried out using Token information mechanisms, in the case where internet security is ensured,
The access right of equipment in network node can be obtained, it is not necessary to which man-to-man repeated authentication can just realize automated log on, it is real
The shared authentication mode of each device node in network is showed.
To realize the goal of the invention of the present invention, a kind of smart machine control method is embodiments provided.Fig. 3 is this
A kind of smart machine control method flow chart of inventive embodiments.As shown in figure 3, the method includes:
S301, the first smart machine send the first control information to the second smart machine;
S302, the second smart machine monitor the first control information;
S303, when the first control information is received, runs the application program of itself according to the control of the first control information.
Preferably, the method also includes:
Second smart machine sends the second control information to the first smart machine;
First smart machine monitors the second control information;
When the second control information is received, the application program of itself is run according to the control of the second control information.
In specific implementation process, between the first smart machine and the second smart machine in JXTA networks, heavy connection of pipe is set up
Connection.First smart machine sends the first control information to the second smart machine by heavy connection of pipe, and the second smart machine passes through
Heavy connection of pipe monitors the first control information, when the first control information is received, controls operation itself according to the first control information
Application program.For example, the intelligent watch and intelligent television in JXTA networks sets up heavy connection of pipe connection, and intelligent watch sends one and wraps
Control information containing gravity sensing information is monitored comprising the gravity sensing information to intelligent television, intelligent television by heavy connection of pipe
Control information, when intelligent television receive the control information be when, the application program of gravity sensing is run according to the control information,
Therefore the movement of traffic congestion in the car race game being currently running on intelligent watch control intelligent television.Smart machine control method is also wrapped
Include, the second smart machine sends the second control information to the first smart machine;First smart machine monitors the second control information, when
When receiving the second control information, the application program of itself is run according to the control of the second control information.
To realize the goal of the invention of the present invention, a kind of smart machine is embodiments provided.Fig. 4 is present invention enforcement
The structure chart of a kind of smart machine of example, as shown in figure 4, the smart machine is located at the JXTA networks comprising several smart machines
In, including:
Authentication module 40, the first registration request of the second smart machine noticed with same pipeline for monitoring, first
Log-on message of the registration request comprising the second smart machine, and the second smart machine is verified according to log-on message and storage the is generated
One authorization code;
Authentication module 41, for sending the first authorization code to the second smart machine after verifying the second smart machine, when second
When smart machine sends the first connection request comprising the first authorization code again, generated according to the first authorization code and store first
Token information, and a Token information is returned to second smart machine, the second smart machine is given birth to according to a token information
Into the second connection request, connect and set up full-duplex channel to the request of the first smart machine;
Authentication module 40 is additionally operable to when the second smart machine sends the second connection request to the 3rd smart machine, and checking comes
From in the second registration request of the 3rd smart machine;
Authentication module 41 is additionally operable to return the 2nd token information comprising the 3rd smart machine to the second smart machine, the
Two smart machines generate and send the 3rd connection request to the 3rd smart machine according to the 2nd token information, set with the 3rd intelligence
It is standby to set up full-duplex channel.
Preferably, smart machine also includes:
First control module 42, for monitoring the control information of other smart machines, and when control information is received, control is certainly
The operation of body application program.
Present invention also offers a kind of carry out the smart machine that full duplex is connected with above-mentioned smart machine.Fig. 5 is the present invention
A kind of structure chart of the smart machine of another embodiment.As shown in figure 5, the smart machine is located at comprising several smart machines
JXTA networks in, including:
Registration request module 50, for generating the first registration request to the first smart machine requests verification;
Connection request module 51, for sending the first connection request comprising the first authorization code to the first smart machine, and
Second connection request to the first smart machine and the 3rd smart machine, the 3rd intelligence are generated and sent according to a Token information
Equipment receives the second connection request, sends the second registration request to the first smart machine, and second registration request is comprising described
First Token information and the 3rd equipment itself log-on message, first smart machine verify the 3rd smart machine, and to second
Smart machine returns the 2nd Token information comprising the 3rd smart machine;
Connection request module 51 is additionally operable to according to the 2nd Token information, generates and sends the 3rd connection request to the 3rd intelligence
Energy equipment, sets up full-duplex channel with the 3rd smart machine.
Preferably, smart machine also includes:
Second control module 52, for monitoring the control information of other smart machines, and when control information is received, control is certainly
The operation of body application program.
In specific implementation process, the second smart machine in JXTA networkings is generated to first in registration request module 50
First registration request of smart machine requests verification.The first smart machine in JXTA networkings is by monitoring tool in authentication module 40
There are the first registration request of the second smart machine of same pipeline notice, note of first registration request comprising the second smart machine
Volume information, after the second smart machine receives first registration request, and verifies the second smart machine according to log-on message, generates
And the first authorization code is stored, then the first smart machine sends the first authorization code to the second smart machine by authentication module 41.
After second smart machine receives the first authorization code, sent comprising again to the first smart machine in connection request module 51
First connection request of one authorization code.First smart machine is received in authentication module 41 and is connected from the first of the second smart machine
Request is connect, is generated according to the first authorization code that the first connection request is included and is stored a Token information, and return first
Token information is to second smart machine.Second smart machine is generated according to a token information in connection request module 51
Second connection request, sets up full-duplex channel to the request of the first smart machine.First smart machine is received in authentication module 31
Second connection request, and full-duplex channel is set up with the second smart machine.
Another embodiment of the present invention, the second smart machine in connection request module 51 send second and connect
Ask to the 3rd smart machine, the 3rd smart machine receives the second connection request, send the second registration request and set to the first intelligence
Standby, the second registration request includes a Token information and the 3rd equipment itself log-on message.First smart machine is in authentication module
The second registration request for coming from the 3rd smart machine is received in 40, and verifies the validity of the 3rd smart machine.First intelligence
Equipment returns twoth token information comprising threeth smart machine to the second smart machine by authentication module 41.Second intelligence
Equipment according to the 2nd token information, generates and sends the 3rd connection request to the 3rd smart machine in connection request module 51,
Full-duplex channel is set up with the 3rd smart machine.
According to foregoing invention purpose, present invention also offers a kind of shared Verification System, the system includes as above arbitrary institute
The some smart machines stated.
In sum, a kind of shared authentication method of the present invention and system, smart machine and control method, improve in network
Transfer rate between smart machine;Using Token mechanism ensure network security simultaneously, equipment in network section can be obtained
The access right of point, it is not necessary to which man-to-man repeated authentication can just realize automated log on, there is provided each equipment is common in network
The mode of certification is enjoyed,.
Any those skilled in the art can be repaiied to above-described embodiment under the spirit and the scope without prejudice to the present invention
Decorations and change.Therefore, the scope of the present invention, should be as listed by claims.