CN115456665A - Resource allocation method, system, electronic device and storage medium - Google Patents
Resource allocation method, system, electronic device and storage medium Download PDFInfo
- Publication number
- CN115456665A CN115456665A CN202211062694.2A CN202211062694A CN115456665A CN 115456665 A CN115456665 A CN 115456665A CN 202211062694 A CN202211062694 A CN 202211062694A CN 115456665 A CN115456665 A CN 115456665A
- Authority
- CN
- China
- Prior art keywords
- user
- activity
- resource
- event
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000013468 resource allocation Methods 0.000 title claims abstract description 24
- 230000000694 effects Effects 0.000 claims abstract description 175
- 230000001960 triggered effect Effects 0.000 claims abstract description 14
- 238000004590 computer program Methods 0.000 claims description 6
- 230000011664 signaling Effects 0.000 claims description 2
- 241000699666 Mus <mouse, genus> Species 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000011161 development Methods 0.000 description 4
- 239000012634 fragment Substances 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000006748 scratching Methods 0.000 description 1
- 230000002393 scratching effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
- G06Q30/0212—Chance discounts or incentives
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
- G06Q30/0222—During e-commerce, i.e. online transactions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
- G06Q30/0239—Online discounts or incentives
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Strategic Management (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Economics (AREA)
- Marketing (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本申请提供了一种资源分配方法,包括服务端接收到用户端发出的初始化信号时,获取用户端当前展示活动的活动编码以及当前登录用户的用户编号;服务端基于用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;在当前用户可参与次数大于0时,用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中事件预先存储在事件队列中并根据第一预设规则展示在用户端中;服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于远程字典服务为用户分配资源。提高用户参与度,利用远程字典服务优化存储性能;无需针对每个活动业务均开发一套资源分配的代码,具有通用性。
This application provides a method for resource allocation, including when the server receives the initialization signal sent by the user terminal, it obtains the activity code of the current display activity of the user terminal and the user number of the currently logged-in user; the server bases the user number, activity code, and The pre-stored configuration information table determines the number of times the current user can participate; when the number of times the current user can participate is greater than 0, the client starts the active game and prompts the user to click on the event until the termination condition is triggered. A preset rule is displayed in the client; the server collects events hit by the current user and records user resource information to the remote dictionary service according to the second preset rule, and allocates resources to the user based on the remote dictionary service. Improve user participation and use remote dictionary services to optimize storage performance; there is no need to develop a set of resource allocation codes for each active business, which is universal.
Description
技术领域technical field
本发明涉及软件开发技术领域,特别涉及一种资源分配方法、系统、电子设备及存储介质。The invention relates to the technical field of software development, in particular to a resource allocation method, system, electronic equipment and storage medium.
背景技术Background technique
在春节假日期间,产品的UV(Unique Visitor,独立访客)以及交易都会呈现断崖式下跌,因此为了提高用户的活跃度,商家通常会推出一些抽奖小游戏,常见的例如邀请新用户一起参与抽奖、刮卡式或幸运转盘抽奖等发送一些优惠券,在一定程度上增加了用户的参与度,增加商品交易额。During the Spring Festival holiday, the product’s UV (Unique Visitor, independent visitor) and transactions will show a cliff-like decline. Therefore, in order to increase user activity, merchants usually launch some lottery games. Common ones include inviting new users to participate in the lottery, Sending some coupons by scratching cards or lucky draws, etc., to a certain extent increases user participation and increases product transaction volume.
将抽奖活动池中的奖品看作是资源池中的资源,上述抽奖方式即可认为是资源分配方式,只需用户点击显示于用户界面的选项,服务器随机或按照一定规则将资源发放给该用户。这些资源分配方式中,用户只需点击静止的按钮,最终资源是否分配完全由后台服务器决定,用户参与度较低。Considering the prizes in the lottery pool as the resources in the resource pool, the above lottery method can be considered as a resource allocation method. Only the user needs to click the option displayed on the user interface, and the server will distribute the resources to the user randomly or according to certain rules . In these resource allocation methods, the user only needs to click the static button, and the final resource allocation is completely determined by the background server, and the user participation is low.
因此,亟需一种资源分配方法以提高用户参与度,以解决现有技术的上述技术问题。Therefore, there is an urgent need for a resource allocation method to improve user participation, so as to solve the above-mentioned technical problems in the prior art.
发明内容Contents of the invention
为了解决现有技术的不足,本发明的主要目的在于提供一种资源分配方法、系统、电子设备及存储介质,以解决现有技术的上述技术问题。In order to solve the deficiencies of the prior art, the main purpose of the present invention is to provide a resource allocation method, system, electronic equipment and storage medium to solve the above-mentioned technical problems of the prior art.
为了达到上述目的,第一方面本发明提供了一种资源分配方法,涉及用户端以及服务端,所述方法包括:In order to achieve the above purpose, the present invention provides a resource allocation method in the first aspect, involving a user end and a server end, the method comprising:
服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;When the server receives the initialization signal sent by the client, it obtains the activity code of the current display activity of the client and the user number of the currently logged-in user;
所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;When the number of times the current user can participate is greater than 0, the user terminal starts the active game and prompts the user to click on an event until the termination condition is triggered, wherein the event is pre-stored in the event queue and displayed on the in the client side;
所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server collects events hit by the current user, records user resource information into the remote dictionary service according to a second preset rule, and allocates resources to the user based on the remote dictionary service.
在一些实施例中,所述配置信息表包含活动次数表以及活动配置表;In some embodiments, the configuration information table includes an activity times table and an activity configuration table;
其中,所述活动次数表用于记录每一活动的参与情况,包括活动编码、参与时间以及对应的用户编号;Wherein, the activity times table is used to record the participation of each activity, including activity code, participation time and corresponding user number;
所述活动配置表用于记录每一活动的配置信息,包括活动编码、活动名称、活动时效、参与类型、资源规则。The activity configuration table is used to record the configuration information of each activity, including activity code, activity name, activity time limit, participation type, and resource rules.
在一些实施例中,所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数,包括:In some embodiments, the server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table, including:
根据所述活动编码查询所述活动配置表以确定当前展示活动的参与类型,所述参与类型包括第一类型以及第二类型;Querying the activity configuration table according to the activity code to determine the participation type of the current exhibition activity, the participation type including the first type and the second type;
若所述参与类型为第一类型,则根据所述活动编码查询所述活动次数表获取当前展示活动在当日的参与时间以确定当前展示活动的当日已参与次数,并根据第一参与总次数减去当日已参与次数确定当前用户可参与次数;If the participation type is the first type, query the activity times table according to the activity code to obtain the participation time of the current exhibition activity on the day to determine the number of participation times of the current exhibition activity on the day, and subtract the first total number of participation times Go to the number of participations of the day to determine the number of participations that the current user can participate in;
若所述参与类型为第二类型,则根据所述用户编号以及活动编码查询所述活动次数表以确定当前展示活动场景下当前登录用户的用户已参与次数,并根据第二参与总次数减去所述用户已参与次数确定当前用户可参与次数。If the participation type is the second type, query the activity times table according to the user number and the activity code to determine the number of times the user has participated in the currently logged-in user in the current display activity scene, and subtract The number of times the user has participated determines the number of times the current user can participate.
在一些实施例中,所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中,包括:In some embodiments, the event is pre-stored in the event queue and displayed in the client according to a first preset rule, including:
所述服务端根据预设比例设置假事件、真事件以及终止事件的数量,并均匀打散到所述事件队列中;The server sets the number of false events, true events and termination events according to a preset ratio, and evenly disperses them into the event queue;
所述服务端根据所述事件队列的事件顺序,在用户端循环展示所述事件队列中每一事件。The server cyclically displays each event in the event queue on the client side according to the sequence of events in the event queue.
在一些实施例中,所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,包括:In some embodiments, the server collects the events hit by the current user and records the user resource information to the remote dictionary service according to the second preset rule, including:
若当前用户击中的事件为假事件,则不进行记录;If the event hit by the current user is a false event, it will not be recorded;
若当前用户击中的事件为真事件,则基于正态分布算法随机在资源池中选取一件资源并记录当前用户的用户编号、活动游戏序号、活动编号以及对应的资源信息至远程字典服务;If the event hit by the current user is a true event, randomly select a resource from the resource pool based on the normal distribution algorithm and record the current user's user number, active game number, event number and corresponding resource information to the remote dictionary service;
若当前用户击中的事件为终止事件,则终止所述活动游戏并根据所述用户编号、活动游戏序号以及活动编号清除所述远程字典服务中已存储的对应的资源信息。If the event hit by the current user is a termination event, the active game is terminated and the corresponding resource information stored in the remote dictionary service is cleared according to the user number, the active game sequence number and the event number.
在一些实施例中,所述方法还包括:所述资源池中包含多种资源,所述资源规则包括游戏时长、事件出现秒数最大值以及最小值、事件出现间隔最大值以及最小值、每秒出现事件数以及每一资源的资源出现概率;In some embodiments, the method further includes: the resource pool contains a variety of resources, and the resource rules include the game duration, the maximum and minimum seconds of event occurrences, the maximum and minimum intervals between event occurrences, and the The number of events per second and the resource occurrence probability of each resource;
所述方法还包括:The method also includes:
根据第一公式计算各资源出现次数最大值,并根据第二公式计算资源出现次数最小值以确定每个资源出现次数范围,以及计算总资源出现次数范围;Calculate the maximum value of occurrence times of each resource according to the first formula, and calculate the minimum value of resource occurrence times according to the second formula to determine the range of occurrence times of each resource, and calculate the range of total resource occurrence times;
基于所述资源出现次数范围以及总资源出现次数范围确定每一资源选取概率范围,并确保基于正态算法随机在资源池中选取每一资源的概率在对应的所述资源概率范围内;Determine each resource selection probability range based on the resource occurrence frequency range and the total resource occurrence frequency range, and ensure that the probability of randomly selecting each resource in the resource pool based on a normal algorithm is within the corresponding resource probability range;
其中,所述第一公式为游戏时长/(事件出现秒数最小值+事件出现间隔最大值)*每秒出现事件数*资源出现概率;Wherein, the first formula is game duration/(minimum number of seconds of occurrence of events+maximum value of interval between occurrences of events)*number of occurrences per second*resource occurrence probability;
所述第二公式为游戏时长/(事件出现秒数最大值+事件出现间隔最小值)*每秒出现事件数*资源出现概率。The second formula is game duration/(maximum number of seconds of occurrence of events+minimum value of interval between occurrences of events)*number of events per second*probability of occurrence of resources.
在一些实施例中,所述基于所述远程字典服务为用户分配资源,包括:In some embodiments, the allocating resources to users based on the remote dictionary service includes:
所述服务端根据所述用户编号、活动游戏序号、活动编号读取所述远程字典服务中对应的资源信息;The server reads the corresponding resource information in the remote dictionary service according to the user number, activity game serial number, and activity number;
所述服务端基于验证所述资源是否符合分配条件,将符合分配条件的资源分配给当前用户。The server allocates resources meeting the allocation conditions to the current user based on verifying whether the resources meet the allocation conditions.
第二方面,本申请提供了一种资源分配系统,所述系统包括:In a second aspect, the present application provides a resource allocation system, the system comprising:
服务端,用于在接收到初始化信号时获取当前展示活动的活动编码以及当前登录用户的用户编号;The server is used to obtain the activity code of the current display activity and the user number of the currently logged-in user when receiving the initialization signal;
用户端,用于发出初始化信号并展示活动;Client, for signaling initialization and displaying activities;
所述服务端,还用于基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server is further configured to determine the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
用户端,用于在所述当前用户可参与次数大于0时,开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;The client is configured to start the active game and prompt the user to click on an event until the termination condition is triggered when the current number of times the user can participate is greater than 0, wherein the event is pre-stored in the event queue and displayed in the event queue according to the first preset rule. in the client;
所述服务端,还用于收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server is further configured to collect events hit by the current user, record user resource information into the remote dictionary service according to a second preset rule, and allocate resources to the user based on the remote dictionary service.
第三方面,本申请提供了一种电子设备,所述电子设备包括:In a third aspect, the present application provides an electronic device, and the electronic device includes:
一个或多个处理器;one or more processors;
以及与所述一个或多个处理器关联的存储器,所述存储器用于存储程序指令,所述程序指令在被所述一个或多个处理器读取执行时,执行如下操作:And a memory associated with the one or more processors, the memory is used to store program instructions, and when the program instructions are read and executed by the one or more processors, perform the following operations:
服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;When the server receives the initialization signal sent by the client, it obtains the activity code of the current display activity of the client and the user number of the currently logged-in user;
所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;When the number of times the current user can participate is greater than 0, the user terminal starts the active game and prompts the user to click on an event until the termination condition is triggered, wherein the event is pre-stored in the event queue and displayed on the in the client side;
所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server collects events hit by the current user, records user resource information into the remote dictionary service according to a second preset rule, and allocates resources to the user based on the remote dictionary service.
第四方面,本申请还提供了一种计算机可读存储介质,所述存储介质上存储计算机程序,所述计算机程序使得计算机执行如下操作:In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program causes the computer to perform the following operations:
服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;When the server receives the initialization signal sent by the client, it obtains the activity code of the current display activity of the client and the user number of the currently logged-in user;
所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;When the number of times the current user can participate is greater than 0, the user terminal starts the active game and prompts the user to click on an event until the termination condition is triggered, wherein the event is pre-stored in the event queue and displayed on the in the client side;
所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server collects events hit by the current user, records user resource information into the remote dictionary service according to a second preset rule, and allocates resources to the user based on the remote dictionary service.
本申请实现的有益效果为:The beneficial effect that this application realizes is:
本申请提供了一种资源分配方法,包括服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。通过事件列表在用户界面循环展示,且用户需要点击动态的事件才能获取对应的资源,提高了用户参与度,每次点击获取的资源具有随机性,提高对用户的吸引度;此外本申请还提出利用远程字典服务优化存储性能;本申请不需要针对每个活动业务均开发一套资源分配的代码,具有通用性,减少了开发周期和开发工作量。The present application provides a method for resource allocation, which includes, when the server receives an initialization signal sent by the user, obtaining the activity code of the current display activity of the user and the user number of the currently logged-in user; the server is based on the user Number, activity code, and pre-stored configuration information table to determine the number of times the current user can participate; when the number of times the current user can participate is greater than 0, the client starts the activity game and prompts the user to click on the event until the termination condition is triggered, wherein The event is pre-stored in the event queue and displayed in the client according to the first preset rule; the server collects the events hit by the current user and records the user resource information to the remote dictionary service according to the second preset rule , and allocate resources to users based on the remote dictionary service. The event list is cyclically displayed on the user interface, and users need to click on dynamic events to obtain corresponding resources, which improves user participation, and the resources obtained by each click are random, which increases the attractiveness to users; in addition, this application also proposes Use the remote dictionary service to optimize storage performance; this application does not need to develop a set of resource allocation codes for each active business, which is universal and reduces the development cycle and development workload.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图,其中:In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work, in which:
图1是本申请实施例提供的第一资源分配方法流程图;FIG. 1 is a flowchart of a first resource allocation method provided by an embodiment of the present application;
图2是本申请实施例提供的第二资源分配方法流程图;FIG. 2 is a flowchart of a second resource allocation method provided by an embodiment of the present application;
图3是本申请实施例提供的资源分配系统架构图;FIG. 3 is an architecture diagram of a resource allocation system provided by an embodiment of the present application;
图4是本申请实施例提供的电子设备结构图。FIG. 4 is a structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the application clearer, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only Some embodiments of this application are not all embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
应当理解,在本申请的描述中,除非上下文明确要求,否则整个说明书和权利要求书中的“包括”、“包含”等类似词语应当解释为包含的含义而不是排他或穷举的含义;也就是说,是“包括但不限于”的含义。It should be understood that in the description of the present application, unless the context clearly requires it, the words "comprising", "comprising" and other similar words in the entire specification and claims should be interpreted as an inclusive meaning rather than an exclusive or exhaustive meaning; That is to say, the meaning of "including but not limited to".
还应当理解,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。It should also be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, "plurality" means two or more.
需要注意的是,术语“S1”、“S2”等仅用于步骤的描述目的,并非特别指称次序或顺位的意思,亦非用以限定本申请,其仅仅是为了方便描述本申请的方法,而不能理解为指示步骤的先后顺序。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the terms "S1", "S2" and so on are only used for the description purpose of the steps, and do not specifically refer to the order or order, nor are they used to limit the application, but are only for the convenience of describing the method of the application , and cannot be understood as indicating the sequence of steps. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present application.
实施例一Embodiment one
本申请实施例提供了一种资源分配方法,具体的,利用本申请实施例公开的资源分配方法进行资源分配的过程包括:The embodiment of the present application provides a resource allocation method. Specifically, the resource allocation process using the resource allocation method disclosed in the embodiment of the present application includes:
S1、设置配置信息表。S1. Setting a configuration information table.
预先在服务端对资源系统进行配置,配置信息存储在服务端中以配置信息表的形式进行记录;其中,配置信息表在内容上可以分为活动次数表以及活动配置表。The resource system is configured on the server in advance, and the configuration information is stored in the server and recorded in the form of a configuration information table; the configuration information table can be divided into an activity times table and an activity configuration table in terms of content.
上述活动配置表用于记录每一个活动的配置信息,包括活动编码、活动时效、参与类型、资源规则。在新建一个活动时,由工作人员配置活动名称,活动时间(即活动时效)、参与类型、资源规则等。其中,参与类型包括一天N次(即第一类型)以及一人N次(即第二类型),具体可由工作人员自信设定N的取值。资源规则包括资源池、游戏时长、事件出现秒数最大值以及最小值、事件出现间隔最大值以及最小值、每秒出现事件数以及资源池内每一资源的资源出现概率。资源系统中可定义多个活动,为了减少服务端的存储压力,工作人员可根据活动时效删除已经失效的活动。The above activity configuration table is used to record the configuration information of each activity, including activity code, activity time limit, participation type, and resource rules. When creating an activity, the staff configures the activity name, activity time (namely activity time limit), participation type, resource rules, etc. Among them, the type of participation includes N times a day (ie, the first type) and N times per person (ie, the second type), and the specific value of N can be set by the staff with confidence. Resource rules include resource pool, game duration, maximum and minimum number of seconds of event occurrence, maximum and minimum value of event occurrence interval, number of events per second, and resource occurrence probability of each resource in the resource pool. Multiple activities can be defined in the resource system. In order to reduce the storage pressure on the server, the staff can delete expired activities according to the activity timeliness.
上述活动次数表用于记录每一活动的参与情况,包括活动编码、参与时间以及对应的用户编号。一个活动游戏开启,则实时更新记录下该活动游戏所述活动的活动编码、活动游戏参与时间以及参与活动游戏的用户对应的编号。The above activity times table is used to record the participation of each activity, including activity code, participation time and corresponding user number. When an activity game is opened, update and record the activity code of the activity described in the activity game, the participation time of the activity game and the numbers corresponding to the users participating in the activity game in real time.
S2、活动游戏初始化。S2. The activity game is initialized.
首先为了保证活动的有效性,在活动初始化时,服务端接收用户端生成的初始化信号后,需要对该活动进行一次有效性校验,通过活动编码查询配置信息表内资源规则中的每一资源的出现概率,校验资源池内设置的每一资源的出现概率总和是否等于100%,若资源出现概率总和不等于100%,则该活动为无效活动,此时由工作人员重新对资源出现概率进行配置。可选的,服务端还可根据活动编码查询资源规则中的资源池内的资源信息,并将资源信息返回至用户端,由用户端展示对应的资源信息以吸引用户,其中返回的资源信息不需要全部进行展示,可由用户端选择性的进行展示。First of all, in order to ensure the validity of the activity, when the activity is initialized, after receiving the initialization signal generated by the client, the server needs to perform a validity check on the activity, and query each resource in the resource rules in the configuration information table through the activity code Check whether the sum of the occurrence probabilities of each resource set in the resource pool is equal to 100%. If the sum of the resource occurrence probabilities is not equal to 100%, the activity is invalid. At this time, the staff will re-check the resource occurrence probability configuration. Optionally, the server can also query the resource information in the resource pool in the resource rule according to the activity code, and return the resource information to the client, and the client will display the corresponding resource information to attract users. The returned resource information does not need All are displayed, and can be selectively displayed by the client.
其次,服务端基于用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数。具体的,根据活动编码查询获得活动配置表以确定当前用户端展示活动的参与类型;若参与类型为一天N次,则根据活动编码查询活动次数表并查询当前活动在当日的参与时间以确定当前展示活动的当日已参与次数,参与时间在当日条件下该活动编码对应的记录即为当前展示活动的当日已参与次数,此时当前用户可参与次数等于参与总次数减去当日已参与次数(即N-当日已参与次数);若参与类型为一人N次,则根据用户编号以及活动编码查询上述活动次数表中用户编号和活动编码都符合的记录,存在几条记录即对应当前展示活动场景下当前登录用户的用户已参与次数,此时根据当前用户可参与此时等于参与总次数减去用户已参与次数(即N-用户已参与次数)。在当前用户可参与次数大于0时,服务端返回初始化完成信号至用户端,用户端接收到初始化完成信号后开启活动游戏。Secondly, the server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table. Specifically, obtain the activity configuration table according to the activity code query to determine the participation type of the current user-side display activity; if the participation type is N times a day, query the activity frequency table according to the activity code and query the participation time of the current activity on the day to determine the current The number of times the current user has participated in the display activity on the day, and the record corresponding to the activity code is the number of times the current user has participated in the display activity on the day under the condition of the participation time of the day. N-the number of participations on the day); if the participation type is one person N times, query the records in the above activity times table that match the user number and activity code according to the user number and activity code. If there are several records, they correspond to the current display activity scene The number of times the user has participated in the currently logged-in user is equal to the total number of participation times minus the number of times the user has participated (that is, N-the number of times the user has participated). When the number of times the current user can participate is greater than 0, the server returns an initialization completion signal to the client, and the client starts the active game after receiving the initialization completion signal.
S3、用户端开启活动游戏并根据事件队列以及第一预设规则展示事件,并提示用户点击事件。S3. The user end starts the active game, displays events according to the event queue and the first preset rule, and prompts the user to click on the event.
具体的,用户端在开启活动游戏前会展示提示页面,以提示用户需要在规定的游戏时长内点击出现的事件。服务端根据预设比例设置假事件、真事件以及终止事件的数量,并均匀打散到事件队列中;然后服务端根据事件队列的事件顺序以及每秒出现事件数,在用户端循环展示事件队列中的每一事件,直至触发终止条件,上述预设比例可由工作人员进行设置,以调整资源获取的难易度。其中,终止条件包括击中终止事件以及游戏时长结束,触发任一终止条件,活动游戏终止。Specifically, before starting the active game, the user terminal will display a prompt page to prompt the user to click on the event that occurs within the specified game duration. The server sets the number of false events, true events, and termination events according to the preset ratio, and evenly disperses them into the event queue; then the server displays the event queue on the client side in a loop according to the event sequence of the event queue and the number of events per second For each event in , until the termination condition is triggered, the above preset ratio can be set by the staff to adjust the difficulty of resource acquisition. Wherein, the termination condition includes hitting the termination event and the end of the game duration, if any termination condition is triggered, the active game is terminated.
S4、服务端基于用户击中的事件记录用户获取的资源信息至远程字典服务。S4. The server records the resource information acquired by the user to the remote dictionary service based on the event hit by the user.
具体的。若当前用户击中的事件为假事件,则无需记录该事件;若当前用户集中的事件为真事件,则基于正态分布算法在资源池中随机选取一件资源并记录当前用户的用户编号、活动游戏序号、活动编码以及对应的资源信息至远程字典服务中;若当前用户集中的事件为终止事件,则立即终止当前活动游戏并将根据当前登录用户的用户编号、活动游戏序号以及活动编号清除远程字典服务中该用户记录新的资源信息。值得注意的是,本申请还提供了一种资源选取验证方法,即根据在上述资源规则中已经设置的游戏时长、事假出现秒数最大值以及最小值、事件出现间隔最大值以及最小值、每秒出现事件数以及每一资源的资源出现概率,计算每一个资源对应的资源选取概率范围。具体的,针对每一个资源根据公式:游戏时长/(事件出现秒数最小值+事件出现间隔最大值)*每秒出现事件数*资源出现概率,计算得到每一个资源出现次数最大值;根据公式:游戏时长/(事件出现秒数最大值+事件出现间隔最小值)*每秒出现事件数*资源出现概率,计算得到每一个资源出现次数最小值;对每一个资源出现次数最大值和最小指分别求和以确定总资源出现次数最大值和最小值。针对每一个资源,通过计算资源出现次数最小值/总资源出现次数最大值求得资源选取概率最小值;通过计算资源出现次数最大值/总资源出现次数最小值求得资源选取概率最大值。在资源池中选取资源时,循环一次事件列表后选取到资源的概率都要保证在该资源对应的资源选取概率最小值和资源选取概率最大值之间。specific. If the event hit by the current user is a false event, there is no need to record the event; if the event in the current user set is a true event, a resource is randomly selected in the resource pool based on the normal distribution algorithm and the current user’s user number, The active game number, activity code and corresponding resource information are sent to the remote dictionary service; if the event in the current user collection is a termination event, the current active game will be terminated immediately and will be cleared according to the user number, active game number and event number of the currently logged-in user This user records new resource information in the remote dictionary service. It is worth noting that this application also provides a resource selection verification method, that is, according to the game duration set in the above resource rules, the maximum and minimum seconds of personal leave occurrences, the maximum and minimum event occurrence intervals, and each The number of occurrence events per second and the resource occurrence probability of each resource are used to calculate the resource selection probability range corresponding to each resource. Specifically, for each resource, according to the formula: game duration/(minimum number of seconds of event occurrence + maximum event occurrence interval) * number of events per second * resource occurrence probability, calculate the maximum number of occurrences of each resource; according to the formula : Game duration/(maximum number of seconds of event occurrences + minimum interval of event occurrences)*number of events per second*probability of resource occurrences, calculate the minimum value of the occurrence times of each resource; Sum separately to determine the total resource occurrence maximum and minimum. For each resource, the minimum value of resource selection probability is obtained by calculating the minimum number of occurrences of resources/the maximum number of occurrences of total resources; the maximum value of resource selection probability is obtained by calculating the maximum number of occurrences of resources/the minimum number of total resource occurrences. When selecting a resource in the resource pool, the probability of selecting a resource after looping through the event list must be guaranteed to be between the minimum value of the resource selection probability and the maximum value of the resource selection probability corresponding to the resource.
例如在抓福鼠送商品的游戏场景中,一个福鼠对应一个事件,抱着真奖品的福鼠对应真事件,抱着空奖品的福鼠对应假事件,抱着炸弹的福鼠则对应终止事件,福鼠们抱着不同的奖品随机在不同的坑位出现。如果抓到抱着真奖品的福鼠,则在奖品池中根据正态分布算法随机选取一个奖品,福鼠发送抖动消失后并生成文字提示“xx奖品+1”,此时在远程字典服务中记录下此次中奖记录,包括用户编号、活动游戏序号以及活动编号。如果抓到抱着假奖品的福鼠,则福鼠直接掉落洞中,并不进行任何操作。如果抓到抱着炸弹的福鼠,则游戏结束,之前抓到的福鼠奖品都失效,即清除已记录的奖品信息。活动游戏结束后,用户可根据用户编号、活动游戏序号、活动编码在远程字典服务中查询中奖记录For example, in the game scene of catching lucky mice and giving away goods, one lucky mouse corresponds to an event, the lucky mouse holding a real prize corresponds to a real event, the lucky mouse holding an empty prize corresponds to a false event, and the lucky mouse holding a bomb corresponds to a termination In the event, Fushus randomly appeared in different pits holding different prizes. If a Fushu holding a real prize is caught, a prize will be randomly selected in the prize pool according to the normal distribution algorithm, and a text prompt "xx prize + 1" will be generated after the sending vibration of Fushu disappears. At this time, in the remote dictionary service Record the winning record, including user ID, event game serial number and event ID. If the fu mouse holding the fake prize is caught, the fu mouse will fall directly into the hole without any operation. If the Fushu holding the bomb is caught, the game is over, and the rewards of the Fushu caught before will be invalid, that is, the recorded prize information will be cleared. After the event game is over, the user can query the winning record in the remote dictionary service according to the user number, event game serial number, and event code
S5、服务端验证记录下的资源信息,将符合分配条件的资源分配给当前用户。S5. The server verifies the recorded resource information, and allocates resources meeting the allocation conditions to the current user.
具体的,资源池中资源可以设置为积分、游戏机会、商品、优惠券等;上述分配条件包括库存条件以及领取次数条件;若资源库存不足,则服务端返回第一错误提示信号,用户端接收到第一错误提示信息并生成第一错误提示以提示用户该资源无法兑换,如“你来晚啦,奖品已兑换完毕”;若用户领取次数已达上限,则服务端返回第二错误提示信号,用户端接收到第二错误提示信息并生成第二错误提示以提示用户该资源无法兑换,如“很抱歉,你的奖品兑换次数已达上限”。本申请还可在分配条件中增加时间条件,对资源设置兑换时间,在击中该资源对应的事件时即进行倒计时,若该资源兑换时间时效,同样提示用户当前资源无法兑换。其中,积分可累计用于兑换游戏机会。此外,本申请实施例提供的方法还支持碎片收集玩法,此时资源池中还会增加游戏碎片,工作人员在配置资源系统时还需规定碎片兑换规则,即集齐预设数量以及预设种类的碎片可兑换预设奖品,例如设置需要一个财神A、一个财神B以及一个财神C才可兑换1000元现金红包。Specifically, the resources in the resource pool can be set to points, game opportunities, commodities, coupons, etc.; the above-mentioned allocation conditions include inventory conditions and the number of times of collection; if the resource inventory is insufficient, the server returns the first error prompt signal, and the user receives the Receive the first error prompt message and generate the first error prompt to remind the user that the resource cannot be redeemed, such as "You are late, the prize has been redeemed"; if the number of times the user has claimed has reached the upper limit, the server returns the second error prompt signal , the user end receives the second error message and generates a second error message to remind the user that the resource cannot be redeemed, such as "Sorry, your prize redemption times have reached the upper limit". This application can also add a time condition to the allocation conditions, set the exchange time for the resource, and count down when the event corresponding to the resource is hit. If the resource exchange time expires, it will also prompt the user that the current resource cannot be exchanged. Among them, the points can be accumulated and used to redeem game opportunities. In addition, the method provided by the embodiment of the present application also supports fragment collection gameplay. At this time, game fragments will be added to the resource pool. When configuring the resource system, the staff also need to specify the fragment exchange rules, that is, collect the preset number and preset types The fragments can be exchanged for preset prizes. For example, one God of Fortune A, one God of Fortune B, and one God of Fortune C are required to exchange for a 1,000 yuan cash red envelope.
本申请实施例提高的资源方法配置灵活,预加载资源,使得活动游戏运行时更加流程,提升用户体验,且通过事件列表展示事件,且进一步限制其中的真事件对应的资源选取,符合正态分布算法;用户需要点击不断出现消失的事件,增加了互动性;本申请还利用远程字典服务优化存储性能,提升加载速度;此外,本申请实施例不需要针对每个活动业务均开发一套资源分配的代码,具有通用性,减少了开发周期和开发工作量。The resource method improved by the embodiment of the present application is flexible in configuration, preloading resources, making the running of the event game more streamlined, improving user experience, and displaying events through the event list, and further restricting the selection of resources corresponding to real events, which conforms to the normal distribution Algorithm; users need to click on events that appear and disappear continuously, which increases interactivity; this application also uses the remote dictionary service to optimize storage performance and improve loading speed; in addition, the embodiment of this application does not need to develop a set of resource allocation for each active business The code is universal, reducing the development cycle and development workload.
实施例二Embodiment two
对应上述实施例一,本申请实施例还提供了一种资源分配方法,如图2所示,具体如下:Corresponding to the first embodiment above, the embodiment of this application also provides a resource allocation method, as shown in Figure 2, specifically as follows:
2100、服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;2100. When the server receives the initialization signal sent by the client, obtain the activity code of the current display activity of the client and the user number of the currently logged-in user;
2200、所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;2200. The server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
优选的,所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数,包括:Preferably, the server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table, including:
2210、根据所述活动编码查询所述活动配置表以确定当前展示活动的参与类型,所述参与类型包括第一类型以及第二类型;2210. Query the activity configuration table according to the activity code to determine the participation type of the current exhibition activity, and the participation type includes the first type and the second type;
2220、若所述参与类型为第一类型,则根据所述活动编码查询所述活动次数表获取当前展示活动在当日的参与时间以确定当前展示活动的当日已参与次数,并根据第一参与总次数减去当日已参与次数确定当前用户可参与次数;2220. If the participation type is the first type, query the activity times table according to the activity code to obtain the participation time of the current exhibition activity on the day to determine the number of participation times of the current exhibition activity on the day, and according to the first participation total The number of times that the current user can participate is determined by subtracting the number of participations of the day from the number of times;
2230、若所述参与类型为第二类型,则根据所述用户编号以及活动编码查询所述活动次数表以确定当前展示活动场景下当前登录用户的用户已参与次数,并根据第二参与总次数减去所述用户已参与次数确定当前用户可参与次数。2230. If the participation type is the second type, query the activity times table according to the user number and activity code to determine the number of user participations of the currently logged-in user in the current display event scene, and calculate the number of participations according to the second total number of participations Subtract the number of times the user has already participated to determine the number of times the current user can participate.
其中,所述配置信息表包含活动次数表以及活动配置表;Wherein, the configuration information table includes an activity times table and an activity configuration table;
其中,所述活动次数表用于记录每一活动的参与情况,包括活动编码、参与时间以及对应的用户编号;Wherein, the activity times table is used to record the participation of each activity, including activity code, participation time and corresponding user number;
所述活动配置表用于记录每一活动的配置信息,包括活动编码、活动名称、活动时效、参与类型、资源规则。The activity configuration table is used to record the configuration information of each activity, including activity code, activity name, activity time limit, participation type, and resource rules.
2300、在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;2300. When the number of times the current user can participate is greater than 0, the user end starts the active game and prompts the user to click on an event until the termination condition is triggered, wherein the event is pre-stored in the event queue and displayed in the event according to the first preset rule In said client;
优选的,所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中,包括:Preferably, the event is pre-stored in the event queue and displayed in the client according to a first preset rule, including:
2310、所述服务端根据预设比例设置假事件、真事件以及终止事件的数量,并均匀打散到所述事件队列中;2310. The server sets the number of false events, true events, and termination events according to a preset ratio, and evenly disperses them into the event queue;
2320、所述服务端根据所述事件队列的事件顺序,在用户端循环展示所述事件队列中每一事件。2320. The server cyclically displays each event in the event queue on the client side according to the sequence of events in the event queue.
2400、所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。2400. The server collects events hit by the current user, records user resource information into the remote dictionary service according to a second preset rule, and allocates resources to the user based on the remote dictionary service.
优选的,所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,包括:Preferably, the server collects the events hit by the current user and records the user resource information to the remote dictionary service according to the second preset rule, including:
2410、若当前用户击中的事件为假事件,则不进行记录;2410. If the event hit by the current user is a false event, no recording is made;
2420、若当前用户击中的事件为真事件,则基于正态分布算法随机在资源池中选取一件资源并记录当前用户的用户编号、活动游戏序号、活动编号以及对应的资源信息至远程字典服务;2420. If the event hit by the current user is a true event, randomly select a resource from the resource pool based on the normal distribution algorithm and record the current user's user ID, active game serial number, event ID, and corresponding resource information to the remote dictionary Serve;
优选的,所述资源池中包含多种资源,所述资源规则包括游戏时长、事件出现秒数最大值以及最小值、事件出现间隔最大值以及最小值、每秒出现事件数以及每一资源的资源出现概率;Preferably, the resource pool contains a variety of resources, and the resource rules include the game duration, the maximum and minimum number of seconds of event occurrence, the maximum and minimum value of the event occurrence interval, the number of events per second, and the number of events for each resource. resource occurrence probability;
所述方法还包括:The method also includes:
2421、根据第一公式计算各资源出现次数最大值,并根据第二公式计算资源出现次数最小值以确定每个资源出现次数范围,以及计算总资源出现次数范围;2421. Calculate the maximum value of occurrence times of each resource according to the first formula, and calculate the minimum value of resource occurrence times according to the second formula to determine the range of occurrence times of each resource, and calculate the range of total resource occurrence times;
2422、基于所述资源出现次数范围以及总资源出现次数范围确定每一资源选取概率范围,并确保基于正态算法随机在资源池中选取每一资源的概率在对应的所述资源概率范围内;2422. Determine each resource selection probability range based on the resource occurrence frequency range and the total resource occurrence frequency range, and ensure that the probability of randomly selecting each resource in the resource pool based on the normal algorithm is within the corresponding resource probability range;
其中,所述第一公式为游戏时长/(事件出现秒数最小值+事件出现间隔最大值)*每秒出现事件数*资源出现概率;Wherein, the first formula is game duration/(minimum number of seconds of occurrence of events+maximum value of interval between occurrences of events)*number of occurrences per second*resource occurrence probability;
所述第二公式为游戏时长/(事件出现秒数最大值+事件出现间隔最小值)*每秒出现事件数*资源出现概率。The second formula is game duration/(maximum number of seconds of occurrence of events+minimum value of interval between occurrences of events)*number of events per second*probability of occurrence of resources.
2430、若当前用户击中的事件为终止事件,则终止所述活动游戏并根据所述用户编号、活动游戏序号以及活动编号清除所述远程字典服务中已存储的对应的资源信息。2430. If the event hit by the current user is a termination event, terminate the event game and clear the corresponding resource information stored in the remote dictionary service according to the user number, the sequence number of the event game, and the event number.
优选的,所述基于所述远程字典服务为用户分配资源,包括:Preferably, the allocation of resources to users based on the remote dictionary service includes:
2440、所述服务端根据所述用户编号、活动游戏序号、活动编号读取所述远程字典服务中对应的资源信息;2440. The server reads the corresponding resource information in the remote dictionary service according to the user ID, event game serial number, and event ID;
2450、所述服务端基于验证所述资源是否符合分配条件,将符合分配条件的资源分配给当前用户。2450. The server allocates resources meeting the allocation conditions to the current user based on verifying whether the resources meet the allocation conditions.
实施例三Embodiment Three
如图3所示,对应上述实施例一和实施例二,本申请实施例提供了一种资源分配系统,所述系统包括:As shown in FIG. 3 , corresponding to the first and second embodiments above, this embodiment of the present application provides a resource allocation system, and the system includes:
服务端310,用于在接收到初始化信号时获取当前展示活动的活动编码以及当前登录用户的用户编号;The server 310 is used to obtain the activity code of the current exhibition activity and the user number of the currently logged-in user when receiving the initialization signal;
用户端320,用于发出初始化信号并展示活动;Client 320, configured to send initialization signals and display activities;
所述服务端310,还用于基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server 310 is further configured to determine the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
用户端320,用于在所述当前用户可参与次数大于0时,开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;The client terminal 320 is configured to start the active game and prompt the user to click on an event until the termination condition is triggered when the current number of times the user can participate is greater than 0, wherein the event is pre-stored in the event queue and displayed in the event queue according to the first preset rule. In said client;
所述服务端310,还用于收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server 310 is also used to collect events hit by the current user, record user resource information into the remote dictionary service according to the second preset rule, and allocate resources to the user based on the remote dictionary service.
其中,所述配置信息表包含活动次数表以及活动配置表;所述活动次数表用于记录每一活动的参与情况,包括活动编码、参与时间以及对应的用户编号;所述活动配置表用于记录每一活动的配置信息,包括活动编码、活动名称、活动时效、参与类型、资源规则。Wherein, the configuration information table includes an activity frequency table and an activity configuration table; the activity frequency table is used to record the participation of each activity, including activity code, participation time and corresponding user number; the activity configuration table is used for Record the configuration information of each activity, including activity code, activity name, activity timeliness, participation type, and resource rules.
在一些实施例中,所述服务端310还用于根据所述活动编码查询所述活动配置表以确定当前展示活动的参与类型,所述参与类型包括第一类型以及第二类型;若所述参与类型为第一类型,则所述服务端310根据所述活动编码查询所述活动次数表获取当前展示活动在当日的参与时间以确定当前展示活动的当日已参与次数,并根据第一参与总次数减去当日已参与次数确定当前用户可参与次数;若所述参与类型为第二类型,则所述服务端310根据所述用户编号以及活动编码查询所述活动次数表以确定当前展示活动场景下当前登录用户的用户已参与次数,并根据第二参与总次数减去所述用户已参与次数确定当前用户可参与次数。In some embodiments, the server 310 is further configured to query the activity configuration table according to the activity code to determine the participation type of the current exhibition activity, and the participation type includes the first type and the second type; if the If the participation type is the first type, then the server 310 queries the activity times table according to the activity code to obtain the participation time of the current exhibition activity on the day to determine the number of participation times of the current exhibition activity on the day, and according to the first participation total The number of times minus the number of times that the current user has participated in the current day determines the number of times the current user can participate; if the participation type is the second type, the server 310 queries the activity times table according to the user number and activity code to determine the current display activity scene The number of user participations of the currently logged-in user is recorded, and the number of participations of the current user is determined according to the second total number of participations minus the number of participations of the user.
在一些实施例中,所述服务端310还用于根据预设比例设置假事件、真事件以及终止事件的数量,并均匀打散到所述事件队列中;所述服务端310还用于根据所述事件队列的事件顺序,在用户端循环展示所述事件队列中每一事件。In some embodiments, the server 310 is further configured to set the number of false events, true events, and termination events according to a preset ratio, and evenly disperse them into the event queue; the server 310 is also configured to The sequence of events in the event queue displays each event in the event queue cyclically on the client side.
在一些实施例中,所述服务端310还用于在当前用户击中的事件为假事件,不进行记录;所述服务端310还用于在当前用户击中的事件为真事件时,基于正态分布算法随机在资源池中选取一件资源并记录当前用户的用户编号、活动游戏序号、活动编号以及对应的资源信息至远程字典服务;所述服务端310还用于在当前用户击中的事件为终止事件时,终止所述活动游戏并根据所述用户编号、活动游戏序号以及活动编号清除所述远程字典服务中已存储的对应的资源信息。In some embodiments, the server 310 is further configured to not record when the event hit by the current user is a false event; the server 310 is also configured to, based on The normal distribution algorithm randomly selects a resource in the resource pool and records the current user's user number, activity game number, activity number and corresponding resource information to the remote dictionary service; the server 310 is also used for the current user to hit When the event is a termination event, the active game is terminated and the corresponding resource information stored in the remote dictionary service is cleared according to the user number, the active game sequence number and the event number.
在一些实施例中,所述资源池中包含多种资源,所述资源规则包括游戏时长、事件出现秒数最大值以及最小值、事件出现间隔最大值以及最小值、每秒出现事件数以及每一资源的资源出现概率;所述服务端310还用于根据第一公式计算各资源出现次数最大值,并根据第二公式计算资源出现次数最小值以确定每个资源出现次数范围,以及计算总资源出现次数范围;所述服务端310还用于基于所述资源出现次数范围以及总资源出现次数范围确定每一资源选取概率范围,并确保基于正态算法随机在资源池中选取每一资源的概率在对应的所述资源概率范围内;其中,所述第一公式为游戏时长/(事件出现秒数最小值+事件出现间隔最大值)*每秒出现事件数*资源出现概率;所述第二公式为游戏时长/(事件出现秒数最大值+事件出现间隔最小值)*每秒出现事件数*资源出现概率。In some embodiments, the resource pool contains a variety of resources, and the resource rules include the game duration, the maximum and minimum seconds of event occurrences, the maximum and minimum intervals of event occurrences, the number of events per second, and the number of events per second. The resource occurrence probability of a resource; the server 310 is also used to calculate the maximum value of the occurrence times of each resource according to the first formula, and calculate the minimum value of the resource occurrence times according to the second formula to determine the range of occurrence times of each resource, and calculate the total resource occurrence times range; the server 310 is also used to determine each resource selection probability range based on the resource occurrence number range and the total resource occurrence number range, and ensure that each resource is randomly selected in the resource pool based on a normal algorithm The probability is within the corresponding resource probability range; wherein, the first formula is the game duration/(the minimum number of seconds of event occurrence + the maximum value of the event occurrence interval)*the number of events per second*the resource occurrence probability; the first The second formula is the game duration/(the maximum number of seconds of event occurrence + the minimum event interval) * number of events per second * resource occurrence probability.
在一些实施例中,所述服务端310还用于根据所述用户编号、活动游戏序号、活动编号读取所述远程字典服务中对应的资源信息;所述服务端310还用于基于验证所述资源是否符合分配条件,将符合分配条件的资源分配给当前用户。In some embodiments, the server 310 is also used to read the corresponding resource information in the remote dictionary service according to the user number, the activity game serial number, and the activity number; Whether the above resources meet the allocation conditions, allocate the resources that meet the allocation conditions to the current user.
实施例四Embodiment four
对应上述所有实施例,本申请实施例提供一种电子设备,包括:Corresponding to all the above-mentioned embodiments, this embodiment of the present application provides an electronic device, including:
一个或多个处理器;以及与所述一个或多个处理器关联的存储器,所述存储器用于存储程序指令,所述程序指令在被所述一个或多个处理器读取执行时,执行如下操作:one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, execute Do as follows:
服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;When the server receives the initialization signal sent by the client, it obtains the activity code of the current display activity of the client and the user number of the currently logged-in user;
所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;When the number of times the current user can participate is greater than 0, the user terminal starts the active game and prompts the user to click on an event until the termination condition is triggered, wherein the event is pre-stored in the event queue and displayed on the in the client side;
所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server collects events hit by the current user, records user resource information into the remote dictionary service according to a second preset rule, and allocates resources to the user based on the remote dictionary service.
其中,图4示例性的展示出了电子设备的架构,具体可以包括处理器410,视频显示适配器411,磁盘驱动器412,输入/输出接口413,网络接口414,以及存储器420。上述处理器410、视频显示适配器411、磁盘驱动器412、输入/输出接口413、网络接口414,与存储器420之间可以通过总线430进行通信连接。Wherein, FIG. 4 exemplarily shows the architecture of the electronic device, which may specifically include a processor 410 , a video display adapter 411 , a
其中,处理器410可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本申请所提供的技术方案。Wherein, the processor 410 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for Relevant programs are executed to realize the technical solutions provided by this application.
存储器420可以采用ROM(Read Only Memory,可编写存储器)、RAM(Random AccessMemory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器420可以存储用于控制电子设备400执行的操作系统421,用于控制电子设备400的低级别操作的基本输入输出系统(BIOS)422。另外,还可以存储网页浏览器423,数据存储管理系统424,以及图标字体处理系统425等等。上述图标字体处理系统425就可以是本申请实施例中具体实现前述各步骤操作的应用程序。总之,在通过软件或者固件来实现本申请所提供的技术方案时,相关的程序代码保存在存储器420中,并由处理器410来调用执行。The memory 420 may be implemented in the form of ROM (Read Only Memory, programmable memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, and the like. The memory 420 may store an operating system 421 for controlling execution of the electronic device 400 , a basic input output system (BIOS) 422 for controlling low-level operations of the electronic device 400 . In addition, a web browser 423, a data storage management system 424, an icon
输入/输出接口413用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 413 is used to connect the input/output module to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
网络接口414用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The network interface 414 is used to connect the communication module (not shown in the figure), so as to realize the communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.), and can also realize communication through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
总线430包括一通路,在设备的各个组件(例如处理器410、视频显示适配器411、磁盘驱动器412、输入/输出接口413、网络接口414,与存储器420)之间传输信息。Bus 430 comprises a path for transferring information between the various components of the device (eg, processor 410, video display adapter 411,
另外,该电子设备400还可以从虚拟资源对象领取条件信息数据库中获得具体领取条件的信息,以用于进行条件判断,等等。In addition, the electronic device 400 can also obtain information about specific receiving conditions from the virtual resource object receiving condition information database, so as to judge the conditions, and so on.
需要说明的是,尽管上述设备仅示出了处理器410、视频显示适配器411、磁盘驱动器412、输入/输出接口413、网络接口414,存储器420,总线430等,但是在具体实施过程中,该设备还可以包括实现正常执行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本申请方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above devices only show the processor 410, the video display adapter 411, the
实施例六Embodiment six
对应上述所有实施例,本申请实施例还提供一种计算机可读存储介质,其特征在于,其存储计算机程序,所述计算机程序使得计算机如下操作:Corresponding to all the above-mentioned embodiments, the embodiment of the present application also provides a computer-readable storage medium, which is characterized in that it stores a computer program, and the computer program enables the computer to operate as follows:
服务端接收到用户端发出的初始化信号时,获取所述用户端当前展示活动的活动编码以及当前登录用户的用户编号;When the server receives the initialization signal sent by the client, it obtains the activity code of the current display activity of the client and the user number of the currently logged-in user;
所述服务端基于所述用户编号、活动编码、以及预先存储的配置信息表,确定当前用户可参与次数;The server determines the number of times the current user can participate based on the user number, activity code, and pre-stored configuration information table;
在所述当前用户可参与次数大于0时,所述用户端开启活动游戏并提示用户点击事件直至触发终止条件,其中所述事件预先存储在事件队列中并根据第一预设规则展示在所述用户端中;When the number of times the current user can participate is greater than 0, the user terminal starts the active game and prompts the user to click on an event until the termination condition is triggered, wherein the event is pre-stored in the event queue and displayed on the in the client side;
所述服务端收集当前用户击中的事件并根据第二预设规则记录用户资源信息至远程字典服务中,以及基于所述远程字典服务为用户分配资源。The server collects events hit by the current user, records user resource information into the remote dictionary service according to a second preset rule, and allocates resources to the user based on the remote dictionary service.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,云服务端,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。It can be known from the above description of the implementation manners that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general-purpose hardware platform. Based on this understanding, the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , optical disc, etc., including several instructions to enable a computer device (which may be a personal computer, a cloud server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的系统及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment. The systems and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is It can be located in one place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211062694.2A CN115456665A (en) | 2022-08-31 | 2022-08-31 | Resource allocation method, system, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211062694.2A CN115456665A (en) | 2022-08-31 | 2022-08-31 | Resource allocation method, system, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115456665A true CN115456665A (en) | 2022-12-09 |
Family
ID=84299873
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211062694.2A Pending CN115456665A (en) | 2022-08-31 | 2022-08-31 | Resource allocation method, system, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115456665A (en) |
-
2022
- 2022-08-31 CN CN202211062694.2A patent/CN115456665A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210319468A1 (en) | Information processing method, server, first terminal, and computer storage medium | |
RU2434295C2 (en) | Advertisement method and system, advertisement control server and mobile device | |
JP5638716B1 (en) | System, method, and program for providing game | |
US20140058811A1 (en) | System and method for monitoring and rewarding an incentivized activity | |
CN104379225A (en) | Game control device, game control method, program, recording medium and game system | |
CN107172182A (en) | A kind of information push method, message push server and terminal | |
US8167725B1 (en) | System and method for using a game to interact with television programs | |
CN105871938B (en) | A kind of virtual resource configuration system, method and device | |
US10643239B2 (en) | Monitoring an application on a processing device and generating rewards | |
AU2015213191A1 (en) | Methods and systems for algorithmically selected trivia gaming content | |
CN113262494A (en) | Task processing method and device in game and electronic equipment | |
CN109343778A (en) | Display method and device and electronic equipment | |
CN114247154A (en) | Virtual resource sending method and device, electronic equipment and readable storage medium | |
CN114037474A (en) | Rights and interests configuration method and device, storage medium and computer equipment | |
JP2003044741A (en) | Device for operating game site | |
JP2015217297A (en) | System, method and program for providing game | |
JP5731057B1 (en) | System, method, and program for providing game | |
CN115082154A (en) | Order processing method, system, apparatus and electronic device | |
CN115456665A (en) | Resource allocation method, system, electronic device and storage medium | |
CN111343469B (en) | Data processing method and device, electronic equipment and storage medium | |
JP2021094151A (en) | Game program, game processing method, information processing device | |
CN114862426A (en) | Customer service recommendation method, device, equipment and medium | |
CN109011586A (en) | It is a kind of to accompany the game for playing platform to accompany object for appreciation request processing method and terminal based on game | |
AU2009201986A1 (en) | Gaming method and gaming system | |
KR102811433B1 (en) | Method for providing advertisements by grouping advertisements and system thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |