CN117035858A - Article entitlement certificate method, apparatus, electronic device and storage medium - Google Patents
Article entitlement certificate method, apparatus, electronic device and storage medium Download PDFInfo
- Publication number
- CN117035858A CN117035858A CN202311001779.4A CN202311001779A CN117035858A CN 117035858 A CN117035858 A CN 117035858A CN 202311001779 A CN202311001779 A CN 202311001779A CN 117035858 A CN117035858 A CN 117035858A
- Authority
- CN
- China
- Prior art keywords
- article
- local
- reserved resource
- reserved
- resource
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000004590 computer program Methods 0.000 claims description 3
- 238000004891 communication Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- Economics (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Storage Device Security (AREA)
Abstract
The disclosure provides an article entitlement certificate method, an article entitlement certificate device, an electronic device and a computer readable storage medium, and relates to the technical field of data processing. The method comprises the following steps: receiving an article right voucher inquiry request which is sent by a user and contains an article right voucher reserved resource, deducting the article right voucher reserved resource from the local reserved resource when the article right voucher reserved resource is smaller than or equal to the local reserved resource, and returning article collar information; when the reserved resource of the article right certificate is larger than the local reserved resource and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, the local cluster node acquires the reserved resource from the total reserved resource of redis, updates the local reserved resource, deducts the reserved resource of the article right certificate from the local reserved resource, and returns article collar information; according to the embodiment of the disclosure, the article right certificate query request is processed through the local cluster node in a concurrent mode, a high concurrency scene is supported, and the article right certificate collar query performance is improved.
Description
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, an electronic device, and a computer readable storage medium for article entitlement credentials.
Background
In the E-commerce marketing system, some marketing activities are provided, coupons, red packages and the like are put in for users, the users can select article right certificates to be picked up, and for some popular coupons, red packages and the like, scenes of high concurrent coupons, red packages and the like can occur, most of the scenes are coupons, red packages and the like with low using threshold and great preferential strength. In these systems, computer systems and techniques are needed for implementation.
In the related art, the redis database is used for realizing budget control, but the existing database can only support up to ten thousand concurrences, cannot support such high concurrences, has low collapsibility, and can cause redis service to be unavailable even under such large concurrences.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a method, apparatus, electronic device, and computer-readable storage medium for article entitlement certificates, which at least to some extent overcomes the problem of low marketable inquiry performance of article entitlement certificates in the related art.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to one aspect of the present disclosure, there is provided an article entitlement credential querying method comprising: receiving an article right voucher inquiry request sent by a user, wherein the article right voucher inquiry request comprises an article right voucher reserved resource; when the reserved resource of the article right certificate is smaller than or equal to the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally, and returning article collar information to the user; and when the reserved resource of the article right certificate is larger than the local reserved resource and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, updating the local reserved resource, deducting the reserved resource of the article right certificate from the local reserved resource, and returning article collar information to the user.
In one embodiment of the present disclosure, when the article entitlement credential reserved resource is greater than the local reserved resource and the article entitlement credential reserved resource is less than or equal to the total reserved resource, updating the local reserved resource, deducting the article entitlement credential reserved resource from the local reserved resource, and returning article-collar information to the user includes: when the article entitlement credential reserved resource is greater than the local reserved resource and the article entitlement credential reserved resource is less than or equal to a total reserved resource, determining an updated reserved resource according to the total reserved resource, the local cluster number, or the local reserved resource, wherein the updated reserved resource is greater than or equal to the article entitlement credential reserved resource; and updating the local reserved resources according to the updated reserved resources.
In one embodiment of the present disclosure, further comprising: obtaining local preemption distribution information of a plurality of local cluster nodes, wherein the local preemption distribution information comprises: the local reserved resources and the updated reserved resources; and adjusting the number of the local reserved resources or the local cluster nodes according to the local pre-occupation distribution information.
In one embodiment of the present disclosure, further comprising: and when the reserved resource of the article right certificate is larger than the total reserved resource, returning article non-collar information to the user, and sending non-update information to the local cluster node.
In one embodiment of the present disclosure, further comprising: and when the non-updated information is not received, judging whether the reserved resource of the article entitlement certificate is larger than the local reserved resource.
In one embodiment of the present disclosure, further comprising: receiving an article right voucher obtaining request sent by a user, wherein the article right voucher obtaining request comprises article right voucher reserved resources; and issuing an article entitlement voucher to the user when the total reserved resources are successfully deducted from the article entitlement voucher reserved resources.
In one embodiment of the present disclosure, when the article entitlement credential reserved resource is greater than the local reserved resource and the article entitlement credential reserved resource is less than or equal to the total reserved resource, updating the local reserved resource, deducting the article entitlement credential reserved resource from the local reserved resource, and returning article-collar information to the user includes: updating the local reserved resources when the article entitlement credential reserved resources are greater than the local reserved resources and the article entitlement credential reserved resources are less than or equal to the total reserved resources; deducting the item entitlement credential reservation resource from the local reservation resource; and when the user meets the receiving condition, returning the article-available information to the user.
According to another aspect of the present disclosure, there is also provided an article entitlement credential querying device, including: the system comprises a certificate inquiry module, a first feedback module and a second feedback module;
the certificate inquiry module receives an article right certificate inquiry request sent by a user, wherein the article right certificate inquiry request comprises an article right certificate reserved resource;
the first feedback module deducts the article right certificate reserved resource from the local reserved resource when the article right certificate reserved resource is smaller than or equal to the local reserved resource, and returns article collar information to a user;
and the second feedback module is used for updating the local reserved resource, deducting the article right certificate reserved resource from the local reserved resource and returning article collar information to a user when the article right certificate reserved resource is larger than the local reserved resource and is smaller than or equal to the total reserved resource.
According to another aspect of the present disclosure, there is also provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the article entitlement credential querying methods described above via execution of the executable instructions.
According to another aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the article rights credential querying method of any of the above.
The article right voucher method, the apparatus, the electronic device and the computer readable storage medium provided by the embodiments of the present disclosure receive an article right voucher inquiry request including an article right voucher reserved resource sent by a user, and deduct the article right voucher reserved resource from the local reserved resource when the article right voucher reserved resource is less than or equal to the local reserved resource, and return article collar information to the user; when the reserved resource of the article right certificate is larger than the local reserved resource and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, the local cluster node acquires the reserved resource from the total reserved resource of redis, updates the local reserved resource, deducts the reserved resource of the article right certificate from the local reserved resource, and returns article collar information to the user; the article right voucher inquiry request is processed through the plurality of local cluster nodes in parallel, the reserved resources of the article right voucher are deducted under a certain condition, a high concurrency scene can be supported, budget is controlled accurately, and the article right voucher can be inquired.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 illustrates a flow chart of a method for querying an article entitlement credential in an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of a method for local reservation resource update in an embodiment of the present disclosure;
FIG. 3 illustrates a flow chart of a method for determining updated reserved resources in an embodiment of the disclosure;
FIG. 4 illustrates a flow chart of a method for article-of-collar information feedback in an embodiment of the present disclosure;
FIG. 5 illustrates a flow chart of a reserved resource adjustment method in an embodiment of the present disclosure;
FIG. 6 illustrates a flow chart of a reserved resource release method in an embodiment of the present disclosure;
FIG. 7 illustrates a flowchart of yet another method for querying article entitlement credentials in an embodiment of the present disclosure;
FIG. 8 illustrates a schematic diagram of an article entitlement credential querying device in an embodiment of the present disclosure;
FIG. 9 illustrates a schematic diagram of an exemplary system architecture of an article rights credential querying method or article rights credential querying device that may be applied to embodiments of the present disclosure; and
fig. 10 shows a block diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
The present exemplary embodiment will be described in detail below with reference to the accompanying drawings and examples.
First, in the embodiments of the present disclosure, a method for querying an article entitlement credential is provided, which may be executed by any electronic device having computing processing capabilities.
Fig. 1 shows a flowchart of an article right certificate querying method in an embodiment of the disclosure, and as shown in fig. 1, the article right certificate querying method provided in the embodiment of the disclosure includes the following steps:
s102, receiving an article right certificate query request sent by a user, wherein the article right certificate query request comprises an article right certificate reserved resource.
The article right certificate is a certificate for proving the article right; the article entitlement credentials include, but are not limited to: coupons, red packs, electronic vouchers for items, and the like; the article electronic certificate is a two-dimensional code corresponding to the article, and information such as article preferential and the like can be determined by scanning the two-dimensional code.
In one embodiment, reserved resources include, but are not limited to: amount and quantity; for example, when the reserved resource is the amount, the reserved resource of the article right certificate is N element, the reserved resource of the local is M, when N is less than or equal to M, the reserved resource of the local after deducting the reserved resource of the article right certificate is M-N, and the article collar information is returned to the user; when the reserved resources are the quantity, the reserved resources of the article right certificates are E, the reserved resources of the local reserved resources are F, when E is smaller than or equal to F, the reserved resources of the local reserved resources after deducting the reserved resources of the article right certificates are F-E, and article collar information is returned to the user.
S104, when the reserved resource of the article right certificate is smaller than or equal to the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally, and returning the article collar information to the user.
The local reserved resource is reserved resource corresponding to each local cluster node; the item availability information is feedback information returned to the user that may be used to obtain the item rights, e.g., available coupons, red packs, etc.
In one embodiment, whether the local reserved resources are sufficient is firstly inquired, if the reserved resources of the article right certificate are smaller than or equal to the local reserved resources, the local reserved resources are characterized to be sufficient, the reserved resources of the article right certificate are deducted from the local reserved resources, and article collar information is returned to the user.
And S106, when the reserved resource of the article right certificate is larger than the reserved resource locally and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, updating the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally and returning article collar information to the user.
The total reserved resources are resources which can be controlled by users, when the local reserved resources are insufficient, the reserved resources can be acquired from the redis total reserved resources, and then the reserved resources acquired from the local reserved resources are deducted from the total reserved resources; for example, the total reserved resource is W, the local reserved resource is V, the local resource is insufficient, the reserved resource X is obtained from the total reserved resource, the local reserved resource is v+x, and the total reserved resource is W-X.
In one embodiment, firstly, whether the local reserved resources are sufficient is inquired, if the reserved resources of the article entitlement certificate are larger than the local reserved resources, the local reserved resources are insufficient, then whether the total reserved resources are sufficient is inquired, if the total reserved resources are insufficient, article unclonable information is returned to the user, and the unclean information is sent to the local cluster node.
The non-updated information is information for marking that the local reserved resources are exhausted and not updated, and when the local cluster node receives the non-updated information and receives an article right certificate inquiry request containing the article right certificate reserved resources again, the non-updated information is directly returned to the article non-collar information, namely the feedback information of the article right cannot be acquired.
In one embodiment, the local cluster node receives the non-updated information, so as not to inquire whether the local reserved resources are sufficient or not, and directly returns the article non-collar information; when the local cluster node does not receive the non-update information, whether the local reserved resources are sufficient or not, namely whether the reserved resources of the article entitlement certificate are larger than the local reserved resources or not needs to be judged.
In one embodiment, when the article entitlement credential reserved resource is greater than the local reserved resource and the article entitlement credential reserved resource is less than or equal to the total reserved resource, determining an updated reserved resource according to the total reserved resource, the local cluster number, or the local reserved resource, the updated reserved resource being a resource acquired by the local cluster node from the total reserved resource, wherein the updated reserved resource is greater than or equal to the article entitlement credential reserved resource; and updating the local reserved resources according to the updated reserved resources.
In the above embodiment, the article entitlement certificate query request is processed through the plurality of local cluster nodes in parallel, the article non-collar information or the article collar information is returned, a high concurrency scene can be supported, the budget is accurately controlled, the article entitlement certificate collar query performance is improved, and the accuracy of reserved resource control is improved through the local reserved resource scheduling service.
Fig. 2 shows a flowchart of a method for updating local reserved resources in an embodiment of the present disclosure, and as shown in fig. 2, the method for updating local reserved resources provided in the embodiment of the present disclosure includes the following steps:
s202, when the reserved resource of the article right certificate is larger than the reserved resource locally and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, acquiring the total reserved resource, the number of local clusters or the reserved resource locally;
s204, determining updated reserved resources according to the total reserved resources, the number of local clusters or the local reserved resources, wherein the updated reserved resources are larger than or equal to the reserved resources of the article entitlement certificate.
Fig. 3 shows a flowchart of a method for determining updated reserved resources in an embodiment of the present disclosure, and as shown in fig. 3, the method for determining updated reserved resources provided in the embodiment of the present disclosure includes the following steps:
S302, obtaining local reserved resource data of a plurality of local cluster nodes;
the local reserved resource data includes, but is not limited to: the size of the local reserved resource, the time of deducting the article right certificate reserved resource by the last local cluster node, and the like;
s304, a local reserved resource value corresponding to the local cluster node with the largest local reserved resource is obtained, and whether the local reserved resource value is larger than or equal to the reserved resource of the article entitlement certificate is judged.
S306, if so, sorting the local cluster nodes according to the local reserved resource data to generate a cluster set, selecting one local cluster node from the cluster set, and deducting the article entitlement certificate reserved resource through the cluster node.
S308, if not, updating the local reserved resources corresponding to one or more local cluster nodes, and repeating the steps; the updated local reserved resources corresponding to the one or more local cluster nodes are greater than or equal to the reserved resources of the article entitlement certificate.
In one embodiment, the updated reserved resources= (total reserved resources×pre-emption factor)/number of local clusters, the updated local reserved resources are the sum of the original reserved resources and the updated reserved resources.
In one embodiment, the updated reserved resources= (total reserved resources + original reserved resources sum) ×the preemption factor/the number of local clusters, and the updated local reserved resources are updated reserved resources.
It should be noted that, the preemption factor may be set manually as required, or may be set automatically according to historical data.
In one embodiment, the local reserved resources corresponding to the plurality of local cluster nodes may be updated one or more times until the local reserved resources corresponding to the one or more local cluster nodes are greater than or equal to the article entitlement credential reserved resources.
In one embodiment, a local reserved resource size corresponding to a target local cluster node is obtained, updated reserved resources are calculated according to the article entitlement certificate reserved resources, and updated reserved resources are deducted from the total reserved resources, wherein the updated reserved resources are the difference between the article entitlement certificate reserved resources and the target local reserved resource size.
In one embodiment, the local cluster node with the largest local reserved resource can be selected as the target local cluster node; the local cluster node with the lowest update frequency can be selected as the target local cluster node; it should be noted that, the update frequency may be a ratio of the number of times the article entitlement certificate is deducted from the reserved resource within a fixed time range and the fixed time.
S206, updating the local reserved resources according to the updated reserved resources.
In one embodiment, the local reserved resources are updated according to the determined updated reserved resources, and the item entitlement credential reserved resources are deducted from the local reserved resources.
In the above embodiment, the reserved resources are determined to be updated according to the total reserved resources, the number of local clusters or the local reserved resources, and the local reserved resources are dynamically adjusted by the service level, so that the reserved resources can be controlled more accurately, and the article entitlement certificate can be queried in a high concurrency scene.
Fig. 4 shows a flowchart of an article collar information feedback method in an embodiment of the present disclosure, and as shown in fig. 4, the article collar information feedback method provided in the embodiment of the present disclosure includes the following steps:
s402, when the reserved resource of the article right certificate is larger than the reserved resource locally and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, updating the reserved resource locally;
in one embodiment, total reserved resources, local cluster number, or local reserved resources are acquired; and determining updated reserved resources according to the total reserved resources, the number of local clusters or the local reserved resources, wherein the updated reserved resources are larger than or equal to the reserved resources of the article entitlement certificate.
In one embodiment, the local reserved resources corresponding to one or more local cluster nodes are updated.
S404, deducting the reserved resource of the article right certificate from the reserved resource when the reserved resource of the article right certificate is smaller than or equal to the reserved resource;
in one embodiment, the cluster set includes a plurality of local cluster nodes, a local cluster node having a local reserved resource greater than or equal to the article entitlement credential reserved resource is obtained from the local cluster nodes, and the article entitlement credential reserved resource is deducted from the local reserved resource.
S406, when the user meets the receiving condition, the item available information is returned to the user.
In one embodiment, the pickup condition includes, but is not limited to, the user being a member, amount information, pickup time information, and the like.
In the above embodiment, if a request of a certain hot key arrives at the server host, the request amount is particularly large, which may cause insufficient host resources and even downtime, so as to affect normal service.
Fig. 5 shows a flowchart of a reserved resource adjustment method in an embodiment of the present disclosure, and as shown in fig. 5, the reserved resource adjustment method provided in the embodiment of the present disclosure includes the following steps:
s502, local preemption distribution information of a plurality of local cluster nodes is obtained.
In one embodiment, the local preemption distribution information includes, but is not limited to: the update frequency can be the ratio of the number of times of deducting the reserved resources of the article right certificate in a fixed time range and the fixed time.
S504, according to the local pre-occupation distribution information, the local reserved resources are adjusted.
For example, when the update frequency of one or more local cluster nodes is obtained to be low, corresponding local reserved resources of the local cluster nodes can be increased; when the updated local reserved resources of one or more local cluster nodes exceed a resource threshold value within a certain time, the corresponding local reserved resources of the local cluster nodes are reduced; the manner of adjusting the local reserved resources can be set according to the needs, for example, adding or subtracting fixed reserved resources, adding or subtracting reserved resources with a certain proportion, and the comparison is not limited.
S506, the number of the local cluster nodes is adjusted according to the local pre-occupation distribution information.
In one embodiment, when it is determined that the amount of the article right voucher query request received and processed by the local cluster node within a certain time exceeds a first threshold according to the local preemption distribution information, the local cluster node is characterized that the load capacity is too large, and the number of the local cluster nodes is increased; when the local cluster node receives the article right certificate query request amount processed within a certain time according to the local pre-occupation distribution information, and the article right certificate query request amount is smaller than a second threshold value, the characterization access amount is too small, and part of local cluster nodes can be suspended from processing the article right certificate query request, so that resources are saved.
In the embodiment, the number of the local cluster nodes can be increased, and higher concurrency is supported in a transverse expansion mode, so that the method is more flexible; according to the local pre-occupation distribution information, local reserved resources are adjusted, budget is accurately controlled, and the condition that the article entitlement certificate is missed is avoided.
Fig. 6 shows a flowchart of a method for releasing reserved resources in an embodiment of the present disclosure, and as shown in fig. 6, the method for releasing reserved resources provided in the embodiment of the present disclosure includes the following steps:
s602, receiving an article right certificate acquisition request sent by a user, wherein the article right certificate acquisition request comprises an article right certificate reserved resource;
S604, when the total reserved resources are successfully deducted from the article entitlement voucher reserved resources, issuing the article entitlement voucher to the user;
s606, judging whether the order generated according to the article right voucher is successfully paid;
for example, when the article entitlement voucher is a coupon, the user receives the coupon, generates an order using the coupon, the local cluster node receives the coupon order, camps on the coupon, the user pays the order, and sends information of successful payment or failure payment to the local cluster node.
S608, if yes, the preemption is released, and the real article right certificate inventory is directly deducted;
s610, otherwise, cancel the order, and release the preemption.
In the above embodiment, when the article right voucher is inquired to be retrievable, the redis total reserved resource successfully deducts the article right voucher reserved resource, issues the article right voucher to the user, clicks the article right voucher to be retrieved by the user, and successfully pays the order corresponding to the article right voucher, directly deducts the real article right voucher inventory, and can accurately control the pre-occupied resource.
Fig. 7 shows a flowchart of yet another method for querying an article right certificate according to an embodiment of the present disclosure, as shown in fig. 7, where the method for querying an article right certificate provided in an embodiment of the present disclosure includes the following steps:
S702, inquiring whether the local reserved resources are sufficient;
in one embodiment, querying whether the coupon local reserved resources, the red packet local reserved resources or the article electronic voucher local reserved resources are sufficient; for example, after the user enters the coupon center, the system queries whether the coupon local reserved resources are sufficient; the manager scans the two-dimensional code corresponding to the electronic certificate of the article and inquires whether the local reserved resource corresponding to the two-dimensional code is sufficient.
And S704, if the local reserved resources are sufficient, deducting the local reserved resources, and returning the current article right certificate to the user through other retrieval limiting rules to be retrieved.
S706, if the local reserved resources are insufficient and updatable, inquiring whether the redis total reserved resources are sufficient, if the redis total reserved resources are sufficient, calculating the pre-occupied reserved resources according to the pre-occupied strategy of the reserved resources, updating to the local reserved resources, deducting the local reserved resources for subsequent release, if the redis total reserved resources are insufficient, exhausting the reserved resources, marking that the local reserved resources are exhausted and are not updatable, and returning the current article entitlement certificate to be not available.
In one embodiment, the calculation formula for camping on reserved resources is as follows:
pre-occupying reserved resources= (redistotal reserved resources x pre-occupying factor)/number of local cluster nodes;
s708, when the uneven distribution of the local reserved resources is monitored, the number of the local reserved resources or the local cluster nodes is adjusted.
In one embodiment, the manner of locally reserving resources is used, and the cluster lateral expansion can also be supported, when the access quantity is increased, the added machine can also play a role in protecting redis, and can also support larger concurrency quantity.
In one embodiment, when the traffic of the local cluster nodes is uneven, the situation of uneven distribution of the local reserved resources occurs, which results in the occurrence of a situation of less coupons and affects the business effect.
In the above embodiment, the problem of performance bottleneck caused by redishot key of reserved resource control in a high concurrency scene is solved, the collapsable query performance is improved, the transverse expansion can be supported, the reserved resource is dynamically adjusted according to the service level, and the reserved resource can be controlled more accurately.
Based on the same inventive concept, the embodiments of the present disclosure also provide an article right certificate inquiry device, as follows. Since the principle of solving the problem of the embodiment of the device is similar to that of the embodiment of the method, the implementation of the embodiment of the device can be referred to the implementation of the embodiment of the method, and the repetition is omitted.
Fig. 8 is a schematic diagram of an article right certificate querying device according to an embodiment of the disclosure, as shown in fig. 8, the article right certificate querying device 8 includes: a credential query module 801, a first feedback module 802, and a second feedback module 803;
the credential inquiry module 801 receives an article right credential inquiry request sent by a user, where the article right credential inquiry request includes an article right credential reserved resource;
the first feedback module 802 deducts the article entitlement credential reserved resource from the local reserved resource when the article entitlement credential reserved resource is less than or equal to the local reserved resource, and returns article-collapsibility information to the user;
and a second feedback module 803, when the reserved resource of the article right certificate is larger than the reserved resource locally and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, updating the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally, and returning the article collar information to the user.
In the above embodiment, the article entitlement and credential inquiry request is processed by the plurality of local cluster nodes in parallel, and the reserved resource of the article entitlement and credential is deducted under a certain condition, so that a high concurrency scene can be supported, the budget is controlled accurately, the retrievable inquiry performance of the article entitlement and credential is improved, and the problem that the redis hot spot is caused by limited concurrency supported in the related technology is solved, thereby causing the problem that the redis service is not available.
Fig. 9 shows a schematic diagram of an exemplary system architecture of an article entitlement credential querying method or article entitlement credential querying device that may be applied to embodiments of the present disclosure.
As shown in fig. 9, system architecture 900 may include terminal devices 901, 902, 903, a network 904, and a server 905.
The network 904 may be a wired network or a wireless network, and is the medium used to provide communications links between the terminal devices 901, 902, 903 and the server 905.
Alternatively, the wireless network or wired network described above uses standard communication techniques and/or protocols. The network is typically the Internet, but may be any network including, but not limited to, a local area network (Local Area Network, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), mobile, wired or wireless network, private network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible MarkupLanguage, XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as secure sockets layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet protocol security (Internet ProtocolSecurity, IPsec), etc. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
The terminal devices 901, 902, 903 may be a variety of electronic devices including, but not limited to, smartphones, tablets, laptop portable computers, desktop computers, and the like.
Alternatively, the clients of the applications installed in the different terminal devices 901, 902, 903 are the same or clients of the same type of application based on different operating systems. The specific form of the application client may also be different based on the different terminal platforms, for example, the application client may be a mobile phone client, a PC client, etc.
The server 905 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal apparatuses 901, 902, 903. The background management server may analyze and process the received data, such as the request for inquiring the article right certificate or the request for picking up the article right certificate, and feed back the processing result to the terminal device.
Optionally, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
Those skilled in the art will appreciate that the number of terminal devices, networks, and servers in fig. 9 is merely illustrative, and that any number of terminal devices, networks, and servers may be provided as desired. The embodiments of the present disclosure are not limited in this regard.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 1000 according to such an embodiment of the present disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is merely an example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 10, the electronic device 1000 is embodied in the form of a general purpose computing device. Components of electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one memory unit 1020, and a bus 1030 that connects the various system components, including the memory unit 1020 and the processing unit 1010.
Wherein the storage unit stores program code that is executable by the processing unit 1010 such that the processing unit 1010 performs steps according to various exemplary embodiments of the present disclosure described in the above section of the present specification.
For example, the processing unit 1010 may perform the following steps of the method embodiment described above: receiving an article right voucher inquiry request sent by a user, wherein the article right voucher inquiry request comprises article right voucher reserved resources; when the reserved resource of the article right certificate is smaller than or equal to the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally, and returning article collar information to the user; when the reserved resource of the article right certificate is larger than the reserved resource locally and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, the reserved resource locally is updated, the reserved resource of the article right certificate is deducted from the reserved resource locally, and article collar information is returned to the user.
For example, the processing unit 1010 may perform the following steps of the method embodiment described above: when the flow of the local cluster nodes is uneven, the situation of uneven distribution of the local reserved resources can occur, the situation of less coupons occurs, and the business effect is affected.
The memory unit 1020 may include readable media in the form of volatile memory units such as Random Access Memory (RAM) 10201 and/or cache memory unit 10202, and may further include Read Only Memory (ROM) 10203.
The storage unit 1020 may also include a program/utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 1030 may be representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1000 can also communicate with one or more external devices 1040 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any device (e.g., router, modem, etc.) that enables the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1050. Also, electronic device 1000 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 over the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with the electronic device 1000, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium, which may be a readable signal medium or a readable storage medium, is also provided. On which a program product is stored which enables the implementation of the method described above of the present disclosure. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
For example, a program product in an embodiment of the disclosure, when executed by a processor, performs a method of: receiving an article right voucher inquiry request sent by a user, wherein the article right voucher inquiry request comprises article right voucher reserved resources; when the reserved resource of the article right certificate is smaller than or equal to the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally, and returning article collar information to the user; when the reserved resource of the article right certificate is larger than the reserved resource locally and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, the reserved resource locally is updated, the reserved resource of the article right certificate is deducted from the reserved resource locally, and article collar information is returned to the user.
For example, a program product in an embodiment of the disclosure, when executed by a processor, performs a method of: the mode of locally reserving resources is used, the cluster can also be supported to be expanded transversely, when the access quantity is increased, the added machine can also play a role in protecting redis, and larger concurrency quantity can also be supported.
More specific examples of the computer readable storage medium in the present disclosure may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In this disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Alternatively, the program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, the program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the description of the above embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims (10)
1. A method for querying an article entitlement credential, comprising:
receiving an article right voucher inquiry request sent by a user, wherein the article right voucher inquiry request comprises an article right voucher reserved resource;
when the reserved resource of the article right certificate is smaller than or equal to the reserved resource locally, deducting the reserved resource of the article right certificate from the reserved resource locally, and returning article collar information to the user;
and when the reserved resource of the article right certificate is larger than the local reserved resource and the reserved resource of the article right certificate is smaller than or equal to the total reserved resource, updating the local reserved resource, deducting the reserved resource of the article right certificate from the local reserved resource, and returning article collar information to the user.
2. The method of claim 1, wherein updating the local reserved resources when the article right voucher reserved resources are greater than the local reserved resources and the article right voucher reserved resources are less than or equal to the total reserved resources, deducting the article right voucher reserved resources from the local reserved resources, and returning article collar information to the user comprises:
when the article entitlement credential reserved resource is greater than the local reserved resource and the article entitlement credential reserved resource is less than or equal to a total reserved resource, determining an updated reserved resource according to the total reserved resource, the local cluster number, or the local reserved resource, wherein the updated reserved resource is greater than or equal to the article entitlement credential reserved resource;
and updating the local reserved resources according to the updated reserved resources.
3. The method of claim 2, further comprising:
obtaining local preemption distribution information of a plurality of local cluster nodes, wherein the local preemption distribution information comprises: the local reserved resources and the updated reserved resources;
And adjusting the number of the local reserved resources or the local cluster nodes according to the local pre-occupation distribution information.
4. The method of claim 1, further comprising:
and when the reserved resource of the article right certificate is larger than the total reserved resource, returning article non-collar information to the user, and sending non-update information to the local cluster node.
5. The method of claim 4, further comprising:
and when the non-updated information is not received, judging whether the reserved resource of the article entitlement certificate is larger than the local reserved resource.
6. The method of claim 1, further comprising:
receiving an article right voucher obtaining request sent by a user, wherein the article right voucher obtaining request comprises article right voucher reserved resources;
and issuing an article entitlement voucher to the user when the total reserved resources are successfully deducted from the article entitlement voucher reserved resources.
7. The method of claim 1, wherein updating the local reserved resources when the article right voucher reserved resources are greater than the local reserved resources and the article right voucher reserved resources are less than or equal to the total reserved resources, deducting the article right voucher reserved resources from the local reserved resources, and returning article collar information to the user comprises:
Updating the local reserved resources when the article entitlement credential reserved resources are greater than the local reserved resources and the article entitlement credential reserved resources are less than or equal to the total reserved resources;
deducting the item entitlement credential reservation resource from the local reservation resource;
and when the user meets the receiving condition, returning the article-available information to the user.
8. An article entitlement credential querying device, comprising:
the certificate inquiry module receives an article right certificate inquiry request sent by a user, wherein the article right certificate inquiry request comprises an article right certificate reserved resource;
the first feedback module deducts the article right certificate reserved resource from the local reserved resource when the article right certificate reserved resource is smaller than or equal to the local reserved resource, and returns article collar information to a user;
and the second feedback module is used for updating the local reserved resource, deducting the article right certificate reserved resource from the local reserved resource and returning article collar information to a user when the article right certificate reserved resource is larger than the local reserved resource and is smaller than or equal to the total reserved resource.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the article entitlement credential querying method of any of claims 1-7 via execution of the executable instructions.
10. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the article entitlement credential querying method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311001779.4A CN117035858A (en) | 2023-08-09 | 2023-08-09 | Article entitlement certificate method, apparatus, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311001779.4A CN117035858A (en) | 2023-08-09 | 2023-08-09 | Article entitlement certificate method, apparatus, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117035858A true CN117035858A (en) | 2023-11-10 |
Family
ID=88625792
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311001779.4A Pending CN117035858A (en) | 2023-08-09 | 2023-08-09 | Article entitlement certificate method, apparatus, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117035858A (en) |
-
2023
- 2023-08-09 CN CN202311001779.4A patent/CN117035858A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112292704B (en) | Transaction processing | |
CN108305072B (en) | Method, apparatus, and computer storage medium for deploying a blockchain network | |
US9996464B2 (en) | Metadata cache management | |
CN108156236A (en) | Service request processing method, device, computer equipment and storage medium | |
CN1953393B (en) | Software installation within a federation | |
CN113657900A (en) | Cross-chain transaction verification method and system and cross-chain transaction system | |
CN109104368B (en) | Connection request method, device, server and computer readable storage medium | |
JP2024505692A (en) | Data processing methods, devices and computer equipment based on blockchain networks | |
CN111427701A (en) | Workflow engine system and business processing method | |
CN111460129A (en) | Method and device for generating identification, electronic equipment and storage medium | |
US20160352843A1 (en) | Data Processing Method, Device, and ESB System | |
CN111885190B (en) | Service request processing method and system | |
US11178197B2 (en) | Idempotent processing of data streams | |
US8756320B2 (en) | Web service grid architecture | |
CN111343220A (en) | Transponder, distributed file transmission method, system, medium and electronic equipment | |
US20200153749A1 (en) | Biased selection of dedicated physical connections to provider network | |
EP1936497A2 (en) | Automated wide area software distribution with reduced network bandwidth requirements | |
CN117035858A (en) | Article entitlement certificate method, apparatus, electronic device and storage medium | |
CN111865576B (en) | Method and device for synchronizing URL classification data | |
CN115509744A (en) | Container distribution method, system, device, equipment and storage medium | |
CN114169863A (en) | Signing method, signing device, electronic equipment and computer readable medium | |
KR102059807B1 (en) | Technique for memory management on service oriented architecture | |
CN112101907A (en) | Method and system for handling accumulation fund service on line | |
CN111984616A (en) | Method, device and system for updating shared file | |
CN111797169A (en) | Data storage method, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |