Resource information query method and device, equipment and storage medium

By setting the update cycle for resource usage and remaining status to be longer than the response cycle for resource allocation requests, the problem of inaccurate resource information queries in high-concurrency scenarios is solved, improving the accuracy of resource information queries on user terminals and enhancing user experience.

CN121807926APending Publication Date: 2026-04-07BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In high-concurrency scenarios, when users query resource usage and remaining resource status, the query results interface is often inaccurate, making it difficult for users to understand the current activity progress and resulting in a poor user experience.

Method used

In response to resource information query requests from user terminals, the update cycle for obtaining resource usage and remaining resource status is longer than the response cycle for resource allocation requests, and this information is fed back to the user terminal. By setting a coarse-grained cycle for processing resource information query requests, resource allocation requests are processed first, thereby reducing interface performance overhead and improving query accuracy.

Benefits of technology

By processing resource allocation requests with fine-grained cycles and resource information query requests with coarse-grained cycles, interface performance overhead is reduced. Prioritizing resource allocation requests improves the accuracy of resource information queries displayed on user terminals, ensuring that users can clearly understand the current activity progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807926A_ABST
    Figure CN121807926A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a resource information query method and device, equipment and a storage medium, and the method comprises the steps: responding to a resource information query request sent by a user terminal, obtaining a resource usage amount and a resource residual state, enabling the updating period of the resource usage amount and the resource residual state to be larger than the response period of a resource distribution request, and obtaining a resource distribution request; the resource usage amount is used for representing the resource usage degree, the resource residual state is used for describing the resource residual condition, and the resource allocation request is used for applying for allocating a specified number of resources; and feeding back the resource usage amount and the resource residual state to the user terminal. According to the embodiment of the invention, the accuracy of resource information query can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for querying resource information. Background Technology

[0002] As social interaction continues to evolve, applications typically offer users a variety of activities. For activities involving multiple users, users often periodically check resource information such as resource usage and remaining resource status.

[0003] However, when users query, especially in high-concurrency scenarios, the query results interface often shows inaccurate resource usage and remaining resource status, making it difficult for users to understand the current activity progress and resulting in a poor user experience. Summary of the Invention

[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, the present disclosure provides a resource information query method, apparatus, device and storage medium.

[0005] A first aspect of this disclosure provides a resource information query method, the method comprising: In response to a resource information query request sent by a user terminal, the resource usage and resource remaining status are obtained. The update cycle of the resource usage and the resource remaining status is longer than the response cycle of the resource allocation request. The resource usage is used to characterize the degree to which the resource is used, the resource remaining status is used to describe the remaining resource situation, and the resource allocation request is used to request the allocation of a specified number of resources. The resource usage and the remaining resource status are fed back to the user terminal.

[0006] A second aspect of this disclosure provides a resource information query device, the device comprising: The first acquisition module is used to respond to a resource information query request sent by a user terminal and acquire resource usage and resource remaining status. The update cycle of the resource usage and the resource remaining status is longer than the response cycle of the resource allocation request. The resource usage is used to characterize the degree to which the resource is used, the resource remaining status is used to describe the remaining resource situation, and the resource allocation request is used to request the allocation of a specified number of resources. The first feedback module is used to feed back the resource usage and the remaining resource status to the user terminal.

[0007] A third aspect of this disclosure provides an electronic device comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method described in the first aspect.

[0008] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the method of the first aspect described above.

[0009] The technical solution provided in this disclosure has the following advantages compared with the prior art: This embodiment of the disclosure can respond to a resource information query request sent by a user terminal, obtain resource usage and resource remaining status, wherein the update cycle of resource usage and resource remaining status is longer than the response cycle of resource allocation request. Resource usage is used to characterize the degree to which resources are used, resource remaining status is used to describe the remaining resource situation, and resource allocation request is used to request the allocation of a specified number of resources; the resource usage and resource remaining status are then fed back to the user terminal. It is evident that by adopting the above technical solution, resource allocation requests can be processed with fine-grained cycles, while resource information query requests can be processed with coarse-grained cycles. This reduces the performance overhead on the interface, prioritizes the processing of resource allocation requests, lengthens the feedback cycle for user terminal resource information queries, and improves the accuracy of resource information display on the user terminal. Attached Figure Description

[0010] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0011] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of a resource information query method provided in an embodiment of this disclosure; Figure 2 This is a flowchart illustrating the remaining state of cached resources according to an embodiment of this disclosure; Figure 3 This is a flowchart illustrating the allocated amount of cache resources provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of a resource information query device provided in an embodiment of this disclosure; Figure 5This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0013] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0014] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0015] Figure 1 This is a flowchart illustrating a resource information query method provided in an embodiment of this disclosure. This method can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a server. Figure 1 As shown, the method provided in this embodiment includes the following steps: S110. In response to the resource information query request sent by the user terminal, obtain the resource usage and resource remaining status. The update cycle of the resource usage and resource remaining status is longer than the response cycle of the resource allocation request. The resource usage is used to characterize the degree to which the resource is used, the resource remaining status is used to describe the remaining status of the resource, and the resource allocation request is used to request the allocation of a specified number of resources.

[0016] In this embodiment of the disclosure, when a user participates in a resource allocation activity and wants to know the progress of the activity, they can trigger a resource information query operation on the user terminal. In response to the resource information query operation, the user terminal can generate a resource information query request and send the request to an electronic device. The electronic device, in response to the query request, can obtain the resource usage and remaining resource status of the resource allocation activity.

[0017] Specifically, resource allocation activities refer to activities that allocate limited digital rights or service capabilities in a video service platform to users. These activities are driven by one or more resource allocation requests. Examples of resource allocation activities include group achievement reward activities, distribution of membership benefits, redemption of paid content, allocation of live streaming viewing quotas, granting of offline caching quotas, and activation of high bitrate playback permissions, but are not limited to these. Specifically, the resource information query operation can be any operation that can trigger the query of resource information such as resource usage and remaining resource status.

[0018] Specifically, a resource information query request can be any request that can trigger an electronic device to provide feedback on resource usage and remaining resource status. For example, a resource information query request may include the activity ID of the resource allocation activity to be queried and the terminal ID of the user terminal, but it is not limited to these.

[0019] Specifically, resource usage includes allocated resources and / or remaining resources. Allocated resources refer to the cumulative amount of resources successfully allocated up to date. Remaining resources refer to the amount still available for allocation. The remaining resources are the difference between the total resources and the allocated resources. The total resources refer to the pre-set maximum number of resources available for allocation. Optionally, allocated resources include the number of participants, remaining resources include the remaining number of participants, and the total resources include the total number of participants. The number of participants refers to the number of users currently involved in the resource allocation activity. The remaining number of participants refers to the number of users who, under the limit of the total number of participants, are not yet occupied and are still available for new users to participate; its value is equal to the total number of participants minus the number of participants.

[0020] Specifically, the resource remaining status characterizes the stage of a resource allocation activity within its lifecycle. Optionally, the resource remaining status includes an incomplete state and / or a completed state. The incomplete state indicates that resources are still available, allowing new resource allocation requests to be accepted; users can continue to participate in the resource allocation activity, for example, the number of participants has not yet reached the total number of participants. The completed state indicates that all resources have been allocated and distributed, rejecting any new resource allocation requests, for example, the number of participants has not yet reached the total number of participants and all resources have been distributed. Further optionally, the resource remaining status may also include a waiting state, indicating that all resources have been allocated but are currently in the resource distribution processing stage, rejecting any new resource allocation requests, for example, the number of participants has not yet reached the total number of participants and resources are waiting to be distributed.

[0021] Specifically, a resource allocation request can be any request that can trigger an electronic device to allocate resources to a user terminal. For example, a resource allocation request may include the activity ID of the resource allocation activity to be participated in and the terminal ID of the user terminal, but it is not limited to these.

[0022] Specifically, when a user wishes to participate in a resource allocation activity, they can trigger a resource acquisition operation on their user terminal. In response to this operation, the user terminal can generate a resource allocation request and send it to the electronic device. It should be noted that the resource acquisition operation and the resource information query operation can be the same operation. For example, after the user triggers the "Participate in Activity" control, the user terminal can simultaneously generate both a resource allocation request and a resource information query request. Alternatively, the resource acquisition operation and the resource information query operation can be different operations. For example, after the user triggers the "Participate in Activity" control, the user terminal generates a resource allocation request, and then immediately after the user triggers the "View Activity Progress" control, the user terminal generates a resource information query request. This is not limited to either approach.

[0023] Specifically, the update cycle for resource usage and remaining resource status refers to the time interval at which resource usage and remaining resource status are refreshed.

[0024] Specifically, the response time for a resource allocation request refers to the time consumed from receiving a resource allocation request to completing the resource allocation.

[0025] It should be noted that the specific values ​​of the update cycle for resource usage and remaining resource status, as well as the response cycle for resource allocation requests, can be set by those skilled in the art according to actual conditions, and are not limited here. For example, the update cycle for resource usage and remaining resource status can be arbitrarily selected within the range of greater than or equal to 1 second and less than or equal to 3 seconds, and the response cycle for resource allocation requests can be arbitrarily selected within the range of greater than or equal to 0.1 seconds and less than or equal to 3 seconds. However, it should be noted that the update cycle for resource usage and remaining resource status must be less than the response cycle for resource allocation requests.

[0026] S120. Feedback the resource usage and remaining resource status to the user terminal.

[0027] In this embodiment of the disclosure, after determining the resource usage and remaining resource status, the electronic device can feed back the resource usage and remaining resource status to the user terminal, so that the user terminal can display the resource usage and remaining resource status. It should be noted that the specific form in which the resource usage is displayed may include numbers, progress bars, etc., but is not limited to these.

[0028] In this embodiment of the disclosure, considering that users typically check the progress of a resource allocation activity immediately after participating in it, the electronic device receives resource allocation requests and resource information query requests almost simultaneously. By setting the "update cycle for resource usage and remaining resource status" to be longer than the "response cycle for resource allocation requests," not only can the performance overhead on the interface be reduced, but resource allocation requests can also be prioritized, extending the feedback cycle for user terminal resource information queries, thereby improving the accuracy of resource information queries displayed by the user terminal.

[0029] In another embodiment of this disclosure, before feeding back the remaining resource status and remaining resources to the user terminal, the method further includes: detecting whether the resource usage and the remaining resource status match; If they do not match, modify one of the resource usage and resource remaining status while leaving the other unchanged to obtain a matching resource usage and resource remaining status.

[0030] In some embodiments, resource usage includes allocated resources. If resource usage matches the total resource amount and the remaining resource status is incomplete, then resource usage and remaining resource status do not match. If allocated resources do not match the total resource amount and the remaining resource status is either pending or completed, then resource usage and remaining resource status do not match. If allocated resources match the total resource amount and the remaining resource status is either pending or completed, then resource usage and remaining resource status match. If allocated resources do not match the total resource amount and the remaining resource status is incomplete, then resource usage and remaining resource status match.

[0031] Correspondingly, if there is a mismatch, one of the resource usage and the remaining resource status is modified while the other remains unchanged to obtain a matching resource usage and remaining resource status. This includes: if the allocated resource amount is consistent with the total resource amount and the remaining resource status is incomplete, the remaining resource status is changed to a waiting status while keeping the allocated resource amount unchanged; if the allocated resource amount is inconsistent with the total resource amount and the remaining resource status is completed, the allocated resource amount is changed to the total resource amount while keeping the remaining resource status unchanged.

[0032] For example, if the total number of participants in the activity is 100, during this resource information query process, if the number of participants is 100 and the remaining status of the resource is "incomplete", then the "incomplete status" can be changed to "waiting status" while keeping the number of participants unchanged.

[0033] Understandably, the prerequisite for resource distribution is that the resource usage and total resource amount are consistent (e.g., the total number of participants in the activity is consistent with the number of participants who have already participated) and the remaining resource status is "completed". If the resource usage and total resource amount are consistent, but the remaining resource status is "incomplete", the resource distribution will usually not begin. Therefore, this embodiment adds an intermediate state (i.e., a waiting state) to show the user that the resource is waiting to be distributed. After a certain interval (e.g., 1 second or 2 seconds), when the remaining resource status changes to "completed" through a refresh, the resource distribution can proceed normally. In this way, not only can the resource usage and remaining resource status be matched, but the activity progress can also be accurately provided to the user, improving the accuracy of resource information queries.

[0034] For example, if the total number of participants in an activity is 100, and during this resource information query process, if the number of participants is 99 and the remaining resource status is "completed", then the number of participants can be directly updated to 100, while keeping the remaining resource status unchanged.

[0035] It is also understandable that, under normal circumstances, the remaining resource status will only be updated from unfinished to completed when the remaining resource amount is 0. In this way, the remaining resource status is usually quite accurate. Therefore, in this embodiment of the disclosure, the remaining resource status is used as the standard to directly modify the allocated amount of resources. In this way, not only can the resource usage and the remaining resource status be matched, but the activity progress can also be accurately provided to the user, improving the accuracy of resource information query.

[0036] Of course, if there is a mismatch between the resource usage and the allocated resource status, one of the resource usage and the remaining resource status will be modified while the other remains unchanged, to obtain a matching resource usage and remaining resource status. This includes: if the allocated resource status matches the total resource status and the remaining resource status is incomplete, the remaining resource status will be changed to a waiting status while keeping the allocated resource status unchanged; if the allocated resource status does not match the total resource status and the remaining resource status is completed, the remaining resource status will be changed to a waiting status while keeping the allocated resource status unchanged.

[0037] In other embodiments, resource usage includes remaining resource quantity. If the remaining resource quantity is 0 and the remaining resource status is incomplete, then resource usage and remaining resource status do not match. If the remaining resource quantity is not 0 and the remaining resource status is waiting or completed, then resource usage and remaining resource status do not match. If the remaining resource quantity is 0 and the remaining resource status is waiting or completed, then resource usage and remaining resource status match. If the remaining resource quantity is not 0 and the remaining resource status is incomplete, then resource usage and remaining resource status match.

[0038] Correspondingly, if there is a mismatch, one of the resource usage and the remaining resource status is modified while the other remains unchanged to obtain a matching resource usage and remaining resource status. This includes: if the remaining resource amount is 0 and the remaining resource status is incomplete, the remaining resource status is modified to complete while keeping the remaining resource amount unchanged; if the remaining resource amount is not 0 and the remaining resource status is complete, the remaining resource status is modified to incomplete while keeping the remaining resource amount unchanged.

[0039] For example, if the total number of participants in an activity is 100, and during this resource information query process, if the number of remaining participants is 0 and the remaining resource status is "incomplete", then the "incomplete status" can be changed to "waiting status" while keeping the number of remaining participants unchanged.

[0040] Understandably, the prerequisite for resource distribution is that the resource usage and total resource quantity are consistent (i.e., the remaining number of participants is 0) and the resource status is "completed". If the remaining number of participants is 0 and the resource status is "incomplete", resource distribution usually will not begin. Therefore, this embodiment adds an intermediate state (i.e., a waiting state) to show the user that the resource is waiting to be distributed. After a certain interval (e.g., 1 or 2 seconds), when the resource status is refreshed to "completed", the resource distribution can proceed normally. This not only ensures that resource usage and remaining resource status are matched, but also provides users with accurate activity progress, improving the accuracy of resource information queries.

[0041] For example, if the total number of participants in an activity is 100, and during this resource information query process, if the number of remaining participants is 1 and the remaining resource status is "completed", then the remaining resource status can be changed to "incomplete" while keeping the number of remaining participants unchanged.

[0042] It is also understandable that, under normal circumstances, the resource remaining status will only be updated from unfinished to completed when the remaining amount of resources is 0. Therefore, in this embodiment of the disclosure, the remaining amount of resources is used as the standard to directly modify the remaining status of resources. In this way, not only can the resource usage and the remaining status of resources be matched, but the activity progress can also be accurately provided to the user, improving the accuracy of resource information query.

[0043] In this embodiment of the disclosure, when the resource usage and the remaining resource status do not match, the two can be corrected to match and then fed back to the user terminal. This solves the problem of mismatch between resource usage and remaining resource status in the query results interface, allowing users to clearly understand the current activity progress and improving the user experience.

[0044] In another embodiment of this disclosure, obtaining resource usage and resource remaining status includes: reading resource usage and resource remaining status from a local cache; wherein, resource usage includes the amount of resources allocated, which represents the number of resources that have been allocated, and the process of updating resource usage and resource remaining status in the local cache includes the following steps: According to the first preset period, the original resource allocation amount recorded in the first database is queried periodically, and the resource allocation amount stored in the local cache is updated based on the original resource allocation amount. The original resource allocation amount is increased when responding to a resource allocation request, and the first preset period is longer than the response period of the resource allocation request. According to the second preset period, the original resource remaining status recorded in the second database is queried periodically, and the resource remaining status stored in the local cache is updated based on the original resource remaining status. The second preset period is longer than the response period of the resource allocation request.

[0045] In this embodiment, the electronic device integrates a first database (such as Redis). When a user wants to participate in a resource allocation activity, they can trigger a resource acquisition operation on their terminal. In response to the resource acquisition operation, the user terminal can generate a resource allocation request and send it to the electronic device. In response to the resource allocation request, if the remaining resource quantity is greater than 0, the electronic device can allocate resources to the user terminal and increment the original allocated resource quantity recorded in the first database. For example, in response to the resource allocation request, if the remaining resource quantity is greater than 0, the electronic device can allocate resources to the user terminal and increment the original allocated resource quantity recorded in the first database by 1. Of course, the electronic device can also associate and record the user terminal's ID in the first database. Thus, the electronic device can periodically query the original allocated resource quantity recorded in Redis according to a first preset period and refresh the allocated resource quantity stored in its local cache to the original allocated resource quantity.

[0046] In this embodiment of the disclosure, the electronic device also integrates a second database, which records the original remaining resource status of resource allocation activities. Thus, the electronic device can periodically query the original remaining resource status recorded in the second database according to a second preset period, and refresh the remaining resource status stored in the local cache to the original remaining resource status.

[0047] Specifically, the specific values ​​of the first preset period and the second preset period can be set by those skilled in the art according to the actual situation, and are not limited here. For example, the first preset period and the second preset period can be arbitrarily selected within the range of greater than or equal to 1 second and less than or equal to 3 seconds. For example, the first preset period and the second preset period can be the same, both being 2 seconds, but it is not limited to this.

[0048] It is understandable that a large number of users will often continuously query the resource information of the resource allocation activities they participate in. In this embodiment of the disclosure, the original resource information is periodically stored in the local cache, so that electronic devices can obtain resource information by querying the local cache. In this way, the interface pressure can be reduced and the interface performance can be improved.

[0049] Optionally, resource usage also includes resource remaining amount. Resource remaining amount is used to represent the amount of resources that can still be allocated. The process of updating resource usage and resource remaining status in the local cache also includes the following steps: according to the third preset period, periodically query the original resource remaining amount recorded in the first database. The original resource remaining amount is deducted when responding to the resource allocation request. The original resource remaining amount is the difference between the total amount of resources and the original amount of resources already allocated. The third preset period is longer than the response period of the resource allocation request. If the original remaining amount of resources is not 0, the original remaining state of resources remains in the incomplete state. If the original resource remaining quantity is 0, update the original resource remaining state from unfinished to completed.

[0050] In this embodiment of the disclosure, after receiving a resource allocation request and allocating resources to a user terminal, the electronic device can update the original remaining resource quantity of the resource activity recorded in the first database. Furthermore, it can determine whether to update the original remaining resource status based on the original remaining resource quantity. Specifically, if the original remaining resource quantity is not 0, the original remaining resource status remains incomplete; if the original remaining resource quantity is 0, the original remaining resource status is updated from incomplete to completed. It should be noted that the decision to update the original remaining resource status can be made immediately after updating the original remaining resource quantity, or the original remaining resource quantity in the first database can be read periodically, and then the decision to update the original remaining resource status can be made based on the read original remaining resource quantity. For example, the initial value of the original remaining resource quantity recorded in the first database is the total resource amount, and the initial value of the original remaining resource status recorded in the first database is incomplete. In response to the activity participation request, after receiving the resource allocation request and allocating resources to the user terminal, the electronic device deducts 1 from the original remaining resource quantity recorded in the first database. When the original remaining resource quantity decreases to 0, the original remaining resource status recorded in the second database is updated to completed.

[0051] Of course, it is also possible to determine whether to update the remaining status of the original resources immediately after the original resource allocation is updated, or to periodically read the original resource allocation in the first database and then determine whether to update the remaining status of the original resources based on the read original resource allocation. If the original resource allocation is not equal to the total resources, the remaining status of the original resources is kept as incomplete; if the original resource allocation is equal to the total resources, the remaining status of the original resources is updated from incomplete to completed.

[0052] Specifically, the specific value of the third preset period can be set by those skilled in the art according to the actual situation, and is not limited here. For example, the third preset period can be any value within the range of greater than or equal to 1 second and less than or equal to 3 seconds, such as 1 second, but is not limited to this.

[0053] For example, such as Figure 2 As shown, the system queries the first database every second to check if the original resource remaining quantity is 0. If the original resource remaining quantity is 0, the system updates the original resource remaining status recorded in the second database from "unfinished" to "completed". Otherwise, the original resource remaining status remains "unfinished". Simultaneously, the system queries the database every two seconds to check the original resource remaining status and refreshes the resource remaining status in the local cache based on this new status.

[0054] It is understandable that when the original resource remaining amount drops to 0, it means that the original resource allocated amount has reached the total resource amount. At this time, the original resource remaining status of the second database is updated so that the original resource allocated amount and the original resource remaining status can be matched as soon as possible.

[0055] In this embodiment of the disclosure, in response to a resource information query request, the allocated amount of resources and the remaining status of resources are quickly read from the local cache, which helps to improve the response speed of the resource information query request.

[0056] Optionally, the method further includes: if, after receiving a resource information query request, it is found that no resource allocation amount is stored in the local cache, the query can be performed to retrieve the original resource allocation amount recorded in the first database, and the original resource allocation amount can be stored in the local cache; similarly, if, after receiving a resource information query request, it is found that no resource remaining status is stored in the local cache, the query can be performed to retrieve the original resource remaining status recorded in the second database, and the original resource remaining status can be stored in the local cache.

[0057] For example, such as Figure 3As shown, in response to a received resource information query request, the electronic device can check whether the allocated resource quantity is stored in the local cache. If so, it can directly read the allocated resource quantity from the local cache. If not, it queries the original allocated resource quantity recorded in the first database to obtain the allocated resource quantity and stores it in the local cache. Similarly, in response to a received resource information query request, the electronic device can also check whether the remaining resource status is stored in the local cache. If so, it can directly read the remaining resource status from the local cache. If not, it queries the original remaining resource status recorded in the second database to obtain the remaining resource status and stores it in the local cache.

[0058] In another embodiment of this disclosure, obtaining resource usage and resource remaining status includes: directly querying the original resource usage (i.e., the original allocated resource amount and / or the original remaining resource amount) from the first database and using it as the resource usage; and directly querying the original resource remaining status from the second database and using it as the resource remaining status.

[0059] Figure 4 This is a schematic diagram of the structure of a resource information query device provided in an embodiment of this disclosure. This resource information query device can be understood as the aforementioned electronic device or a functional module within the aforementioned electronic device. For example... Figure 4 As shown, the resource information query device includes: The first acquisition module 410 is used to acquire resource usage and resource remaining status in response to a resource information query request sent by a user terminal. The update cycle of the resource usage and the resource remaining status is longer than the response cycle of the resource allocation request. The resource usage is used to characterize the degree to which resources are used, the resource remaining status is used to describe the remaining resource situation, and the resource allocation request is used to apply for the allocation of a specified number of resources. The first feedback module 420 is used to feed back the resource usage and the remaining resource status to the user terminal.

[0060] Optionally, the device further includes: a first detection module, configured to detect whether the resource usage and the resource remaining status match before feeding back the resource remaining status and remaining resources to the user terminal; The first modification module is used to modify one of the resource usage and the resource remaining status if they do not match, while keeping the other unchanged, so as to obtain a matching resource usage and resource remaining status.

[0061] Optionally, the resource usage includes the allocated resource amount, which is used to represent the number of resources that have been allocated. Specifically, the first modification module is used to modify the remaining resource status to a waiting status if the allocated resource amount is consistent with the total resource amount and the remaining resource status is incomplete, while keeping the allocated resource amount unchanged. If the allocated amount of resources is inconsistent with the total amount of resources, and the remaining state of the resources is "completed", the allocated amount of resources will be changed to the total amount of resources, while the remaining state of the resources will remain unchanged.

[0062] Optionally, the resource usage includes the remaining resource amount, which represents the amount of resources that can still be allocated. Specifically, the first modification module is used to modify the remaining resource status to the completed status if the remaining resource amount is 0 and the remaining resource status is incomplete, while keeping the remaining resource amount unchanged. If the remaining amount of resources is not 0 and the remaining status of resources is completed, change the remaining status of resources to incomplete, and keep the remaining amount of resources unchanged.

[0063] Optionally, the first acquisition module 410 is used to read the resource usage and the remaining status of the resource from the local cache; The resource usage includes the allocated resource amount, which represents the quantity of resources that have been allocated. The device also includes a first update module for updating the resource usage and the remaining resource status in the local cache. The first update module includes: The first update submodule is used to periodically query the original resource allocation amount recorded in the first database according to a first preset period, and update the resource allocation amount stored in the local cache based on the original resource allocation amount, wherein the original resource allocation amount is increased when responding to the resource allocation request, and the first preset period is longer than the response period of the resource allocation request. The second update submodule is used to periodically query the original resource remaining status recorded in the second database according to the second preset period, and update the resource remaining status stored in the local cache based on the original resource remaining status, wherein the second preset period is longer than the response period of the resource allocation request.

[0064] Optionally, the resource usage also includes the remaining resource amount, which represents the amount of resources that can still be allocated. The first update module further includes: a third update submodule, used to periodically query the original remaining resource amount recorded in the first database according to a third preset period, wherein the original remaining resource amount is deducted when responding to the resource allocation request, and the original remaining resource amount is the difference between the total resource amount and the original allocated resource amount, and the third preset period is longer than the response period of the resource allocation request. If the remaining amount of the original resources is not 0, the remaining state of the original resources remains in the incomplete state. If the remaining amount of the original resource is 0, the remaining status of the original resource is updated from unfinished to completed.

[0065] Optionally, the resource usage includes the allocated resources and the remaining resources. The allocated resources include the number of participants who have already participated in the activity, and the remaining resources include the number of remaining participants who can participate in the activity.

[0066] Example, Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. See below for details. Figure 5 The diagram illustrates a structural schematic suitable for implementing the electronic device 500 in the embodiments of this disclosure. The electronic device 500 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0067] like Figure 5 As shown, electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. RAM 503 also stores various programs and data required for the operation of electronic device 500. Processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0068] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0069] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.

[0070] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0071] In some implementations, user terminals and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0072] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0073] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method described in any of the above embodiments.

[0074] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0075] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0076] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0077] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0078] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0079] This disclosure also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the methods of any of the above embodiments. The execution method and beneficial effects are similar, and will not be described again here.

[0080] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0081] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for querying resource information, characterized in that, include: In response to a resource information query request sent by a user terminal, the resource usage and resource remaining status are obtained. The update cycle of the resource usage and the resource remaining status is longer than the response cycle of the resource allocation request. The resource usage is used to characterize the degree to which the resource is used, the resource remaining status is used to describe the remaining resource situation, and the resource allocation request is used to request the allocation of a specified number of resources. The resource usage and the remaining resource status are fed back to the user terminal.

2. The method according to claim 1, characterized in that, Before feeding back the remaining resource status and remaining resources to the user terminal, the method further includes: Detect whether the resource usage and the remaining resource status match; If they do not match, one of the resource usage and the resource remaining status is modified while the other remains unchanged, to obtain a matching resource usage and resource remaining status.

3. The method according to claim 2, characterized in that, The resource usage includes the allocated resource amount, which represents the quantity of resources that have been allocated. If there is a mismatch, one of the resource usage and the remaining resource status is modified while the other remains unchanged to obtain a matching resource usage and remaining resource status, including: If the amount of resources allocated is the same as the total amount of resources, and the remaining status of the resources is incomplete, change the remaining status of the resources to a waiting state, and keep the amount of resources allocated unchanged. If the allocated amount of resources is inconsistent with the total amount of resources, and the remaining state of resources is "completed", the allocated amount of resources will be modified to the total amount of resources, while the remaining state of resources will remain unchanged.

4. The method according to claim 2, characterized in that, The resource usage includes the remaining resource amount, which represents the amount of resources that can still be allocated. If there is a mismatch, one of the resource usage and the remaining resource status is modified while the other remains unchanged to obtain a matching resource usage and remaining resource status, including: If the remaining amount of resources is 0 and the remaining status of resources is incomplete, change the remaining status of resources to complete, and keep the remaining amount of resources unchanged. If the remaining amount of resources is not 0 and the remaining status of resources is completed, change the remaining status of resources to incomplete, and keep the remaining amount of resources unchanged.

5. The method according to claim 1, characterized in that, The acquisition of resource usage and remaining resource status includes: Read the resource usage and the remaining resource status from the local cache; The resource usage includes the allocated resource amount, which represents the number of resources that have been allocated. The process of updating the resource usage and the remaining resource status in the local cache includes the following steps: According to a first preset period, the original resource allocation amount recorded in the first database is queried periodically, and the resource allocation amount stored in the local cache is updated based on the original resource allocation amount. The original resource allocation amount is increased when responding to the resource allocation request, and the first preset period is longer than the response period of the resource allocation request. According to the second preset period, the original resource remaining status recorded in the second database is queried periodically, and the resource remaining status stored in the local cache is updated based on the original resource remaining status, wherein the second preset period is longer than the response period of the resource allocation request.

6. The method according to claim 5, characterized in that, The resource usage also includes the remaining resource amount, which represents the amount of resources that can still be allocated. The process of updating the resource usage and the remaining resource status in the local cache further includes the following steps: According to the third preset period, the original remaining amount of resources recorded in the first database is queried periodically. The original remaining amount of resources is deducted when responding to the resource allocation request. The original remaining amount of resources is the difference between the total amount of resources and the amount of original resources already allocated. The third preset period is longer than the response period of the resource allocation request. If the remaining amount of the original resources is not 0, the remaining state of the original resources remains in the incomplete state. If the remaining amount of the original resource is 0, the remaining status of the original resource is updated from unfinished to completed.

7. The method according to any one of claims 1-6, characterized in that, The resource usage includes the allocated resources and the remaining resources. The allocated resources include the number of participants who have already participated in the activity, and the remaining resources include the number of participants who are still available to participate in the activity.

8. A resource information query device, characterized in that, include: The first acquisition module is used to respond to a resource information query request sent by a user terminal and acquire resource usage and resource remaining status. The update cycle of the resource usage and the resource remaining status is longer than the response cycle of the resource allocation request. The resource usage is used to characterize the degree to which the resource is used, the resource remaining status is used to describe the remaining resource situation, and the resource allocation request is used to request the allocation of a specified number of resources. The first feedback module is used to feed back the resource usage and the remaining resource status to the user terminal.

9. An electronic device, characterized in that, include: A processor and a memory, wherein the memory stores a computer program that, when executed by the processor, performs the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-7.