Cross platform system and method thereof that a kind of portable terminal is used
Technical field
The present invention relates to cross platform system and method thereof that a kind of portable terminal is used; The cross platform system that this portable terminal is used has taken into full account the strengths and weaknesses of NATIVE pattern and traditional WEB application; Merge the advantage of two kinds of patterns, reduce the cell-phone customer terminal applied version as far as possible and change, application provider can upgrade and promote the use of in real time; Improve the respond of user's request, reduce popularization cost and the difficulty used.
Background technology
Move application software at present and adopt the NATIVE pattern more.The advantage of this pattern is that user experience is good, response speed is fast.Same shortcoming is also apparent in view, mainly is to upgrade inconvenience, and different client side is incompatible on the different mobile platform.Cell phone platform is more, and cross-platform development cost is high, and version updating is complicated with change.Be unfavorable for exploitation and popularization that large scale business enterprise uses.
Compare the NATIVE pattern, the html5 mode can compensate its defect just, also has its shortcoming certainly, like the encryption of data, and compression, interactive experience and vision etc.
The advantage of these two kinds of patterns is merged in the present invention well; Cross-platform mobile application and development is proposed; Solved the coupled problem of mobile application display interface and mobile phone itself; Realized the cross-platform of mobile phone application, the efficient communication of data and service end resource access mobile phone local function form preliminary mobile development technique framework and standard.
Summary of the invention
The cross platform system that portable terminal of the present invention is used is made up of client, service end and message informing system.Wherein client comprises client and html5 interactive module, client data request module, client-side data cache module; Service end comprises service end deciphering module and service end service providing module; The message informing system comprises the message informing module.
Client and html5 interactive module are made up of webkit engine and html5; Utilize html page layout design and cross-platform on advantage and native in the advantage aspect calling system function and the systematic function; Be reduced in the development difficulty on cross-platform, improve exploitation and move the efficient of using.
The client data request module is after the user passes through client UI transmission request, in data exchange process, to adopt the DES symmetric encipherment algorithm to carry out encryption to request msg, improves Information Security.
The client-side data cache module with the metadata cache of user capture in the client terminal local database; The user is after visit first; Follow-up all give tacit consent to from the client terminal local database obtain data, have only as the explicit Shi Caihui that refreshes of user and obtain data again from service end.In process of caching, before at first judging whether identical data is arranged, if having, buffer memory not then, if do not have, buffer memory then.In obtaining data procedures, data are lost the effect time judge, if spend the out-of-service time, then can't obtain data, if do not spend the out-of-service time, then return data is given the page.
The service end deciphering module is after server end receives the request of client transmission, before data are handled, it to be deciphered, and in order to improve fail safe, service end will regularly be sent secret sign indicating number to client, the real-time update of maintenance password.
The message informing module is based on XMPP (scalable message is handled on-the-spot agreement) consensus standard, realizes service end and client is notified each other and the propelling movement of the asynchronous message of unstable network.
Cross-platform method according to portable terminal of the present invention is used comprises the steps:
Step 1, running client software, whether the real-time monitoring of client receives the prompting message that server end sends;
Step 2 if client detects the prompting message that server end sends, shows at customer terminal webpage, if not, then return step 1;
Step 3, according to the function command that client is selected, client and html5 interactive module are called the mobile application system corresponding function, obtain request msg;
Step 4, if obtain the request msg success, the request msg that the client data request module is sent client is encrypted, if not, then return step 1;
Step 5 sends to server end to the request msg after encrypting;
Step 6 is if server end receives the message that client is sent, then to the data deciphering, according to sending it back client after the practical business processing;
Step 7 judges whether client obtains the data success, if not, then return step 1;
Step 8, the client-side data cache module is gone into client database with metadata cache.
Use XMPP (scalable message is handled on-the-spot agreement) consensus standard quasi real time to survey in step 2 client through the pattern realization IM (instant message) and the online scene of data channel; If monitor the prompting message that server end sends; Then remind at the customer terminal webpage display message; If no, then continue monitoring.
In step 3 client call client and html5 interactive module; When selection function is instructed; To complicated service, the generation of UI is accomplished by server end, adopts web exploitation dwr operating data mode commonly used to show through the class WEB page; To application simple, that renewal is not frequent, UI directly generates in client.
In step 5, the request msg that client is generated adopts the DES symmetric encipherment algorithm to encrypt, if the password expire of data encryption, client is then obtained password from server end, with the password update of client.
If obtain data from service end, server end at first receives the services request that client sends in step 7, and next judges whether service end has this service; If do not have; Then return error message and give client,, judge again and should serve the whether open client of giving if having; Give client if no, then return error message.If obtain data from client, the client-side data cache module at first judges to wait to obtain and data cachedly whether spends the out-of-service time, if mistake, then return data not.Said step 7 comprises following substep:
Step 7.1, if obtain data from service end, the service end service providing module receives the services request that client sends over;
Step 7.2 has judged whether this service, if service end should not served, then returns error message, and gets back to step 7.1; If service is arranged, then get into next step;
Step 7.3, the service that judges whether is open gives client, if service is not open, then returns error message, and gets back to step 7.1; If serve openly, then get into next step;
Step 7.4 will ask service data to return to client.
Step 7.5, the client-side data cache module is obtained data from client database;
Step 7.6 is judged data cached whether lost efficacy (expired), if lost efficacy, then returns the sky data;
Step 7.7, if lost efficacy, return data then.
In step 8, whether existing the client-side data cache module at first judge client database identical data, if existing, then buffer memory not if do not have, is then gone into client database with metadata cache.And at the customer terminal webpage video data.Said step 8 comprises following substep:
Step 8.1, the client-side data cache module will deposit client database in from the data that service end gets access to;
Step 8.2 is judged data cached whether the existence, if exist, and buffer memory not then;
Step 8.3, if do not exist, buffer memory then.
Description of drawings
The cross platform system block diagram that Fig. 1 uses for portable terminal of the present invention;
Fig. 2 is the overview flow chart of the cross-platform method of portable terminal application of the present invention;
Fig. 3 is the prompting message flow chart of the cross-platform method of portable terminal application of the present invention;
Fig. 4 is the client-side data cache flow chart of the cross-platform method of portable terminal application of the present invention;
Embodiment
As shown in Figure 1, the cross platform system that the cross platform system that portable terminal of the present invention is used is used by portable terminal of the present invention is made up of client, service end and message informing system.Comprising client and html5 interactive module, client data request module, client-side data cache module, service end deciphering module and message informing module.Form application server cluster by two IBM minicomputers, two minicomputers constitute HTTP access server, a minicomputer composition data storehouse system.The HTTP access server is responsible for receiving all requests, according to load balancing request is assigned to wherein one of application server cluster then.
Client and html5 interactive moduleForm by webkit engine and html5, utilize html page layout design and cross-platform on advantage and native in the advantage aspect calling system function and the systematic function, be reduced in the development difficulty on cross-platform, improve exploitation and move the efficient of using.
The client data request moduleBe after the user passes through client UI transmission request, in data exchange process, to adopt the DES symmetric encipherment algorithm to carry out encryption, improve Information Security request msg.
The client-side data cache moduleWith the metadata cache of user capture in the client terminal local database, the user after visit first, follow-up all give tacit consent to from the client terminal local database obtain data, have only as the explicit Shi Caihui that refreshes of user and obtain data again from service end.In process of caching, before at first judging whether identical data is arranged, if having, buffer memory not then, if do not have, buffer memory then.In obtaining data procedures, data are lost the effect time judge, if spend the out-of-service time, then can't obtain data, if do not spend the out-of-service time, then return data is given the page.
The service end deciphering moduleBe after server end receives the request of client transmission, before data are handled, it to be deciphered, in order to improve fail safe, service end will regularly be sent secret sign indicating number to client, the real-time update of maintenance password.
The message informing moduleBe based on XMPP (scalable message is handled on-the-spot agreement) consensus standard, realize service end and client is notified each other and the propelling movement of the asynchronous message of unstable network.
Cross platform system as shown in Figure 2, that portable terminal of the present invention is used, the cross-platform method that its portable terminal is used comprises the steps:
Step 1, running client software, whether the real-time monitoring of client receives the prompting message that server end sends;
Step 2 if client detects the prompting message that server end sends, shows at customer terminal webpage, if not, then return step 1;
Step 3: according to the function command that client is selected, client and html5 interactive module are called the mobile application system corresponding function, obtain request msg;
Step 4: if obtain the request msg success, the request msg that the client data request module is sent client is encrypted, if not, then return step 1;
Step 5: send to server end to the request msg after encrypting;
Step 6 is if server end receives the message that client is sent, then to the data deciphering, according to sending it back client after the practical business processing;
Step 7 judges whether to obtain the data success, if not, then return step 1;
Step 8, the client-side data cache module is gone into client database with metadata cache.
Fig. 3 is the prompting message flow chart of the cross-platform method of portable terminal application of the present invention; Fig. 4 is the client-side data cache flow chart of the cross-platform method of portable terminal application of the present invention.
Cross-platform method as shown in Figure 3, that portable terminal of the present invention is used, its prompting message module is operated between the client and server end as follows:
Step 1, running client software, whether the real-time monitoring of client receives the prompting message that server end sends;
Step 2 client uses XMPP (scalable message is handled on-the-spot agreement) consensus standard quasi real time to survey through the pattern realization IM (instant message) and the online scene of data channel; If monitor the prompting message that server end sends; Then remind at the customer terminal webpage display message; If no, then continue monitoring.
Cross-platform method as shown in Figure 4, that portable terminal of the present invention is used, its client-side data cache module is operated as follows:
Step 7.1, if obtain data from service end, the service end service providing module receives the services request that client sends over;
Step 7.2 has judged whether this service, if service end should not served, then returns error message, and gets back to step 7.1; If service is arranged, then get into next step;
Step 7.3, the service that judges whether is open gives client, if service is not open, then returns error message, and gets back to step 7.1; If serve openly, then get into next step;
Step 7.4 will ask service data to return to client.
Step 7.5, the client-side data cache module is obtained data from client database;
Step 7.6 is judged data cached whether lost efficacy (expired), if lost efficacy, then returns the sky data;
Step 7.7, if lost efficacy, return data then.
Step 8.1, the client-side data cache module will deposit client database in from the data that service end gets access to;
Step 8.2 is judged data cached whether the existence, if exist, and buffer memory not then;
Step 8.3, if do not exist, buffer memory then.As shown in Figure 4.