Summary of the invention
It is insufficient the purpose of the present invention is overcoming in above-mentioned background technique, DLNA in a kind of Android intelligent television is provided and is thrownThe method for shielding authority managing and controlling is realized based on the rights management for throwing screen equipment information, can be implemented forever for determining credible equipmentScreen authorization is thrown long, and the throwing screen of unknown device is then rejected, and be ensure that and is thrown screen safety in Android intelligent television in local area network.
In order to reach above-mentioned technical effect, the present invention takes following technical scheme:
A kind of method that DLNA throws screen authority managing and controlling in Android intelligent television, based on it is mobile throw screen end equipment andAndroid intelligent television is equipped with DLNA in the Android intelligent television and throws screen application, specifically includes the following steps:
A. mobile screen end equipment of throwing is initiated to throw screen request to Android intelligent television;
The DLNA of B.Android smart television throws screen application and receives analysis request message after throwing screen request, obtains mobile throwShield the IP address information of end equipment and sends player layer to;
C. player layer is based on the mobile IP address for throwing screen end equipment, in the network routing that Android intelligent television savesThe mobile MAC Address for throwing screen end equipment is inquired in address lookup table;
D.DLNA throws the throwing screen that screen application is saved based on the mobile MAC Address for throwing screen end equipment in Android intelligent televisionThe mobile throwing screen permission for throwing screen end equipment is inquired and handled in permissions list, and is saved according to processing result real-time update and thrown screen powerLimit list;Wherein, the throwing screen permissions list as key word index and preserves the corresponding movement of each MAC Address using MAC AddressThrow the throwing screen rights state of screen end equipment;
E.DLNA, which throws screen and handles this using the query result based on step D and throw, shields request, and processing throws screen and requests specific packetIt includes receiving and throws screen or refusal throwing screen.
DLNA throws the method for screen authority managing and controlling, it can be achieved that in Android intelligence in Android intelligent television through the inventionCan television reception to push throw screen request when, first distinguish the equipment whether the credible equipment of known identities, only the TV ownerThe equipment of approval is just allowed to throw screen, otherwise requests the throwing screen for not receiving unidentified equipment, by the permission for throwing screen requestControl authorizes throwing screen of the credible equipment in Android intelligent television, prevents the throwing screen of unknown device from occurring, thus effectivelyIt ensure that DLNA throws the safe handling shielded in Android intelligent television.
Further, the equipment throw screen rights state specifically include it is permanent receive to throw screen, permanent refusal throws screen, throws screen powerIt limits three kinds of states of transient state, and preserves each MAC Address throwing report in screen permissions list corresponding mobile to throw screen end equipment continuousRefusal throws the counting of screen.
Further, the step D specifically includes the following steps:
D1.DLNA throws the inquiry movement in throwing screen permissions list of MAC Address of the screen application based on mobile throwing screen end equipment and throwsShield the throwing screen permission of end equipment;
D2. judge throw in screen permissions list whether recorded the MAC Address, do not record the MAC if throwing in screen permissions listAddress then enters step D3, otherwise, enters step D4;
D3. the MAC Address is added in throwing screen permissions list, and corresponding mobile throw of MAC Address is set and shields end equipmentIt is counted as 0 by continuous refusal throwing screen, then pop-up throws screen request permissions prompting interface and enters step D5;
D4. the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address is obtained, if the state obtained is permanentReceive to throw screen, then return to the query result for receiving to throw screen and enters step E;
If the state obtained is that permanent refusal throws screen, returns to refusal and throw the query result of screen and enter step E;
If the state obtained is to throw screen permission transient state, pops up throwing screen request permissions prompting interface and enter step D5;
D5. user's mobile throwing screen end equipment setting corresponding to the MAC Address on throwing screen request permissions prompting interface is thrownShield permission, throws and provide three kinds of throwing screen permissions in screen request permissions prompting interface for user's selection, specifically include: permanently receiving throwingScreen, this receives, and throwing is shielded, refusal throws screen;
D6 is entered step if user selects permanently to receive to throw screen, is entered step if user selects this to receive throwing screenD7 enters step D8 if user selects refusal to throw screen;
D6. the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address in throwing screen permissions list is updated for foreverIt is long to receive to throw screen, and the corresponding movement throwing screen end equipment of the MAC Address is set and is counted as 0 by what continuous refusal throwing was shielded, return connectsBy the query result for throwing screen and enter step E;
D7. the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address in throwing screen permissions list is updated to throwShield permission transient state, and the corresponding movement throwing screen end equipment of the MAC Address is set and is counted as 0 by what continuous refusal throwing was shielded, return connectsBy the query result for throwing screen and enter step E;
D8. the query result that refusal throws screen is returned, the corresponding mobile screen end of throwing of the MAC Address in screen permissions list will be thrown and setAdd 1 and more New count in original count for by the continuous counting for refusing to throw screen, judges updated whether count greater than presetRefuse threshold value N, if updated count is greater than preset refusal threshold value N, it is corresponding to update the MAC Address in throwing screen permissions listThe throwing screen rights state of mobile throwing screen end equipment be that permanent refusal throws screen, enter step E.
DLNA throws screen and applies when player layer receives throwing screen request, goes inquiry to throw screen priority assignation state first, such asFruit is enabled state, then obtains the mobile terminal IP address thrown in screen request, then locally saved using the address in televisionThe MAC Address of the IP address current device is inquired in ARP table (network routing address inquiry table), then is gone based on the MAC AddressScreen authority list is thrown in inquiry, (is thrown in screen authority list if the MAC Address equipment does not throw screen authority records and has not been recorded the MACAddress), then it is assumed that it is to throw screen for the first time, screen priority assignation window is thrown in pop-up;It is thrown if the MAC Address equipment has been recorded as refusalScreen then checks that continuous refusal throws screen number, distinguishes situation and make subsequent processing;If the MAC Address equipment has been recorded as foreverRefuse to throw screen long, then directly respond and refuse equipment throwing screen, above-mentioned design logic can specifically be located according to the selection situation of userReason realizes that state machine is jumped and safeguarded, is effectively guaranteed based on the mode that user interface selection and internal layer logic combineDLNA throws the safe handling of screen in Android intelligent television.
Further, the refusal threshold value N is equal to 3, also may be set to other values in practice.
Compared with prior art, the present invention have it is below the utility model has the advantages that
DLNA is thrown in the method for screen authority managing and controlling in Android intelligent television of the invention, throws screen stream in originally requested contentIncrease rights management node in journey provides authorisation device and throws screen operation, authorised device certainly for screen equipment is thrown come classification processingThe processing strategies such as the dynamic throwing screen for throwing screen, refusal unauthorized device, to realize movement on the basis of the throwing screen service of optimized integrationThe throwing screen authority managing and controlling of end equipment, the unsafe row for efficiently solving malicious interference in WIFI LAN environment, occupying TVTo have ensured that Android intelligent television possesses the ownership equity shown to TV screen, having prevented unknown device with other people to TVIt pushes uncontrollable matchmaker and provides displaying, be effectively guaranteed the safe handling that DLNA in Android intelligent television throws screen.
Embodiment:
It will be explained in detail a kind of embodiment of a kind of technical solution for realizing this method and this method in the present embodiment, it is realOther schemes can also be used in border and implement this method.
Many application ends are all supported to arrive content push on smaller screen in Android intelligent in same LAN environmentIt is shown in large-size screen monitors Android intelligent television, such as camera, various sound screen softwares etc., application scenarios are very extensive.But withThe opening of WIFI resource and the complexity of access device, multi-screen push class application also suffer from security threat, such as unknown handAfter machine equipment accesses the WIFI where Android TV by force, the media push of various pictures, audio-video can be supported, in TVIt is shown on screen.If pushed content is illegal or against morals, very severe is brought to user and television manufacturerIt influences.Therefore, Android intelligent television is when receiving push and throwing screen request, need to distinguish the equipment whether known identitiesThe equipment that credible equipment, only the TV owner are approved just is allowed to throw screen, otherwise will not receive the throwing screen of unidentified equipmentRequest.
A kind of method that DLNA throws screen authority managing and controlling in Android intelligent television is disclosed in the present embodiment, is specifically existedThe support DLNA push carried in Android intelligent television is thrown in the application of screen, is increased authorization node in request entrance and is handled mouldBlock just continues original throwing screen and plays business processing flow only by agreeing to throw the mobile terminal of screen.It is mentioned to throw screen for DLNAFlexible rights management is supplied, effective guarantee Android intelligent television upslide screen safety.
A kind of method that DLNA throws screen authority managing and controlling in Android intelligent television, based on it is mobile throw screen end equipment andAndroid intelligent television is equipped with DLNA in Android intelligent television and throws screen application, specifically includes the following steps:
A. mobile screen end equipment of throwing is initiated to throw screen request to Android intelligent television;
The DLNA of B.Android smart television throws screen application and receives analysis request message after throwing screen request, obtains mobile throwShield the IP address information of end equipment and sends player layer to;
C. player layer is based on the mobile IP address for throwing screen end equipment, in the network routing that Android intelligent television savesThe mobile MAC Address for throwing screen end equipment is inquired in address lookup table;
D.DLNA throws the throwing screen that screen application is saved based on the mobile MAC Address for throwing screen end equipment in Android intelligent televisionThe mobile throwing screen permission for throwing screen end equipment is inquired and handled in permissions list, and is saved according to processing result real-time update and thrown screen powerLimit list;Wherein, screen permissions list is thrown using MAC Address as key word index and preserves the corresponding mobile throwing screen of each MAC AddressThe throwing screen rights state of end equipment;
Equipment throw screen rights state specifically include it is permanent receive to throw screen, permanent refusal throws screen, throws screen three kinds of shapes of permission transient stateState, and the meter that the corresponding movement throwing screen end equipment of each MAC Address is shielded by continuous refusal throwing is preserved throwing report in screen permissions listNumber refcount.
As shown in Fig. 2, step D specifically includes the following steps:
D1.DLNA throws the inquiry movement in throwing screen permissions list of MAC Address of the screen application based on mobile throwing screen end equipment and throwsShield the throwing screen permission of end equipment;
D2. judge throw in screen permissions list whether recorded the MAC Address, do not record the MAC if throwing in screen permissions listAddress then enters step D3, otherwise, enters step D4;
D3. the MAC Address is added in throwing screen permissions list, and corresponding mobile throw of MAC Address is set and shields end equipmentIt is 0 by the counting refcount that continuous refusal throws screen, then pop-up throws screen request permissions prompting interface and enters step D5;
D4. the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address is obtained, if the state obtained is permanentReceive to throw screen, then return to the query result for receiving to throw screen and enters step E;
If the state obtained is that permanent refusal throws screen, returns to refusal and throw the query result of screen and enter step E;
If the state obtained is to throw screen permission transient state, pops up throwing screen request permissions prompting interface and enter step D5;
D5. user's mobile throwing screen end equipment setting corresponding to the MAC Address on throwing screen request permissions prompting interface is thrownShield permission, throws and provide three kinds of throwing screen permissions in screen request permissions prompting interface for user's selection, specifically include: permanently receiving throwingScreen, this receives, and throwing is shielded, refusal throws screen;
D6 is entered step if user selects permanently to receive to throw screen, is entered step if user selects this to receive throwing screenD7 enters step D8 if user selects refusal to throw screen;
D6. the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address in throwing screen permissions list is updated for foreverIt is long to receive to throw screen, and the corresponding movement throwing screen end equipment of the MAC Address is set by the counting refcount that continuous refusal throwing is shielded and is0, it returns to the query result for receiving to throw screen and enters step E;
D7. the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address in throwing screen permissions list is updated to throwShield permission transient state, and the corresponding movement throwing screen end equipment of the MAC Address is set by the counting refcount that continuous refusal throwing is shielded and is0, it returns to the query result for receiving to throw screen and enters step E;
D8. the query result that refusal throws screen is returned, the corresponding mobile screen end of throwing of the MAC Address in screen permissions list will be thrown and setAdd 1 and more New count refcount in original count for the counting refcount for throwing screen by continuous refusal, judges updated meterWhether number refcount is greater than preset refusal threshold value N (N=3), if updated counting refcount is greater than preset refusalThreshold value N updates the corresponding mobile throwing screen rights state for throwing screen end equipment of the MAC Address in throwing screen permissions list then permanently to refuseScreen is thrown absolutely, enters step E.
E.DLNA, which throws screen and handles this using the query result based on step D and throw, shields request, and processing throws screen and requests specific packetIt includes receiving and throws screen or refusal throwing screen, and throw screen end return processing result to mobile.
DLNA throws the method for screen authority managing and controlling, it can be achieved that in Android intelligence in Android intelligent television through the inventionCan television reception to push throw screen request when, first distinguish the equipment whether the credible equipment of known identities, only the TV ownerThe equipment of approval is just allowed to throw screen, otherwise requests the throwing screen for not receiving unidentified equipment, by the permission for throwing screen requestControl authorizes throwing screen of the credible equipment in Android intelligent television, prevents the throwing screen of unknown device from occurring, thus effectivelyIt ensure that DLNA throws the safe handling shielded in Android intelligent television.
Currently, Android intelligent television as the receiving device shielded is thrown, is only to identify throwing screen resource on old process,It is played in the machine.In order to realize that throwing screen equipment permission is controlled, need to throw screen process in originally requested content in this programmeMiddle increase rights management node, for screen equipment is thrown come classification processing, providing authorisation device, to throw screen operation, authorised device automaticThrow the processing strategies such as the throwing screen of screen, refusal unauthorized device.
In the present embodiment, it in order to implement this programme in the Android intelligent television of the present embodiment, is also based onThe throwing screen Authority Design of facility information, the original DLNA device of the Android intelligent television of the present embodiment throws screen process canSummary are as follows: when mobile end equipment is initiated to throw screen operation to Android intelligent television, send throw the ground that screen request carries resource firstLocation is to television;Television application parses information after receiving throwing screen request, obtains media money according to address by player layerSource plays and shows in the machine.
In order to realize the control for throwing screen equipment permission, request to design in responding process in above-mentioned throwing screen in the present embodimentOne independent authority management module, after supporting player layer to receive throwing screen request message, for the throwing of device flag settingThe rights management node whether screen operation is allowed to.The throwing screen authority management module provides the static interface of inquiry and modification, mentionsPlayer layer is supplied to call.The unique identification by equipment is only needed when throwing screen rights interface and calling, it can be by simpleStatic method shields permission to judge or modify throwing.It, can be in addition, based on " throw screen authorization " item is newly increased in complete machine setting applicationFacilitate enabling to throw screen equipment authorization function, the processing for throwing screen authorization can also be removed in safe WIFI environment.
Specifically, throw the method for screen authority managing and controlling for DLNA in the Android intelligent television of the present embodiment as shown in Figure 1The schematic diagram for realizing framework has specifically included the DLNA agreement thrown in screen end equipment and Android intelligent television in the architectureStack processing module, Android player throw screen equipment authority management module, throw screen authorization switch, wherein at DLNA protocol stackIt manages module, Android player, throw screen equipment authority management module in DLNA throws and shields.
Wherein, throwing screen equipment authority management module is the starting provided in setting application for compatible subscribers use habitThe switch of screen permission is thrown, specifically, mobile end equipment DLNA can be directed to when throwing screen when throwing screen priority assignation is " opening " stateThe equipment does throwing screen permission processing (the monitoring process in this method can be embodied), and throwing screen permission when setting is " closing " shapeState then executes original throwing screen process flow, does not do authority managing and controlling.
Specifically, the DLNA protocol stack such as following table institute that DLNA throws screen is handled in the present embodiment in Android intelligent televisionShow:
| Layered protocol | Description |
| Android player | Android broadcast layer |
| UPnP protocol | It encapsulates UPnP " action ". |
| Http protocol | Obtain http data |
| TCP/IP | Socket transmission network data |
According to UPnP protocol, there is no the pushing equipment end IP address relevant informations in http protocol in original realization.ForPush end equipment information is obtained, the realization of this layer protocol will be implemented to be transformed in the present embodiment, will be parsed in push requestThe IP address at pushing equipment end be encapsulated in UPnP " action " structure in certain field, pass to broadcast layer.Broadcast layer obtainsAfter the IP address for throwing screen equipment to current push, by the network routing address inquiry table of TV local record, push is gotThe MAC Address of equipment.For broadcast layer using MAC Address as the unique designation of equipment identities, subsequent throwing shields rights management for foundationMAC Address is realized.
Meanwhile it is also some to having been carried out in Android intelligent television end DLNA throwing screen application to protocol library in the present embodimentScalability modification, main thought are that the IP address information carried in screen request, the ground saved by the end TV are thrown using pushing equipmentLocation resolution table (ARP table), finds the MAC Address at pushing equipment end, carries out the identification of equipment throwing screen permission based on MAC Address and testsCard.
Television TV when receiving the push of other equipment is abstract as a DMR, runs a HttpServer thread prisonThe http packet for listening pushing equipment to send is assisted in http protocol layer calling SetupResponse function to UPnP after receiving push packetIt discusses layer transmission request and obtains and respond.
SetupResponse function prototype is as follows:
PLT_HttpServer::SetupResponse(NPT_HttpRequest&request,
const NPT_HttpRequestContext&context,
NPT_HttpResponse&response);
UPnP protocol layer calls ProcessHttpPostRequest parsing http after receiving HTTP server push requestPacket, and the action packet that UPnP protocol defines is repacked according to HTTP content, pass to renderer layers of processing.In this mistakeBottom-up information in HttpRequestContext about ip will not be packed into account by the action packet realized originally in journey.AndThoroughly HttpRequestContext can be abandoned not when the PLT_MediaRenderer::OnAction () processing of next stepIt uploads again.
In this regard, we are when PLT_MediaRenderer::OnAction () is handled by PLT_Ip information in HttpRequestContext parses and is uploaded to CHMediaRenderDelegate::OnSetAVTransportURI () passes to Android player layer eventually by jni.
Improved ProcessHttpPostRequest, OnAction, OnSetAVTransportURI function prototype is such asUnder:
PLT_DeviceHost::ProcessHttpPostRequest(NPT_HttpRequest&request,
const NPT_HttpRequestContext&context,
NPT_HttpResponse&response);
PLT_MediaRenderer::OnAction(PLT_ActionReference&action,
const PLT_HttpRequestContext&context);
CHMediaRenderDelegate::OnSetAVTransportURI(PLT_ActionReference&action,
NPT_String&remoteIP);
So far, DLNA protocol stack transformation finishes, and the IP address at pushing equipment end is output to player layer.
Meanwhile it is also specifically disclosed that a kind of player layer throws screen permission based on the equipment that MAC Address is realized in the present embodimentManagement, ARP, that is, address resolution protocol is the basic agreement of network transmission package, and each networked devices locally can learn and tie upProtect the machine ARP table, be stored in local file system using file mode, as in android smart television/proc/Net/arp file.Based on ARP information, the MAC Address of available corresponding IP as throws the MAC Address of screen equipment.Based on MACThe query interface of screen rights state is thrown in call by location, returns to the throwing screen of the throwing screen or refusal current device that receive current device.Throw all process steps in the step D for realizing logical process and this method inside screen authority management module.