Activity list settlement method and device and storage medium

文档序号:1315077 发布日期:2020-07-10 浏览:11次 中文

阅读说明:本技术 活动榜单结算方法、装置及存储介质 (Activity list settlement method and device and storage medium ) 是由 刘志斌 郑俊 于 2020-02-14 设计创作,主要内容包括:本申请公开了一种更新活动榜单的方法、装置及存储介质,属于互联网技术领域。在本申请实施例中,可以在活动消息的消息标识符中设置设定比特字段,如果根据活动消息对多个活动榜单中的一个或多个目标榜单更新失败,则将消息标识符中目标榜单对应的标志位设置为第一数值,进而根据包含有更新后的消息标识符的活动消息重新对对应的目标榜单进行更新,直至更新成功为止,这样,相较于相关技术中通过编写修复脚本来修复,更为简单,且也不会影响到后续的业务逻辑。(The application discloses a method, a device and a storage medium for updating a activity list, and belongs to the technical field of internet. In the embodiment of the application, a set bit field may be set in a message identifier of an activity message, if one or more target lists in a plurality of activity lists are unsuccessfully updated according to the activity message, a flag bit corresponding to the target lists in the message identifier is set to be a first numerical value, and then the corresponding target lists are updated again according to the activity message including the updated message identifier until the update is successful, so that the target lists are repaired by writing a repair script in comparison with the related art, which is simpler and does not affect subsequent business logic.)

1. A method of updating a leaderboard, the method comprising:

obtaining an activity message, wherein the activity message comprises a message identifier which is used for uniquely identifying the activity message;

if one or more target lists in a plurality of activity lists are unsuccessfully updated according to the activity message, setting a flag bit corresponding to each target list in a set bit field included by the message identifier to be a first numerical value, wherein each flag bit in the set bit field corresponds to one activity list in the plurality of activity lists;

and according to the activity message containing the updated message identifier, re-updating the one or more target lists.

2. The method of claim 1, wherein after obtaining the activity message, further comprising:

detecting whether the message identifier includes a set bit field;

if the message identifier comprises the set bit field, determining a campaign list which is not updated completely according to the set bit field;

updating the activity list which is not updated completely according to the activity message;

and setting the flag bit corresponding to the successfully updated activity list as a second numerical value, wherein the second numerical value is different from the first numerical value.

3. The method of claim 2, wherein the determining a leaderboard of incomplete updates from the set bit field comprises:

determining a flag bit taking a first value from a plurality of flag bits included in the set bit field;

and determining the activity list corresponding to the zone bit with the value of the first numerical value as the activity list which is not updated completely.

4. The method of claim 2, wherein after detecting whether the message identifier includes a set bit field, further comprising:

and if the message identifier does not comprise the set bit field, adding the set bit field in the message identifier, wherein the initial value of each flag bit in a plurality of flag bits comprised in the added set bit field is the first numerical value.

5. The method of any of claims 1-4, wherein obtaining the activity message comprises:

reading the active message from a message queue;

accordingly, the re-updating the one or more target lists according to the campaign message including the updated message identifier includes:

and rewriting the active message containing the updated message identifier into the message queue, and returning to execute the step of reading the active message from the message queue until the one or more target lists are updated successfully.

6. An apparatus to update a leaderboard, the apparatus comprising:

an obtaining module, configured to obtain an activity message, where the activity message includes a message identifier, and the message identifier is used to uniquely identify the activity message;

a setting module, configured to set a flag corresponding to each target list in a set bit field included in the message identifier to a first numerical value if updating of one or more target lists in a plurality of activity lists according to the activity message fails, where each flag in the set bit field corresponds to one activity list in the plurality of activity lists;

and the updating module is used for updating the one or more target list again according to the activity message containing the updated message identifier.

7. The apparatus of claim 6, further comprising:

a detection module for detecting whether the message identifier includes a set bit field;

a determining module, configured to determine a leader board not updated completely according to the set bit field if the message identifier includes the set bit field;

the updating module is further configured to update the uncompleted updated activity list according to the activity message;

the setting module is further configured to set a flag bit corresponding to the successfully updated activity list to a second numerical value, where the second numerical value is different from the first numerical value.

8. The apparatus according to claim 6 or 7,

the obtaining module is specifically configured to read the activity message from a message queue;

the update module is specifically configured to: rewriting the active message containing the updated message identifier into the message queue, and triggering the acquisition module to read the active message from the message queue until the one or more target list is updated successfully.

9. An apparatus to update a leaderboard, the apparatus comprising:

a processor;

a memory for storing processor-executable instructions;

wherein the processor executes the executable instructions in the memory to perform the steps of the method of any of the preceding claims 1-5.

10. A computer-readable storage medium, having stored thereon instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 5.

Technical Field

The application relates to the technical field of internet, in particular to a method, a device and a storage medium for clearing activity lists.

Background

Currently, to enhance the user experience and increase the user's viscosity, application providers may set various activities in applications. For example, in a live broadcast application, an application facilitator may set a popularity anchor competition activity, generate an anchor list by counting the value or number of gifts received by the anchor within a fixed time period, and then evaluate the popularity anchor from the anchor list. In activities such as this, settlement statistics can be performed on activity data in the activity process from multiple dimensions, so as to obtain multiple activity lists corresponding to the multiple dimensions, thereby providing enthusiasm for users to participate in the activity.

Disclosure of Invention

The embodiment of the application provides a method, a device and a storage medium for updating a activity list, which can simplify the processing process of re-updating the activity list under the condition that the list settlement fails. The technical scheme is as follows:

in a first aspect, a method for updating a leaderboard is provided, the method comprising:

obtaining an activity message, wherein the activity message comprises a message identifier which is used for uniquely identifying the activity message;

if one or more target lists in a plurality of activity lists are unsuccessfully updated according to the activity message, setting a flag bit corresponding to each target list in a set bit field included by the message identifier to be a first numerical value, wherein each flag bit in the set bit field corresponds to one activity list in the plurality of activity lists;

and according to the activity message containing the updated message identifier, re-updating the one or more target lists.

Alternatively,

after the acquiring the activity message, the method further comprises:

detecting whether the message identifier includes a set bit field;

if the message identifier comprises the set bit field, determining a campaign list which is not updated completely according to the set bit field;

updating the activity list which is not updated completely according to the activity message;

and setting the flag bit corresponding to the successfully updated activity list as a second numerical value, wherein the second numerical value is different from the first numerical value.

Optionally, the determining a campaign list of incomplete updates according to the set bit field includes:

determining a flag bit taking a first value from a plurality of flag bits included in the set bit field;

and determining the activity list corresponding to the zone bit with the value of the first numerical value as the activity list which is not updated completely.

Alternatively,

after the detecting whether the message identifier includes the set bit field, the method further includes:

and if the message identifier does not comprise the set bit field, adding the set bit field in the message identifier, wherein the initial value of each flag bit in a plurality of flag bits comprised in the added set bit field is the first numerical value.

Optionally, the obtaining the activity message includes:

reading the active message from a message queue;

accordingly, the re-updating the one or more target lists according to the campaign message including the updated message identifier includes:

and rewriting the active message containing the updated message identifier into the message queue, and returning to execute the step of reading the active message from the message queue until the one or more target lists are updated successfully.

In a second aspect, an apparatus for updating a leaderboard is provided, the apparatus comprising:

an obtaining module, configured to obtain an activity message, where the activity message includes a message identifier, and the message identifier is used to uniquely identify the activity message;

a setting module, configured to set a flag corresponding to each target list in a set bit field included in the message identifier to a first numerical value if updating of one or more target lists in a plurality of activity lists according to the activity message fails, where each flag in the set bit field corresponds to one activity list in the plurality of activity lists;

and the updating module is used for updating the one or more target list again according to the activity message containing the updated message identifier.

Optionally, the apparatus further comprises:

a detection module for detecting whether the message identifier includes a set bit field;

a determining module, configured to determine a leader board not updated completely according to the set bit field if the message identifier includes the set bit field;

the updating module is further configured to update the uncompleted updated activity list according to the activity message;

the setting module is further configured to set a flag bit corresponding to the successfully updated activity list to a second numerical value, where the second numerical value is different from the first numerical value.

Optionally, the determining module is specifically configured to:

determining a flag bit taking a first value from a plurality of flag bits included in the set bit field;

and determining the activity list corresponding to the zone bit with the value of the first numerical value as the activity list which is not updated completely.

Optionally, the apparatus further comprises:

an adding module, configured to add the set bit field in the message identifier if the message identifier does not include the set bit field, where an initial value of each of a plurality of flag bits included in the added set bit field is the first numerical value.

Optionally, the obtaining module is specifically configured to read the activity message from a message queue;

the update module is specifically configured to: rewriting the active message containing the updated message identifier into the message queue, and triggering the acquisition module to read the active message from the message queue until the one or more target list is updated successfully.

In a third aspect, an apparatus for updating a leaderboard is provided, the apparatus comprising:

a processor;

a memory for storing processor-executable instructions;

wherein the processor executes executable instructions in the memory to perform any of the methods of the first aspect.

In a fourth aspect, a computer-readable storage medium is provided, having instructions stored thereon, which when executed by a processor, implement the steps of any of the methods of the first aspect described above.

The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:

in the embodiment of the application, a set bit field may be set in a message identifier of an activity message, if one or more target lists in a plurality of activity lists are unsuccessfully updated according to the activity message, a flag bit corresponding to the target lists in the message identifier is set to be a first numerical value, and then the corresponding target lists are updated again according to the activity message including the updated message identifier until the update is successful, so that the target lists are repaired by writing a repair script in comparison with the related art, which is simpler and does not affect subsequent business logic.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a system architecture diagram of a network system according to an embodiment of the present application;

fig. 2 is a flowchart of a method for updating a leader board according to an embodiment of the present application;

FIG. 3 is a flowchart of another method for updating a leaderboard provided by an embodiment of the application;

fig. 4 is a schematic structural diagram of an apparatus for updating a leaderboard provided by an embodiment of the present application;

fig. 5 is a schematic structural diagram of a server for updating a leaderboard provided in an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

Before explaining the embodiments of the present application in detail, an application scenario related to the embodiments of the present application will be described.

Currently, in various applications such as games, live broadcasts, music, and the like, various activities may be set in the applications in order to increase user stickiness and improve application revenues. In the activity, a list of the activity in the corresponding period can be generated according to the user data in different activity periods, and then a promotion user from the promotion to the next activity period is selected, so that the enthusiasm of the user for making a best lead is provided. In order to ensure the leaderboard enthusiasm of each user, the activity data in the activity process can be generally subjected to settlement statistics from multiple dimensions, so as to obtain activity lists of multiple dimensions.

For example, in a live application, in some large activities, a main and audience list may be set up separately. Assume that the entire activity can be divided into three activity periods. For the first activity period, all the anchor participating in the activity can perform talent demonstration according to the requirements of the first activity period. Audience users can give gifts to the anchor according to talent shows of the respective anchors. At this time, the total value of the gifts received by each anchor in the first activity period may be counted, and the anchor activity list of the first activity period may be generated according to the descending order of the total value of the gifts. And taking the top N anchor in the anchor activity list in the first activity period as the anchor of the promotion to the second activity period. The method comprises the steps of calculating the value of gifts given by each audience in a first activity period while settling the value of the gifts received by the anchor to obtain an anchor activity list, and generating the audience activity list in the first activity period according to the value of the gifts given by each audience. A promotion may be promoted to a second campaign for a top ranked audience in the audience campaign list for the first campaign. Thereafter, during a second activity session, the top N anchor of the promotion may be exposed to different talent performance as required during the second activity session. And counting the total value of the gifts received by the N anchor players in the second activity period, and further generating an anchor player activity list in the second activity period. And taking the top M numbered anchor in the anchor activity list in the second activity period as the anchor of the promotion to the third activity period. Similarly, the value of the gifted gifts of the audiences promoted in the second activity period can be continuously counted, so that the audience activity list in the second activity period is obtained, and the top M audiences in the audience activity list in the second activity period are used as audiences promoted in the third activity period. Finally, in the third activity period, obtaining a total main board list and a audience board list according to the activity data of the third activity period, and executing subsequent business logic according to the final main board list and the audience board list. For example, an optimal anchor may be evaluated based on an anchor list, and an optimal viewer may be evaluated based on a viewer list to give the viewer a special permission award. The method for updating the activity list provided by the embodiment of the application can be applied to the activity process, and is used for updating the activity lists with different dimensions.

It should be noted that the foregoing is only an example of several possible application scenarios given in the embodiment of the present application, but does not constitute a limitation on the application scenarios in the embodiment of the present application.

Next, a system configuration according to an embodiment of the present application will be described.

Fig. 1 is a schematic diagram of a network system according to an embodiment of the present application. As shown in fig. 1, the network system includes a user equipment 101, a first server 102, and a second server 103. Therein, the user equipment 101 may communicate with a first server 102, and the first server 102 may communicate with a second server 103.

The user device 101 may refer to a device corresponding to a user participating in an activity. The user device 101 may generate operation data according to a user operation, and then send the operation data to the first server 102.

For example, in a live application scenario, the user equipment 101 may be all devices of the audience users who give gifts to respective anchor gifts during the activity, and at this time, the operation data sent by the user equipment 101 is a gift request for giving gifts to the audience users.

The first server 102 may generate an activity message according to the operation data sent by each user equipment 101 after receiving the operation data sent by the user equipment 101. Wherein the activity message includes user data determined from the operational data.

Still taking the above-mentioned live broadcast application scenario as an example, after receiving a gift-giving request of each viewer user for giving a gift, the first server 102 may deduct a fee from an account of the corresponding viewer user according to the gift-giving request of each viewer user for giving a gift, and add the gift to an account of the corresponding anchor to complete the gift-giving, that is, complete the processing of the gift-giving request. After the gifting request process is completed, the first server 102 may generate an activity message corresponding to the gifting request from activity data, which includes the activity data, the identification of the audience gifting the gift, and the identification of the anchor, with the gift value, the identification of the audience gifting the gift, and the identification of the anchor receiving the gift in the corresponding gifting request as the activity data.

Optionally, in other scenarios, the first server 102 may also generate activity messages of the users who subsequently participate in the list generation by other methods. The embodiments of the present application are not limited herein. When generating an activity message, the first server 102 may generate a timestamp of the corresponding activity message according to the generation time of the activity message or the completion time of the operation corresponding to the activity message, and carry the timestamp in the corresponding activity message. The completion time of the operation corresponding to the activity message may refer to the settlement time of the activity data in the activity message. For example, in the above-described live application scenario, the completion time of the operation corresponding to the activity message is the time of the activity data obtained by the settlement when the gifting operation corresponding to the activity message is completed.

The first server 102, after generating the activity message, may send the activity message to the second server 103. After receiving the activity message, the second server 103 may update the activity list of different dimensions according to the activity message according to the method provided in the embodiment of the present application.

It should be noted that the user equipment 101 may be a terminal device such as a smart phone, a notebook, a tablet, a desktop computer, or the like. The first server 102 and the second server 103 may be two independent servers, or may be two different functional modules included in one server. The embodiment of the present application does not limit this.

Next, a method for updating a leader board provided in an embodiment of the present application is described.

Fig. 2 is a method for updating a leader board according to an embodiment of the present application. The method may be applied in a server, for example, in a second server as shown in fig. 1. As shown in fig. 2, the method comprises the steps of:

step 201: an activity message is obtained, the activity message including a message identifier for uniquely identifying the activity message.

In the embodiment of the present application, a message queue may be maintained in the server. A number of active messages received by the server up to the current time and not yet processed may be included in the message queue. The server may process each active message in sequence from front to back in the message queue. That is, the server may read the head-of-line active message from the message queue. Wherein the activity message may include a message identifier and activity data. The activity data is used for carrying out list settlement subsequently. The activity data may be different according to the application scenario and the type of the activity list to be settled.

For example, in the foregoing application scenario, when the activity list includes a main board list and a audience list, the main board identification and the audience identification will be included in the activity data. Optionally, if the activity list further includes a list of guild to which the anchor belongs, the activity data further includes an identifier of guild to which the anchor belongs.

Alternatively, in a possible case, a database may be deployed on the server, the activity message may be stored in the database, and the server may read the activity message from the database.

In addition, the message identifier is used for uniquely identifying one active message, and the message identifiers corresponding to different active messages are different. Wherein the message identifier may include a message identification field for uniquely identifying the corresponding active message. In the embodiment of the present application, when the activity data in an activity message is used for the first time to perform the settlement of the activity list, the initial message identifier of the activity message may include only the message identification field. In this case, after the server reads an active message from the message queue, before processing the active data in the active message, it may first detect whether the message identifier of the active message only includes the message identification field, and if the message identifier of the active message only includes the message identification field, the server may know that the active message is used for the first time for performing the settlement of the active list, and at this time, the server may generate a set bit field and add the set bit field to the message identifier.

The set bit field includes a plurality of flag bits, each flag bit corresponds to one of the activity lists to be maintained, that is, the number of flag bits included in the set bit field may be the same as the total number of the activity lists to be maintained. For example, assuming that the current activity list to be maintained includes a main list, a audience list and a guild list, the set bit field may include three flags, and each flag corresponds to one activity list.

It should be noted that, after the server generates the set bit field, the value of each flag bit in the set bit field may be set to be the first value, and then the set bit field and the message identification field are spliced to obtain the message identifier. For example, assuming that the first value is 1, and the aforementioned three event lists are taken as an example, the set bit field generated is 111, so as to indicate that the settlement of the three event lists according to the event data in the event message is not completed.

Alternatively, if the server detects that the message identifier of the activity message includes not only the message identification field but also the set bit field, the server may determine that the activity message has been used for performing the settlement of the activity list before, and only in the process of the settlement, some or all of the list fails to be successfully settled.

For example, the server detects that the message identifier of the activity message already includes a set bit field 010, and if the first flag bit from left to right corresponds to the guild list, the second flag bit corresponds to the anchor list, and the third flag bit corresponds to the audience list, it may be determined that the anchor list has not been successfully settled according to the set bit field.

Step 202: if the updating of one or more target lists in the plurality of the activity lists according to the activity message fails, setting a flag bit corresponding to each target list in a set bit field included in the message identifier as a first numerical value.

As can be seen from the introduction in step 201, after the server obtains the active message, it may detect whether the message identifier of the active message includes a set bit field, and further determine whether the active message is used for performing the active list settlement for the first time according to the detection result.

When the message identifier does not contain the set bit field, the server can determine that the activity message is used for settlement of the activity list for the first time, and at the moment, the server generates the set bit field of which each zone bit value is the first numerical value and adds the set bit field to the message identifier. Based on this, in this step, the server may sequentially perform settlement updating on the activity list corresponding to each flag bit according to the activity data in the activity message.

For example, the server may update the activity list corresponding to the first flag according to the activity data in the activity message from left to right, or from right to left, or in other order, and if the update is successful, that is, the settlement is successful, the server may modify the value of the first flag to a second value to indicate that the update of the activity list corresponding to the first flag has been successful, that is, the update has been completed, according to the activity data in the activity message. Wherein the second value is different from the first value. For example, when the first value is 1, the second value may be 0.

If the update of the activity list corresponding to the first flag bit fails according to the activity data in the activity message, that is, the settlement fails, the activity list corresponding to the first flag bit is a target list with the failed update. At this time, the server may set the value of the first flag corresponding to the target list to be a first numerical value, that is, keep the value of the first flag corresponding to the target list unchanged, then update the activity list corresponding to the second flag, and so on until the activity lists corresponding to all the flags are updated, so that the flags of the target lists that are failed to be updated in the maintained plurality of activity lists are the first numerical value, and the flags of the lists that are successfully updated are the second numerical value.

Alternatively, if it is detected that the message identifier of the activity message includes a set bit field after the activity message is read in step 201, the server may determine the uncompleted updated activity list in the plurality of activity lists according to the set bit field. Updating the activity list which is not updated according to the activity message; and setting the flag bit corresponding to the successfully updated activity list as a second numerical value.

It should be noted that, if a set bit field exists in the read activity message, it indicates that the activity message has been used for performing the settlement of the activity list before, and only that there is a failure in updating part or all of the activity lists. As can be seen from the foregoing description, in the process of updating the activity list according to the activity message, for the activity list that fails to be updated, the flag bit corresponding to the activity list is set to be the first numerical value. Based on this, the server may determine the flag bit with the first value in the set bit field, and then determine the activity list corresponding to the flag bit with the first value as the activity list which has not been updated in the last updating process.

The server may then update these not completed update leaderboards with reference to the methods described above. Similarly, for a successful update, the corresponding flag bit may be set to the second value, and for a failed update, the corresponding flag bit may be set to the first value, that is, the value of the corresponding flag bit is kept unchanged.

Step 203: and re-updating one or more target lists according to the activity message containing the updated message identifier.

After the activity lists corresponding to all the flags are updated in step 202 and the flags corresponding to the set bit fields in the message identifier are updated, the server may detect whether a flag with a first value exists in each flag of the set bit fields, so as to determine whether each activity list is updated successfully. If the flag bit with the value of the first numerical value exists, it indicates that one or more target list sheets with failed updating (i.e. incomplete updating) exist in the updating process. At this time, the server may reinsert the active message into the message queue so that a subsequent server may read the active message from the message queue again and process the active message through step 201 and 203.

Optionally, in some possible implementations, after determining that there is still a list of activities that failed to update in the update process, the server may also store the activity message in the database. Subsequently, the server can read the activity message from the database and settle the uncompleted activity list again according to the activity message through step 201 and step 203.

Therefore, in the embodiment of the application, for the activity list which is failed to be updated, the server may set the flag bit corresponding to the activity list to be the first numerical value, and for the activity list which is successfully updated, set the corresponding flag bit to be the second numerical value, then, re-insert the activity message into the queue or store the activity message into the database, and perform a subsequent rerun process to re-update the activity lists according to the activity message. Therefore, the list needing to be settled in each settlement process can be definitely indicated due to the existence of the zone bit, so that the successful settlement can not be repeatedly settled, that is, the result that the same activity message enters the settlement process for multiple times and is correctly settled once through the activity message is consistent, and the idempotent of settlement is ensured.

It should be noted that, for the activity messages reinserted into the message queue or the activity messages stored in the database, the message identifiers of the activity messages all include a set bit field, and the value of the flag bit corresponding to the activity list which is unsuccessfully updated in the set bit field is the first value, while the value of the flag bit corresponding to the activity list which is successfully updated is the second value.

Optionally, in a possible case, after detecting the set bit field, the server may find that the values of the flags included in the set bit field are all the second values, and at this time, it may be determined that all the activity lists have been updated successfully according to the activity message. In this case, the server may delete the active message, thereby ending the operation on this active message.

Therefore, in the embodiment of the application, the server enables the activity message to enter the settlement process for multiple times until the settlement of all the activity lists is successful according to the activity message. Therefore, the subsequent business process can be completed subsequently according to the list with successful settlement, and compared with the repair by writing the repair script in the related technology, the method is simpler and can not influence the subsequent business logic.

In summary, in the embodiment of the present application, a set bit field may be added to a message identifier of an active message, and if one or more target lists in a plurality of active lists fail to be updated according to the active message, a flag bit corresponding to the target list in the message identifier is set to be a first numerical value, and then the corresponding target list is updated again according to the active message including the updated message identifier until the update is successful, so that compared with the related art, the method for repairing the target list by writing a repair script is simpler and does not affect subsequent service logic.

In addition, because the existence of the flag bit can clearly indicate the list needing to be settled in each settlement process, the successful settlement of the list can not be repeatedly carried out, namely, the result that the same activity message enters the settlement process for multiple times is consistent with the result of one-time correct settlement through the activity message, and the idempotent of the settlement is ensured.

Next, a method for updating a list provided in an embodiment of the present application is illustrated as an example.

Three lists to be maintained by the activity are assumed, namely a main broadcasting list, a spectator list and a guild list. Referring to fig. 3, after acquiring an activity message, the server may detect whether a message identifier of the activity message includes a set bit field, and if not, the server may generate a set field bit "111", that is, an initial value of each flag bit in the set bit field is set to 1. The set bit field is added to the message identifier. And the activity lists corresponding to the flag bits in the set bit field from left to right are a guild list, a main broadcast list and a spectator list.

After adding the set bit field to the message identifier, the server may first update the audience list from the campaign message. If the update is successful, the last flag bit is modified to 0. If the update fails, the last flag bit is set to 1, that is, the value of the last flag bit is kept unchanged. Assuming in this example that the audience list update is successful, the set bit field in the updated message identifier is 110. Then, the main board is updated, and if the updating of the main board fails in the embodiment, the flag bit corresponding to the main board is kept unchanged, that is, the set bit field is still 110. Finally, the guild list is updated, and if the guild list is updated successfully in the embodiment, the corresponding flag bit is set to 0, and at this time, the set bit field is 010.

After the three active lists are updated, because the update of the main list fails, the server may reinsert the active message into the message queue or store the active message into the database, and at this time, the set bit field included in the message identifier of the active message is 010.

Subsequently, after the server reads the active message again, it can be detected that the message identifier of the active message includes the set bit field. At this time, the server may refer to the foregoing method to update the activity list corresponding to the flag whose value is the first value in the set bit field again, and so on, until all the activity lists are updated successfully, delete the activity message.

Next, an apparatus for updating a leaderboard provided in an embodiment of the present application will be described.

Referring to fig. 4, an apparatus 400 for updating a leaderboard according to an embodiment of the present disclosure is provided, where the apparatus 400 includes:

an obtaining module 401, configured to obtain an activity message, where the activity message includes a message identifier, and the message identifier is used to uniquely identify the activity message;

a setting module 402, configured to set a flag bit corresponding to each target list in a set bit field included in the message identifier as a first numerical value if the update of one or more target lists in the multiple activity lists according to the activity message fails, where each flag bit in the set bit field corresponds to one activity list in the multiple activity lists;

an updating module 403, configured to update one or more target lists again according to the activity message including the updated message identifier.

Optionally, the apparatus 400 further comprises:

the detection module is used for detecting whether the message identifier comprises a set bit field;

the determining module is used for determining the activity list which is not updated according to the set bit field if the message identifier comprises the set bit field;

the updating module is also used for updating the activity list which is not updated according to the activity message;

the setting module is further used for setting the flag bit corresponding to the successfully updated activity list to be a second numerical value, and the second numerical value is different from the first numerical value.

Optionally, the determining module is specifically configured to:

determining a zone bit taking a first value from a plurality of zone bits included in a set bit field;

and determining the activity list corresponding to the zone bit with the value of the first numerical value as the activity list which is not updated completely.

Optionally, the apparatus 400 further comprises:

and the adding module is used for adding the set bit field in the message identifier if the message identifier does not comprise the set bit field, wherein the initial value of each flag bit in a plurality of flag bits included in the added set bit field is a first numerical value.

Optionally, the obtaining module is specifically configured to read an active message from the message queue;

the update module is specifically configured to: and rewriting the active message containing the updated message identifier into the message queue, and triggering the acquisition module to read the active message from the message queue until the one or more target list is updated successfully.

To sum up, in the embodiment of the present application, a set bit field may be added to a message identifier of an active message, and if one or more target lists in a plurality of active lists fail to be updated according to the active message, a flag bit corresponding to the target list in the message identifier is set to be a first numerical value, and then the corresponding target list is updated again according to the active message including the updated message identifier until the update is successful, so that compared with the related art, the target list is repaired by writing a repair script, which is simpler and does not affect subsequent service logic. .

It should be noted that: in the apparatus for updating a leaderboard provided in the foregoing embodiments, when updating a leaderboard, only the division of the functional modules is illustrated, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules, so as to complete all or part of the above described functions. In addition, the apparatus for updating a leader board provided in the above embodiments and the method embodiment for updating a leader board belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.

FIG. 5 is a block diagram illustrating a server 500 for updating a leaderboard according to an example embodiment. The functions of the server in the embodiments shown in fig. 2 or 3 described above can be implemented by the server shown in fig. 5. The server may be a server in a cluster of background servers. Specifically, the method comprises the following steps:

the server 500 includes a Central Processing Unit (CPU)501, a system memory 504 including a Random Access Memory (RAM)502 and a Read Only Memory (ROM)503, and a system bus 505 connecting the system memory 504 and the central processing unit 501. The server 500 also includes a basic input/output system (I/O system) 506, which facilitates transfer of information between devices within the computer, and a mass storage device 507, which stores an operating system 513, application programs 514, and other program modules 515.

The basic input/output system 506 comprises a display 508 for displaying information and an input device 509, such as a mouse, keyboard, etc., for user input of information. Wherein a display 508 and an input device 509 are connected to the central processing unit 501 through an input output controller 510 connected to the system bus 505. The basic input/output system 506 may also include an input/output controller 510 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 510 also provides output to a display screen, a printer, or other type of output device.

The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable media provide non-volatile storage for the server 500. That is, the mass storage device 507 may include a computer readable medium (not shown) such as a hard disk or CD-ROM drive.

Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 504 and mass storage device 507 described above may be collectively referred to as memory.

According to various embodiments of the present application, server 500 may also operate as a remote computer connected to a network through a network, such as the Internet. That is, the server 500 may be connected to the network 512 through the network interface unit 511 connected to the system bus 505, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 511.

The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the method for updating a leaderboard provided by an embodiment of the application.

Embodiments of the present application further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a server, enable the server to perform the method for updating a leaderboard provided in the embodiments shown in fig. 2 to 3.

Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the method for updating a leaderboard provided by the embodiments of fig. 2-3.

It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

The invention is not to be considered as limited to the particular embodiments shown and described, but is to be understood that various modifications, equivalents, improvements and the like can be made without departing from the spirit and scope of the invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于KCP协议的Android端到端直播方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类