Summary of the invention
The present invention aims to provide a kind of terminal program and uses control method and device; Can solve terminal program clocking method in the correlation technique and when causing program interrupt when factors such as terminal outage, lossing signal or human interventions; Be difficult to the control terminal program in the request of the sending finish time with notification server concluding time accurately, thereby cause reliability and the accuracy lower problem of server to the terminal program timing.
In an embodiment of the present invention, a kind of terminal program clocking method is provided, has may further comprise the steps: whether the startup of judging terminal program is to start for the first time; If not start for the first time; According to terminal memory time, program start server time and the terminal server time difference; Calculate single program service time, wherein, the terminal end side time of memory time for the history file of program is finally revised; The program start server time is the server side time of start-up routine last time, the terminal server time difference be last time start-up routine the server side time and last time start-up routine the difference of end side time.
Preferably; In above-mentioned clocking method; According to terminal memory time, program start server time and the terminal server time difference, calculate the single program and specifically comprise service time:, obtain the EP (end of program) server time terminal memory time and the addition of the terminal server time difference; EP (end of program) server time and program start server time are subtracted each other, obtain single program service time.
Preferably; In above-mentioned clocking method; The startup of judging terminal program whether be start for the first time before, also comprise: terminal to server sends request, request comprises user profile, content information, terminal standard time and terminal memory time; Wherein, the terminal standard time is the end side time of this start-up routine; The server side time of this start-up routine of server record is the server standard time.
Preferably, in above-mentioned clocking method, a plurality of single programs are added up service time, obtain accumulative total program service time, the accumulative total program is used to verify user's validity service time.
Preferably, in above-mentioned clocking method, checking user's validity specifically comprises: if the accumulative total program does not surpass the accumulative total upper limit service time service time, the user is effective; The server standard time is recorded as starts the program start server time carry out timing next time, the difference of server standard time and terminal standard time is recorded as the terminal server time difference that next time, timing was carried out in startup.
Preferably, in above-mentioned clocking method, checking user's validity specifically comprises: if the accumulative total program surpasses the accumulative total upper limit service time service time, the user is invalid; Bolt down procedure; Delete program starts server time and the record of the terminal server time difference.
Preferably, in above-mentioned clocking method, also comprise: encrypt request at the terminal, and server is deciphered request.
Preferably; In above-mentioned clocking method; Also comprise: if start for the first time; The server side time that starts for the first time is recorded as starts the program start server time that carries out timing next time, the difference of the server side time that starts for the first time and the end side time that starts for the first time is recorded as starts the terminal server time difference of carrying out timing next time.
Preferably, in above-mentioned clocking method, judge whether the startup of terminal program is to start for the first time specifically to comprise: judge whether to exist program start server time and the record of the terminal server time difference.
In an embodiment of the present invention, a kind of terminal program time set is provided also, has comprised: judge module is used to judge whether the startup of terminal program is to start for the first time; Computing module; Be used for when not being when starting for the first time; According to terminal memory time, program start server time and the terminal server time difference; Calculate single program service time, wherein, the terminal end side time of memory time for the history file of program is finally revised; The program start server time is the server side time of start-up routine last time, the terminal server time difference be last time start-up routine the server side time and last time start-up routine the difference of end side time.
Preferably, in above-mentioned time set, computing module also is used for a plurality of single program added up service time and obtains accumulative total program service time.
Preferably, in above-mentioned time set, also comprise: authentication module is used for verifying user's validity service time according to adding up program; Control module is used for according to the checking result user's service routine being controlled.
The end side time that the foregoing description is finally revised according to history file, last time time difference of server side time, terminal and server of start-up routine calculates single program service time; Even the terminal abnormal factorses such as outage, lossing signal or human intervention occur and causes the program accidental interruption; Still can know the last service time of program through history file; Thereby obtain the terminal program exact value of service time; So improved reliability and accuracy to the terminal program timing; Overcome the terminal program clocking method in the correlation technique and when causing program interrupt when factors such as terminal outage, lossing signal or human interventions; Be difficult to the control terminal program in the request of the sending finish time with notification server concluding time accurately, thereby cause reliability and the accuracy lower problem of server to the terminal program timing.
Embodiment
Below with reference to accompanying drawing and combine embodiment, specify the present invention.
Fig. 1 shows the flow chart according to the clocking method of first embodiment of the invention, and this method may further comprise the steps:
Step S101 judges whether the startup of terminal program is to start for the first time;
Step S102; If not start for the first time; According to terminal C-ST memory time (Client-Saving Time), program start server time S-BT (Server-Beginning Time) and terminal server time difference SC-DCP, calculate single program C-UT service time (Client-Used Time), wherein; The end side time of C-ST for the history file of program is finally revised, produce by the terminal clock system; S-BT is the server side time of start-up routine last time, is produced by the server clock system; SC-DCP be last time start-up routine the server side time and last time start-up routine the difference of end side time, the end side time of start-up routine last time is produced by the terminal clock system.
Present embodiment judges whether the startup of terminal program is to start for the first time; When not being when starting for the first time, calculate C-UT according to C-ST, S-BT and SC-DCP, wherein the end side time of C-ST for the history file of program is finally revised; Confirm that according to the final modification time of history file the advantage of exercise end time is; History file is the file that the user preserves consciously, can be considered the user to the affirmation of service routine time, and history file is the vital document of program startup next time; Program itself can be protected this document; The difficulty of revising this document is bigger, thereby has improved fail safe, even the terminal abnormal factors such as outage, lossing signal or human intervention occurs and causes the program accidental interruption; Still can know the last service time of program through history file; Thereby obtain the terminal program exact value of service time,, overcome the terminal program clocking method in the correlation technique and when causing program interrupt when factors such as terminal outage, lossing signal or human interventions so improved reliability and accuracy to the terminal program timing; Be difficult to the control terminal program in the request of the sending finish time with notification server concluding time accurately, thereby cause reliability and the accuracy lower problem of server to the terminal program timing.Terminal wherein is the electronic equipment with system clock and certain computing ability, such as mobile phone, PC (Personal Computer, PC), STB etc.
Preferably, in above-mentioned clocking method, among the step S102 according to C-ST, S-BT and SC-DCP, calculate C-UT and specifically comprise:, obtain EP (end of program) server time S-ET (Server-Ending Time) C-ST and SC-DCP addition; S-ET and S-BT are subtracted each other, obtain C-UT.
Present embodiment at first with C-ST and SC-DCP addition, obtains S-ET, and then S-ET and S-BT are subtracted each other, thereby obtains C-UT.Present embodiment need not program and carries out extra timing expense; Reduce the complexity of timing, improved the speed of program running, and then improved user's impression; And present embodiment is a relatively independent time system of each use flow process maintenance at each terminal; Even revise terminal time after variant or user's service routine on terminal and the server time, all can calculate user's service time effectively, thereby improve the accuracy of timing.
Preferably, in above-mentioned clocking method, before step S101; Also comprise: terminal to server sends request; Request comprises user profile, content information, terminal standard time C-LT (Client-Local Time) and C-ST, and wherein, C-LT is the end side time of this start-up routine; The server side time of this start-up routine of server record is server standard time S-LT (Server-Local Time).
By the terminal C-LT and the C-ST that user profile, content information, terminal clock system produce sent to server through request in the present embodiment; Server is noted the S-LT that the server clock system produces, thereby server can come terminal program is carried out timing according to C-LT, C-ST and S-LT.
Preferably, in above-mentioned clocking method, a plurality of C-UT are added up, obtain accumulative total program service time.
Present embodiment will be repeatedly a plurality of C-UT of obtaining of service routine add up, thereby obtain accumulative total program service time.Because reliability and the accuracy of each C-UT are higher, so reliability and the accuracy of accumulative total program service time that present embodiment obtains have also obtained assurance to greatest extent.
Preferably, in above-mentioned clocking method, the accumulative total program is used to verify user's validity service time.
Present embodiment is verified user's validity service time according to adding up program, verifies promptly whether this user has the authority that continues to use this program.Higher reliability and the accuracy of accumulative total program service time have guaranteed the accuracy to user's validation verification.
Preferably, in above-mentioned clocking method, the accumulative total program is used for user's service routine is chargeed service time.
Present embodiment charges to user's service routine according to the accumulative total program service time, and the higher reliability of accumulative total program service time has guaranteed the accuracy to user's charging with accuracy.
Preferably, in above-mentioned clocking method, checking user's validity specifically comprises: if the accumulative total program does not surpass the accumulative total upper limit service time service time, the user is effective; S-LT is recorded as starts the S-BT carry out timing next time, the difference of S-LT and C-LT is recorded as the SC-DCP that next time, timing was carried out in startup.
Accumulative total program service time surpasses preset accumulative total upper limit service time in the present embodiment; Think that then the user is effective; Return success response and give the terminal; The terminal allows the user to continue service routine, and S-LT is recorded as starts the S-BT that carries out timing next time, and the difference of S-LT and C-LT is recorded as the SC-DCP that next time, timing was carried out in startup.
Preferably, in above-mentioned clocking method, checking user's validity specifically comprises: if the accumulative total program surpasses the accumulative total upper limit service time service time, the user is invalid; Bolt down procedure; The record of deletion S-BT and SC-DCP.
Accumulative total program service time surpasses preset accumulative total upper limit service time in the present embodiment; Think that then the user is invalid; Return failure response and give the terminal, the terminal is continued service routine to this user's bolt down procedure to forbid the user, and records such as the S-BT of deletion server for saving and SC-DCP.
Preferably, in above-mentioned clocking method, S-LT is used to verify user's validity.
Present embodiment is verified user's validity according to S-LT; Verify promptly whether this user has authority that continue to use this program, promptly receive request at every turn after, S-LT is compared with this program use term of validity; Use if surpass the term of validity then do not allow, otherwise allow to use.
Preferably, in above-mentioned clocking method, access times are used to verify user's validity.
Present embodiment is verified user's validity according to access times; Verify promptly whether this user has authority that continue to use this program, promptly receive request at every turn after, former accumulative total access times are added an operation; Use if surpass the access times upper limit then do not allow, otherwise allow to use.
Preferably, in above-mentioned clocking method, also comprise: encrypt request at the terminal, and server is deciphered request.
Present embodiment is encrypted request in end side, at server side request is deciphered, to strengthen the fail safe of communication between terminal and the server.AES can be a symmetry algorithm, such as AES (Advanced Encryption Standard, Advanced Encryption Standard), DES (Data Encryption Standard, data encryption standard) etc., also can be asymmetric arithmetic, like RSA etc.The method that key can adopt prior agreement, regularly change also can be through the safe transmission and the encrypting and decrypting of digital publishing rights system realization key.
Preferably; In above-mentioned clocking method; Also comprise: if start for the first time; The server side time that starts for the first time is recorded as starts the S-BT that carries out timing next time, the difference of the server side time that starts for the first time and the end side time that starts for the first time is recorded as starts the SC-DCP that carries out timing next time.
When present embodiment starts for the first time when the startup of judging terminal program; Then need not to calculate the cumulative time; The server side time that directly will start for the first time is recorded as and starts the S-BT that carries out timing next time, the difference of the server side time that starts for the first time and the end side time that starts for the first time is recorded as start the SC-DCP that carries out timing next time.
Preferably, in above-mentioned clocking method, judge whether the startup of terminal program is to start for the first time specifically to comprise: the record that judges whether to exist S-BT and SC-DCP.
Present embodiment when not having the record of S-BT and SC-DCP, thinks that the startup of terminal program is to start for the first time according to whether existing the record of S-BT and SC-DCP to judge whether the startup of terminal program is to start for the first time; When having the record of S-BT and SC-DCP, think that the startup of terminal program is not to start for the first time.
Fig. 2 shows according to the sketch map that concerns between the time term of second embodiment of the invention, has used following time term in the present embodiment:
Terminal standard time C-LT: this time term is the end side time of start-up routine, is produced by the terminal clock system;
Server standard time S-LT: this time term is the server side time of start-up routine, is produced by the server clock system;
Terminal C-ST memory time: the end side time of this time term for the history file of program is finally revised, produce by the terminal clock system;
Program start server time S-BT: this time term is a program start server time constantly, is produced by the server clock system;
Terminal server time difference SC-DCP: this time term is used to describe the time difference between terminal and the server, is calculated by C-LT and S-LT to obtain;
EP (end of program) server time S-ET: this time term is a program start server time constantly, is calculated by C-ST and SC-DCP to obtain;
Single program C-UT service time: this time term is the single service time of program at the terminal, is calculated by S-BT and S-ET to obtain.
If program is to start for the first time; C-LT obtains from terminal request, and system obtains S-LT from the server local clock, and C-LT is saved in S-BT2; The difference of S-LT and C-LT is saved in SC-DCP2, and SC-DCP2 and S-BT2 are saved in the local storage system of server;
If program is not to start for the first time; At first from terminal request, obtain C-LT, C-ST, system obtains S-LT from the server local clock, from the local storage system of server, obtains SC-DCP2 and S-BT2; And save as this SC-DCP1 and S-BT1; Then C-ST and SC-DCP1 addition are obtained S-ET, S-ET and S-BT1 are subtracted each other obtain C-UT, promptly started corresponding single program service time last time;
Add up and obtain accumulative total program service time start the C-UT obtain at every turn.
Fig. 3 shows the flow chart according to the clocking method of third embodiment of the invention, and this method may further comprise the steps:
Step S301, server receive the request of self terminal, resolve and should ask; Obtain the corresponding time according to this request content and field condition; The server current time is S-LT, and the local zone time that send at the terminal is C-LT, and the filling time that send at the terminal is C-ST.;
Step S302, server comes judges validity according to S-LT, judges promptly whether this user can use in this period, as if term of validity mistake, then forwards step S307 to;
Step S303, whether determining program is to start for the first time, judges promptly whether this user is to use for the first time, and basis for estimation then for whether having S-BT1 and SC-DCP2, if start for the first time, then forwards step S308 to;
Step S304 utilizes C-ST to add that SC-DCP1 obtains S-ET;
Step S305 deducts S-BT1 with S-ET and obtains C-UT;
Step S306 has used the cumulative time addition with C-UT and user, obtains the up-to-date cumulative time, judges according to this time whether this user is effective, and promptly whether the user can continue service routine, if the user is effective, then forwards step S308 to;
Step S307 returns failure, and timing flow process so far finishes;
Step S308 preserves S-LT as S-BT2, wherein S-BT2 will handle as the S-BT1 that uses next time;
Step S309 deducts C-LT with S-LT and obtains SC-DCP2 and it is preserved, and wherein SC-DCP2 will handle as the SC-DCP1 that uses next time;
Step S310 returns success.
Server in the present embodiment was handled original program before terminal acquisition program, implanted boot, and utilized this boot to realize the timing to terminal program.Present embodiment is only implanted boot at program start constantly; Realized the calculating to service time, the change workload is little and difficulty is low, thereby has guaranteed the integrality of original service routine; Enlarge the coverage rate of this kind charge mode, satisfied the demand of operator.
For example; In the 3rd embodiment, the user starts boot 10: 0 on the 1st January of 2009 terminal time, and server standard time this moment is 11: 0 on the 1st January in 2009; Be that C-LT is 10: 0 on the 1st January in 2009, S-LT is 11: 0 on the 1st January in 2009;
If server judges that S-LT (11: 0 on the 1st January in 2009) is in effective time, then S-LT is deducted C-LT (10: 0 on the 1st January in 2009) and obtain SC-DCP2 (1 hour 0 minute), and SC-DCP2 and S-LT (as S-BT2) are all preserved; Return success; The normal service routine of user's this moment, this user's service routine was filed after 1 hour, and quit a program; The final modification time that file this moment is 11: 0 on the 1st January in 2009, and promptly C-ST is 11: 0 on the 1st January in 2009;
This user continues to start boot again 14: 0 on the 1st January in 2009 and prepares recreation, and the time of server this moment is 15: 0 on the 1st January in 2009, and promptly C-LT is 14: 0 on the 1st January in 2009, and S-LT is 15: 0 on the 1st January in 2009;
If server judges that S-LT (15: 0 on the 1st January in 2009) is in effective time; Then utilize C-ST (11: 0 on the 1st January in 2009) to add that SC-DCP1 (1 hour 0 minute) obtains S-ET (12: 0 on the 1st January in 2009), utilizing S-ET (12: 0 on the 1st January in 2009) to deduct S-BT1 (11: 0 on the 1st January in 2009) again, to obtain C-UT be 1 hour 0 minute;
Server adds the already used cumulative time of user with C-UT, obtains up-to-date accumulative total program service time, whether can continue service routine according to up-to-date accumulative total program judges service time;
If can not continue to use, then return failure, the data such as SC-DCP, S-BT and access times that deletion was preserved for this user originally.
Use if can continue; Then S-LT (15: 0 on the 1st January in 2009) is deducted C-LT (14: 0 on the 1st January in 2009) and obtain SC-DCP2 (1 hour 0 minute); SC-DCP2 (1 hour 0 minute) and S-LT (as S-BT2) are all preserved, return success, the user is service routine normally;
If the user continues to use, then repeat above process, till the accumulative total program surpasses the operable time of this user service time.
Fig. 4 shows the structure chart according to the time set of fourth embodiment of the invention, and this device comprises:
Judge module 10 is used to judge whether the startup of terminal program is to start for the first time;
Computing module 20; Be used for according to C-ST, S-BT and SC-DCP, calculating C-UT when not being when starting for the first time; Wherein, The end side time of C-ST for the history file of program is finally revised, S-BT is the server side time of start-up routine last time, SC-DCP be last time start-up routine the server side time and last time start-up routine the difference of end side time.
Present embodiment at first adopts judge module 10 to judge whether the startup of terminal program is to start for the first time; Adopt computing module 20 not being when starting for the first time then, calculate C-UT according to C-ST, S-BT and SC-DCP, wherein the end side time of C-ST for the history file of program is finally revised; Confirm that according to the final modification time of history file the advantage of exercise end time is; History file is the file that the user preserves consciously, can be considered the user to the affirmation of service routine time, and history file is the vital document of program startup next time; Program itself can be protected this document; The difficulty of revising this document is bigger, thereby has improved fail safe, even the terminal abnormal factors such as outage, lossing signal or human intervention occurs and causes the program accidental interruption; Still can know the last service time of program through history file; Thereby obtain the terminal program exact value of service time,, overcome the terminal program clocking method in the correlation technique and when causing program interrupt when factors such as terminal outage, lossing signal or human interventions so improved reliability and accuracy to the terminal program timing; Be difficult to the control terminal program in the request of the sending finish time with notification server concluding time accurately, thereby cause reliability and the accuracy lower problem of server to the terminal program timing.Terminal wherein is the electronic equipment with system clock and certain computing ability, such as mobile phone, PC (Personal Computer, PC), STB etc.
Preferably, in above-mentioned time set, also comprise: sending module, be used for sending request to server, request comprises user profile, content information, C-LT and C-ST, wherein, C-LT is the end side time of this start-up routine.
Present embodiment adopts sending module that C-LT and the C-ST that user profile, content information, terminal clock system produce sent to server through request; Server is noted the S-LT that the server clock system produces, thereby server can come terminal program is carried out timing according to C-LT, C-ST and S-LT.
Preferably, in above-mentioned time set, computing module also is used for a plurality of C-UT are added up and obtains accumulative total program service time.
Present embodiment will be repeatedly a plurality of C-UT of obtaining of service routine add up, thereby obtain accumulative total program service time.Because reliability and the accuracy of each C-UT are higher, so reliability and the accuracy of accumulative total program service time that present embodiment obtains have also obtained assurance to greatest extent.
Preferably, in above-mentioned time set, also comprise: authentication module is used for verifying user's validity service time according to adding up program; Control module is used for according to the checking result user's service routine being controlled.
Present embodiment adopts authentication module to verify user's validity service time according to adding up program, verifies promptly whether this user has the authority that continues to use this program, adopts control module according to the checking result user's service routine to be controlled then.Higher reliability and the accuracy of accumulative total program service time have guaranteed the accuracy to user's validation verification.
Preferably, in above-mentioned time set, also comprise: encrypting module is used for sending module is encrypted; Deciphering module is used for sending module is deciphered.
Present embodiment adopts encrypting module that request is encrypted in end side, adopts deciphering module that request is deciphered at server side, to strengthen the fail safe of communication between terminal and the server.AES can be a symmetry algorithm, such as AES, DES etc., also can be asymmetric arithmetic, like RSA etc.The method that key can adopt prior agreement, regularly change also can be through the safe transmission and the encrypting and decrypting of digital publishing rights system realization key.
Fig. 5 shows the structure chart according to the time set of fifth embodiment of the invention.
The encrypting module of end side is encrypted the request of being made up of user profile, content information, C-LT and C-ST according to key, and the request after sending module will be encrypted sends to server side;
The deciphering module of server side is deciphered the request that receives according to key; Whether obtain the raw information that submit at the terminal, this raw information comprises user profile, content information, C-LT and C-ST, be to start for the first time to judge through judge module to program; If not start for the first time; Then raw information is inputed to computing module, calculate C-UT, user's validity is verified according to raw information and C-UT by authentication module again; And will verify that the result returns to control module, by control module terminal program is controlled;
The control command of end side response module, decision allow the user to continue to use this program, or close this program.
From above description; Can find out; Even the above embodiments of the present invention terminal abnormal factorses such as outage, lossing signal or human intervention occur and causes the program accidental interruption; Still can know the last service time of program, thereby obtain the terminal program exact value of service time, so improved reliability and accuracy the terminal program timing through history file.
Obviously, it is apparent to those skilled in the art that above-mentioned each module of the present invention or each step can realize with the general calculation device; They can concentrate on the single calculation element; Perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element; Thereby; Can they be stored in the storage device and carry out, perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize by calculation element.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.