The invention discloses a local time detection method and system for Flash player, which relates to the field of time detection. The steps of this method are as follows: when the Flash player needs to use the local timer, the number of local timers m is counted; when m > 0, the Flash player establishes a connection with the server, and the server returns the server time to the Flash player regularly; when the Flash player obtains the server time, the Flash player records the server time. Record the current local time of each local timer used by Flash player in real time, and determine whether the current local time of each local timer matches the current server time. If so, make sure that the Flash player is running normally, otherwise, make sure that the Flash player is running abnormally. The invention not only effectively guarantees the operator benefit of the application running on the Flash player, but also significantly improves the user experience, and is very suitable for popularization.
【技术实现步骤摘要】
用于Flash播放器的本地时间检测方法及系统
本专利技术涉及时间检测领域,具体涉及一种用于Flash播放器的本地时间检测方法及系统。
技术介绍
Flash播放器是一个exe的可执行程序,用于播放本地文件,Flash播放器使用时,需要计时器来确定具有时效性的特定功能的开启、关闭或其他属性状态。对于时效性的特定功能而言,时间是否准确是保证该功能正常运行的核心因素,若时间不够准确,则该功能会非常容易产生错误。目前,现有Flash播放器一般使用客户端系统提供的本地计时器,系统在发生一些资源占用类操作时(例如CPU占用过高),会使得本地计时器变慢,进而导致Flash播放器获取的错误时间。与此同时,市面上还存在一些第三方的加速器,加速器会使得本地计时器变快或变慢,进而直接导致Flash播放器获取的错误时间。例如,用户通过第三方加速器加快本地计时器,继而在非指定时间内完成时效性的特定功能(如提早开启指定时间才能开启的宝箱等)。因此,现有的Flash播放器获取的本地时间不够准确,不仅可能危害有关应用的运营商利益,而且进而降低了用户体验。
技术实现思路
针对现有技术中存在的缺陷,本专利 ...
【技术保护点】
1.一种用于Flash播放器的本地时间检测方法,其特征在于,该方法包括以下步骤:S1:当监测到Flash播放器需要使用本地计时器时,统计Flash播放器实时使用的本地计时器数量m,转到S2;S2:判断m是否>0,若是,转到S3,否则结束;S3:Flash播放器与服务端建立连接,服务端定期向Flash播放器返回服务端时间,转到S4;S4:Flash播放器获取服务端时间时,记录Flash播放器实时使用的每个本地计时器的当前本地时间,判断每个本地计时器的当前本地时间,是否均与当前服务端时间匹配,若是,确定Flash播放器运行正常,结束,否则确定Flash播放器运行异常,结束。
【技术特征摘要】
1.一种用于Flash播放器的本地时间检测方法,其特征在于,该方法包括以下步骤:S1:当监测到Flash播放器需要使用本地计时器时,统计Flash播放器实时使用的本地计时器数量m,转到S2;S2:判断m是否>0,若是,转到S3,否则结束;S3:Flash播放器与服务端建立连接,服务端定期向Flash播放器返回服务端时间,转到S4;S4:Flash播放器获取服务端时间时,记录Flash播放器实时使用的每个本地计时器的当前本地时间,判断每个本地计时器的当前本地时间,是否均与当前服务端时间匹配,若是,确定Flash播放器运行正常,结束,否则确定Flash播放器运行异常,结束。2.如权利要求1所述的用于Flash播放器的本地时间检测方法,其特征在于:S4中所述每个本地计时器的当前本地时间,均与当前服务端时间匹配的标准为:每个当前本地时间与当前服务端时间的误差,在指定阈值以内,指定阈值为15~30毫秒。3.如权利要求1所述的用于Flash播放器的本地时间检测方法,其特征在于:S3的具体流程包括:Flash播放器与服务端建立心跳连接,Flash播放器与服务端约定心跳消息数据包类型,当服务端返回的数据包符合心跳消息数据包的类型时,Flash播放器获取并解析当前数据包,得到服务端时间。4.如权利要求1所述的用于Flash播放器的本地时间检测方法,其特征在于:S3中所述服务端时间为UTC时间。5.如权利要求1至4任一项所述的用于Flash播放器的本地时间检测方法,其特征在于:S4中所述确定Flash播放器运行异常后,会在Flash播放器的播放界面添加遮盖图层,遮盖图层的尺寸与播放尺寸相同。6.一种用于Flash播放器的本地时间检测系统,其特征在于:该系统包括本地计时器监听模块、本地计时器统计模块、服务端时间获取模块和Flash播放器检测模块;本地计时...
【专利技术属性】
技术研发人员:潘龙,陈少杰,张文明,
申请(专利权)人:武汉斗鱼网络科技有限公司,
类型:发明
国别省市:湖北,42
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。