Summary of the invention
The invention provides a kind of adaptation method that interface is set with android terminal device systems, solve in prior art that to there is intelligent terminal update workload larger, promoting service inconvenience, variation is set and the technical problem of related service demand cannot be met, achieve make Operation system setting can from different Android system, different chip stream media device communicates, in existing stream media equipment, variation is set to solve and related service demand cannot be met, and realize the unitized problem that existing Android system arranges middle stream media equipment top level control module, the performance of enhanced IP TV+OTT business setting and the technique effect of extensibility.
For solving the problems of the technologies described above, the embodiment of the present application provides a kind of adaptation method arranging interface with android terminal device systems, and described method comprises:
Step one: client binds service end Service by BindService, obtains device systems and arranges interface instance object, and send request data by Proxy agency service to service end;
Step 2: service end Service obtains Proxy proxy requests data by the onTransact of Binder;
Step 3: service end Service by the data encapsulation result of request, and calls the corresponding function interface of service end by the inner abstract class of Stub;
Step 4: the success of service end Service return function interface interchange data or failed information, and judge whether information meets the demands, if met the demands, then flow process terminates; If critical data does not meet, master data meets, then according to preset strategy, perform corresponding strategy;
Step 5: service end Service returns the result of client-requested information and by client end response information, handling process is complete.
Further, to the request msg in described step one, do following process respectively: parse the number of request msg and type of data structure and length, then request msg is resolved to the form meeting transmission; Or, according to the form of request msg, parse wherein specific fields, then according to preset form, generate the form meeting transmission.
Further, the constraints in described step 2 is comprised: Android system version, chip type.
Further, the constraint of corresponding Android system version, includes but not limited to following two kinds of processing modes: android edition upgrading upgrades, and energy is compatibility and loose coupling completely; Same Android system version, the continuous updating of bottom can not have influence on terminal device interface, can completely compatible and loose coupling.
Further, for different chips, business aspect Rapid transplant, avoids overlapping development.
The one or more technical schemes provided in the embodiment of the present application, at least have following technique effect or advantage:
Owing to have employed, the adaptation method arranging interface with android terminal device systems is designed to comprise: step one: client binds service end Service by BindService, obtain device systems and interface instance object is set, and send request data by Proxy agency service to service end; Step 2: service end Service obtains Proxy proxy requests data by the onTransact of Binder; Step 3: service end Service by the data encapsulation result of request, and calls the corresponding function interface of service end by the inner abstract class of Stub; Step 4: the success of service end Service return function interface interchange data or failed information, and judge whether information meets the demands, if met the demands, then flow process terminates; If critical data does not meet, master data meets, then according to preset strategy, perform corresponding strategy; Step 5: service end Service return client-requested information result and by client end response information, the technical scheme that handling process is complete, namely, in the basic condition applied in IPTV field in conjunction with android intelligent terminal, the basic service of carrier class requirement can not only be realized, meet its primary demand, and allow carrier class user according to the business demand of oneself, meet the requirement of some desired particular aspects, improve IPTV+OTT service flexibility; Operator allows terminal producer provide different Android system, the intelligent terminal of different chip type, improves product competitiveness, meets the independence of user.
Further, in increase new business situation, adopt the method in the application can also add new function point in the module on the basis not changing original module, this just substantially increases the extensibility of module, avoid the operation cost again developed, improve the stability of system and the maintenance quality in later stage, reduce maintenance cost.
Embodiment
The invention provides a kind of adaptation method that interface is set with android terminal device systems, solve in prior art that to there is intelligent terminal update workload larger, promoting service inconvenience, variation is set and the technical problem of related service demand cannot be met, achieve make Operation system setting can from different Android system, different chip stream media device communicates, in existing stream media equipment, variation is set to solve and related service demand cannot be met, and realize the unitized problem that existing Android system arranges middle stream media equipment top level control module, the performance of enhanced IP TV+OTT business setting and the technique effect of extensibility.
Technical scheme during the application implements is for solving the problems of the technologies described above.General thought is as follows:
Have employed and the adaptation method arranging interface with android terminal device systems is designed to comprise: step one: client binds service end Service by BindService, obtain device systems and interface instance object is set, and send request data by Proxy agency service to service end; Step 2: service end Service obtains Proxy proxy requests data by the onTransact of Binder; Step 3: service end Service by the data encapsulation result of request, and calls the corresponding function interface of service end by the inner abstract class of Stub; Step 4: the success of service end Service return function interface interchange data or failed information, and judge whether information meets the demands, if met the demands, then flow process terminates; If critical data does not meet, master data meets, then according to preset strategy, perform corresponding strategy; Step 5: service end Service return client-requested information result and by client end response information, the technical scheme that handling process is complete, namely, in the basic condition applied in IPTV field in conjunction with android intelligent terminal, the basic service of carrier class requirement can not only be realized, meet its primary demand, and allow carrier class user according to the business demand of oneself, meet the requirement of some desired particular aspects, improve IPTV+OTT service flexibility; Operator allows terminal producer provide different Android system, the intelligent terminal of different chip type, improves product competitiveness, meets the independence of user.
In order to better understand technique scheme, below in conjunction with Figure of description and concrete execution mode, technique scheme is described in detail.
Embodiment one:
In embodiment one, provide a kind of adaptation method arranging interface with android terminal device systems, please refer to Fig. 1-Fig. 4, described method comprises:
Step one: client passes through BindService() bind service end Service, obtain device systems and interface instance object is set, and send request data by Proxy agency service to service end;
Step 2: service end Service is by the onTransact(of Binder) obtain Proxy proxy requests data;
Step 3: service end Service by the data encapsulation result of request, and calls the corresponding function interface of service end by the inner abstract class of Stub;
Step 4: the success of service end Service return function interface interchange data or failed information, and judge whether information meets the demands, if met the demands, then flow process terminates; If critical data does not meet, master data meets, then according to preset strategy, perform corresponding strategy;
Step 5: service end Service returns the result of client-requested information and by client end response information, handling process is complete.
Wherein, in the embodiment of the present application, a kind of data for request of step, do following process: parse the number of request msg and type of data structure and length, then request msg is resolved to the form meeting transmission respectively; Or, according to the form of request msg, parse wherein specific fields, then according to preset form, generate the form meeting transmission.
Wherein, in the embodiment of the present application, preset strategy: service end is divided into critical data and master data to the data received, no matter be that data structure or data type do not meet for critical data, then flow process terminates, as critical data meets the requirements, master data does not meet, then execution result success.
Wherein, in the embodiment of the present application, service is the service in Android system, and bindService binds Service service exactly; The service of general android is divided into local and remote, and this technical approach is long-range service.
Wherein, Service comes with user client communication mutual by Binder mechanism in the embodiment of the present application; Transact (): object distally sends and calls, onTransact (): be the call request that long-range object can respond the other end and sends over.These two API are synchronous execution.Transact () method will be clogged to after onTransact () method call completes always and just return; Proxy mode (Proxy): for other objects provide a kind of agency to control the access to this object.
Wherein, in the embodiment of the present application, the constraints in step 2 comprises Android system version, different chip.
Wherein, in the embodiment of the present application, the constraint of corresponding Android system version, at least comprises two kinds of processing modes: android version is by 2.2, and no matter just 4.0,4.2,4.4 constantly upgrade renewal, lowest version or highest version, can completely compatible and loose coupling; Same Android system version, the continuous updating of bottom can not have influence on terminal device interface (may have expansion interface), can completely compatible and loose coupling.
Wherein, in the embodiment of the present application, for different chips, the adaptation method of interface is set, business aspect: accomplish Rapid transplant according to android terminal device systems; Avoid overlapping development.
Wherein, in the embodiment of the present application, below in conjunction with accompanying drawing, the specific embodiment of the present invention is further illustrated:
Fig. 2 is the android intelligent terminal system frame construction drawing of technical scheme application, and the adaptation method of Operation system setting interface is included in each layers such as Linux Kernel, Libraries, Application Framework, Application of system respectively.
Linux Kernel is that Android provides core system service based on Linux 2.6, such as: safety, memory management, management of process, network stack, driving model.Linux Kernel is also as the level of abstraction between hardware and software, and its is hidden particular hardware details and provides unified service for upper strata.
Linux Kernel expanding packet contains:
---Network_Driver: refer to expand integrated network-driven agreement for supporting business.Mainly comprise the standard I GMP V2 agreement of support based on the multicast direct broadcast function of IGMP, the standard 802.1Q functions of modules of support dual network access at present, IPV4/IPV6 agreement;
---Security_Driver: the relevant informations such as the hardware relevant to chip, operating system.
---Dispyay Driver(display driver pattern), Camera Driver(webcam driver), Aduio Driver(audio driven), Flash Men Driver(external equipment drive) etc. other drive.
Libraries is the set that Android comprises a C/C++ storehouse, for each assembly of android system.These functions are exposed to developer by the application framework (application framework) of Android
Libraries expanding packet contains:
---NetworkServic: client software, the main data that send perform corresponding function with the request of reception.
---SQLite(relational database engine), LibWebCore(web browser), SGL(2D graphics engine), media library etc.,
Application Framework is that android passes through to provide open development platform, and Android enables developer work out extremely abundant and novel application program.Developer freely can utilize device hardware advantage, access location information, runs background service, arranges alarm clock, add notice etc. to status bar
Application Framework expanding packet contains:
---LibsyUtils: mainly for static IP, DHCP+, pppoe, IPV4/IPV6, IPOE, two stack, authentications etc. are to intelligent terminal bottom-layer network abstract API, for the unified call of intelligent terminal top level control module;
---view (View), content provider (Content Providers), explorer (Resource Manager), notification manager (Notification Manager), active manager (Activity Manager)
Application; Android assembles a core application set, comprises email client, SMS program, calendar, map, browser, contact person and other settings
Application application comprises:
---Setting APK: be mainly used in realizing intelligent terminal Operation system setting and unify UI, facilitate operator to the customization of software operation module, can at different Android system, different chip represents equivalent effect.
NetworkService, LibSyUtils are packaged into into object by unified for Operation system setting interface, call for Setting, accomplish not rely on Android system and chip make it between can be cross-platform, across chip operation, reduce the complicated repetitive operation brought.
In order to ensure that the method for Setting is at different Android system, different chip chamber normally uses, and with system, the function point that chip has nothing to do is as business account, and server info, is stored in iptv_prefs.xml or system database by Put, Set are unified.The interface that Setting is arranged at the bottom of android system can be classified, mainly include spider lines, wireless network, sound and display, business setting, system version information, server info, high-level information etc., different classes of interface possesses oneself exclusive Some features, not only this interface class can be indicated according to these features, according to the feature on the concrete function of distinct interface, different message structures concrete operand can also be encapsulated.Thus not only can meet and different Android system, the adaptive demand of different chip, and greatly can simplify control flow, metaphor arranges independent classification cable network, to static network, and PPPOE, DHCP etc. are numbering separately, can identify easily and adopt which kind of message structure.
Fig. 3 is method for interface adaptation flow chart of the present invention, is specially:
Step one: client passes through BindService() bind service end Service, obtain device systems and interface instance object is set, and send request data by Proxy agency service to service end;
First, client passes through BindService() bind service end Service, and collect related data information;
Secondly, according to the information of collecting, data type is judged;
For type first, parse the length of data amount check and each data, then according to these two data parameters, by resolution unit, obtain device systems and interface object is set;
For type first, parse data message format, then according to this specific fields, by resolution unit, obtain device systems and interface object is set;
Again, interface message failure is obtained, client and service end Bind Failed; Otherwise binding success;
Finally, data are sent request by agency to service end;
Step 2: service end Service is by the onTransact(of Binder) obtain Proxy proxy requests data;
If obtain data field by agency not mate, service end returns error message, and refusal request, points out to user;
If it is normal to obtain data by agency, service end receives request msg and processes;
Step 3: service end Service by the data encapsulation result of request, and calls the corresponding function interface of service end by the inner abstract class of Stub; Stub is the stub class in Android service.
Step 4: the success of service end Service return function interface interchange data or failed information, and judge whether information meets the demands, if met the demands, then flow process terminates; If critical data does not meet, master data meets, then according to preset strategy, perform corresponding strategy;
If call the success of intrinsic function part of interface, prompting User Part constraints is limited, and send failure information, flow process terminates;
Step 5: service end Service returns the result of client-requested information and by client, client end response information, handling process is complete.
Fig. 4 is in the embodiment of the present application, the flow chart of cable network is created in Setting, be specially beginning, bind Service by BindService, then collect data message, then obtain data-message structure, then transfer data to resolution unit to resolve, then obtain device systems interface data, otherwise client and service end it fails to match, then get back in resolution unit and resolve; Then to service end request instance objects, otherwise service end feedback error information, get back to and obtain device systems interface data, then receive request, package request data structure, call intrinsic function interface, if so, then sending orders successfully, response message, if not, partial condition meets, and sends and orders unsuccessfully, response message, then service end processes the request message of client, receives the results messages of service end feedback, and reception result also sends results messages to Setting.
Wherein, in the embodiment of the present application, step one: Setting APK binds service end Service(NetworkServic by BindService, i.e. AIDL), obtain device systems and interface instance getEthernetDevInfo is set, and to cable network state lower network port, network schemer, network IP, DNS, the data-message structures such as DNS for subsequent use, length passes through resolution unit, judge that current network state is cable network, and acted on behalf of by Proxy send Transact request msg to service end; Step 2: service end Service passes through the mechanism of Binder and responds Proxy proxy requests data to Setting APK by onTransact, and as proxy requests data can be mated with service end, then the match is successful; Otherwise it fails to match; Step 3: service end Service is to the data network port by Proxy proxy requests, network schemer, network IP, DNS encapsulates, and calls service end Service corresponding function setEthernetDevInfo interface by the inner abstract class Stub of Service; Step 4: service end Service return function interface setEthernetDevInfo calls result, as network schemer, network IP, DNS, DNS for subsequent use etc. are normal, then cable network arranges normally; If DNS for subsequent use arranges mistake, then part meets, cable network setup failed; Step 5: service end Service returns client cable network and arranges successful result and by client, client Setting arranges successfully cable network, and cable network setting procedure is complete.
Adopt the present invention, operator, manufacturer terminal can adopt different chip easily, different Android system versions, more convenient, effectively for user provides service;
Technical scheme in above-mentioned the embodiment of the present application, at least has following technique effect or advantage:
Owing to have employed, the adaptation method arranging interface with android terminal device systems is designed to comprise: step one: client binds service end Service by BindService, obtain device systems and interface instance object is set, and send request data by Proxy agency service to service end; Step 2: service end Service obtains Proxy proxy requests data by the onTransact of Binder; Step 3: service end Service by the data encapsulation result of request, and calls the corresponding function interface of service end by the inner abstract class of Stub; Step 4: the success of service end Service return function interface interchange data or failed information, and judge whether information meets the demands, if met the demands, then flow process terminates; If critical data does not meet, master data meets, then according to preset strategy, perform corresponding strategy; Step 5: service end Service return client-requested information result and by client end response information, the technical scheme that handling process is complete, namely, in the basic condition applied in IPTV field in conjunction with android intelligent terminal, the basic service of carrier class requirement can not only be realized, meet its primary demand, and allow carrier class user according to the business demand of oneself, meet the requirement of some desired particular aspects, improve IPTV+OTT service flexibility; Operator allows terminal producer provide different Android system, the intelligent terminal of different chip type, improves product competitiveness, meets the independence of user.
Further, in increase new business situation, adopt the method in the application can also add new function point in the module on the basis not changing original module, this just substantially increases the extensibility of module, avoid the operation cost again developed, improve the stability of system and the maintenance quality in later stage, reduce maintenance cost.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.