Data updating method, device, equipment, medium and program product

CN123011920APending Publication Date: 2026-10-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510570911.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]然而,相关技术中,当需要更新用户的资格使用情况时,需要向Redis数据库发送至少两次查询请求以检查用户在不同时间维度下的资格使用情况,导致对用户活动参与资格的管理效率较低

Benefits of technology

[0017]本申请实施例提供的技术方案带来的有益效果至少包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011920A_ABST
    Figure CN123011920A_ABST
Patent Text Reader

Abstract

The application discloses a data updating method and device, equipment, medium and program product. The method comprises the following steps: in the case that a first account sends a resource use request for a first resource, acquiring resource limit data corresponding to the first account; acquiring resource use data corresponding to the first account; in the case that the resource use data and the resource limit data meet resource use requirements, updating the resource use data corresponding to the first account based on the resource use request. By storing the resource use data corresponding to the first account in at least two time dimensions by a single data item, all time dimensions of resource use data can be acquired by one operation, compared with the related art which needs to query different Hash structures multiple times, the operation process is simplified, and the management efficiency of the resource is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data update method, apparatus, device, medium, and program product. Background Technology

[0002] User resource management refers to the management of a user's resource usage within a certain period (day, month, etc.). Taking resource realization as the qualification for participating in activities as an example, user qualification management refers to the management of the number of times a user can participate in activities within a certain period.

[0003] In related technologies, the Redis (Remote Dictionary Server) database stores a user's eligibility usage over different time dimensions using multiple hash structures. For example, the first hash structure stores the user's eligibility usage for the current day, and the second hash structure stores the user's eligibility usage for the current month.

[0004] However, in related technologies, when it is necessary to update a user's eligibility status, at least two query requests need to be sent to the Redis database to check the user's eligibility status at different time dimensions, resulting in low efficiency in managing user participation eligibility. Summary of the Invention

[0005] This application provides a data updating method, apparatus, device, medium, and program product, the technical solution of which is as follows:

[0006] On the one hand, a data update method is provided, the method comprising:

[0007] Upon receiving a resource usage request from a first account for a first resource, the resource restriction data corresponding to the first account is obtained. The resource restriction data includes the usage restriction conditions of the first account for the first resource in at least two time dimensions.

[0008] Obtain resource usage data corresponding to the first account. The resource usage data is used to store the usage of the first resource by the first account under the at least two time dimensions through a single data item. There is an inclusion relationship between the time periods indicated by the at least two time dimensions.

[0009] If the resource usage data and the resource restriction data meet the resource usage requirements, the resource usage data corresponding to the first account is updated based on the resource usage request.

[0010] On the other hand, a data updating apparatus is provided, the apparatus comprising:

[0011] The acquisition module is used to acquire resource restriction data corresponding to the first account when receiving a resource usage request from the first account for the first resource. The resource restriction data includes the usage restriction conditions of the first account for the first resource in at least two time dimensions.

[0012] The acquisition module is used to acquire resource usage data corresponding to the first account. The resource usage data is used to store the usage of the first resource by the first account under the at least two time dimensions through a single data item. There is an inclusion relationship between the time periods indicated by the at least two time dimensions.

[0013] An update module is used to update the resource usage data corresponding to the first account based on the resource usage request, provided that the resource usage data and the resource restriction data meet the resource usage requirements.

[0014] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement any of the above-described data update methods.

[0015] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement any of the data update methods described above.

[0016] On the other hand, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the data update methods described above.

[0017] The beneficial effects of the technical solutions provided in this application include at least the following:

[0018] When the first account requests to use the first resource, the system retrieves the resource restriction data and resource usage data for the first account across at least two time dimensions. The resource usage data is stored as a single data item, showing the first account's usage of the first resource across at least two time dimensions. This data is then updated according to the resource usage requirements. By storing the resource usage information for the first account across at least two time dimensions as a single data item, all time-dimensional resource usage data can be retrieved in a single operation. Compared to related technologies that require multiple queries of different hash structures, this simplifies the operation process and improves resource management efficiency. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of a computer system provided in an exemplary embodiment of this application;

[0021] Figure 2 This is a flowchart of a data update method provided in an exemplary embodiment of this application;

[0022] Figure 3 This is a schematic diagram of a multi-dimensional coexistence structure provided in an exemplary embodiment of this application;

[0023] Figure 4 This is a schematic diagram of resource usage data provided in an exemplary embodiment of this application;

[0024] Figure 5 This is a schematic diagram of resource usage data provided in another exemplary embodiment of this application;

[0025] Figure 6 This is a schematic diagram of resource usage data provided in yet another exemplary embodiment of this application;

[0026] Figure 7 This is a schematic diagram of resource usage data provided in another exemplary embodiment of this application;

[0027] Figure 8 This is a flowchart of a data update method provided in another exemplary embodiment of this application;

[0028] Figure 9 This is a flowchart of a data update method provided in yet another exemplary embodiment of this application;

[0029] Figure 10 This is a flowchart of a data update method provided in another exemplary embodiment of this application;

[0030] Figure 11 This is a schematic diagram of an activity participation interface provided in an exemplary embodiment of this application;

[0031] Figure 12 This is a schematic diagram of a qualification configuration management interface provided in an exemplary embodiment of this application;

[0032] Figure 13 This is a structural block diagram of a data update apparatus provided in an exemplary embodiment of this application;

[0033] Figure 14 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] In this application, the terms "first" and "second" are used to distinguish between identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first" and "second", nor is there any limitation on the quantity or execution order.

[0036] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user data. These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their data is being collected. This ensures that the application only begins the steps for collecting user data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without user confirmation), the steps for collecting user data end, meaning no user data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of related user data must comply with relevant laws, regulations, and standards.

[0037] User resource management refers to managing a user's resource usage within a certain period (day, month, etc.). Taking resource implementation as eligibility to participate in activities as an example, user eligibility management refers to managing the number of times a user can participate in activities within a certain period. In related technologies, Redis (Remote Dictionary Server) databases store user eligibility usage across different time dimensions using multiple hash structures. For example, a first hash structure stores a user's daily eligibility usage, a second hash structure stores their monthly eligibility usage, etc. Each hash structure includes "total" and "used" fields. The "total" field represents the maximum number of activities a user can participate in at the current time dimension, and "used" represents the number of times a user has participated in activities at the current time dimension. However, in these technologies, updating a user's eligibility usage requires sending at least two query requests to the Redis database to check the user's eligibility usage across different time dimensions, resulting in low efficiency in managing user activity participation eligibility.

[0038] Based on this, this application provides a data update method. When a first account requests to use a first resource, it obtains resource restriction data and resource usage data of the first account for the first resource in at least two time dimensions. The resource usage data is stored as a single data item, showing the first account's usage of the first resource in each of the at least two time dimensions. Then, the resource usage data is updated according to the resource usage requirements. Storing the resource usage information of the first account in each of the at least two time dimensions as a single data item allows for the retrieval of resource usage data for all time dimensions in a single operation. Compared to related technologies that require multiple queries of different hash structures, this simplifies the operation process and improves the efficiency of resource management.

[0039] On the other hand, since a single data item stores data for at least two time dimensions, data consistency can be guaranteed when updating the resource usage data of the first account, avoiding data synchronization problems caused by independently updating data corresponding to multiple time dimensions. Furthermore, compared to related technologies that store the maximum number of activity parameters and the number of activities participated in the same hash structure, this application separates resource limit data and resource usage data. This allows resource limit data to be updated independently, reducing operational complexity and avoiding low data update efficiency due to data coupling. For example, using the data update method provided in this application, when an administrator wants to adjust the maximum number of activity participations for all users, they can uniformly adjust the resource limit data for all users.

[0040] The computer systems involved in the embodiments of this application will be described below.

[0041] Figure 1This is a schematic diagram of a computer system provided in an exemplary embodiment of this application. The computer system can implement a system architecture that serves as a data update method. The computer system includes a terminal 110 and a server 120. The terminal 110 is connected to the server 120 via a wireless network or a wired network.

[0042] Terminal 110 can be an electronic device such as a mobile phone, tablet computer, in-vehicle terminal, wearable device, PC (Personal Computer), VR (Virtual Reality) device, AR (Augmented Reality) device, or MR (Mixed Reality) device. A client application for the first application can be installed and run on terminal 110. This application does not limit the form of the first application, including but not limited to apps, mini-programs, etc., installed on terminal 110, and it can also be in web page form. Optionally, a first account is logged in on the client application of the first application.

[0043] Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, a cloud server providing basic cloud computing services, or a node in a blockchain system. Server 120 can be the backend server of the aforementioned first application, used to provide backend services to the clients of the first application.

[0044] The data update method provided in this application embodiment can be executed by a computer device, which refers to an electronic device with data computing, processing, and storage capabilities. For example... Figure 1 As shown, the data update method can be executed by terminal 110 (e.g., by the client of the first application installed and running in terminal 110), by server 120, or by interaction between terminal 110 and server 120. This application does not limit this.

[0045] The following explanation uses the data update method executed by server 120 as an example. Illustratively, a first application provides the function of using a first resource (e.g., activity participation qualification), and a first account is logged into the client of the first application. After the first account triggers a resource usage operation on the first resource in the client of the first application, terminal 110 sends a resource usage request to server 120. After receiving the resource usage request from the first account at terminal 110, server 120 first obtains the resource restriction data of the first account. The resource restriction data includes the usage restrictions of the first account on the first resource in at least two time dimensions. For example, the resource restriction data for the first account's activity participation qualification is "[10, October 1st], [50, October]", where [10, October 1st] indicates that the first account's maximum number of activity participations on October 1st is 10, and [50, October] indicates that the first account's maximum number of activity participations in October is 50.

[0046] Secondly, server 120 obtains resource usage data corresponding to the first account. This resource usage data is used to store the first account's usage of the first resource across at least two time dimensions using a single data item. For illustration, server 120 runs a database 121 (such as a Redis database). When it receives a resource usage request for the first resource from the first account, server 120 sends a query request to database 121. This query request retrieves a single String structure corresponding to the first account from database 121. This single String structure stores the first account's usage of the first resource across at least two time dimensions. For example, a single String structure storing the first account's activity participation count "1|October 1st|10|October" indicates that the first account participated in the activity 1 time on October 1st and 10 times in October.

[0047] Then, server 120 determines whether the resource usage data and resource restriction data meet the resource usage requirements. Specifically, it determines whether the usage data and resource restriction data corresponding to at least two time dimensions meet the resource usage requirements. If they do, it updates the resource usage data corresponding to the first account based on the resource usage request (i.e., updates the stored data in a single String structure). For example, server 120 will perform a check on each time dimension. For instance, for "1|October 1st|10|October" and "[10, October 1st], [50, October]", server 120 first checks whether the number of times the activity has been participated in on October 1st + 1 is less than or equal to the maximum number of activity participations on October 1st, which is 10. If so, the daily dimension meets the resource usage requirements. Then, it checks whether the number of times the activity has been participated in in October + 1 is less than or equal to the maximum number of activity participations in October, which is 50. If so, the monthly dimension meets the resource usage requirements. Here, "+1" indicates that the first account requests to use the activity qualification once in this resource usage request.

[0048] If all dimensions meet the resource usage requirements, server 120 updates the resource usage data corresponding to the first account based on the resource usage request (that is, updates the stored data in a single String structure). For illustration, before the update, the number of times the first account had participated in activities stored in a single String structure was "1|October 1st|10|October". As mentioned above, the first account requested to use the activity qualification once in this resource usage request. After updating the single String structure, the number of times the first account had participated in activities stored in a single String structure is "2|October 1st|11|October".

[0049] The following describes the process of the data update method provided in this application.

[0050] Figure 2 This is a flowchart illustrating a data update method provided in an embodiment of this application. The method is executed by a computer device, which may be... Figure 1 The terminal 110 and / or server 120 are shown. The method includes steps 210 to 230.

[0051] Step 210: Upon receiving a resource usage request from the first account for the first resource, obtain the resource restriction data corresponding to the first account.

[0052] Optionally, the first resource includes at least one of the following resources: eligibility to participate in the event, points, items, etc., without limitation here.

[0053] Optionally, a resource usage request is used to request the use of a first resource.

[0054] For illustrative purposes, taking activity participation eligibility as an example, a resource usage request refers to a request triggered by the first account when requesting to consume or acquire activity participation eligibility. If the first account triggers a resource usage request when requesting to consume activity participation eligibility, the following resource usage data is used to store the activity participation eligibility consumed by the first account. If the first account triggers a resource usage request when requesting to acquire activity participation eligibility, the following resource usage data is used to store the activity participation eligibility acquired by the first account. Taking points as an example, a resource usage request refers to the first account requesting to consume or acquire points. If the first account triggers a resource usage request when requesting to consume points, the following resource usage data is used to store the points consumed by the first account. If the first account triggers a resource usage request when requesting to acquire points, the following resource usage data is used to store the points acquired by the first account. Taking items as an example, a resource usage request refers to the first account requesting to consume or acquire items. If the first account triggers a resource usage request when requesting to consume (e.g., use) an item, the following resource usage data is used to store the items consumed by the first account. If the first account triggers a resource usage request when requesting to obtain (e.g., purchase) items, the following resource usage data is used to store the activity participation qualifications already obtained by the first account.

[0055] Resource restriction data includes the usage restrictions on the first resource by the first account in at least two time dimensions. The time dimension refers to the way time is divided, such as by day, hour, minute, etc.

[0056] Different time dimensions represent different time periods. Optionally, time dimensions include daily, weekly, bi-weekly, monthly, quarterly, annual, and total dimensions, etc., without limitation here. Among them, at least two time dimensions indicate time periods that have an inclusion relationship. The time periods indicated by different time dimensions are of different lengths, with shorter time periods being included in longer time periods, such as the time period indicated by the daily dimension being included in the time period indicated by the weekly dimension.

[0057] Regarding the overall dimension, in some embodiments, the overall dimension can refer to the time dimension corresponding to the longest period among at least two time dimensions. When the first resource is implemented as an activity participation qualification, the overall dimension can be the entire activity period. In other embodiments, the overall dimension refers to the global dimension. When the first resource is implemented as an activity participation qualification, the usage limit corresponding to the overall dimension can be the total number of activity participation qualifications that all users can obtain during the activity.

[0058] Optionally, usage restrictions include usage limits. That is, the resource restriction data includes usage limits corresponding to at least two time dimensions. The usage limit represents the maximum usage of the first resource by the first account, such as the maximum number of times an activity can be participated in, or the maximum number of items that can be purchased. For example, using the daily dimension, the usage limit represents the maximum daily usage; using the monthly dimension, the usage limit represents the maximum monthly usage.

[0059] In some embodiments, there is a positive correlation between usage limits and the time period indicated by the time dimension. That is, the longer the time period, the greater the usage limit. For example, the usage limit for the daily dimension is greater than the usage limit for the monthly dimension.

[0060] Optionally, the usage restrictions also include time period restrictions. That is, the resource restriction data includes usage limits and time period restrictions corresponding to at least two time dimensions. The usage limit represents the maximum amount of the first resource that the first account can use within the time period limit. For example, the time period limit can be set to October 1, 2014, and the usage limit can be set to 5, which means that on October 1, 2014, the first account can use a maximum of 5 first resources.

[0061] Step 220: Obtain the resource usage data corresponding to the first account.

[0062] Resource usage data is used to store the usage of a first resource by a first account in at least two time dimensions through a single data item, wherein there is an inclusion relationship between the time periods indicated by the at least two time dimensions.

[0063] Optionally, resource usage data is used to store the first usage corresponding to at least two time dimensions through a single data item. The first usage represents the amount used by the first account for the first resource. By storing the usage of all time dimensions (such as daily and monthly usage) through a single data item, only one check is needed during updates to confirm whether all levels meet the usage limits, reducing the overhead of multiple queries.

[0064] Optionally, resource usage data is used to store at least two time dimensions, corresponding to the first usage amount and the first time period, respectively, through a single data item. The first usage amount represents the amount of the first resource used by the first account within the first time period. For example, the first time period can be implemented as October 1, 2014, and the usage amount can be implemented as 1, indicating that on October 1, 2014, the first account used 1 unit of the first resource. By storing time period information, the time period of user requests (i.e., time period constraints) can be dynamically matched, avoiding resource update errors caused by time period mismatches.

[0065] Optionally, resource usage data is also used to store dimension identifiers within individual data items. Dimension identifiers represent at least two time dimensions, and the storage order of the usage corresponding to each of these two time dimensions within a single data item. For example, a dimension identifier can be implemented as "day + month," indicating that the current single data item stores resource usage information corresponding to both the daily and monthly dimensions, stored in the order of daily and monthly dimensions. By clearly defining the storage order of each time dimension (e.g., day, week, month) through dimension identifiers, the system can quickly process data at different levels, avoiding misjudgments caused by dimension confusion.

[0066] For illustrative purposes, a single data item can be implemented as a single data structure, which stores a dimension identifier, a first usage amount corresponding to at least two time dimensions, and a first time period, respectively. The single data structure can be implemented as at least one of a single String structure, a single Hash structure, etc., without limitation here.

[0067] In some embodiments, a single data structure includes at least two time dimensions, namely a time period field and a usage field. The time period field stores a first time period, and the usage field stores a first usage. Optionally, the single data structure also includes a dimension identifier field, which stores the dimension identifier. Please refer to [reference needed]. Figure 3 , Figure 3 This diagram illustrates a multi-dimensional coexistence structure (i.e., a single data result) provided in this application. Figure 3 As shown, a single String structure 300 is also a multi-dimensional coexistence structure, which includes a dimension identifier field (domain), usage field 1 (count-1), time period field 1 (offset-1), usage field 2 (count-2), and time period field 2 (offset-2).

[0068] It should be noted that in this application Figure 3 The single String structure 300 shown is not a limitation; the number of time period fields and the number of usage fields in a single String structure 300 can be more or less.

[0069] The following explanation uses daily and total dimensions as examples. Figure 4This diagram illustrates a resource usage data provided in this application. In a single String structure 400, the usage field 1 stores the first usage "1" corresponding to the daily dimension; the time period field 1 stores the first time period "October 1, 2024" corresponding to the daily dimension; the usage field 2 stores the first usage "50" corresponding to the total dimension; and the time period field 2 stores the first time period "total" corresponding to the total dimension. If the first resource is implemented as the number of times an activity is participated in, then the first time period "total" corresponding to the total dimension can represent the entire activity period. Optionally, the dimension identifier field in the single String structure 400 stores "Day + Total," indicating that the time dimension of the data stored in the dimension identifier field in the single String structure 400 includes both the daily and total dimensions, and the data storage order is: daily dimension, total dimension.

[0070] The following explanation uses daily, weekly, monthly, and total dimensions as examples. Figure 5 This illustration shows a resource usage data provided in this application. In a single String structure 500, the usage field 1 stores the first usage "1" corresponding to the daily dimension, and the time period field 1 stores the first time period "October 1, 2024" corresponding to the daily dimension; the usage field 2 stores the first usage "1" corresponding to the weekly dimension, and the time period field 2 stores the first time period "Week 1, October 2024" corresponding to the weekly dimension; the usage field 3 stores the first usage "1" corresponding to the monthly dimension, and the time period field 3 stores the first time period "October 2024" corresponding to the monthly dimension; the usage field 4 stores the first usage "50" corresponding to the total dimension, and the time period field 4 stores the first time period "total" corresponding to the total dimension. Optionally, the dimension identifier field in the single String structure 500 stores "Day + Week + Month + Total", indicating that the time dimensions of the data stored in the dimension identifier field in the single String structure 500 include the daily dimension, weekly dimension, monthly dimension, and total dimension, and the data storage order is: daily dimension, weekly dimension, monthly dimension, and total dimension.

[0071] In some embodiments, resource usage data is used to store a first string in a single data item to represent a first time period, such as storing "October 1, 2024" to represent the time period from 00:00:00 on October 1, 2024 to 00:00:00 on October 2, 2024.

[0072] In some embodiments, resource usage data is used to store a first timestamp in a single data item to represent a first time period, the first timestamp indicating the end time of the first time period. Optionally, the first timestamp refers to the number of hours, minutes, seconds, or milliseconds from a preset time to the end time of the first time period, etc., and this application does not limit this. For example, storing "1727798400" represents the time period from 00:00:00 on October 1, 2024 to 00:00:00 on October 2, 2024.

[0073] Please refer to Figure 6 , Figure 6 A schematic diagram of resource usage data provided in this application is shown. Figure 6 In the single String structure 600 shown, the time period field 1 stores the first timestamp "1727798400" corresponding to the day dimension, which represents 00:00:00 on October 2, 2024, that is, the end time of October 1, 2024; the time period field 2 stores the second timestamp "1728230400" corresponding to the week dimension, which represents 00:00:00 on October 8, 2024, that is, the end time of the first week of October 2024; the time period field 3 stores the third timestamp "1730390400" corresponding to the month dimension, which represents 00:00:00 on November 1, 2024, that is, the end time of October 2024.

[0074] Using timestamps to represent time periods typically requires less storage space than using strings, thus saving storage resources. Furthermore, computers can perform numerical calculations directly on timestamps, which is more efficient than processing date strings, reducing computational overhead and improving data update efficiency.

[0075] In other embodiments, resource usage data is used to store a first offset representing a first time period through a single data item; wherein, the first offset corresponding to the i-th time dimension refers to the offset between the first time period determined based on the i-th time dimension and a preset time period. Illustratively, if the i-th time dimension is a day dimension, the offset between the first time period and the preset time period is calculated in "days". If the preset time period is January 1, 2024, and the first time period is January 8, 2024, the offset is 7. If the i-th time dimension is a week dimension, the offset between the first time period and the preset time period is calculated in "weeks". If the preset time period is January 1, 2024, and the first time period is the second week of January 2024, the offset is 1. Please refer to Table 1, which shows an offset table with "January 1, 2024" as the preset time period.

[0076] Table 1

[0077] date Daily offset Weekly offset Monthly offset Annual offset January 1, 2024 0 0 0 0 January 8, 2024 7 1 0 0 February 1, 2024 31 4 1 0 October 1, 2024 274 39 9 0 October 2, 2024 275 39 9 0

[0078] Based on Table 1, please refer to Figure 7 , Figure 7 A schematic diagram of resource usage data provided in this application is shown. Figure 7 In the single String structure 700 shown, the time period field 1 stores the first offset "274" corresponding to the day dimension, which represents the daily offset between October 1, 2024 and January 1, 2024; the time period field 2 stores the second timestamp "39" corresponding to the week dimension, which represents the weekly offset between the first week of October 2024 and January 1, 2024, that is, the end time of the first week of October 2024; the time period field 3 stores the third timestamp "9" corresponding to the month dimension, which represents the monthly offset between October 2024 and January 1, 2024.

[0079] Representing time periods by offsets simplifies the storage of time periods and further saves storage resources. Offsets are usually integers (e.g., "the 3rd month" can be represented as 3, requiring only 1-2 bytes of storage), occupying much less space than strings (e.g., "October 2024" requires more bytes of storage). When managing resource usage data of a large number of users, offsets can significantly reduce the database storage pressure.

[0080] Optionally, the dimension identifier stored in the dimension identifier field can be stored using a bitwise storage method, such as binary "0000", where the high-order bits represent "daily dimension", "weekly dimension", "monthly dimension", and "total" dimension respectively. If its value is 1, it indicates that the configuration of that dimension is enabled. Therefore, "1001" indicates that "daily dimension" and "total dimension" are stored. Finally, it is only necessary to convert "1001" to decimal "9" and then store it in the dimension identifier field of a single String structure 700. Figure 7 As shown, "1111" indicates that the restrictions of "Daily Dimension", "Weekly Dimension", "Monthly Dimension", and "Total Dimension" have been enabled. Ultimately, it is only necessary to convert "1111" to decimal "15" and then store it in the dimension identifier field of a single String structure 700. And so on, which will not be elaborated here.

[0081] In some embodiments, upon receiving an initial resource usage request from a first account for a first resource, initial resource limit data and initial resource request data corresponding to the first account are obtained; initial resource usage data corresponding to the first account is generated based on the initial resource limit data and initial resource request data. For example, when an initial resource usage request is received, it indicates that the current database does not store resource usage data for the first account for the first resource. Therefore, initial resource usage data corresponding to the first account can be generated based on the initial resource limit data and initial resource request data. For instance, the initial resource limit data is "[10, October 1st], [50, October]", where [10, October 1st] indicates that the maximum resource usage of the first account on October 1st is 10, and [50, October] indicates that the maximum resource usage of the first account in October is 50. The initial resource request data includes the initial resource request quantity. Assuming the initial resource request quantity is 1, which is less than 10 and less than 50, a single String structure "1|October 1st|1|October" is generated to represent the initial resource usage data, indicating that the first account has used 1 resource on October 1st and 1 resource in October.

[0082] The initial resource request quantity can be 1 or other preset quantity; or, the initial resource request quantity is obtained after parsing the initial resource usage request, and is used to represent the amount of usage of the first resource requested by the first account through the initial resource usage request.

[0083] By generating initial resource usage data (such as initial daily and monthly usage of 1) with a single request, the complex operation of initializing different data structures multiple times is avoided. Furthermore, all time-dimensional data is set at once during initialization, avoiding resource management vulnerabilities caused by some dimensions not being initialized.

[0084] Step 230: If the resource usage data and resource restriction data meet the resource usage requirements, update the resource usage data corresponding to the first account based on the resource usage request.

[0085] In some embodiments, if the usage limits and the first usage and resource request quantity meet the resource usage requirements at least in two time dimensions respectively, the resource usage data is updated based on the resource usage request; wherein, the resource request quantity represents the amount of usage of the first resource requested by the first account.

[0086] The above process compares the amount of resources requested with the usage limits for each time dimension to ensure that the resources requested by the user (such as the number of times to participate in activities or the amount of items used) do not exceed the limits in any time dimension.

[0087] Optionally, the usage limits corresponding to at least two time dimensions and the situation where the first usage and the resource request meet the resource usage requirements include at least one of the following:

[0088] Scenario 1: The resource constraint data includes usage constraints corresponding to at least two time dimensions; resource usage... The data is used to store the first usage corresponding to at least two time dimensions through a single data item.

[0089] Optionally, if the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, the i-th time dimension is determined to meet the resource usage requirements, where i is a positive integer.

[0090] In some embodiments, if the first time period represented by the i-th time dimension is included in the first time period represented by the (i+1)-th time dimension, then the time dimension is determined to meet the resource usage requirements in order from 1 to N, where N is an integer greater than 1 and i≤N. Optionally, if the usage limit corresponding to the i-th time dimension is less than the sum of the resource request and the first usage corresponding to the i-th time dimension, the process is stopped and an update failure result is generated. The update failure result is used to indicate that the current qualification usage request exceeds the limit.

[0091] Optionally, if resource usage requirements are met in at least two time dimensions, the resource usage data is updated based on the resource usage request. For example, if resource usage requirements are met in at least two time dimensions, the first usage corresponding to each of the at least two time dimensions is updated based on the resource usage request. Assuming the resource usage is 1, the first usage corresponding to each of the at least two time dimensions is incremented by 1 and saved, thus completing the update of the resource usage data.

[0092] The above solution ensures that users' resource usage complies with restrictions across different time dimensions through layer-by-layer checks.

[0093] Scenario 2: The resource constraint data includes at least two time dimensions, corresponding to usage limits and time periods respectively. Period restrictions; resource usage data is used to store the first usage corresponding to at least two time dimensions through a single data item. And the first cycle.

[0094] In some embodiments, resource usage requirements include at least one of a first resource usage requirement, a second resource usage requirement, and a third resource usage requirement.

[0095] (1) Requirements for the use of primary resources

[0096] Optionally, when the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, and the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, the i-th time dimension is determined to meet the first resource usage requirement.

[0097] To illustrate, the requirement that the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension meet the period matching requirement means that the time period indicated by the time period limit corresponding to the i-th time dimension is consistent with the first time period corresponding to the i-th time dimension. For example, if the time period limit corresponding to the i-th time dimension is January 1, 2024, and the first time period corresponding to the i-th time dimension is also January 1, 2024, then the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension meet the period matching requirement.

[0098] In the above scheme, before updating resource usage data, it is verified whether the time period matches. Only when the time period matches is the usage accumulated, which ensures the accuracy of resource updates and avoids resource overruns caused by mismatched time periods.

[0099] (2) Requirements for the use of the second resource

[0100] Optionally, when the time period limit corresponding to the i-th time dimension does not meet the period matching requirement with the first time period corresponding to the i-th time dimension, if the usage limit corresponding to the i-th time dimension is greater than or equal to the resource request amount, the i-th time dimension is determined to meet the second resource usage requirement.

[0101] To illustrate, a mismatch between the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension means that the time period indicated by the time period limit corresponding to the i-th time dimension is inconsistent with the first time period corresponding to the i-th time dimension. For example, if the time period limit corresponding to the i-th time dimension is January 2, 2024, and the first time period corresponding to the i-th time dimension is also January 1, 2024, then a mismatch between the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension does not meet the period matching requirement.

[0102] In the above scheme, when time periods do not match, the period can be reset and usage updated, dynamically adjusting resource usage data and ensuring the accuracy of resource updates. Furthermore, the automatic updating of period information (such as updating the daily period to a new day) reduces manual intervention and improves resource management efficiency.

[0103] (3) Requirements for the use of third-party resources

[0104] Optionally, when the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, if the resource allocation requirement is met in the i-th time dimension, the account priority corresponding to the first account is obtained; if the account priority is greater than the preset priority, it is determined that the i-th time dimension meets the third resource usage requirement.

[0105] The resource allocation requirement indicates that the usage limit corresponding to the i-th time dimension is less than the sum of the resource request quantity and the first usage quantity corresponding to the i-th time dimension, and the usage limit corresponding to the (i+1)-th time dimension is greater than the sum of the resource request quantity and the first usage quantity corresponding to the (i+1)-th time dimension.

[0106] Optionally, account priority can be dynamically calculated or directly configured based on account attributes, behavior, or payment status. For illustrative purposes, high-priority accounts include paying users, long-term active users, verified accounts (such as those linked to a mobile phone number or verified with real-name authentication), or accounts meeting specific level requirements. Low-priority accounts include new users, unverified accounts, or accounts exhibiting abnormal behavior.

[0107] In the above scheme, when low-dimensional quotas are insufficient but high-dimensional quotas are sufficient, high-priority users are allowed to borrow high-dimensional quotas (e.g., after a VIP user has used up their daily quota, the remaining quota for the month can be deducted), enhancing the user experience. Through the priority mechanism, the allocation strategy can be flexibly adjusted when resources are scarce. For example, in scenarios with limited item availability, priority is given to ensuring continued use for high-value users, while avoiding complete rejection of requests.

[0108] In some embodiments, resource usage data is updated based on a resource usage request if resource usage requirements are met in at least two time dimensions. For example, if at least two time dimensions meet a first resource usage requirement, a second resource usage requirement, or a third resource usage requirement, resource usage data corresponding to the first account is updated based on a resource usage request.

[0109] Optionally, for the time dimension that meets the first resource usage requirement, the first usage amount is updated in the resource usage data. For example, for the time dimension that meets the first resource usage requirement, the corresponding first usage amount is updated; if the resource usage amount is 1, then the first usage amount for the time dimension that meets the first resource usage requirement is incremented by 1 and saved.

[0110] Optionally, for the time dimension that meets the second resource usage requirements, the first usage amount and the first time period are updated in the resource usage data. For example, for the time dimension that meets the second resource usage requirements, the corresponding first usage amount and first time period are updated. If the resource usage amount is 1, the first time period corresponding to the time dimension that meets the second resource usage requirements is modified to the time period indicated by the time period limit for the time dimension that meets the second resource usage requirements. Then, the first usage amount corresponding to the time dimension that meets the second resource usage requirements is modified to 1 and saved.

[0111] Optionally, for the time dimension that meets the third resource usage requirements, the first usage amount is updated in the resource usage data. For example, for the time dimension that meets the third resource usage requirements, the corresponding first usage amount is updated; if the resource usage amount is 1, then the first usage amount for the time dimension that meets the third resource usage requirements is incremented by 1 and saved. In some embodiments, for the time dimension that meets the third resource usage requirements, a resource allocation identifier can also be stored. The resource allocation identifier is used to identify allocation events, such as indicating that the first account exceeded the limit of the first resource within time period a (the first time period indicated by the time dimension that meets the third resource usage requirements).

[0112] In some embodiments, upon receiving a data adjustment request for resource limit data corresponding to the first account, the resource limit data is adjusted based on the data adjustment request. For example, when an administrator configures the usage limits for each dimension of the resource limit data corresponding to the first account on the resource configuration interface, a data adjustment request is triggered, adjusting the usage limits for each dimension of the current resource limit data corresponding to the first account to the usage limits configured by the administrator.

[0113] The above solution allows administrators to adjust user resource limits in real time based on business needs, improving system flexibility. For example, in scenarios with limited item availability, the daily or total usage limit for users can be dynamically adjusted to address sudden demands or resource allocation.

[0114] In some embodiments, the resource usage data includes the current activity data of the first account corresponding to the activity dimension, and the resource restriction data includes the activity restriction data corresponding to the activity dimension.

[0115] Optionally, if the resource usage data and resource restriction data meet the activity requirements and the resource usage requirements, the resource usage data corresponding to the first account can be updated based on the resource usage request.

[0116] Schematic illustration: The activity limit data included in the resource restriction data represents the minimum activity level required for the first account to use the first resource. When the activity level data in the resource usage data is greater than or equal to the activity limit data, it is determined that the first account meets the activity requirements. Then, it is determined whether the resource usage data and the resource restriction data meet the resource usage requirements. Optionally, the activity level of the first account in using the first resource can be determined based on at least one of the following: the quantity or frequency of the first account's use of the first resource, or the account activity level of the first account. Among these, the quantity or frequency of the first account's use of the first resource is positively correlated with the activity level data of the first account.

[0117] In summary, the data update method provided in this application, when a first account requests to use a first resource, obtains resource restriction data and resource usage data of the first account for the first resource in at least two time dimensions. The resource usage data is stored as a single data item, showing the first account's usage of the first resource in each of the at least two time dimensions. Then, the resource usage data is updated according to the resource usage requirements. Storing the resource usage information of the first account in each of the at least two time dimensions as a single data item allows for the retrieval of resource usage data for all time dimensions in a single operation. Compared to related technologies that require multiple queries of different hash structures, this simplifies the operation process and improves the efficiency of resource management.

[0118] This is illustrative; please refer to it. Figure 8 , Figure 2 The illustrated embodiments can also be implemented as follows: Figure 8 Steps 801 to 804 are shown.

[0119] Step 801: Upon receiving a resource usage request from the first account for the first resource, obtain the resource restriction data and resource request data corresponding to the first account.

[0120] Resource restriction data includes the restrictions on the first account's use of the first resource in at least two time dimensions.

[0121] Optionally, the resource restriction data includes at least two time dimensions, namely usage restrictions and time period restrictions, whereby the usage restriction represents the maximum amount of the first resource used by the first account within the time period indicated by the time period restriction.

[0122] Resource request data includes the resource request quantity, which represents the amount of the first account requests to use the first resource.

[0123] Step 802: Obtain the resource usage data corresponding to the first account.

[0124] Optionally, the resource usage data is used to store, through a single data item, at least two time dimensions corresponding to a first usage amount and a first time period, whereby the first usage amount represents the amount of the first resource used by the first account within the first time period. There is an inclusion relationship between the time periods indicated by the at least two time dimensions.

[0125] Step 803: When the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, and the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, it is determined that the i-th time dimension meets the first resource usage requirement.

[0126] i is a positive integer.

[0127] For illustration purposes, the period matching requirement between the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension means that the time period indicated by the time period limit corresponding to the i-th time dimension is consistent with the first time period corresponding to the i-th time dimension.

[0128] Step 804: If the first resource usage requirements are met in at least two time dimensions, update the first usage amount corresponding to at least two time dimensions based on the resource usage request.

[0129] In other words, if the resource usage requirements are met in all time dimensions, the resource usage data is updated with the first usage corresponding to at least two time dimensions. For example, if the resource usage is 1, the first usage corresponding to at least two time dimensions is incremented by 1 and saved, thus completing the update of the resource usage data.

[0130] In summary, the data update method provided in this application only updates the usage of all time dimensions (e.g., daily, monthly, and yearly usage are all increased by 1) when all time dimensions meet the requirements, thus avoiding update errors, such as mistakenly allowing usage because the daily dimension does not exceed the limit but the monthly dimension does. Furthermore, it completes multi-dimensional data updates in one operation (e.g., atomic operation on a single Redis key), reducing the number of database interactions.

[0131] This is illustrative; please refer to it. Figure 9 , Figure 2 The illustrated embodiments can also be implemented as follows: Figure 9 Steps 901 to 905 are shown.

[0132] Step 901: Upon receiving a resource usage request from the first account for the first resource, obtain the resource restriction data and resource request data corresponding to the first account.

[0133] Resource restriction data includes the restrictions on the first account's use of the first resource in at least two time dimensions.

[0134] Optionally, the resource restriction data includes at least two time dimensions, namely usage restrictions and time period restrictions, whereby the usage restriction represents the maximum amount of the first resource used by the first account within the time period indicated by the time period restriction.

[0135] Resource request data includes the resource request quantity, which represents the amount of the first account requests to use the first resource.

[0136] Step 902: Obtain the resource usage data corresponding to the first account.

[0137] Optionally, the resource usage data is used to store, through a single data item, at least two time dimensions corresponding to a first usage amount and a first time period, whereby the first usage amount represents the amount of the first resource used by the first account within the first time period. There is an inclusion relationship between the time periods indicated by the at least two time dimensions.

[0138] Step 903: When the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, and the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, it is determined that the i-th time dimension meets the first resource usage requirement.

[0139] For illustration purposes, the period matching requirement between the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension means that the time period indicated by the time period limit corresponding to the i-th time dimension is consistent with the first time period corresponding to the i-th time dimension.

[0140] Step 904: When the time period limit corresponding to the i-th time dimension does not meet the period matching requirement with the first time period corresponding to the i-th time dimension, if the usage limit corresponding to the i-th time dimension is greater than or equal to the resource request amount, it is determined that the i-th time dimension meets the second resource usage requirement.

[0141] For illustration purposes, the time period limit corresponding to the i-th time dimension does not meet the period matching requirement with the first time period corresponding to the i-th time dimension, which means that the time period indicated by the time period limit corresponding to the i-th time dimension is inconsistent with the first time period corresponding to the i-th time dimension.

[0142] Step 905: If the resource usage requirements are met in at least two time dimensions, update the resource usage data corresponding to the first account based on the resource usage request.

[0143] As an illustration, if the first resource usage requirement or the second resource usage requirement is met in at least two time dimensions, the resource usage data corresponding to the first account is updated based on the resource usage request.

[0144] For each time dimension that meets the first resource usage requirement, update the first usage amount in the resource usage data. For example, if the resource usage amount is 1, then increment the first usage amount of the time dimension that meets the first resource usage requirement by 1 and save it.

[0145] For the time dimension that meets the second resource usage requirements, update the first usage amount and the first time period in the resource usage data. For example, for the time dimension that meets the second resource usage requirements, update the corresponding first usage amount and first time period. If the resource usage amount is 1, then modify the first time period corresponding to the time dimension that meets the second resource usage requirements to the time period limit indication of the time dimension that meets the second resource usage requirements, then modify the first usage amount corresponding to the time dimension that meets the second resource usage requirements to 1 and save.

[0146] In summary, the above embodiments allow resetting the time period and resource usage in resource usage data. When a user requests resources at the start of a new period (such as a new day), the system automatically updates the period and resets the usage, without requiring the user to wait for background tasks or perform manual operations, thus improving resource update efficiency.

[0147] The following example uses the realization of the first resource as an eligibility for participation in the activity. It is for illustrative purposes only. Please refer to it. Figure 10 , Figure 2 The illustrated embodiments can also be implemented as follows: Figure 10 Steps 1001 to 1007 are shown.

[0148] Step 1001: Upon receiving a request from the first account to use the first qualification for participating in the activity, obtain the first qualification restriction data and the number of first qualification requests corresponding to the first account.

[0149] The first qualification usage request represents the first account's initial qualification usage request for participating in the event, that is, the first qualification usage request received from the first account for participating in the event.

[0150] For illustrative purposes, the first account is the account logged in on the client of the first application. The first application provides an activity participation interface, where users can use the first account to participate in activities.

[0151] Please refer to Figure 11 , Figure 11The diagram shows an activity participation interface provided in an embodiment of this application. In the activity participation interface 1100, users can complete tasks 1, 2 and 3 to receive opportunities to open treasure chests. The method provided in this application can control the number of opportunities that users can receive. When a user receives an opportunity for the first time, a first qualification usage request is triggered.

[0152] The first qualification restriction data includes at least two time dimensions, corresponding to the qualification frequency limit and the time period limit, respectively. The qualification frequency limit indicates the maximum number of times the first account can participate in activities within the time period indicated by the time period limit.

[0153] The first qualification request count represents the number of times the first account requests to use the qualification to participate in the event.

[0154] In some embodiments, upon receiving a data configuration request for a first account, first eligibility restriction data is generated based on the data configuration request.

[0155] Please refer to Figure 12 , Figure 12 The diagram shows a qualification configuration management interface provided in an embodiment of this application. Indicatively, in the qualification configuration management interface 1200, the administrator can configure the number of opportunities corresponding to the daily, weekly, monthly and activity periods, that is, the number of opportunities that users can receive daily, weekly, monthly and during the activity period.

[0156] Step 1002: Generate the first qualification usage data corresponding to the first account based on the first qualification restriction data and the number of first qualification requests.

[0157] The first qualification usage data is used to store the number of qualification usages and the first time period corresponding to at least two time dimensions through a single data item. The number of qualification usages represents the number of times the first account has used the activity participation qualification within the first time period.

[0158] Optionally, the first qualification data is used to store a first timestamp through a single data item to represent a first time period, and the first timestamp is used to indicate the end time of the first time period; or, the first qualification data is used to store a first offset through a single data item to represent the first time period; wherein, the first offset corresponding to the i-th time dimension refers to the offset between the first time period determined based on the i-th time dimension and the preset time period.

[0159] As an illustration, the following Redis script demonstrates the data update method based on the first-qualification request. The input parameters and logic of this Redis script are shown below:

[0160] Script input parameters:

[0161] {key}{+count}{max,offset}; Examples of script input parameters: user-key 1[10, October 1st], [100, Total], this example indicates that an attempt is made to deduct 1 qualification from the user user-key, the maximum available qualification of the user user-key on October 1st is 10, and the total available qualification is 100;

[0162] Script logic:

[0163] (1) Obtain the current in-memory data of the user user-key, such as "", which indicates that the current user is visiting for the first time;

[0164] (2) Based on the input parameter "1[10, October 1st], [100, Total]", update the in-memory data to "Daily + Total|1|October 1st|1|Total", and return success.

[0165] Herein, the request logic of the above data configuration request can also be implemented through a redis script. For example, when adjusting the maximum value limit of the "daily" qualification to 20, it is only necessary to pass in "[20, October 1st]" in the input parameter on the calling side, and the script logic will not be affected at all.

[0166] Step 1003, in response to receiving a second qualification usage request for the activity participation qualification from the first account, acquire the second qualification restriction data and the second qualification request count corresponding to the first account.

[0167] The second qualification usage request represents a qualification usage request received after the initialization qualification usage request.

[0168] The second qualification restriction data includes qualification count restrictions and time period restrictions respectively corresponding to at least two time dimensions, and the qualification count restriction indicates the maximum number of activity participation qualifications of the first account within the time period indicated by the time period restriction.

[0169] The second qualification request count represents the number of times the first account requests to use the activity participation qualification.

[0170] Herein, the first qualification restriction data and the second qualification restriction data may be the same or different, and the first qualification request count and the second qualification request count may be the same or different.

[0171] In some embodiments, the first qualification restriction data and the second qualification restriction data are different, that is, the first qualification restriction data is adjusted before the second qualification usage request is received. Optionally, in response to receiving a data adjustment request for the first qualification restriction data corresponding to the first account, the first qualification restriction data is adjusted to the second qualification restriction data based on the data adjustment request.

[0172] Step 1004: Obtain the second qualification usage data corresponding to the first account.

[0173] The second qualification usage data is used to store the number of qualification usages and the first time period corresponding to at least two time dimensions through a single data item. The number of qualification usages represents the number of times the first account has used the activity participation qualification within the first time period.

[0174] Optionally, the second qualification data is used to store a first timestamp in a single data item to represent a first time period, the first timestamp indicating the end time of the first time period; or, the second qualification data is used to store a first offset in a single data item to represent the first time period; wherein, the first offset corresponding to the i-th time dimension refers to the offset between the first time period determined based on the i-th time dimension and the preset time period.

[0175] In some embodiments, the first qualification usage data and the second qualification usage data are the same; that is, the first qualification usage data is not updated before the second qualification usage request is received. Optionally, the second qualification usage request may be the first qualification usage request received after the first qualification usage request.

[0176] In other embodiments, the first qualification usage data and the second qualification usage data are different; that is, the first qualification usage data is updated before the second qualification usage request is received. Optionally, the second qualification usage request may be the j-th qualification usage request received after the first qualification usage request, where j is an integer greater than 1.

[0177] Step 1005: When the time period indicated by the time period limit corresponding to the i-th time dimension is consistent with the first time period corresponding to the i-th time dimension, and the qualification count limit corresponding to the i-th time dimension is greater than or equal to the sum of the second qualification request count and the second qualification usage count corresponding to the i-th time dimension, it is determined that the i-th time dimension meets the first qualification usage requirements.

[0178] Step 1006: When the time period indicated by the time period limit corresponding to the i-th time dimension is inconsistent with the first time period corresponding to the i-th time dimension, if the qualification limit corresponding to the i-th time dimension is greater than or equal to the second qualification request count, it is determined that the i-th time dimension meets the requirements for the use of the second qualification.

[0179] Step 1007: If the eligibility requirements are met in at least two time dimensions, update the second eligibility usage data corresponding to the first account based on the eligibility usage request.

[0180] Optionally, for the time dimension that meets the first qualification requirement, the number of qualification uses can be updated in the qualification use data. For example, for the time dimension that meets the first qualification requirement, the corresponding number of qualification uses can be updated. If the qualification use count is 1, then the number of qualification uses for the time dimension that meets the first qualification requirement can be incremented by 1 and saved.

[0181] The following example, using a Redis script, illustrates the data update method based on the first-qualification usage requirement. The input parameters and logic of this Redis script are shown below:

[0182] Script input parameters:

[0183] {key}{+count}{max,offset}; Example of script input parameters: user-key 1[10,October 1st],[100,total], This example means trying to deduct 1 qualification from user-key. The maximum number of qualifications that user-key can use on October 1st is 10, and the total number of qualifications that can be used is 100.

[0184] Script logic:

[0185] (1) Get the current memory data of the user-key, such as “Daily + Total|1|October 1st|50|Total”. This memory data indicates that the current user has used 1 qualification on October 1st and has used a total of 100 qualifications.

[0186] (2) Compare the input parameters “1[10, October 1st], [100, Total]” with the memory data dimension by dimension to see if they can still be deducted: [10, October 1st] means that a maximum of 10 resources can be used on October 1st. The usage qualification for this dimension in the memory data is 1, so it can be deducted. Save the usage qualification for this dimension in the memory data as 2; [100, Total] means that the maximum total resources used is 100. The usage qualification for this dimension in the memory data is 50, so it can be deducted. Save the usage qualification for this dimension in the memory data as 51. That is, update the memory data to “Day + Total|2|October 1st|51|Total” and return success.

[0187] Optionally, for the time dimension that meets the second qualification usage requirements, update the qualification usage count and the first time period in the qualification usage data. For example, for the time dimension that meets the second qualification usage requirements, update the corresponding qualification usage count and the first time period. If the qualification usage count is 1, then modify the first time period corresponding to the time dimension that meets the second qualification usage requirements to the time period limit indication of the time dimension that meets the second qualification usage requirements, then modify the qualification usage count corresponding to the time dimension that meets the second qualification usage requirements to 1 and save.

[0188] The following example, using a Redis script, illustrates the data update method based on the second qualification requirement. The input parameters and logic of this Redis script are shown below:

[0189] Script input parameters:

[0190] {key}{+count}{max,offset}; Example of script input parameters: user-key 1[10,October 2nd],[100,total], This example means trying to deduct 1 qualification from user-key. The maximum number of qualifications that user-key can use on October 2nd is 10, and the total number of qualifications that can be used is 100.

[0191] Script logic:

[0192] (1) Get the current memory data of the user-key, such as “Daily + Total|1|October 1st|50|Total”. This memory data indicates that the current user has used 1 qualification on October 1st and has used a total of 100 qualifications.

[0193] (2) Compare the input parameters “1[10, October 2nd], [100, Total]” with the memory data: It is found that the current day dimension has changed and the data of October 1st can no longer be used for comparison. Therefore, the data of October 2nd is created directly and the count is saved. That is, the memory data is updated to “day + total|1|October 2nd|51|total” and the result is returned as success.

[0194] In this application, a Redis script is used to implement a data update method: (1) Due to the atomicity of the Redis script, the consistency of multi-dimensional periodic deduction can be guaranteed. For example, user qualifications can be deducted simultaneously in the "daily" and "total" dimensions, instead of only one being successful; (2) The judgment of user qualification deduction can be completed based on a single Redis call; (3) The maximum value limit of all user qualifications can be dynamically adjusted.

[0195] In summary, the data update method provided in this application stores eligibility usage data for multiple time dimensions such as day, week, month, and activity period through a single data item, avoiding the problem of needing to query multiple hash structures separately in related technologies, reducing the number of database queries, and when users use eligibility during period switching, the system automatically recognizes the period change and adjusts the count, improving the efficiency of eligibility management. In addition, using timestamps or offsets to represent time periods saves storage space.

[0196] The data update method provided in this application can be applied to various scenarios, including gaming, e-commerce, online education, and enterprise resource management, without limitation. Specifically, for gaming, the method can be used for managing eligibility for in-game activities, limited redemption in game stores, and limited acquisition of game points. For e-commerce, the method can be used for managing limited coupon redemption and limited use of shopping points on e-commerce platforms. For online education, the method can be used for managing limited use of learning points and course eligibility on online education platforms. For enterprise resource management, the method can be used for managing eligibility for office supplies requisition on enterprise resource management platforms, without limitation.

[0197] The following section uses a game scenario as an example to illustrate the specific solutions for applying the data update method provided in this application to the management of eligibility for game activities, the management of limited redemptions in the game store, and the management of limited acquisition of game points.

[0198] (I) Management of eligibility for game activities

[0199] Step 1: Display the event participation interface in the game application.

[0200] The game application has a first account logged in, and the activity participation interface is used to provide the first account with an entry point to participate in game activities.

[0201] Optionally, game applications include, but are not limited to: Virtual Reality (VR) games, Augmented Reality (AR) games, First-Person Shooter (FPS) games, Third-Person Shooter (TPS) games, Multiplayer Online Battle Arena (MOBA) games, Massive Multiplayer Online Role-Playing Game (MMORPG), Simulation Game (SLG), and Party Games.

[0202] Optionally, game activities include, but are not limited to: limited-time dungeon events, daily sign-in events (daily sign-in / weekly sign-in, etc.), and season-limited events.

[0203] Step 2: Upon receiving an action request to participate in the game activity, determine the eligibility request data.

[0204] Optionally, the entry point for the game activity provided by the activity participation interface can be implemented as an activity participation control displayed in the activity participation interface; upon receiving a trigger operation on the activity participation control, the eligibility request data is determined.

[0205] The eligibility request data includes data corresponding to at least two time dimensions. For example, using a daily and total time dimension, the eligibility request data can be implemented as: Number of eligibility currently requested | [Maximum daily activity eligibility, time period of the daily dimension] | [Maximum total activity eligibility, effective activity time period]. The number of eligibility currently requested can be set to 1 by default. The maximum daily activity eligibility refers to the maximum number of activity eligibility for the first account within the current daily time period. The daily time period can be the day when the current activity participation operation is triggered. The maximum total activity eligibility refers to the maximum number of activity eligibility for the first account within the effective activity time period, which is the duration of the activity. The maximum daily activity eligibility is less than or equal to the maximum total activity eligibility.

[0206] In some embodiments, the eligibility request data of the first account is dynamically determined based on the account's activity data. For example, the maximum daily activity eligibility for the first account is determined based on the account's activity level in the game application the previous day. Optionally, the account's activity level in the game application the previous day can be determined based on the account's participation progress or data in game activities the previous day. Optionally, activity level and the maximum daily activity eligibility are positively correlated. Optionally, the total maximum activity eligibility for the first account remains unchanged, or the total maximum activity eligibility is adjusted according to changes in the daily maximum activity eligibility; for example, if the daily maximum activity eligibility increases by 1 on a certain day, the total maximum activity eligibility also increases by 1.

[0207] In this application, by decoupling eligibility restriction data (such as the maximum number of daily activity participation eligibility) from eligibility usage data, it is easier to flexibly modify eligibility restriction data while maintaining data consistency and maintainability.

[0208] Step 3: Obtain the first account's eligibility data for game activities.

[0209] The eligibility usage data is used to store the usage of game activity participation eligibility by the first account across at least two time dimensions, using a single data item. For example, assuming at least two time dimensions are implemented as a daily and a total dimension, the eligibility usage data can be represented as: Daily + Total | [Daily activity participation eligibility usage count, daily time period] | [Total activity participation eligibility usage count, effective activity time period]. Here, the daily activity participation eligibility usage count is the number of game activities used by the first account within the daily time period, and the total activity participation eligibility usage count is the number of game activities used by the first account within the effective activity time period.

[0210] Step 4: If the eligibility usage data and eligibility request data meet the eligibility usage requirements, update the eligibility usage data of the first account based on the eligibility request data. Taking at least two time dimensions—daily and total—as an example, meeting the eligibility usage requirements includes at least one of the following:

[0211] (1) The first account participates in the game activity for the first time.

[0212] For illustrative purposes, if the first account participates in the game activity for the first time on the same day (October 1st), the qualification usage data of the first account will be empty. If the number of qualifications currently requested in the qualification request data is less than or equal to the maximum number of qualifications to participate in the activity on a daily basis, it is determined that the qualification usage requirements are met. At this time, a new qualification usage data is created directly based on the qualification request data. For example, if the number of qualifications currently requested in the qualification request data is 1 and the time period of the daily dimension in the qualification request data is October 1st, then the qualification usage data created for the first account is: Daily + Total |[1, October 1st] |[1, Activity Valid Time Period].

[0213] (2) The first account participated in the game activity on the same day.

[0214] For illustrative purposes, if the first account participates in the game activity on the same day (October 1st), but it is not the first time participating in the game activity, then the time period of the first account's qualification usage data and qualification request data is the same in the daily dimension. If the number of qualifications currently requested + the number of daily activity participation qualifications used ≤ the maximum number of daily activity participation qualifications, and the number of qualifications currently requested + the total number of activity participation qualifications used ≤ the total maximum number of activity participation qualifications, then it is determined that the qualification usage requirements are met. If the number of qualifications currently requested is 1, the number of daily activity participation qualifications used is 2, the total number of activity participation qualifications used is 6, and the time period of the daily dimension is October 1st, then the qualification usage data is updated to: daily + total |[3, October 1st] |[7, effective time period of the activity].

[0215] (3) The first account participates in game activities for the first time on a new day.

[0216] For illustrative purposes, if the first account participates in the game activity for the first time on a new day (October 2nd), but it is not the first time participating in the game activity, then the time period of the daily dimension in the first account's qualification usage data and qualification request data are different. If the number of qualifications currently requested to be used is less than or equal to the maximum number of daily activity participation qualifications, and the number of qualifications currently requested to be used + the total number of activity participation qualifications used is less than or equal to the total maximum number of activity participation qualifications, then it is determined that the qualification usage requirements are met. If the number of qualifications currently requested to be used is 1, the total number of activity participation qualifications used is 7, and the time period of the daily dimension in the qualification request data is October 2nd, then the qualification usage data is updated to: daily + total |[1, October 2nd] |[8, effective time period of the activity].

[0217] Steps 2-4 can be executed on the client side of the game application or on the server side. The server is the backend server of the game application client, and there is no limitation here.

[0218] (II) Limited-time redemption management in the game store

[0219] Step 1: Display the game store interface in the game application.

[0220] The game application has a primary account, and the game store interface provides an entry point for redeeming virtual items in the game.

[0221] Optionally, game applications include, but are not limited to: virtual reality games, augmented reality games, first-person shooter games, third-person shooter games, multiplayer online tactical battle royale games, massively multiplayer online role-playing games, strategy games, and party games.

[0222] Optionally, virtual items include, but are not limited to: virtual props, virtual skins, virtual pets, virtual heroes, etc. The virtual item redemption portal provides a channel for exchanging virtual resources for virtual items, where virtual resources are resources provided within the game application, such as points, coins, diamonds, experience points, etc.

[0223] Step 2: Upon receiving a request to redeem virtual items, determine the item request data.

[0224] Optionally, the virtual item redemption entry provided by the game store interface can be implemented as a redemption control displayed in the game store interface; upon receiving a trigger operation on the redemption control, the item request data is determined.

[0225] The item request data includes data corresponding to at least two time dimensions. For example, using a daily and total time dimension, the item request data can be implemented as: Current Item Requested Redemption Count | [Daily Maximum Item Redemption Count, Daily Time Period] | [Total Maximum Item Redemption Count, Valid Redemption Time Period]. The current requested item redemption count can be 1 by default, or it can be the number of virtual items customized when the first account triggers the redemption control. The daily maximum item redemption count refers to the maximum number of virtual items the first account can redeem within the current daily time period. The daily time period can be the day the current redemption operation is triggered. The total maximum item redemption count refers to the total number of virtual items that multiple accounts in the game application can redeem within the valid redemption time period, or the total number of virtual items the first account can redeem within the valid redemption time period. The daily maximum item redemption count is less than or equal to the total maximum item redemption count.

[0226] Among them, multiple accounts refer to at least two accounts including the first account. Multiple accounts can refer to all accounts in a certain server in the game application, or multiple accounts can refer to all accounts in the same group in the game application, or multiple accounts can refer to all accounts in the game application with the same account level, etc. There are no restrictions here.

[0227] In some embodiments, the eligibility request data for the first account is dynamically determined based on the redemption popularity of game items and the account attributes of the first account. For example, the maximum daily item redemption count for the first account is determined based on the redemption popularity of game items within a historical time period and the current account level of the first account. Optionally, if the redemption popularity of game items exceeds a preset popularity, the maximum daily item redemption count for the first account is determined based on the current account level of the first account, where account level and maximum daily item redemption count are positively correlated. Optionally, the total maximum item redemption count remains constant or changes with the daily maximum item redemption count; for example, if the daily maximum item redemption count increases by 1 on a certain day, the total maximum item redemption count also increases by 1 accordingly.

[0228] Step 3: Obtain the item redemption data of the first account for virtual items.

[0229] The item redemption data is used to store the redemption status of the first account across at least two time dimensions, using a single data item. For example, assuming the at least two time dimensions are daily and total, the item redemption data can be represented as: Daily + Total | [Daily Item Redemption Count, Daily Time Period] | [Total Item Redemption Count, Valid Redemption Time Period]. Here, the daily item redemption count is the number of virtual items redeemed by the first account within the daily time period, and the total item redemption count is the number of virtual items redeemed by the first account within the valid redemption time period.

[0230] Step 4: If the item exchange data and the item request data meet the item exchange requirements, update the item exchange data of the first account based on the item request data.

[0231] Taking at least two time dimensions as a daily dimension and a total dimension as an example, the conditions for meeting the item redemption requirements include at least one of the following:

[0232] (1) The first account redeems virtual items for the first time.

[0233] For illustrative purposes, if the first account redeems virtual items for the first time on the same day, the item redemption data for the first account will be empty. If the number of items requested for redemption in the item request data is less than or equal to the maximum number of items that can be redeemed per day, then the item redemption requirements are met. In this case, a new item redemption data will be created directly based on the item request data. For example, if the number of items requested for redemption in the item redemption data is 1 and the time period of the day dimension in the item request data is October 1, then the item redemption data created for the first account will be: Daily + Total |[1, October 1] |[1, Valid time period for item redemption].

[0234] (2) The first account redeemed virtual items on the same day.

[0235] For illustrative purposes, if the first account participates in the game activity on the same day (October 1st), but this is not the first time it has redeemed virtual items, then the item redemption data of the first account and the daily time period in the item request data are the same. If the number of items currently requested for redemption + the number of items redeemed daily ≤ the maximum number of items redeemed daily, and the number of items currently requested for redemption + the total number of items redeemed ≤ the maximum number of items redeemed total, then it is determined that the item redemption requirements are met. If the number of items currently requested for redemption is 1, the number of items redeemed daily is 2, the total number of items redeemed is 6, and the time period in the daily dimension is October 1st, then the item redemption data is updated to: daily + total |[3, October 1st] |[7, valid time period for item redemption].

[0236] (3) The first account participates in the exchange of virtual items for the first time on a new day.

[0237] For illustrative purposes, if the first account participates in the exchange of virtual items for the first time on a new day (October 2nd), but it is not the first time to exchange virtual items, then the daily time period in the item exchange data and the item request data of the first account are different. If the number of items currently requested for exchange is less than or equal to the maximum number of items that can be exchanged per day, and the number of items currently requested for exchange plus the total number of items exchanged is less than or equal to the maximum number of items that can be exchanged per day, then it is determined that the item exchange requirements are met. If the number of items currently requested for exchange is 1, the total number of items exchanged is 7, and the daily time period in the item request data is October 2nd, then the item exchange data is updated to: daily + total |[1, October 2nd] |[8, valid time period for item exchange].

[0238] Steps 2-4 can be executed on the client side of the game application or on the server side. The server is the backend server of the game application client, and there is no limitation here.

[0239] In some embodiments, after a first account triggers a redemption operation for a virtual item, if the first account triggers another redemption operation for the same virtual item between the triggering time and a preset time, the frequency of the first account's redemption of virtual items can be limited by setting the number of items currently requested for redemption in the item request data to a large number (usually greater than the total maximum number of items that can be redeemed). The time interval between the triggering time and the preset time is a pre-set fixed duration (e.g., 10 minutes). That is, if the first account triggers a redemption operation for the same virtual item a second time within the fixed duration, the redemption will fail.

[0240] (III) Management of Limited Acquisition of Game Points

[0241] Step 1: Display the points acquisition interface in the game application.

[0242] The game application has a first account logged in, and the points acquisition interface is used to provide an entry point for the first account to collect game points in the game.

[0243] Optionally, game applications include, but are not limited to: virtual reality games, augmented reality games, first-person shooter games, third-person shooter games, multiplayer online tactical battle royale games, massively multiplayer online role-playing games, strategy games, and party games.

[0244] Optionally, game points are points earned by the first account within the game application through completing specific actions (such as quests, battles, logins, etc.). For example, the first account can earn game points by completing daily tasks, dungeons, events, etc., or by defeating enemies, obtaining MVP, achieving winning streaks, etc., or by logging in daily and continuously participating in tasks.

[0245] Optionally, the entry point for claiming game points refers to a triggerable point claiming control displayed after the first account completes a specific action; or the entry point for claiming game points refers to a task claiming control for the first account that performs a specific action.

[0246] Optionally, game points can be used in the game for purposes including but not limited to: redeeming virtual resources, redeeming eligibility to participate in events, and unlocking new gameplay features.

[0247] Step 2: Upon receiving a request to claim game points, determine the points request data.

[0248] Optionally, the entry point for claiming game points provided on the points acquisition interface can be implemented as a points claim control displayed on the points acquisition interface; upon receiving a trigger operation on the points claim control, the points request data is determined.

[0249] The points request data includes data corresponding to at least two time dimensions. For example, using a daily and total time dimension, the points request data can be represented as: Current requested points | [Maximum daily points to claim, daily time period] | [Total maximum points to claim, valid points claim period]. The current requested points are the points corresponding to the specific action executed or completed in the current request. The maximum daily points to claim refers to the maximum number of points the first account can claim within the current daily time period, which can be the day the current points claim operation was triggered. The total maximum points to claim refers to the maximum number of points the first account can claim within the valid points claim period. The maximum daily points to claim is less than or equal to the total maximum points to claim.

[0250] In some embodiments, the point request data of the first account is dynamically determined based on the point usage of the first account. For example, the maximum daily points that the first account can claim are determined based on the amount or frequency of the first account's use of game points within a historical time period (the most recent 7 days), and the amount or frequency of game point usage is positively correlated with the maximum daily points that can claim. Optionally, the total maximum points that can claim remain constant, or the total maximum points that can claim change with the daily maximum points that can claim. For example, if the daily maximum points that can claim increase by 1 on a certain day, the total maximum points that can claim also increase by 1 accordingly.

[0251] Step 3: Obtain the points redemption data for the first account in the game.

[0252] The points redemption data is used to store the points redemption status of the first account across at least two time dimensions, using a single data item. For example, assuming the at least two time dimensions are daily and total, the points redemption data can be represented as: Daily + Total | [Daily Points Redemption Count, Daily Time Period] | [Total Points Redemption Count, Valid Point Redemption Time Period]. Here, the daily points redemption count is the number of game points the first account has redeemed within the daily time period, and the total points redemption count is the number of game points the first account has redeemed within the valid point redemption time period.

[0253] Step 4: If the points redemption data and the points request data meet the points redemption requirements, update the points redemption data of the first account based on the points request data.

[0254] Taking at least two time dimensions as a daily dimension and a total dimension as an example, the conditions for meeting the points redemption requirements include at least one of the following:

[0255] (1) The first account receives game points for the first time.

[0256] For illustrative purposes, if the first account claims game points for the first time on the same day (October 1st), the points claim data for the first account will be empty. If the number of points currently requested in the points request data is less than or equal to the maximum number of points that can be claimed on a daily basis, then it is determined that the points claim requirements are met. At this time, a new points claim data is created directly based on the points request data. For example, if the number of points currently requested in the points request data is 1 and the time period of the daily dimension in the points request data is October 1st, then the points claim data created for the first account will be: Daily + Total |[1, October 1st] |[1, valid time period for points claiming].

[0257] (2) The first account can collect game points on the same day.

[0258] For illustrative purposes, if the first account claims game points on the same day (October 1st), but this is not the first time it has claimed game points, then the time period of the first account's points claim data and the daily dimension of the points request data are the same. If the number of points currently requested to be claimed + the number of points claimed daily ≤ the maximum number of points claimed daily, and the number of points currently requested to be claimed + the total number of points claimed ≤ the total number of points claimed, then it is determined that the points claim requirements are met. If the number of points currently requested to be claimed is 1, the number of points claimed daily is 2, the total number of points claimed is 6, and the time period of the daily dimension is October 1st, then the points claim data is updated to: Daily + Total |[3, October 1st] |[7, valid time period for points claiming].

[0259] (3) The first account receives game points for the first time on the new day.

[0260] For illustrative purposes, if the first account claims game points for the first time on a new day (October 2nd), but this is not the first time claiming game points, then the time period of the daily dimension in the first account's points claim data and points request data will be different. If the number of points currently requested to be claimed is less than or equal to the number of points claimed per day, and the number of points currently requested to be claimed plus the total number of points claimed is less than or equal to the total number of points claimed, then it is determined that the points claim requirements are met. If the number of points currently requested to be claimed is 1, the total number of points claimed is 7, and the time period of the daily dimension in the points request data is October 2nd, then the points claim data will be updated to: Daily + Total |[1, October 2nd] |[8, valid time period for points claiming].

[0261] Steps 2-4 can be executed on the client side of the game application or on the server side. The server is the backend server of the game application client, and there is no limitation here.

[0262] Figure 13 This is a structural block diagram of a data update apparatus provided in an exemplary embodiment of this application, such as... Figure 13 As shown, the device includes:

[0263] The acquisition module 1310 is used to acquire resource restriction data corresponding to the first account when receiving a resource usage request from the first account for the first resource. The resource restriction data includes the usage restriction conditions of the first account for the first resource in at least two time dimensions.

[0264] The acquisition module 1310 is used to acquire resource usage data corresponding to the first account. The resource usage data is used to store the usage of the first resource by the first account under the at least two time dimensions through a single data item. There is an inclusion relationship between the time periods indicated by the at least two time dimensions.

[0265] The update module 1320 is used to update the resource usage data corresponding to the first account based on the resource usage request, provided that the resource usage data and the resource restriction data meet the resource usage requirements.

[0266] In some embodiments, the usage restrictions include usage limits, which represent the maximum usage of the first resource by the first account; the resource usage data is used to store the first usage corresponding to the at least two time dimensions in a single data item, whereby the first usage represents the amount used by the first account for the first resource; the update module 1320 is used to update the resource usage data based on the resource usage request if the usage limits corresponding to the at least two time dimensions and the first usage and resource request quantity meet the resource usage requirements; wherein, the resource request quantity represents the amount of the first account requests to use the first resource.

[0267] In some embodiments, the update module 1320 is configured to determine that the i-th time dimension meets the resource usage requirements when the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, where i is a positive integer; and to update the resource usage data based on the resource usage request when at least two time dimensions meet the resource usage requirements respectively.

[0268] In some embodiments, the usage restrictions include time period restrictions, the usage limit representing the maximum usage of the first resource by the first account within the time period restriction; the resource usage data is further used to store the first time periods corresponding to the at least two time dimensions respectively through a single data item, the first usage representing the amount of the first resource used by the first account within the first time period.

[0269] In some embodiments, the resource usage requirements include first resource usage requirements; the update module 1320 is configured to determine that the i-th time dimension meets the first resource usage requirements when the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, and when the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension; and update the first usage amount in the resource usage data for the time dimension that meets the first resource usage requirements.

[0270] In some embodiments, the resource usage requirements include second resource usage requirements; the update module 1320 is configured to determine that the i-th time dimension meets the second resource usage requirements when the time period limit corresponding to the i-th time dimension does not meet the period matching requirement with the first time period corresponding to the i-th time dimension, provided that the usage limit corresponding to the i-th time dimension is greater than or equal to the resource request amount; and update the first usage amount and the first time period in the resource usage data for the time dimension that meets the second resource usage requirements.

[0271] In some embodiments, the resource usage requirements include third resource usage requirements; the first time period corresponding to the i-th time dimension is included within the first time period corresponding to the (i+1)-th time dimension; the update module 1320 is configured to, when the time period limit corresponding to the i-th time dimension and the first time period corresponding to the i-th time dimension meet the period matching requirement, obtain the account priority corresponding to the first account if the i-th time dimension meets the resource allocation requirement; the resource allocation requirement indicates that the usage limit corresponding to the i-th time dimension is less than the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, and the usage limit corresponding to the (i+1)-th time dimension is greater than the sum of the resource request amount and the first usage amount corresponding to the (i+1)-th time dimension; if the account priority is greater than the preset priority, determine that the i-th time dimension meets the third resource usage requirements; for the time dimension that meets the third resource usage requirements, update the first usage amount in the resource usage data.

[0272] In some embodiments, the resource usage data is used to store a first timestamp in a single data item to represent the first time period, the first timestamp indicating the end time of the first time period; or, the resource usage data is used to store a first offset in a single data item to represent the first time period; wherein, the first offset corresponding to the i-th time dimension refers to the offset between the first time period determined based on the i-th time dimension and a preset time period.

[0273] In some embodiments, the acquisition module 1310 is configured to acquire initial resource restriction data and initial resource request data corresponding to the first account when receiving an initial resource usage request from the first account for the first resource; the update module 1320 is configured to generate initial resource usage data corresponding to the first account based on the initial resource restriction data and the initial resource request data.

[0274] In some embodiments, the acquisition module 1310 is configured to adjust the resource restriction data based on the data adjustment request when a data adjustment request for the resource restriction data corresponding to the first account is received.

[0275] In some embodiments, the resource usage data is used to store dimension identifiers through a single data item; the dimension identifiers are used to represent the storage order of the at least two time dimensions and the usage corresponding to the at least two time dimensions in the single data item.

[0276] In summary, the data updating device provided in this application, when a first account requests to use a first resource, obtains resource restriction data and resource usage data of the first account for the first resource in at least two time dimensions. The resource usage data is stored as a single data item, showing the first account's usage of the first resource in each of the at least two time dimensions. Then, the resource usage data is updated according to the resource usage requirements. Storing the resource usage information of the first account in each of the at least two time dimensions as a single data item allows for the acquisition of resource usage data for all time dimensions in a single operation. Compared to related technologies that require multiple queries of different hash structures, this simplifies the operation process and improves the efficiency of resource management.

[0277] It should be noted that the data update device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the data update device and the data update method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0278] Figure 14 A structural block diagram of a computer device provided in an exemplary embodiment of this application is shown. The computer device 1410 may be a server.

[0279] Typically, computer device 1410 includes a processor 1401 and a memory 1402.

[0280] Processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1401 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1401 may also include a main processor and a coprocessor. The main processor, also known as a central processing unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1401 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1401 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0281] The memory 1402 may include one or more computer-readable storage media, which may be non-transitory. The memory 1402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 are used to store at least one instruction, which is executed by the processor 1401 to implement the data update method provided in the method embodiments of this application.

[0282] In some embodiments, the computer device 1410 also includes other components 1403, the type and number of which can be selected based on the functional needs of the computer device 1410. Those skilled in the art will understand that... Figure 14 The structure shown does not constitute a limitation on the computer device 1410 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0283] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0284] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the data update method as described in any of the above embodiments of this application.

[0285] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the data update method as described in any of the above embodiments of this application.

[0286] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the data update methods described in the above embodiments.

[0287] It should be noted that the data collection and processing in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0288] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0289] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A data update method, characterized in that, The method includes: Upon receiving a resource usage request from a first account for a first resource, the resource restriction data corresponding to the first account is obtained. The resource restriction data includes the usage restriction conditions of the first account for the first resource in at least two time dimensions. Obtain resource usage data corresponding to the first account. The resource usage data is used to store the usage of the first resource by the first account under the at least two time dimensions through a single data item. There is an inclusion relationship between the time periods indicated by the at least two time dimensions. If the resource usage data and the resource restriction data meet the resource usage requirements, the resource usage data corresponding to the first account is updated based on the resource usage request.

2. The method according to claim 1, characterized in that, The usage restrictions include usage limits, which represent the maximum amount of the first account can use the first resource; the resource usage data is used to store the first usage corresponding to the at least two time dimensions in a single data item, whereby the first usage represents the amount of the first account has used the first resource. When the resource usage data and the resource restriction data meet the resource usage requirements, updating the resource usage data corresponding to the first account based on the resource usage request includes: If the resource usage requirements are met between the usage limits corresponding to the at least two time dimensions and the first usage and resource request, the resource usage data is updated based on the resource usage request. The resource request amount refers to the amount of the first account requests to use the first resource.

3. The method according to claim 2, characterized in that, The method further includes: If the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, then the i-th time dimension is determined to meet the resource usage requirements, where i is a positive integer; When the resource usage requirements are met between the usage limits corresponding to at least two time dimensions and the first usage and resource request, updating the resource usage data based on the resource usage request includes: If the resource usage requirements are met in at least two time dimensions, the resource usage data is updated based on the resource usage request.

4. The method according to claim 2, characterized in that, The usage restrictions also include time period restrictions, whereby the usage limit represents the maximum amount of the first resource used by the first account within the time period restriction; the resource usage data is also used to store the first time period corresponding to the at least two time dimensions through a single data item, whereby the first usage represents the amount of the first resource used by the first account within the first time period.

5. The method according to claim 4, characterized in that, The resource usage requirements include the first resource usage requirements; The method further includes: When the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, and the usage limit corresponding to the i-th time dimension is greater than or equal to the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, it is determined that the i-th time dimension meets the first resource usage requirement. Updating the resource usage data based on the resource usage request includes: For the time dimension that meets the first resource usage requirements, update the first usage amount in the resource usage data.

6. The method according to claim 4, characterized in that, The resource usage requirements include second resource usage requirements; The method further includes: When the time period limit corresponding to the i-th time dimension does not meet the period matching requirement with the first time period corresponding to the i-th time dimension, if the usage limit corresponding to the i-th time dimension is greater than or equal to the resource request amount, it is determined that the i-th time dimension meets the second resource usage requirement. Updating the resource usage data based on the resource usage request includes: For the time dimension that meets the second resource usage requirements, update the first usage amount and the first time period in the resource usage data.

7. The method according to claim 4, characterized in that, The resource usage requirements include third resource usage requirements; the first time period corresponding to the i-th time dimension is included within the first time period corresponding to the (i+1)-th time dimension; The method further includes: When the time period limit corresponding to the i-th time dimension meets the period matching requirement with the first time period corresponding to the i-th time dimension, and the resource allocation requirement is met in the i-th time dimension, the account priority corresponding to the first account is obtained; the resource allocation requirement indicates that the usage limit corresponding to the i-th time dimension is less than the sum of the resource request amount and the first usage amount corresponding to the i-th time dimension, and the usage limit corresponding to the (i+1)-th time dimension is greater than the sum of the resource request amount and the first usage amount corresponding to the (i+1)-th time dimension; If the account priority is greater than the preset priority, it is determined that the i-th time dimension meets the requirements for the use of the third resource; Updating the resource usage data based on the resource usage request includes: For the time dimension that meets the third resource usage requirements, update the first usage amount in the resource usage data.

8. The method according to claim 4, characterized in that, The resource usage data is used to store a first timestamp in a single data item to represent the first time period, the first timestamp indicating the end time of the first time period; or, The resource usage data is used to store a first offset representing the first time period through a single data item; wherein, the first offset corresponding to the i-th time dimension refers to the offset between the first time period determined based on the i-th time dimension and a preset time period.

9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Upon receiving the resource initialization request from the first account for the first resource, obtain the resource initialization restriction data and resource initialization request data corresponding to the first account; Initial resource usage data corresponding to the first account is generated based on the initial resource restriction data and the initial resource request data.

10. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Upon receiving a data adjustment request for the resource restriction data corresponding to the first account, the resource restriction data is adjusted based on the data adjustment request.

11. The method according to any one of claims 1 to 8, characterized in that, The resource usage data is also used to store dimension identifiers through a single data item; the dimension identifiers are used to represent the storage order of the at least two time dimensions and the usage corresponding to the at least two time dimensions in the single data item.

12. A data update device, characterized in that, The device includes: Upon receiving a resource usage request from a first account for a first resource, the resource restriction data corresponding to the first account is obtained. The resource restriction data includes the usage restriction conditions of the first account for the first resource in at least two time dimensions. Obtain resource usage data corresponding to the first account. The resource usage data is used to store the usage of the first resource by the first account under the at least two time dimensions through a single data item. There is an inclusion relationship between the time periods indicated by the at least two time dimensions. If the resource usage data and the resource restriction data meet the resource usage requirements, the resource usage data corresponding to the first account is updated based on the resource usage request.

13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the data update method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the data update method as described in any one of claims 1 to 11.

15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the data update method as described in any one of claims 1 to 11.