The invention discloses a method for quickly updating the integral balance in the integral expiration system, which includes: establishing an integral system composed of a user table and a flow meter, the user table includes ID field and case field; adding last_off_date field and off_cast field in the user table; updating off_cast field in each consumption integral; calculating the next holding when the integral expires; The integral that will be deducted if the line integral expires. The invention maintains an additional integral balance deducted at the next expiration, compares whether the current time has reached the expiration time when obtaining the user's integral, if the expiration time is reached, the integral balance can be used as the integral balance after deducting the integral value; the integral balance can not be returned to the time, so as to realize the quick and non-delayed execution of the integral overdue deduction operation.
【技术实现步骤摘要】
积分过期系统中快速更新积分余额的方法
本专利技术涉及积分数据处理
,具体的说,是一种积分过期系统中快速更新积分余额的方法。
技术介绍
目前,积分作为一种有效扩展用户群,提高用户忠诚度的促销手段。积分过期策略可以筛选目标活跃用户,降低用户维护成本,因此对于积分系统十分有必要设置积分过期时间,以便及时对用户积分执行过期操作。目前积分过期的实现方法一般分为两种,一种是针对每一笔积分获取,达到过期时间后该笔积分还未消费,就扣除掉。另一种是,针对某一个时间段内获取的积分,达到设定的过期时间后还未花费就扣除掉,第一种的实现逻辑较为复杂,计算量较大。因此,目前很多实现方案采用的第二种方案。第二种目前实现是到达过期时间后逐个对用户积分进行过期,执行过程可能持续几个小时甚至更久,在积分过期执行过程中,积分清零就会出现延迟的现象。
技术实现思路
本专利技术的目的在于提供一种积分过期系统中快速更新积分余额的方法,用于解决现有技术中由于执行积分过期时间较长,积分清零出现延迟的问题。本专利技术通过下述技术方案解决上述问题:一种积分过期系统中快速更新积分余额的方法,包括:步骤S100:建立由用户表和流水表组成的积分系统,所述用户表包括id字段和cash字段,所述id字段用于唯一标识用户,所述cash字段用于标识当前积分余额;步骤S200:在用户表中增加last_off_date字段和off_cash字段,所述last_off_date字段用于标识上次执行节分过期时间,所述off_cash字段用于标识下次执行积分过期将扣除的积分;步骤S300:在每一笔消费积分时更新off_cash字 ...
【技术保护点】
1.一种积分过期系统中快速更新积分余额的方法,其特征在于,包括:步骤S100:建立由用户表和流水表组成的积分系统,所述用户表包括id字段和cash字段,所述id字段用于唯一标识用户,所述cash字段用于标识当前积分余额;步骤S200:在用户表中增加last_off_date字段和off_cash字段,所述last_off_date字段用于标识上次执行节分过期时间,所述off_cash字段用于标识下次执行积分过期将扣除的积分;步骤S300:在每一笔消费积分时更新off_cash字段;步骤S400:在执行积分过期时,计算出下一次执行积分过期将被扣除的积分。
【技术特征摘要】
1.一种积分过期系统中快速更新积分余额的方法,其特征在于,包括:步骤S100:建立由用户表和流水表组成的积分系统,所述用户表包括id字段和cash字段,所述id字段用于唯一标识用户,所述cash字段用于标识当前积分余额;步骤S200:在用户表中增加last_off_date字段和off_cash字段,所述last_off_date字段用于标识上次执行节分过期时间,所述off_cash字段用于标识下次执行积分过期将扣除的积分;步骤S300:在每一笔消费积分时更新off_cash字段;步骤S400:在执行积分过期时,计算出下一次执行积分过期将被扣除的积分。2.根据权利要求1所述的积分过期系统中快速更新积分余额的方法,其特征在于,所述步骤S300具体包括:步骤S310:获取用户积分余额:查询用户表,检测last_off_date加上一个积分周期是否小于当前日期,如果是,将cash字段减去off_cash字段的值返回作为当前积分余额,否则返回cash字段值作为用户余额;步骤S320:用户消费积分:比较当前积...
【专利技术属性】
技术研发人员:陈熙,杨雪梅,漆尧,唐军,
申请(专利权)人:四川长虹电器股份有限公司,
类型:发明
国别省市:四川,51
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。