A kind of method of device map, control terminal and controlled terminal
Technical field
The invention belongs to the communications field, particularly relate to a kind of method of device map, control terminal and controlled
Terminal.
Background technology
Video game is a kind of interactive multimedia for entertaining, it is common that instigate electricity consumption to regard as display
The electronic game played, game generally can utilize the game paddle being connected to TV to manipulate, wherein TV
Being controlled terminal, game paddle is to control terminal.Game paddle would generally comprise multiple button and stick,
Each button and stick can be endowed specific function, by pressing these buttons or rotating stick,
Operator can control the image on telescreen.
But, video game needs special game paddle (i.e. controlling terminal) to use, and does not has
Versatility.
Summary of the invention
A kind of method that the technical problem to be solved is to provide device map, it is intended to solve TV
Game needs special control terminal to use, the problem without versatility.
First aspect, it is provided that a kind of method of device map, described method includes:
Controlled terminal and sent device enumeration request message to control by remote control protocol RCP data message
Terminal processed, obtains with request and controls the device type list that terminal is supported;
Controlled terminal and received the device type comprising support that control terminal is sent by RCP data message
The response message of list;
Controlled terminal and generated the device type list with described support according to the device type list of described support
In virtual unit corresponding to device type, so that device map that terminal supports will be controlled to by control terminal;
Controlled terminal and sent device data request message to controlling terminal by RCP data message;
By control terminal receive control terminal by RCP data message send comprise control terminal wait reflect
The response message of the device data that jet device generates;
Controlled terminal and described device data is supplied to described virtual unit, then provided by described virtual unit
To upper layer application.
Second aspect, it is provided that a kind of terminal that controlled, described controlled terminal and is included that RCP data message sends
Module, RCP data message receiver module and processor, wherein,
Described RCP data message sending module sends equipment piece by remote control protocol RCP data message
Lift and ask message to controlling terminal, obtain, with request, the device type list that control terminal is supported;
Described RCP data message receiver module receives and controls terminal by comprising that RCP data message sends
The response message of the device type list supported;
Described processor generates the device type list with described support according to the device type list of described support
In virtual unit corresponding to device type, so that device map that terminal supports will be controlled to by control terminal;
Described RCP data message sending module by RCP data message send device data request message to
Control terminal;
Described RCP data message receiver module receives and controls terminal by comprising that RCP data message sends
Control the response message of the device data of the equipment to be mapped generation of terminal;
Described device data is supplied to described virtual unit by described processor, then is provided by described virtual unit
To upper layer application.
The third aspect, it is provided that a kind of method of device map, described method includes:
Control terminal and receive the device enumeration request message sent by RCP data message by control terminal;
Control terminal and obtain the device type list supported;
Control terminal and will comprise the response message of the device type list of described support by RCP data message
It is sent to be controlled terminal, with by being controlled the terminal device type list generation according to described support with described
Virtual unit corresponding to device type in the device type list supported, will control the equipment that terminal is supported
It is mapped to and is controlled terminal;
Control terminal and receive the device data request message sent by RCP data message by control terminal;
Control terminal and obtain the device data of the equipment to be mapped generation controlling terminal;
Control terminal and by RCP data message, the response message comprising described device data is sent to controlled
Terminal processed, to be supplied to described virtual unit by being controlled terminal, then by described virtual by described device data
Equipment is supplied to upper layer application.
Fourth aspect, it is provided that a kind of control terminal, described control terminal include RCP data message sending module,
RCP data message receiver module and processor, wherein,
Described RCP data message receiver module receives and is controlled terminal by setting that RCP data message sends
Standby enumeration request message;
Described processor obtains the device type list supported;
Described RCP data message sending module will comprise the equipment class of described support by RCP data message
The response message of type list is sent to be controlled terminal, with by being controlled the terminal equipment class according to described support
Type list generates the virtual unit corresponding with the device type in the device type list of described support, controlling
The device map that terminal processed is supported is to being controlled terminal;
Described RCP data message receiver module receives and is controlled terminal by setting that RCP data message sends
Standby data request information;
Described processor obtains and controls the device data that the equipment to be mapped of terminal generates;
Described RCP data message sending module will comprise the sound of described device data by RCP data message
Message is answered to be sent to be controlled terminal, described device data to be supplied to described virtual set by being controlled terminal
Standby, then it is supplied to upper layer application by described virtual unit.
In the present invention, owing to being controlled terminal reception control terminal by comprising that RCP data message sends
After the response message of the device type list of described support, controlled the terminal device type according to described support
List generates the virtual unit corresponding with the device type in the device type list of described support, with by control
The device map that terminal is supported is to being controlled terminal;Controlled terminal and received control terminal by RCP datagram
After the response message comprising described device data that literary composition sends, controlled terminal and described device data is supplied to
Described virtual unit, then it is supplied to upper layer application by described virtual unit.Therefore can be by certain in control terminal
Individual device map, to being controlled in terminal, is controlled terminal using the equipment of this mapping as oneself equipment own
Using, therefore the method for this device map has versatility, unrelated with the upper layer application being controlled terminal,
And interface is unified, conveniently calls, there is good autgmentability, setting of the various possible increase of suitable solution terminal
Standby.
Accompanying drawing explanation
Fig. 1 is the flow chart of the method for the device map that the embodiment of the present invention one provides.
Fig. 2 is the flow chart of the method for the device map that the embodiment of the present invention two provides.
Fig. 3 is the functional block diagram by control terminal that the embodiment of the present invention three provides.
Fig. 4 is the functional block diagram of the control terminal that the embodiment of the present invention four provides.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and beneficial effect clearer, below in conjunction with accompanying drawing
And embodiment, the present invention is further elaborated.Should be appreciated that described herein being embodied as
Example only in order to explain the present invention, is not intended to limit the present invention.
In order to technical solutions according to the invention are described, illustrate below by specific embodiment.
The specific embodiment of the invention relates to controlling terminal and being controlled terminal, wherein controls terminal and has to be mapped
Equipment, for being sent to be controlled terminal by the device data that equipment to be mapped generates;Controlled terminal to be used for
The device map to be mapped of terminal will be controlled to being controlled in terminal.
Embodiment one:
Referring to Fig. 1, the method for the device map that the embodiment of the present invention one provides comprises the following steps:
S101, by control terminal by remote control protocol (Remote Control Protocol, RCP) number
Sending device enumeration according to message asks message to controlling terminal, obtains with request and controls the equipment that terminal is supported
List of types;
In the embodiment of the present invention one, control the device type supported of terminal include touch screen, audio frequency apparatus,
The information input equipments such as vibrator, sensor, GPS.
S102, control terminal are received the device enumeration request sent by RCP data message by control terminal and disappear
After breath, control terminal and obtain the device type list supported;
S103, control terminal will comprise the response of the device type list of described support by RCP data message
Message is sent to be controlled terminal;
S104, controlled terminal and receive and control terminal and comprise described support by what RCP data message sent
After the response message of device type list, controlled terminal according to the device type list of described support generate with
The virtual unit that device type in the device type list of described support is corresponding, will control what terminal was supported
Device map is to being controlled terminal;
S105, by control terminal by RCP data message send device data request message to control terminal;
S106, control terminal are received the device data request sent by RCP data message by control terminal and disappear
After breath, control terminal and obtain the device data of the equipment to be mapped generation controlling terminal;
The response message comprising described device data is sent to by S107, control terminal by RCP data message
Controlled terminal;
S108, by control terminal receive control terminal comprise described number of devices by what RCP data message sent
According to response message after, controlled terminal and described device data be supplied to described virtual unit, then by described
Virtual unit is supplied to upper layer application;
In the embodiment of the present invention one, RCP data message includes RCP header and RCP data, and RCP reports
Head includes type of message, command type and data length, and type of message includes request message and response message,
Command type includes device enumeration order, device parameter order and device data order, and described device enumeration please
Seeking the type of message in message is request message, and command type is device enumeration order, described in comprise described
The type of message of the response message of the device type list held is in response to message, and command type is device enumeration life
Order, the type of message in described device data request message is request message, and command type is device parameter life
Order, described in comprise described device data the type of message of response message be in response to message, command type is to set
Standby data command.
In the embodiment of the present invention one, after S108, described method can also comprise the following steps:
After being made to be finished virtual unit by the upper layer application controlling terminal, controlled virtual described in terminal log-down setting
Standby;
Controlled terminal by RCP data message to the request message controlling terminal transmission revoked apparatus;
Control terminal and receive the request being controlled the described revoked apparatus that terminal is sent by RCP data message
After message, nullify the equipment supported and map to by control terminal, and by RCP data message to being controlled
Terminal returns the response message of deregistration.
In the embodiment of the present invention one, sent out by RCP data message owing to controlling terminal reception control terminal
After the response message of device type list comprising described support sent, controlled terminal according to described support
Device type list generates the virtual unit corresponding with the device type in the device type list of described support,
With the device map by controlling terminal support to being controlled terminal;Controlled terminal reception control terminal to pass through
After the response message comprising described device data that RCP data message sends, controlled terminal by described equipment
Data are supplied to described virtual unit, then are supplied to upper layer application by described virtual unit.Therefore can will control
Certain device map in terminal, to being controlled in terminal, is controlled terminal using the equipment of this mapping as oneself
Equipment itself uses, and therefore the method for this device map has versatility, and is controlled the upper of terminal
Layer application is unrelated, and interface is unified, conveniently calls, has good autgmentability, and suitable solution terminal is various
The equipment that may increase.
Embodiment two:
Referring to Fig. 2, the method for the device map that the embodiment of the present invention two provides is in the embodiment of the present invention one
Increase following steps before S101 in the method for the device map provided:
S201, control terminal send broadcast request by RCP data message to the terminal that controlled of global field net
Message, described broadcast request message is used for searching suitably by control terminal;
S202, the described broadcast request sent by RCP data message by control terminal reception control terminal are disappeared
After breath, send response message by RCP data message to controlling terminal;
S203, control after terminal receives and controlled the response message that terminal is sent by RCP data message, to lead to
Crossing RCP data message and sent certification solicited message to controlling terminal, request controls to connect;
S204, the certification solicited message sent by RCP data message by control terminal reception control terminal
After, described certification solicited message is authenticated, by RCP data message to controlling terminal after certification success
Send response message.
In the embodiment of the present invention two, S203 particularly as follows:
Control after terminal receives and controlled the response message that terminal is sent by RCP data message, stochastic generation
First data X, use the first shared key Ks to be encrypted the first data X, will after encryption the
The unique identifier of one data X and control terminal sends certification by RCP data message to by control terminal
Solicited message, described first shared key Ks is to control terminal and controlled the key that terminal is shared;Described
Type of message in certification solicited message is request message, and command type is authentication command, RCP data portion
Dividing front 4 bytes is to control the unique identifier of terminal, and remaining part is shared key.
In the embodiment of the present invention two, S204 particularly as follows:
Controlled after terminal receives and control the certification solicited message that terminal is sent by RCP data message, use
The first data X after encryption are decrypted and obtain the first data X by the first shared key Ks, then make
Being encrypted the first data X+D by the first shared key Ks, wherein D is for controlling terminal and being controlled eventually
The fixed value of end agreement;Meanwhile, stochastic generation the second data Y, use the first shared key Ks to second
Data Y are encrypted, by the second data Y after encryption, the first data X+D after encryption and quilt
The unique identifier controlling terminal sends response message by RCP data message to controlling terminal;Described response
Type of message in message is in response to message, and command type is authentication command, 4 bytes before RCP data division
For being controlled the unique identifier of terminal, rear 4 bytes are the first data X+D after encryption, last 4 words
Joint is the second data Y after encryption.
In the embodiment of the present invention two, after S204, described method is further comprising the steps of:
S205, control after terminal receives and controlled the response message that terminal is sent by RCP data message, to make
By the first shared key Ks, the first data X+D after the second data Y after encryption and encryption are carried out
Deciphering, calculates the value of first data X+ the second data Y, then re-uses the first shared key Ks to meter
The result calculated is encrypted;
S206, control terminal will encryption after calculating result by RCP data message to by control terminal send out
Send request message;Type of message in described solicited message is request message, and command type is authentication command,
Before RCP data division, 4 bytes are to control the unique identifier of terminal, and rear 4 bytes are the first number after encryption
Value according to X+ the second data Y.
S207, controlled after terminal receives and control the request message that terminal is sent by RCP data message, to make
Being decrypted data by the first shared key Ks, then checking result of calculation is the most correct, if calculating knot
Fruit is correct, then stochastic generation the second shared key Ka, and it is close to use the first shared key Ks to share second
Key Ka is encrypted;
S208, controlled terminal and by the second shared key Ka after encryption and controlled unique mark of terminal
Know symbol and send response message, wherein, described second shared key by RCP data message to controlling terminal
Ka is to control terminal and controlled the key talked with for this that terminal is shared;Report in described response message
Literary composition type is in response to message, and command type is authentication command, and before RCP data division, 4 bytes are to be controlled eventually
The unique identifier of end, rear 4 bytes are the second shared key Ka of encryption.
After S208, the RCP data division of all RCP data messages is all through the second shared key
Ka is encrypted.
In the embodiment of the present invention two, described in the method for the device map of the embodiment of the present invention one offer
Control terminal and receive the request message being controlled the described revoked apparatus that terminal is sent by RCP data message
After, nullify the equipment supported and map to by control terminal, and by RCP data message to being controlled terminal
Following steps are also increased after the step of the response message returning deregistration:
After S209, control terminal complete being controlled the operation of terminal, control terminal by RCP data message
Solicited message is exited to being controlled terminal transmission;
S2010: after being controlled to exit solicited message described in terminal reception, clear up corresponding resource, and pass through
RCP data message sends response message to controlling terminal.
In the embodiment of the present invention two, the concrete form of RCP data message can be as shown in table 1:
Table 1
Wherein, RCP header format can be as shown in table 2:
Table 2
The meaning of each field is as follows:
The version of Ver:RCP;
Type: type of message, can be divided into 2 classes, including:
A, request message, macrodefinition is: REQUEST;
B, response message, macrodefinition is: REPLY;
Cmd: command type, can be divided into 4 classes, including:
A, authentication command
B, device enumeration order
C, device parameter order
D, device data order
ErrorCode: type of error, can be divided into 2 classes, including:
A, order run succeeded, and macrodefinition is: OK;
B, order perform mistake, and macrodefinition is: ERROR;
Length: data length, does not include header;
Digest: to whole data message calculate verification and.
Wherein, the message of RCP data message is divided into four types:
TYPE_AUTH: message identifying.
When being authenticated, the first character joint of data field will be as AUTH_PHASE, and labelling is current
The authentication phase carried out.Subsequent byte, according to the description in certification mutual stage, is entered by the data in corresponding stage
Row is filled.
TYPE_DEV_LIST: device enumeration message.
When carrying out device enumeration, the list of devices of return wraps in data field and lists each equipment successively.
By character between each two facility information ' 0 ' separate.
TYPE_DEV_PARA: device parameter message.
When carrying out device parameter request, the data message of return is in data segment first character feast-brand mark bright equipment class
Type, byte behind is according to the device parameter data structure pad device parameter specified.
TYPE_DEV_DATA: device data message.
When returning equipment data, the data message of return in the data segment bright device type of first character feast-brand mark,
Byte behind is filled according to the device data data structure specified.
RCP data field:
Data length:
RCP determines the length of data field by the Length field of header, meanwhile, in each data
Afterbody all can fill the ’ 0 ' character of not more than 8 bytes, to guarantee the integral multiple that data length is 8.
2. data check:
After the content of data segment is the most ready, it will the Digest field of header is set to full 0,
Then verifying whole data message, algorithm verifies and consistent with IP.
3. data form:
If without specified otherwise, all data forms are all binary data, direct corresponding each item data structure.
The syllable sequence of each item data structure all uses network bytes sequence.
4. data encryption:
In authentication phase, the data field of RCP is plaintext transmission.But after certification success, RCP's
The key using certification to consult out is encrypted, to guarantee safety by all data interactions.
In the embodiment of the present invention two, due to certification success after, the RCP of all RCP data messages
Data division all passes through the second shared key Ka consulting out and is encrypted, and is therefore possible to prevent network to detect
Listen, Replay Attack, password are guessed, follow the tracks of address attack etc., thus ensure that control terminal and controlled
Communication security between terminal.
Embodiment three:
Referring to Fig. 3, the terminal that controlled that the embodiment of the present invention three provides includes: RCP data message sends
Module 11, RCP data message receiver module 12 and processor 13, wherein,
RCP data message sending module 11 sends device enumeration by remote control protocol RCP data message
Request message is given and is controlled terminal, obtains with request and controls the device type list that terminal is supported;
RCP data message receiver module 12 receive control terminal by RCP data message send comprise prop up
The response message of the device type list held;
Processor 13 generates the device type list with described support according to the device type list of described support
In virtual unit corresponding to device type, so that device map that terminal supports will be controlled to by control terminal;
RCP data message sending module 11 sends device data request message to control by RCP data message
Terminal processed;
RCP data message receiver module 12 receives control terminal and comprises control by what RCP data message sent
The response message of the device data that the equipment to be mapped of terminal processed generates;
Described device data is supplied to described virtual unit by processor 13, then is supplied to by described virtual unit
Upper layer application.
In the embodiment of the present invention three, described device data is supplied to described virtual unit by described processor 13,
After being supplied to upper layer application by described virtual unit again, also include:
After being made to be finished virtual unit by the upper layer application controlling terminal, described virtual set nullified by processor 13
Standby;
RCP data message sending module 11 sends revoked apparatus by RCP data message to controlling terminal
Request message, maps to by control terminal with the equipment supported by control terminal log-down.
In the embodiment of the present invention three, described RCP data message sending module 11 is by remote control protocol RCP
Before data message transmission device enumeration request message is to controlling terminal, also include:
RCP data message receiver module 12 is received and controls terminal and looked into by being used for of sending of RCP data message
Look for and suitably controlled terminal broadcast request message;
RCP data message sending module 11 sends response message by RCP data message to controlling terminal;
RCP data message receiver module 12 receives control terminal please by the certification that RCP data message sends
Seek information;
Described certification solicited message is authenticated by processor 13, and after certification success, RCP data message sends
Module 11 sends response message by RCP data message to controlling terminal.
In the embodiment of the present invention three, described certification solicited message is authenticated by described processor 13, and certification becomes
After merit, RCP data message sending module 11 sends response message tool by RCP data message to controlling terminal
Body is:
The certification solicited message that the control terminal received is sent by RCP data message, processor
13 use the first shared key Ks to be decrypted the first data X after encryption obtains the first data X,
Then using the first shared key Ks to be encrypted the first data X+D, wherein D is for controlling terminal and quilt
Control the fixed value of terminal agreement;Meanwhile, stochastic generation the second data Y, use the first shared key Ks
Second data Y are encrypted, RCP data message sending module 11 will encryption after the second data Y,
The first data X+D after encryption and controlled the unique identifier of terminal by RCP data message to control
Terminal processed sends response message, and wherein said certification solicited message comprises the first data X after encryption and control
The unique identifier of terminal processed, described first shared key Ks is to control terminal and shared by controlling terminal
Key;
In the embodiment of the present invention three, described certification solicited message is authenticated by described processor 13, and certification becomes
After merit RCP data message sending module 11 by RCP data message to control terminal send response message it
After, also include:
The request that RCP data message receiver module 12 reception control terminal is sent by RCP data message disappears
Breath;Wherein, described request message comprises the result of the calculating after encryption, the result of the calculating after described encryption
Refer to that controlling terminal uses the first shared key Ks to the after the second data Y after encryption and encryption
One data X+D are decrypted, and calculate the value of first data X+ the second data Y, then re-use first
Shared key Ks the result calculated is encrypted after the result of calculating;
Processor 13 uses the first shared key Ks to be decrypted data, and then whether checking result of calculation
Correctly, if result of calculation is correct, then stochastic generation the second shared key Ka, and use the first shared key
Second shared key Ka is encrypted by Ks;
RCP data message sending module 11 is by the second shared key Ka after encryption and is controlled terminal
Unique identifier sends response message, afterwards, all RCP numbers by RCP data message to controlling terminal
All being encrypted through the second shared key Ka according to the RCP data division of message, wherein, described second altogether
Enjoying key Ka is to control terminal and controlled the key talked with for this that terminal is shared.
In the embodiment of the present invention three, RCP data message includes RCP header and RCP data, and RCP reports
Head includes type of message, command type and data length, and type of message includes request message and response message,
Command type includes device enumeration order, device parameter order and device data order, and described device enumeration please
Seeking the type of message in message is request message, and command type is device enumeration order, described in comprise described
The type of message of the response message of the device type list held is in response to message, and command type is device enumeration life
Order, the type of message in described device data request message is request message, and command type is device parameter life
Order, described in comprise described device data the type of message of response message be in response to message, command type is to set
Standby data command.
In the embodiment of the present invention three, control owing to being received by the RCP data message receiver module controlling terminal
After the response message of device type list comprising described support that terminal is sent by RCP data message, quilt
The processor controlling terminal generates the device type row with described support according to the device type list of described support
The virtual unit that device type in table is corresponding, will control device map that terminal supports to by control terminal;
Received by the RCP data message receiver module controlling terminal and control what terminal was sent by RCP data message
After comprising the response message of described device data, by the processor controlling terminal, described device data is supplied to
Described virtual unit, then it is supplied to upper layer application by described virtual unit.Therefore can be by certain in control terminal
Individual device map, to being controlled in terminal, is controlled terminal using the equipment of this mapping as oneself equipment own
Using, therefore the method for this device map has versatility, unrelated with the upper layer application being controlled terminal,
And interface is unified, conveniently calls, there is good autgmentability, setting of the various possible increase of suitable solution terminal
Standby.And owing to, after certification success, the RCP data division of all RCP data messages all passes through negotiation
The second shared key Ka out is encrypted, and is therefore possible to prevent network intercepting, Replay Attack, password
Word conjecture, tracking address attack etc., thus ensure that the communication security controlling terminal and being controlled between terminal.
Embodiment four:
Referring to Fig. 4, the control terminal that the embodiment of the present invention four provides includes: RCP data message sends mould
Block 21, RCP data message receiver module 22 and processor 23, wherein,
RCP data message receiver module 22 receives and is controlled the equipment that terminal is sent by RCP data message
Enumeration request message;
Processor 23 obtains the device type list supported;
RCP data message sending module 21 will comprise the device type of described support by RCP data message
The response message of list is sent to be controlled terminal, with by being controlled the terminal device type according to described support
List generates the virtual unit corresponding with the device type in the device type list of described support, with by control
The device map that terminal is supported is to being controlled terminal;
RCP data message receiver module 22 receives and is controlled the equipment that terminal is sent by RCP data message
Data request information;
Processor 23 obtains and controls the device data that the equipment to be mapped of terminal generates;
RCP data message sending module 21 will comprise the response of described device data by RCP data message
Message is sent to be controlled terminal, described device data is supplied to described virtual unit by by control terminal,
It is supplied to upper layer application again by described virtual unit.
In the embodiment of the present invention four, described RCP data message sending module 21 is by RCP data message
It is sent to be controlled terminal by the response message comprising described device data, to be set described by by control terminal
Standby data are supplied to described virtual unit, then after being supplied to upper layer application by described virtual unit, also include:
RCP data message receiver module 22 receives and is controlled the cancellation that terminal is sent by RCP data message
The request message of equipment;
Processor 23 is nullified the equipment supported and is mapped to by control terminal;
RCP data message sending module 21 returns deregistration by RCP data message to by control terminal
Response message.
In the embodiment of the present invention four, described RCP data message receiver module 22 receives and is led to by control terminal
Before crossing the device enumeration request message that RCP data message sends, also include:
RCP data message sending module 21 is sent out to the terminal that controlled of global field net by RCP data message
Broadcast request message, described broadcast request message is sent to be used for searching suitably by control terminal;
RCP data message receiver module 22 receives and is controlled the response that terminal is sent by RCP data message
Message;
RCP data message sending module 21 is asked to being controlled terminal transmission certification by RCP data message
Information, request controls to connect, and to be authenticated described certification solicited message by by control terminal, certification becomes
Response message is sent by RCP data message to controlling terminal after merit.
In the embodiment of the present invention four, described RCP data message sending module 21 is by RCP data message
To by control terminal send certification solicited message, request control connect particularly as follows:
Processor 23 stochastic generation the first data X, use the first shared key Ks to carry out the first data X
Encryption, RCP data message sending module 21 is by the first data X after encryption and controls the unique of terminal
Identifier sends certification solicited message, described first shared key by RCP data message to by control terminal
Ks is to control terminal and controlled the key that terminal is shared.
In the embodiment of the present invention four, described by control terminal described certification solicited message is authenticated, recognize
After demonstrate,proving successfully by RCP data message after controlling terminal transmission response message, also include:
RCP data message receiver module 22 receives and is controlled the response that terminal is sent by RCP data message
After message, after processor 23 uses the first shared key Ks to the second data Y after encryption and encryption
The first data X+D be decrypted, calculate the value of first data X+ the second data Y, then re-use
The result calculated is encrypted by the first shared key Ks;
The result of the calculating after encryption is passed through RCP data message to quilt by RCP data message sending module 21
Control terminal and send request message, to generate the second shared key Ka by being controlled terminal, wherein, described the
Two shared keys Ka are to control terminal and controlled the key talked with for this that terminal is shared.
In the embodiment of the present invention four, RCP data message includes RCP header and RCP data, and RCP reports
Head includes type of message, command type and data length, and type of message includes request message and response message,
Command type includes device enumeration order, device parameter order and device data order, and described device enumeration please
Seeking the type of message in message is request message, and command type is device enumeration order, described in comprise described
The type of message of the response message of the device type list held is in response to message, and command type is device enumeration life
Order, the type of message in described device data request message is request message, and command type is device parameter life
Order, described in comprise described device data the type of message of response message be in response to message, command type is to set
Standby data command.
In the embodiment of the present invention four, pass through RCP owing to controlling the RCP data message sending module of terminal
The response message of the device type list comprising described support is sent to be controlled terminal by data message, with by
Controlled terminal to generate in the device type list with described support according to the device type list of described support
The virtual unit that device type is corresponding, with the device map by controlling terminal support to being controlled terminal;Control
The RCP data message sending module of terminal will comprise the response of described device data by RCP data message
Message is sent to be controlled terminal, described device data is supplied to described virtual unit by by control terminal,
It is supplied to upper layer application again by described virtual unit.Therefore can be by certain device map in control terminal to quilt
Control in terminal, controlled terminal and the equipment of this mapping is used, therefore as oneself equipment own
The method of this device map has versatility, unrelated with the upper layer application being controlled terminal, and interface is unified,
Conveniently call, there is good autgmentability, the various equipment that may increase of suitable solution terminal.And due to
After certification success, the RCP data division of all RCP data messages all passes through consult out second altogether
Enjoy key Ka to be encrypted, be therefore possible to prevent the conjecture of network intercepting, Replay Attack, password, follow the tracks of
Address attack etc., thus ensure that the communication security controlling terminal and being controlled between terminal.
One of ordinary skill in the art will appreciate that all or part of step realizing in above-described embodiment method is
Can instruct relevant hardware by program to complete, described program can be stored in a computer-readable
Taking in storage medium, described storage medium, such as ROM/RAM, disk, CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all at this
Any amendment, equivalent and the improvement etc. made within bright spirit and principle, should be included in the present invention
Protection domain within.