Activity resource issuing method and device, equipment, medium and program product
Through distributed inventory management and database sharding technology, the performance bottlenecks and misrecord problems of traditional database inventory management in high concurrency scenarios are solved, and efficient prize distribution and reconciliation processes are realized, improving system stability and customer experience.
Patent Information
- Application Number
- CN202411888090.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-14
AI Technical Summary
Under the pressure of high concurrent requests, traditional database storage inventory forms are prone to performance bottlenecks, unable to efficiently realize distribution capabilities, and may even cause system crashes, and prone to misrepresentation, resulting in poor customer experience.
A distributed inventory management solution is adopted to store inventory information on multiple nodes, combine database sharding technology to improve query efficiency and concurrent processing capabilities, and propose an automated reconciliation algorithm process to ensure the accuracy and efficiency of prize distribution and reconciliation.
It solves the performance bottleneck caused by downlink locks in traditional database management inventory solutions, improves the stability and efficiency of the system in high concurrency scenarios, ensures that customers can receive activity prizes efficiently and stably, and improves the reconciliation efficiency and customer experience through automated reconciliation processes.
Smart Images

Figure CN119624537A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of distributed technology, specifically to the field of high-concurrency data processing technology, and more specifically to an activity resource distribution method, device, equipment, medium and program product. Background Art
[0002] With the development of marketing activities of various financial institutions, marketing organizations have various forms, such as consumer voucher activities to promote consumption, participation activities to guide customers to experience new functions and new systems, and sign-in activities to guide customers to continue to pay attention to the app. By configuring a series of rewards, customers' enthusiasm for participating in activities is greatly aroused, which has played a good role in system ecological construction and traffic diversion. However, while a wide range of operational activities promote traffic diversion, the system often also bears a relatively large request pressure. Under this high concurrent request pressure, on the one hand, the traditional database storage inventory form is prone to performance bottlenecks, unable to efficiently realize the distribution capability, and even easy to cause system crashes; on the other hand, under high concurrency, it is easy to have wrong accounts, causing customer complaints or poor experience. Therefore, there is an urgent need for a set of prize distribution and reconciliation mechanisms suitable for high-concurrency scenarios to ensure that customers can finally receive the event prizes in an efficient and stable manner.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a method, apparatus, device, medium and program product for issuing activity resources.
[0005] According to a first aspect of the present disclosure, a method for distributing activity resources is provided, comprising:
[0006] In response to an activity participation operation initiated by a user, obtaining user information and an activity identifier;
[0007] After verifying the user information, determine the activity participation result of the current user;
[0008] Perform distributed inventory data query and deduction according to the activity participation results, and generate a deduction details table;
[0009] Calling the corresponding service interface according to the activity identifier to perform the activity resource dispatch operation, and generating the activity resource dispatch detailed table according to the dispatch result; and
[0010] Reconciliation and account replenishment operations are performed according to the deduction details table and the activity resource dispatch details table.
[0011] According to an embodiment of the present disclosure, performing distributed inventory data query deduction according to the activity participation result and generating a deduction detail table includes:
[0012] Query distributed inventory data based on user information and activity identifiers;
[0013] If it is determined that the remaining amount of the distributed inventory is greater than or equal to the preset threshold, a deduction operation is performed; or
[0014] If it is determined that the distributed inventory remaining amount is less than the preset threshold, the activity participation result is modified.
[0015] According to an embodiment of the present disclosure, querying distributed inventory data according to user information and activity identifiers includes:
[0016] Determine the activity resource database according to the activity identifier;
[0017] Determine the corresponding database shard after performing a hash operation on the user information; and
[0018] Query database shard data.
[0019] According to an embodiment of the present disclosure, the reconciliation and account replenishment operation according to the deduction details table and the activity resource dispatch details table includes:
[0020] If it is determined according to the activity resource dispatching details table that the activity resource dispatching fails, then the activity resource reissuing operation is initiated;
[0021] If it is determined based on the activity participation results details table and the activity resource dispatch details table that the activity resources have not been dispatched, a reconciliation and account replenishment operation is performed.
[0022] According to an embodiment of the present disclosure, the account reconciliation and account replenishment operation includes:
[0023] Sorting the activity participation result detailed list and the activity resource dispatch detailed list in ascending order according to the activity resource identifier;
[0024] Take n records from the activity participation result detail table and record the minimum and maximum values of these n records, where n is an integer greater than 0;
[0025] Get the data volume m in the activity resource dispatch details table based on the minimum and maximum values as query conditions;
[0026] If it is determined that m is not equal to n, it indicates that there is a discrepancy in the data, so m and n are recorded for further data verification later;
[0027] Repeat the above verification steps, perform a second detailed comparison on the intervals with differences in the records, and determine the difference data to perform the activity resource reissue operation.
[0028] According to an embodiment of the present disclosure, the method further includes:
[0029] The distributed inventory data is synchronized to the database inventory component at regular intervals, and the database inventory component is a backup component of the distributed inventory component.
[0030] A second aspect of the present disclosure provides an activity resource distribution device, comprising:
[0031] An acquisition module, used to respond to an activity participation operation initiated by a user and acquire user information and an activity identifier;
[0032] A determination module is used to determine the activity participation result of the current user after verifying the user information;
[0033] A data query module, used to query and deduct distributed inventory data according to the activity participation results, and generate a deduction detail list;
[0034] A resource dispatching module, used to call a corresponding service interface according to an activity identifier to perform an activity resource dispatching operation, and generate an activity resource dispatching detailed list according to the dispatching result; and
[0035] The reconciliation module is used to perform reconciliation and replenishment operations according to the deduction details list and the activity resource dispatch details list.
[0036] According to an embodiment of the present disclosure, the data query module includes: a first determination submodule, a second determination submodule and a third determination submodule.
[0037] A first determination submodule is used to query distributed inventory data according to user information and activity identifier;
[0038] A second determination submodule is configured to perform a deduction operation if it is determined that the remaining amount of the distributed inventory is greater than or equal to a preset threshold; or
[0039] The third determination submodule is used to modify the activity participation result if it is determined that the distributed inventory remaining amount is less than a preset threshold.
[0040] According to an embodiment of the present disclosure, the first determining submodule includes a first determining unit, a second determining unit and a query unit.
[0041] A first determining unit, configured to determine an activity resource database according to an activity identifier;
[0042] A second determining unit, configured to determine a corresponding database shard after performing a hash operation on the user information; and
[0043] Query unit, used to query database shard data.
[0044] According to an embodiment of the present disclosure, the reconciliation module includes a fourth determination submodule and a reconciliation submodule.
[0045] A fourth determination submodule is used to start an activity resource reissue operation if it is determined according to the activity resource dispatching detailed table that the activity resource dispatching fails;
[0046] The reconciliation submodule is used to perform reconciliation and replenishment operations if it is determined based on the activity participation result details table and the activity resource dispatch details table that the activity resources have not been dispatched.
[0047] According to an embodiment of the present disclosure, the reconciliation submodule includes: a sorting unit, a first recording unit, an acquisition unit, a second recording unit and a reissue unit.
[0048] A sorting unit, used to sort the activity participation result detailed list and the activity resource dispatch detailed list in ascending order according to the activity resource identifier;
[0049] The first recording unit is used to take n records from the activity participation result detailed table and record the minimum and maximum values of the n records, where n is an integer greater than 0;
[0050] An acquisition unit is used to acquire the data volume m in the activity resource dispatch details table according to the minimum value and the maximum value as query conditions;
[0051] The second recording unit is used to record m and n if it is determined that m is not equal to n, indicating that there is a difference in the data, and to keep them for further data verification later;
[0052] The reissue unit is used to repeat the above-mentioned checking steps, perform a second detailed comparison on the intervals with differences in the records, and determine the difference data to perform the reissue operation of the activity resources.
[0053] According to an embodiment of the present disclosure, the device further includes: a data synchronization module.
[0054] The data synchronization module is used to synchronize the distributed inventory data to the database inventory component at regular intervals. The database inventory component is a backup component of the distributed inventory component.
[0055] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0056] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.
[0057] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.
[0058] The activity resource distribution method provided by the embodiment of the present disclosure solves the performance bottleneck caused by row locks under the traditional database inventory management solution by adopting distributed inventory; by proposing an automated reconciliation algorithm process, the reconciliation efficiency is improved, and prizes are reissued to customers in a timely manner, thereby improving customer experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0060] Figure 1 A schematic diagram showing an application scenario of the activity resource distribution method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0061] Figure 2 The system architecture diagram of the activity resource distribution device according to the embodiment of the present disclosure is schematically shown;
[0062] Figure 3 A flowchart of a method for distributing activity resources according to an embodiment of the present disclosure is schematically shown;
[0063] Figure 4 A flowchart of a method for querying and deducting distributed inventory data according to the activity participation result according to an embodiment of the present disclosure is schematically shown;
[0064] Figure 5 One of the flowcharts of the method for reconciling and replenishing accounts according to the deduction details table and the activity resource dispatch details table according to an embodiment of the present disclosure is schematically shown;
[0065] Figure 6 A second flowchart of a method for performing reconciliation and replenishment operations according to the deduction details table and the activity resource dispatch details table according to an embodiment of the present disclosure is schematically shown;
[0066] Figure 7 A schematic diagram showing a structural block diagram of an activity resource distribution device according to an embodiment of the present disclosure; and
[0067] Figure 8 A block diagram of an electronic device suitable for implementing the activity resource distribution method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0068] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0069] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0070] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0071] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0072] First, the terms that appear in the embodiments of the present disclosure are explained:
[0073] Business activity system: refers to various types of marketing activity systems released by financial institutions through different channels. Customers who participate in the activities have the opportunity to win prizes such as lucky draws. This type of system is mainly used to attract customers and increase customer traffic.
[0074] Reconciliation: refers to the process of checking the allocated prize inventory with the actual number of prizes distributed to customers to ensure the accuracy of the accounts.
[0075] Distributed inventory solution: An inventory management method that distributes inventory information across multiple nodes to reduce the management pressure of a single node and improve system performance.
[0076] Database sharding: Split the database into multiple fragments, each of which stores a portion of data, to improve query efficiency and concurrent processing capabilities.
[0077] Batch: For processing tasks with large amounts of data, they can be carried out regularly through specific transactions, divided into daytime batches and nighttime batches.
[0078] Based on the above technical problems, an embodiment of the present disclosure provides an activity resource distribution method, the method comprising: in response to an activity participation operation initiated by a user, obtaining user information and activity identification; after verifying the user information, determining the activity participation result of the current user; performing distributed inventory data query deductions according to the activity participation results, and generating a deduction details list; calling a corresponding service interface according to the activity identification to perform an activity resource dispatch operation, and generating an activity resource dispatch details list according to the dispatch result; and performing reconciliation and account replenishment operations according to the deduction details list and the activity resource dispatch details list.
[0079] Figure 1 The application scenario diagram of the activity resource distribution method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.
[0080] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a large-scale server installation scenario. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0081] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0082] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0083] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0084] It should be noted that the activity resource distribution method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the activity resource distribution device provided in the embodiment of the present disclosure can generally be set in the server 105. The activity resource distribution method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the activity resource distribution device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0085] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements. Figure 1 The application scenarios shown are only examples of application scenarios and system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. It should be noted that the method and device for issuing activity resources determined in the present disclosure can be used in the financial field, and can also be used in any field other than the financial field, and the application field of the method and device for issuing activity resources determined in the present disclosure is not limited.
[0086] Figure 2 The following schematically shows the system architecture of the activity resource distribution device according to an embodiment of the present disclosure. Figure 2As shown, the system provided by the embodiment of the present disclosure includes a user lottery component, a distributed inventory management component, a database inventory management component, a prize distribution component and an automatic reconciliation component. Among them, the user lottery component is responsible for the lottery transactions initiated by the user, including user identity verification, winning probability calculation, etc.; distributed inventory management component: responsible for high-performance inventory management functions, including inventory query, deduction and distributed inventory scheduling, etc.; specifically, database sharding, according to the user information after hashing to access different database shards; during initialization, initialize different values for each shard according to the resource inventory average; also combined with local memory, each shard corresponding to the application server calculates the inventory amount n put into the memory each time according to the inventory amount and the number of application servers, and after the local memory is consumed, obtain n stocks from the local database again. Add the operation of returning inventory during graceful shutdown, and return the remaining inventory in the local memory to the database in scenarios such as container restart. Add a local memory inventory query and update interface to each application server; add an overall inventory scheduling node, which regularly queries the inventory in each database and readjusts the inventory in each shard; on the other hand, when the application server can no longer obtain the inventory from its corresponding shard database, it will obtain it from this node. This node will first query the remaining inventory from other shard databases. If it still does not meet the requirements, it will schedule from the memory of other application servers. Database inventory component: responsible for regularly synchronizing distributed inventory data, and used as a downgrade component when the distributed inventory component is unavailable; the prize distribution component is responsible for connecting with each coupon party, distributing resources directly to the customer account, and updating the corresponding detailed list; the automatic reconciliation component is responsible for sorting and comparing the missed data that may exist in multiple scenarios, and re-initiating the prize distribution action.
[0087] The following will be based on Figure 1 The scene described and Figure 2 The architecture shown, through Figure 3~Figure 5 The activity resource distribution method of the disclosed embodiment is described in detail.
[0088] Figure 3 The flowchart of the activity resource distribution method according to the embodiment of the present disclosure is schematically shown.
[0089] like Figure 3 As shown, the activity resource distribution method of this embodiment includes operations S210 to S240, and the transaction processing method can be executed by a server or other computing devices.
[0090] In operation S210 , in response to an activity participation operation initiated by a user, user information and an activity identifier are acquired.
[0091] In operation S220, after verifying the user information, the activity participation result of the current user is determined.
[0092] In one example, the activities in the disclosed embodiments may be, for example, voucher activities to promote consumption, participation activities to guide customers to experience new functions and new systems, sign-in activities to guide customers to continue to pay attention to the app, etc. Activity resources may be, for example, points, coupons or other prizes. When a user initiates a lottery action, the request message carries basic information about the user, basic information about the prizes drawn, etc. After the message enters the system, certain information verification and security control will be performed. The current customer is calculated based on the winning probability configured in the activity to determine whether he or she has won the prize, determine the current user's activity participation results, and record them in the activity participation results detailed table.
[0093] In operation S230, distributed inventory data query and deduction are performed according to the activity participation result, and a deduction detail list is generated.
[0094] According to the embodiment of the present disclosure, the distributed inventory data is synchronized to the database inventory component at regular intervals, and the database inventory component is a backup component of the distributed inventory component. The database inventory component is responsible for regularly synchronizing the distributed inventory data and is used as a downgrade component when the distributed inventory component is unavailable, thereby ensuring the high availability of the system.
[0095] In one example, the remaining inventory in the distributed inventory management component is obtained. If the inventory has been consumed, no subsequent operations are performed. However, even if there is inventory at this time, it does not mean that there will be inventory when the actual deduction is made. Because prizes are distributed at all times in high concurrency, it is possible that the inventory has been distributed at this time, and the actual status is changed to no prize. If there is still inventory, it will be deducted normally, and the deduction details table will be generated in an asynchronous form.
[0096] In operation S240, a corresponding service interface is called according to the activity identifier to perform an activity resource dispatch operation, and an activity resource dispatch detail table is generated according to the dispatch result.
[0097] In operation S250, a reconciliation and account replenishment operation is performed according to the deduction detail list and the activity resource dispatch detail list.
[0098] In one example, different activity types are used to call the interfaces of various parties (internal or third-party) to distribute the prizes, and the prizes are actually distributed to the corresponding accounts of customers. After the prizes are distributed, detailed registration is performed based on the distribution results, and a detailed list of activity resource distribution is generated for subsequent reconciliation and replenishment.
[0099] The activity resource distribution method provided by the embodiment of the present disclosure solves the performance bottleneck caused by row locks under the traditional database inventory management solution by adopting distributed inventory; by proposing an automated reconciliation algorithm process, the reconciliation efficiency is improved, and prizes are reissued to customers in a timely manner, thereby improving customer experience.
[0100] Figure 4A flowchart of a method for querying and deducting distributed inventory data according to the activity participation results according to an embodiment of the present disclosure is schematically shown.
[0101] like Figure 4 As shown, operation S230 includes operations S231 to S233.
[0102] In operation S231, the distributed inventory data is queried according to the user information and the activity identifier;
[0103] According to an embodiment of the present disclosure, an activity resource database is determined according to an activity identifier; a corresponding database shard is determined after a hash operation is performed according to user information; and database shard data is queried.
[0104] In one example, the corresponding activity resource database is determined according to the activity identifier. Specifically, due to the large number of activities, if each activity manages the inventory separately, the system coupling is too large. If the activity information is carried in the inventory management process, it is bound to cause the message body to increase in the transaction process and the interaction to be complicated. Therefore, the resource module is designed separately in the architecture design, decoupled from the activity gameplay, and the inventory of each resource is managed in the resource module. When creating an activity, it is sufficient to establish an association with the corresponding resource. The inventory data only contains the resource ID and the corresponding quantity, which makes management simpler. This system uses a distributed database to control inventory. While the distributed database increases the system support capability, it also brings management complexity. How to use the inventory of each shard evenly and finally distribute it all is the difficulty of distributed inventory management. Therefore, this system adds an overall inventory scheduling node. On the one hand, this node regularly queries the inventory in each database and readjusts the inventory in each shard.
[0105] In operation S232, if it is determined that the distributed inventory remaining amount is greater than or equal to the preset threshold, a deduction operation is performed.
[0106] In operation S233, if it is determined that the distributed inventory remaining amount is less than the preset threshold, the activity participation result is modified.
[0107] In one example, a hash operation is performed based on user information to access the corresponding database shard and query the database shard data. When the customer is determined to have won a prize, the inventory is deducted based on the remaining amount of the distributed inventory. In high concurrency situations, prizes are distributed all the time, so it is possible that the inventory has been distributed at this time. In this case, the user's activity participation result is modified, that is, the user's winning is changed to not winning. If there is still inventory, the normal deduction operation is performed.
[0108] Figure 5 One of the flowcharts of the method for performing reconciliation and replenishment operations according to the deduction details table and the activity resource dispatch details table according to an embodiment of the present disclosure is schematically shown. Figure 6The second flowchart of the method for reconciling and replenishing accounts according to the deduction details table and the activity resource dispatch details table according to an embodiment of the present disclosure is schematically shown.
[0109] like Figure 5 As shown, operation S250 includes operation S251 and operation S252.
[0110] In operation S251, if it is determined according to the activity resource dispatching details table that the activity resource dispatching fails, an activity resource reissuing operation is initiated.
[0111] In operation S252, if it is determined according to the activity participation result detail table and the activity resource dispatch detail table that the activity resources have not been dispatched, a reconciliation and account replenishment operation is performed.
[0112] In an example, customers need to be reissued in the following scenarios: (1) Data that is directly registered as failed in the activity resource dispatch details table; (2) Data that is in the deduction details table but not in the activity participation results details table; (3) Data that is in the activity participation results details table but not in the activity resource dispatch details table. Scenario (1) can be directly reissued, which is relatively simple. Scenarios (2) and (3) involve reconciliation of large amounts of data, which is relatively complex. Specifically, scenario (3) is used as an example to analyze the reconciliation and reissue process.
[0113] like Figure 6 The operation S252 shown includes operations S310 to S350.
[0114] In operation S310, the activity participation result detailed list and the activity resource dispatch detailed list are sorted in ascending order according to the activity resource identifiers.
[0115] In operation S320, n records are taken from the activity participation result detail table, and the minimum and maximum values of the n records are recorded, where n is an integer greater than 0;
[0116] In operation S330, the data volume m in the activity resource allocation details table is obtained according to the minimum value and the maximum value as query conditions.
[0117] In operation S340, if it is determined that m is not equal to n, it indicates that there is a difference in the data, and m and n are recorded for further data verification later.
[0118] In operation S350, the above-mentioned checking step is repeated to perform a secondary detailed comparison on the intervals with differences in the records, and the difference data is determined to perform an activity resource reissue operation.
[0119] In one example, since the amount of detailed data in both tables is very large, the efficiency of comparing the entire table or checking them one by one is too low. Considering that a large proportion of the detailed data in the two tables is consistent, the following algorithm flow is designed:
[0120] (1) The two tables are stored in ascending order according to the activity resource identifier (prize ID);
[0121] (2) Take n records from the activity participation result details table and record the minimum value min and maximum value max of these n records;
[0122] (3) Using min and max as query conditions in (2), obtain the data volume m in the activity resource dispatch details table. If m is equal to n, it indicates that there is no difference in the data within the interval. If m is not equal to n, it indicates that there is a difference in the data. Then record m and n for further data verification later.
[0123] (4) After the repeated verification of steps (2) and (3) is completed, a second detailed comparison is performed on the intervals with discrepancies in the records to find out the specific discrepant data and then reissue them.
[0124] The segment data with differences obtained according to the above reconciliation process is small in quantity, which avoids global one-to-one comparison and improves the reconciliation efficiency.
[0125] Based on the above activity resource distribution method, the present disclosure also provides an activity resource distribution device. Figure 7 The device is described in detail.
[0126] Figure 7 The structure block diagram of the activity resource distribution device according to the embodiment of the present disclosure is schematically shown.
[0127] like Figure 7 As shown, the activity resource distribution device 700 of this embodiment includes an acquisition module 710 , a determination module 720 , a data query module 730 , a resource dispatching module 740 and a reconciliation module 750 .
[0128] The acquisition module 710 is used to respond to the activity participation operation initiated by the user and acquire the user information and the activity identifier. In one embodiment, the acquisition module 710 can be used to perform the operation S210 described above, which will not be described in detail here.
[0129] The determination module 720 is used to determine the activity participation result of the current user after verifying the user information. In one embodiment, the determination module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0130] The data query module 730 is used to query the distributed inventory data for deduction according to the activity participation result and generate a deduction detail list. In one embodiment, the information extraction module 730 can be used to perform the operation S230 described above, which will not be described in detail here.
[0131] The resource dispatching module 740 is used to call the corresponding service interface according to the activity identifier to perform the activity resource dispatching operation, and generate the activity resource dispatching detailed table according to the dispatching result. In one embodiment, the resource dispatching module 740 can be used to perform the operation S240 described above, which will not be described in detail here.
[0132] The reconciliation module 750 is used to perform reconciliation and account replenishment operations according to the deduction details table and the activity resource dispatch details table. In one embodiment, the reconciliation module 750 can be used to perform the operation S250 described above, which will not be repeated here.
[0133] According to an embodiment of the present disclosure, the data query module includes: a first determination submodule, a second determination submodule and a third determination submodule.
[0134] A first determination submodule is used to query distributed inventory data according to user information and activity identifier;
[0135] A second determination submodule is configured to perform a deduction operation if it is determined that the remaining amount of the distributed inventory is greater than or equal to a preset threshold; or
[0136] The third determination submodule is used to modify the activity participation result if it is determined that the distributed inventory remaining amount is less than a preset threshold.
[0137] According to an embodiment of the present disclosure, the first determining submodule includes a first determining unit, a second determining unit and a query unit.
[0138] A first determining unit, configured to determine an activity resource database according to an activity identifier;
[0139] A second determining unit, configured to determine a corresponding database shard after performing a hash operation on the user information; and
[0140] Query unit, used to query database shard data.
[0141] According to an embodiment of the present disclosure, the reconciliation module includes a fourth determination submodule and a reconciliation submodule.
[0142] The fourth determining submodule is configured to start an activity resource reissuance operation if it is determined according to the activity resource dispatching detailed table that the activity resource dispatching fails.
[0143] The reconciliation submodule is used to perform reconciliation and replenishment operations if it is determined based on the activity participation result details table and the activity resource dispatch details table that the activity resources have not been dispatched.
[0144] According to an embodiment of the present disclosure, the reconciliation submodule includes: a sorting unit, a first recording unit, an acquisition unit, a second recording unit and a reissue unit.
[0145] A sorting unit, used to sort the activity participation result detailed list and the activity resource dispatch detailed list in ascending order according to the activity resource identifier;
[0146] The first recording unit is used to take n records from the activity participation result detailed table and record the minimum and maximum values of the n records, where n is an integer greater than 0;
[0147] An acquisition unit is used to acquire the data volume m in the activity resource dispatch details table according to the minimum value and the maximum value as query conditions;
[0148] The second recording unit is used to record m and n if it is determined that m is not equal to n, indicating that there is a difference in the data, and to keep them for further data verification later;
[0149] The reissue unit is used to repeat the above-mentioned checking steps, perform a second detailed comparison on the intervals with differences in the records, and determine the difference data to perform the reissue operation of the activity resources.
[0150] According to an embodiment of the present disclosure, the device further includes: a data synchronization module.
[0151] The data synchronization module is used to synchronize the distributed inventory data to the database inventory component at regular intervals. The database inventory component is a backup component of the distributed inventory component.
[0152] According to an embodiment of the present disclosure, any multiple modules among the acquisition module 710, the determination module 720, the data query module 730, the resource dispatch module 740 and the reconciliation module 750 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the acquisition module 710, the determination module 720, the data query module 730, the resource dispatch module 740 and the reconciliation module 750 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the acquisition module 710, the determination module 720, the data query module 730, the resource dispatch module 740 and the reconciliation module 750 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.
[0153] Figure 8A block diagram of an electronic device suitable for implementing the activity resource distribution method according to an embodiment of the present disclosure is schematically shown.
[0154] like Figure 8 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0155] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0156] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the input / output (I / O) interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.
[0157] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the activity resource distribution method according to the embodiment of the present disclosure is implemented.
[0158] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.
[0159] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the activity resource distribution method provided by the embodiment of the present disclosure.
[0160] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 901. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0161] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0162] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0163] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0164] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0166] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for distributing activity resources, characterized in that: The method comprises: In response to an activity participation operation initiated by a user, obtaining user information and an activity identifier; After verifying the user information, determine the activity participation result of the current user; Perform distributed inventory data query and deduction according to the activity participation results, and generate a deduction details table; Calling the corresponding service interface according to the activity identifier to perform the activity resource dispatch operation, and generating the activity resource dispatch detailed table according to the dispatch result; and Reconciliation and account replenishment operations are performed according to the deduction details table and the activity resource dispatch details table.
2. The method according to claim 1, characterized in that: The querying and deducting of distributed inventory data according to the activity participation results and generating a deduction detail list includes: Query distributed inventory data based on user information and activity identifiers; If it is determined that the remaining amount of the distributed inventory is greater than or equal to the preset threshold, a deduction operation is performed; or If it is determined that the distributed inventory remaining amount is less than the preset threshold, the activity participation result is modified.
3. The method according to claim 1, characterized in that The querying of distributed inventory data according to user information and activity identifiers includes: Determine the activity resource database according to the activity identifier; Determine the corresponding database shard after performing a hash operation on the user information; and Query database shard data.
4. The method according to claim 1, characterized in that The reconciliation and account replenishment operation according to the deduction details table and the activity resource dispatch details table includes: If it is determined according to the activity resource dispatching details table that the activity resource dispatching fails, then the activity resource reissuing operation is initiated; If it is determined based on the activity participation results details table and the activity resource dispatch details table that the activity resources have not been dispatched, a reconciliation and account replenishment operation is performed.
5. The method according to claim 4, characterized in that: The reconciliation and account replenishment operations include: Sorting the activity participation result detailed list and the activity resource dispatch detailed list in ascending order according to the activity resource identifier; Take n records from the activity participation result detail table and record the minimum and maximum values of these n records, where n is an integer greater than 0; Get the data volume m in the activity resource dispatch details table based on the minimum and maximum values as query conditions; If it is determined that m is not equal to n, it indicates that there is a discrepancy in the data, so m and n are recorded for further data verification later; Repeat the above verification steps, perform a second detailed comparison on the intervals with differences in the records, and determine the difference data to perform the activity resource reissue operation.
6. The method according to claim 1, characterized in that The method further comprises: The distributed inventory data is synchronized to the database inventory component at regular intervals, and the database inventory component is a backup component of the distributed inventory component.
7. An activity resource distribution device, characterized in that: The device comprises: An acquisition module, used to respond to an activity participation operation initiated by a user and acquire user information and an activity identifier; A determination module is used to determine the activity participation result of the current user after verifying the user information; A data query module, used to query and deduct distributed inventory data according to the activity participation results, and generate a deduction detail list; A resource dispatching module, used to call a corresponding service interface according to an activity identifier to perform an activity resource dispatching operation, and generate an activity resource dispatching detailed list according to the dispatching result; and The reconciliation module is used to perform reconciliation and replenishment operations according to the deduction details list and the activity resource dispatch details list.
8. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.