Universal reward exchange method and device, electronic equipment, readable storage medium and computer program product
Through the design of configuration files and standardized interfaces, the problems of repeated development and system coupling in the reward redemption system are solved, efficient and flexible reward redemption process management is achieved, and development efficiency and system stability are improved.
Patent Information
- Application Number
- CN202510935059.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-10-17
AI Technical Summary
The existing reward redemption system needs to repeatedly develop the core redemption process for each new activity, resulting in code redundancy and waste of development resources. It is unable to meet the real-time adjustment needs of operations, and the system has a high degree of coupling and limited scalability.
By creating configuration files and standardized interfaces, business rules are abstracted into configurable parameters, achieving development decoupling and operational autonomy, supporting differentiated expansion, reducing code writing, and improving process applicability.
Significantly reduce the amount of code written, improve R&D efficiency, reduce the risk of human errors, support high-frequency business iterations and multi-activity management, and improve system stability and flexibility.
Smart Images

Figure CN120803409A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of reward redemption, in particular, to a universal reward redemption method, device, electronic equipment, readable storage medium and computer program. BACKGROUND
[0002] As a key component of Internet services, online reward redemption systems have been widely used in e-commerce, social platforms and game fields. Its core function is to handle the process of users redeeming prizes or interests through reward vouchers such as points and virtual currency. The current business scenario presents a high degree of dynamic characteristics. Large platforms need to launch 3-5 new types of redemption activities (such as time-limited promotions, holiday exclusive, etc.) every month. Under the traditional development mode, each new activity requires writing independent redemption logic code, resulting in continuous development pressure on the technical team and difficulty in adapting to high-frequency business iteration needs.
[0003] There are three technical bottlenecks in the mainstream reward redemption system. First, each activity needs to repeatedly develop the core redemption process (including permission verification, point deduction, inventory update, etc.), resulting in a large amount of code redundancy and waste of development resources. Second, business rules are hard-coded in the system bottom layer, and configuration changes must be deployed offline, which cannot meet the real-time adjustment needs of operations. In addition, when extending functions for different scenarios, the existing architecture requires modification of the core code, resulting in increased system coupling and violation of the open-closed principle, severely limiting the extension capability.
[0004] Based on the above problems, how to effectively improve the work efficiency of the reward redemption process has become a problem that needs to be solved by technical personnel in the field. SUMMARY
[0005] To solve the existing technical problems, the present application provides a universal reward redemption method, device, electronic equipment, readable storage medium and computer program product.
[0006] In a first aspect, the embodiments of the present application provide a universal reward redemption method, and the method steps specifically include:
[0007] Creating a configuration file, the configuration file including at least configuration information related to rewards in activities;
[0008] Creating a redemption information query interface configured to take user information and part of the configuration information as input parameters to query the reward redemption information corresponding to the current user, generate reward redemption information and return it to the user;
[0009] Creating a reward redemption execution interface configured to take user information and part of the configuration information as input parameters to execute the reward redemption related process, generate reward redemption information, and store the reward redemption information in the database;
[0010] A query interface of the exchange record is configured to take part of the user information and part of the configuration information as input parameters, query part of the reward exchange information from the database, and return to the user.
[0011] Optionally, the configuration file further includes configuration information related to the activity.
[0012] Optionally, the reward-related configuration information includes at least one prize pool configuration, and the prize pool configuration includes a prize pool identifier, an exchange time range, a required integral condition for opening, a total inventory limit of each prize in the prize pool, a personal inventory limit, and an integral value required for exchange.
[0013] Optionally, the execution of the exchange information query interface includes:
[0014] Based on the exchange time range and the required integral condition for opening in the configuration file, the open state of each prize pool is dynamically calculated;
[0015] The returned data includes: prize pool open state, user unlock state, prize remaining total inventory value, and user remaining exchangeable times.
[0016] Optionally, the reward exchange information includes: exchange serial number, prize issuing state, user remaining integral value, and prize remaining inventory value.
[0017] Optionally, the exchange record query interface supports page filtering, the input parameters include a time range and a prize identifier, and the returned data is arranged in descending order of exchange time.
[0018] Optionally, the execution process of the reward exchange execution interface includes:
[0019] a) verifying whether the prize pool configuration information exists;
[0020] b) permission verification step: calling a differentiated permission verification logic to judge the user exchange permission;
[0021] c) integral data source acquisition step: calling a differentiated integral data source acquisition logic;
[0022] d) deducting user integral and updating inventory;
[0023] e) post-processing step: calling a differentiated post-processing logic;
[0024] Steps b), c), and e) support extension point injection for activity customization implementation.
[0025] Optionally, the differentiated logic of the permission verification step is completed by implementing a preset permission verification interface, and the input of the interface includes user information and prize pool opening conditions, and the output is a Boolean value indicating whether the permission is met.
[0026] In a second aspect, the embodiments of the present application provide a general reward redemption device, comprising:
[0027] A configuration management module configured to create a configuration file, the configuration file comprising at least configuration information related to rewards in an activity;
[0028] An information query module comprising a redemption information query interface configured to take user information and part of the configuration information as input parameters, query the reward redemption information corresponding to the current user, generate the reward redemption information and return the reward redemption information to the user;
[0029] An execution engine module comprising a reward redemption execution interface configured to take the user information and part of the configuration information as input parameters, execute the reward redemption related process, generate the reward redemption information, and store the reward redemption information in a database;
[0030] A record query module comprising a redemption record query interface configured to take the user information and part of the configuration information as input parameters, query part of the reward redemption information from the database, and return the reward redemption information to the user.
[0031] In a third aspect, the embodiments of the present application provide an electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, the transceiver, the memory and the processor being connected through the bus, and the computer program, when executed by the processor, implements the steps in the method of the general reward redemption in any one of the first aspect.
[0032] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implements the steps in the method of the general reward redemption in any one of the first aspect.
[0033] In a fifth aspect, the embodiments of the present application provide a computer program product comprising a computer program, the computer program, when executed by a processor, implements the steps in the method of the general reward redemption in any one of the first aspect.
[0034] The business rules are decoupled from the core code through the setting of the configuration file, and the three interfaces of information query, redemption execution and record query are standardized, so that the development of the new reward redemption process is simplified to only the operation of writing the configuration file, the code writing amount is greatly reduced, the manual error risk is significantly reduced, and the research and development work efficiency is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings needed to be used in the embodiments of the present application or the background art will be described below.
[0036] Figure 1 A flow chart of a method for general reward redemption is shown.
[0037] Figure 2 A flow chart of an execution flow method of a reward redemption execution interface is shown.
[0038] Figure 3 A specific structural schematic diagram of a general reward redemption device is shown.
[0039] Figure 4 A structural schematic diagram of an electronic device of a method for general reward redemption is shown.
[0040] The reference signs in the drawings respectively represent:
[0041] 301: configuration management module; 302: information query module;
[0042] 303: execution engine module; 304: record query module;
[0043] 1110: bus; 1120: processor; 1130: transceiver;
[0044] 1140: bus interface; 1150: memory; 1160: user interface;
[0045] 1151: operating system; 1152: application program. DETAILED DESCRIPTION
[0046] In the description of the embodiments of the present application, those skilled in the art shall know that the embodiments of the present application can be implemented as a method, device, electronic device, computer readable storage medium and computer program product. Therefore, the embodiments of the present application can be specifically implemented in the following forms: complete hardware, complete software (including firmware, resident software, microcode, etc.), hardware and software combined form. Moreover, in some embodiments, the embodiments of the present application can also be implemented as a computer program product in one or more computer readable storage media, which contains computer program code.
[0047] The aforementioned computer readable storage medium can take any combination of one or more computer readable storage medium. The computer readable storage medium includes an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any combination thereof. More specific examples of the computer readable storage medium include 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0048] The computer program code contained in the aforementioned computer readable storage medium can be transmitted using any suitable medium, including, but not limited to, wireless, wireline, optical fiber, radio frequency (RF), or any suitable combination thereof.
[0049] The computer program code for carrying out operations of the present embodiment can be written in assembly language, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or in one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++, or a conventional procedural programming language such as the C programming language or similar programming languages. The computer program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, and entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), and can be connected to an external computer.
[0050] The present embodiment provides a method, device, and electronic equipment described by a flowchart and / or block diagram.
[0051] It should be understood that each block of the flowchart and / or block diagram and combinations of blocks in the flowchart and / or block diagram can be realized by computer readable program instructions. These computer readable program instructions can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus to produce a machine, so that these computer readable program instructions, when executed by the computer or other programmable data processing apparatus, generate a device that implements the functions / operations specified in the block of the flowchart and / or block diagram.
[0052] These computer readable program instructions can be provided to a computer or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0053] These computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable data processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0054] The embodiments of the present application will be described below with reference to the drawings.
[0055] Figure 1 A flowchart of a general method for reward redemption provided by an embodiment of the present application is shown. As shown in the figure, the method includes the following steps: Figure 1
[0056] Creating a configuration file, the configuration file including at least configuration information related to rewards in an activity;
[0057] Creating a redemption information query interface, configured to take user information and part of the configuration information as input parameters, query the reward redemption information corresponding to the current user, generate the reward redemption information and return it to the user;
[0058] Creating a reward redemption execution interface, configured to take user information and part of the configuration information as input parameters, execute the reward redemption related process, generate the reward redemption information, and store the reward redemption information into a database;
[0059] Creating a redemption record query interface, configured to take user information and part of the configuration information as input parameters, query part of the reward redemption information from the database, and return it to the user.
[0060] First, a configuration file is created, which includes at least configuration information related to the rewards in the activity, and can be flexibly configured according to actual conditions. By setting a structured configuration file, the configuration file is used as a carrier of business rules, and has the following advantages: the difference point encapsulation can be realized, and the variable factors (such as the integral rule, the inventory threshold, the regional restriction, etc.) in the reward exchange process can be abstracted as configurable parameters; the development decoupling is realized, and the developers no longer need to write customized code for each activity, but only need to declare the business rules through the configuration items; the operation autonomy is realized, and the activity maintenance personnel can directly edit the configuration file to adjust the rules (such as modifying the inventory quantity), without the intervention of the technical team. By fixing the change point to the configuration file, the architecture goal of "stable code structure and variable business rules" is realized, and the repeated coding requirement is fundamentally eliminated.
[0061] Then, a query interface of exchange information is set, which is configured to take user information and part of the information in the configuration information as input parameters, query the reward exchange information corresponding to the current user, generate the reward exchange information and return it to the user; the main function of the exchange information query interface is to pre-check the user's participation qualification (such as the integral balance, the exchange frequency limit), return the dynamically exchangeable item list, and drive different activity strategies (such as A activity requires level ≥ 5, B activity requires binding mobile phone) through the eligibility rule parameters in the configuration. Optionally, the exchange information query interface can be processed differently, such as creating an extension function, and writing the extension function name into the corresponding configuration file (such as writing the custom_eligibility_check() function name into the configuration to call).
[0062] Afterwards, the reward exchange execution interface is created, configured to take user information and part of the information in the configuration information as input parameters, execute the reward exchange related process, generate reward exchange information, and store the reward exchange information into the database; the standardized processing flow of reward exchange execution is: first, permission verification is performed, and the default logic is to perform basic account verification; optionally, an extended permission verification module can also be called to perform account verification; then, according to the verification result, a general atomic operation is performed, that is, integral deduction and inventory decrement are performed, a unique serial number is generated after the general atomic operation is completed, and the data generated during the execution process is persistently stored. In the above process, the permission verification, integral deduction and other operations are encapsulated as unmodifiable basic service units, the general steps are solidified, and the applicability of the process is improved. At the same time, differentiated processing steps can be added on this basis, such as creating a trigger extension point, declaring a differentiated execution function entry in the configuration, which can realize the execution of differentiated functions, and the execution order of the general program can be guided by configuring the execution order of the methods in the configuration file, so that the configuration can be changed without changing the code, and the flexibility of the execution program is improved. In the above process, a unique serial number is set to realize uniqueness constraint to prevent repeated exchange, and a transaction rollback mechanism can be added to increase the fault tolerance of execution and subsequent maintainability. Developers only need to focus on configuration declaration of difference points (such as extended function name), and the general process is automatically processed by the system, thereby greatly reducing the development workload.
[0063] Finally, the exchange record query interface is created, configured to take user information and part of the information in the configuration information as input parameters, query part of the information in the reward exchange information from the database, and return to the user. The above process can realize automatic trimming and screening of returned content (such as hiding the cost price of goods) through the field filtering rules in the configuration, and at the same time realize multi-dimensional aggregation to support data generation according to the statistical caliber defined in the configuration.
[0064] After the development or configuration personnel receives a new reward exchange task, after fully understanding the specific requirements of the reward exchange task, the corresponding configuration file can be created, and the corresponding difference points (such as access interfaces of different function calls) are declared in the configuration file, so that the information query interface, exchange execution interface and record query interface are reused in the entire reward exchange task. Only configuration of the configuration file and generation of differentiated related code are required in the entire process, without the need to code the details in the entire exchange process, which greatly saves the development workload and effectively improves the research and development efficiency. At the same time, it also reduces the system bugs caused by the uneven technical level of developers, and improves the stability of the overall process operation.
[0065] The technical solution can realize accurate positioning of technical problems, apply "general process solidification" and "difference point configurability" in the reward exchange field, and realize differentiated process lossless embedding in the general framework through the expansion trigger mechanism of the execution interface, form a technical closed loop with the configuration file and the three interfaces, to solve the unpredictability of the solution and improve the flexibility of the solution.
[0066] In some embodiments, optionally, the configuration file further includes activity-related configuration information. Including activity-related configuration information (such as activity ID, time range, participation rules, etc.) in the configuration file decouples business rules from system code through declarative configuration, so that when a new activity is added or changed, the program logic does not need to be modified, and only the configuration file needs to be adjusted to take effect in real time, thereby compressing the workload of developing new activities by more than 80%, and at the same time, the configuration verification mechanism intercepts 85% of rule logic errors, combined with hot loading technology to greatly improve the response speed of operational adjustments, and support a single system to manage multiple differentiated activities through dynamic configuration, with daily average bearing of more than ten million exchange requests, systematically solving the technical problems of low development efficiency, long iteration cycle, and complex multi-activity management in the reward exchange field.
[0067] In some embodiments, optionally, the reward-related configuration information includes at least one prize pool configuration, and the prize pool configuration includes a prize pool identifier, an exchange time range, an opening required point condition, a total inventory limit of each prize in the prize pool, a personal inventory limit, and an exchange required point value. In the configuration file, set a structured prize pool configuration including prize pool identifier, time window, point threshold, total inventory, personal limit, and single prize point cost, abstract resource constraints and exchange rules into machine-readable parameters that can be hot updated, so that developers do not need to repeatedly write verification logic code for each prize pool, while the three dynamic constraint mechanisms (time range verification → global inventory decrement → personal limit counting) guarantee business reliability (effectively reduce error rate) with atomic operations, and support real-time adjustment of inventory strategy (such as emergency expansion of prize number seconds-level effect) on the operation side, ultimately realizing fine operation of multiple prize pools driven by a single configuration file, and systematically solving the problems of resource competition, over-exchange vulnerabilities, and rule rigidity in traditional solutions.
[0068] In some embodiments, optionally, the execution of the exchange information query interface includes:
[0069] Based on the exchange time range and the opening required point condition in the configuration file, dynamically calculate the opening state of each prize pool;
[0070] The returned data includes: prize pool opening state, user unlocking state, prize remaining total inventory value, and user remaining exchangeable times.
[0071] In the above process, based on the exchange time range and the required integral in the configuration file, the system time and the current integral of the user are compared in real time to generate a Boolean open identifier, which is calculated independently each time the request is made to avoid logical distortion caused by caching, eliminate hard-coded time / integral verification logic, effectively reduce the effective time of configuration modification when accessing new prize pools, and reduce response delay. In the process of determining the user's unlocking state, double-factor verification is performed, the user's historical behavior (such as whether it is the first time to participate) is combined with the personal inventory limit in the configuration, and the remaining exchangeable times are dynamically calculated; the Redis atomic counter is used to achieve millisecond-level exchange times query, which prevents over-exchange vulnerabilities, supports precise limits for thousands of concurrent users, effectively reduces error rates and data error rates; at the same time, the real-time of the depositor data is realized, according to the total inventory limit configured, the atomic query interface of the inventory service is called to return the remaining value, and a dynamic decay mechanism is realized, the return value is max (total inventory-distributed transaction lock reservation, 0), which prevents overselling and can effectively improve the query accuracy of the inventory and reduce the database load. The design converts the traditional prize pool query logic that requires customized code into pure configuration-driven + standardized calculation, effectively reduces the access time of new prize pools, improves the query efficiency of high-frequency query scenarios, reduces faults caused by configuration changes, and solves the scalability bottleneck and stability risk of the query layer of the reward exchange system through the combination of dynamic calculation and atomic operation.
[0072] In some embodiments, optionally, the reward exchange information includes: exchange serial number, prize delivery status, user remaining integral value, and prize remaining inventory value. The exchange serial number in the reward exchange information uses a distributed unique ID generation algorithm (such as Snowflake), which guarantees global uniqueness by binding timestamp + machine ID + sequence number (setting principle), and fundamentally eliminates the data disorder problem caused by order number conflicts in traditional solutions; the prize delivery status is driven by a state machine engine, and is accurately mapped to state values such as 0 pending / 1 in delivery / 2 completed according to the delivery_policy field in the configuration (such as setting async_delivery: true for asynchronous delivery), so that the delivery progress is visualized and supports breakpoint resume, and customer service consultation volume is reduced; the user remaining integral value is calculated in real time based on atomic transactions (integral deduction and query are atomized), and the current integral minus the dynamic value of the pre-occupied integral is returned when called, eliminating the risk of integral overdraft in high-concurrency scenarios; the prize remaining inventory value is dynamically generated through a pre-occupied inventory mechanism (resources are reserved and actual inventory-sold quantity-pre-occupied quantity are updated when requested), and the setting principle guarantees data strong consistency. The four elements cooperatively form a closed-loop tracking system, which improves the reliability and transparency of the exchange process to an industrial standard and effectively reduces the overall failure rate.
[0073] In some embodiments, optionally, the exchange record query interface supports page filtering, the input parameters include a time range and a prize identifier, and the returned data is arranged in descending order of exchange time. Based on the LIMIT-OFFSET paging algorithm combined with a distributed cursor (such as Redis Scan), the page number (page_no) and the page size (page_size) in the request parameters can be converted into physical paging instructions, and a WHERE condition can be automatically added to realize data filtering. Compared with the traditional full table scanning scheme, the memory occupation of a million-level data query is greatly reduced, and the page jump delay is stabilized within 50 ms. At the same time, the start_time / end_time input parameters are bound with the database exchange timestamp index, and only the data shards in the target time interval are scanned. The prize ID is used as the first column of the cluster index, and the target record is quickly located through the B+ tree. The above operations greatly improve the query efficiency and effectively shorten the record screening time. The time is arranged in descending order, the ORDER BY exchange time DESC is forced to specify, and the descending index technology (such as MySQL DescendingIndex) is used to avoid Filesort temporary table sorting. This operation can eliminate the performance black hole of large data set sorting and optimize the user experience.
[0074] In some embodiments, as shown in Figure 2 The execution flow of the reward exchange execution interface includes:
[0075] a) Check whether the prize pool configuration information exists;
[0076] b) Permission verification step: call the differentiated permission verification logic to judge the user exchange permission;
[0077] c) Step of obtaining integral data source: call the differentiated integral data source obtaining logic;
[0078] d) Deduct the user's points and update the inventory;
[0079] e) Post-processing step: call the differentiated post-processing logic;
[0080] Steps b), c), and e) support activity customization implementation through extension points.
[0081] In the process of checking the prize pool configuration information, the MD5 fingerprint of the configuration file in the memory cache can be queried, and the validity of the config_version field in the request parameter can be compared. This operation can intercept illegal requests of invalid configurations and avoid data confusion caused by configuration loss. Then, the permission check is performed. The auth_module field in the configuration can be used to specify the extension point (such as face_verify_v2), the implementation class is dynamically loaded and executed, only the standard interface needs to be implemented, the development amount of customized requirements is effectively reduced, and the stability of the core code is ensured. Then, the integral data source is obtained. Based on the point_source configuration item (such as source_type: game_center), the corresponding integral micro service is routed, abstracted as a unified data protocol, and seamless switching of multiple integral systems is supported, which can effectively compress the extension period. In the process of deducting user points and updating inventory, the TCC distributed transaction (Try-Confirm-Cancel) atomic operation can be used. In the Try stage, the pre-occupied points and inventory are executed. If the pre-occupation is successful, the commit operation is performed. If the pre-occupation fails, the rollback operation is performed. This operation can improve the data consistency under concurrency and effectively reduce the performance loss. Finally, the post-processing is performed. The post_processor configuration (such as coupon_delivery) can trigger the extension logic, support asynchronous operations such as delivery / notice, and realize zero-invasive extension through logistics docking and other customized requirements, which can effectively improve the system reuse rate. Through the binary architecture design of the standard extension point protocol + atomic core operation, the technical effect of absolute reuse of public capabilities and lossless expansion of differential logic is realized in the field of reward exchange for the first time, which effectively reduces the repeated development and provides an optimized solution for high-complexity dynamic business systems.
[0082] In some embodiments, optionally, the differentiated logic of the permission verification step is completed by implementing a preset permission verification interface, the input of the interface includes user information and prize pool opening conditions, and the output is a Boolean value of whether the permission is met. First, abstract the standard contract, and through the preset permission verification interface, the implementation class is forced to accept two types of structured input parameters, user information (including ID / region attribute, etc.) and prize pool opening conditions (such as regional whitelist / user level threshold), and through the interface isolation principle, it is ensured that business rule changes do not affect the core process, and a strategy pattern is implemented, based on the auth_strategy field (such as strategy_id:geo_restrict) in the configuration file, the corresponding interface implementation class is dynamically loaded, the verify(user, condition)→boolean method is executed at runtime, and a hot deployment mechanism is implemented, and new verification logic only needs to implement the interface and update the configuration, and the service is loaded without restarting. The above operation can effectively improve the development efficiency, reduce the code amount of development, effectively shorten the online period, and improve the system stability. Under the premise of not changing the core process, the interface is used for dynamic expansion, which effectively improves the flexibility of the overall process. By abstracting the permission verification into an extensible architecture of "standardized input parameters + business rule plug-in", the defect that the business rule change must modify the core code in the traditional hard coding scheme is overcome, and the "plug and play" management in the permission strategy is realized.
[0083] In some embodiments, as shown in Figure 3 The application embodiment provides a general reward redemption device, which comprises:
[0084] The configuration management module 301 is configured to create a configuration file, and the configuration file at least includes configuration information related to rewards in an activity;
[0085] The information query module 302 includes a redemption information query interface, which is configured to take part of the information in the user information and the configuration information as input parameters, query the reward redemption information corresponding to the current user, generate the reward redemption information, and return the reward redemption information to the user;
[0086] The execution engine module 303 includes a reward redemption execution interface, which is configured to take part of the information in the user information and the configuration information as input parameters, execute the reward redemption related process, generate the reward redemption information, and store the reward redemption information in the database;
[0087] The record query module 304 includes a redemption record query interface, which is configured to take part of the information in the user information and the configuration information as input parameters, query part of the information in the reward redemption information from the database, and return the information to the user.
[0088] The configuration management module 301 receives the YAML configuration instruction input by the operation end, parses and generates a structured configuration file, and contains core fields such as reward rules, activity parameters, and extension point mapping. The configuration file version is published to a distributed configuration center (such as ZooKeeper), and is synchronously pushed to the information query module 302, the execution engine module 303, and the record query module 304. The information query module 302 receives a user end request, extracts a user ID and a target prize pool identifier, loads a corresponding configuration subset (including a time range / integral condition) from the configuration management module 301, and calculates the current integral and exchangeable state of the user in real time. The execution engine module 303 verifies the consistency of the prize pool identifier in the request and the version of the configuration management module 301, loads the permission verification module specified by the configuration, executes differentiated users, calls the integral service atomic deduction interface and the inventory service pre-occupation interface, generates a globally unique serial number, and writes into a database. The record query module 304 receives a user query request, extracts a time range / prize pool ID filtering condition, constructs a query statement based on the field rule defined by the configuration management module 301, retrieves data from a database shard, and returns a filtered record set. With the configuration as the only source of truth, the four modules build a closed-loop execution chain through a standardized protocol, and realize complete business life cycle management from qualification determination to performance tracing.
[0089] In addition, the embodiment of the present application also provides an electronic device, which comprises a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, the transceiver, the memory and the processor are connected through the bus respectively, the computer program is executed by the processor to realize each process of the embodiment of the general reward exchange method, and the same technical effects can be achieved. To avoid repetition, details are not repeated here.
[0090] Specifically, referring to Figure 4 The embodiment of the present application also provides an electronic device, which comprises a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150 and a user interface 1160.
[0091] The transceiver 1130 is used for receiving and sending data under the control of the processor 1120.
[0092] In the embodiment of the present application, the bus architecture (represented by the bus 1110) can include any number of interconnected buses and bridges, and the bus 1110 connects various circuits of one or more processors represented by the processor 1120 and the memory represented by the memory 1150 together.
[0093] Bus 1110 represents one or more of any of several types of bus structures, including an address bus, a data bus, a control bus, a memory bus, and a storage bus, each of which can be implemented using various technologies and standards. Bus 1110 can include one or more buses implementing various bus standards, such as an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Extended ISA (EISA) bus, a Video Electronics Standards Association (VESA) bus, a Peripheral Component Interconnect (PCI) bus, or a Peripheral Component Interconnect Express (PCIe) bus.
[0094] Processor 1120 can be an integrated circuit chip that has signal processing capability. In implementation, each step of the above method embodiments can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The above processor includes: a general processor, a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a complex programmable logic device (CPLD), a programmable logic array (PLA), a microcontroller unit (MCU), or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. For example, the processor can be a single-core processor or a multi-core processor, and the processor can be integrated into a single chip or located in multiple different chips.
[0095] The processor 1120 can be a microprocessor or any conventional processor. The disclosed method steps in conjunction with the embodiments of the present application can be directly executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can be located in a readable storage medium known in the art, such as a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), a register, etc. The readable storage medium is located in a memory, and the processor reads the information in the memory to complete the steps of the above method in conjunction with the hardware thereof.
[0096] The bus 1110 can also connect various other circuits or devices, such as peripheral devices, voltage stabilizers, or power management circuits, together. The bus interface 1140 provides an interface between the bus 1110 and the transceiver 1130, which are well known in the art. Therefore, the embodiments of the present application will not be further described.
[0097] The transceiver 1130 can be one element or multiple elements, such as multiple receivers and transmitters, which provide a unit for communicating with various other devices on a transmission medium. For example, the transceiver 1130 receives external data from other devices, and the transceiver 1130 is used to send data processed by the processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 can also be provided, such as a touch screen, a physical keyboard, a display, a mouse, a speaker, a microphone, a trackball, a joystick, a stylus.
[0098] It should be understood that the memory 1150 in the embodiments of the present application can further include a memory remotely disposed with respect to the processor 1120, which can be connected to a server through a network. One or more portions of the above-mentioned network can be an ad hoc network, an intranet, an extranet, a virtual private network (VPN), a local area network (LAN), a wireless LAN (WLAN), a wide area network (WAN), a wireless wide area network (WWAN), a metropolitan area network (MAN), the Internet, a public switched telephone network (PSTN), a public or private telephone network, a wireless phone network, a wireless network, a Wi-Fi network, and a combination of two or more of the above-mentioned networks. For example, the wireless phone network and the wireless network can be a global system for mobile communications (GSM) system, a code division multiple access (CDMA) system, a worldwide interoperability for microwave access (WiMAX) system, a general packet radio service (GPRS) system, a wideband code division multiple access (WCDMA) system, a long term evolution (LTE) system, an LTE frequency division duplex (FDD) system, an LTE time division duplex (TDD) system, an LTE-advanced (LTE-A) system, a universal mobile telecommunications system (UMTS) system, an enhanced mobile broadband (eMBB) system, a massive machine type of communication (mMTC) system, an ultra-reliable low latency communications (uRLLC) system, and the like.
[0099] It should be understood that the memory 1150 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory.
[0100] The volatile memory can include random access memory (RAM), which acts to provide external cache memory. By way of example only, many forms of RAM are available, such as: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The memory 1150 of the subject electronic device includes, but is not limited to, one or more memories including use of volatile and nonvolatile memory modules. By way of example only, the memory 1150 can also include one or more tangible machine-readable media. For example, these machine-readable media can include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, compact disk read-only memory (CD-ROM), digital versatile disk (DVD), Blu-ray, another suitable type of machine-readable media, or a combination of two or more of these. The memory 1150 includes, but is not limited to, the above examples and / or any other suitable type of memory.
[0101] In an embodiment of the present application, the memory 1150 stores an operating system 1151 and an application program 1152, including the following elements: executable modules, data structures, or a subset thereof, or an extended set thereof.
[0102] In particular, the operating system 1151 includes various system programs, such as: a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application program 1152 includes various application programs, such as: a media player (MediaPlayer), a browser (Browser), for implementing various application services. The program for implementing the method of the embodiment of the present application can be included in the application program 1152. The application program 1152 includes: applets, objects, components, logic, data structures, and other computer system executable instructions for performing specific tasks or implementing specific abstract data types.
[0103] In addition, the embodiment of the present application also provides a computer readable storage medium, which stores a computer program, the computer program is executed by a processor to implement each process of the above-mentioned general reward redemption method embodiment, and can achieve the same technical effect, to avoid repetition, which will not be repeated here.
[0104] Computer-readable storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions. Computer-readable storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, memory cards, solid-state RAM, or any other medium which can be used to store the desired information. According to the definition of the embodiments of the present application, computer-readable storage media does not include a transitory signal per se, such as a radio wave or other freely propagating electromagnetic wave, the electromagnetic wave through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals traveling through a wire.
[0105] In several embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method can be implemented in other manners. For example, the division of the apparatus embodiments is merely illustrative, and the division of the modules or units can be changed according to actual conditions, such as a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms of connection.
[0106] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, which can be located in one location or distributed on multiple network units. Some or all of the units can be selected according to actual needs to solve the problems to be solved by the embodiments of the present application.
[0107] In addition, each function unit in various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0108] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application essentially or the parts that contribute to the prior art, or all or part of the technical solutions can be embodied in the form of a program product, which is stored in a storage medium, including a plurality of instructions to make a computer device (including a personal computer, a server, a data center or other network device) execute all or part of the steps of the method described in various embodiments of the present application. The storage medium includes various storage media listed above that can store program codes.
[0109] In addition, the embodiments of the present application provide a computer program product, which includes a computer program, and the computer program is executed by a processor to realize each process of the general reward redemption method embodiments described above and achieve the same technical effects. To avoid repetition, details are not described here.
[0110] Embodiment 1
[0111] Implementation process of the general reward redemption system based on dynamic configuration
[0112] 1. Configuration file creation and management
[0113] The configuration management module creates and maintains the YAML format configuration file at system startup, defines the activity configuration information, including the activity ID, the global valid period (such as the "summer_2024" activity valid period 2024-06-01 to 2024-08-31), sets the prize pool configuration information, allocates a unique identifier to each prize pool, sets the prize pool exclusive exchange time window, configures the required integral condition for opening, defines the prize parameters, including the total inventory limit, the personal limit, the integral value required for exchange, etc.; declares the extension point mapping, including the permission verification module binding the biometric service, the integral source specifying the game center micro service, and the post-processing connecting the logistics system. The configuration file is distributed to each service node in real time through ZooKeeper, and when changed, it triggers a second-level hot update.
[0114] 2. Exchange qualification query process
[0115] When a user queries the redemption status of the prize pool, the information query module receives the request parameters (user ID + target prize pool ID), dynamically calculates the real-time status, compares the current time with the configured redemption time range, verifies whether the user's points meet the activation conditions, calculates the remaining inventory, and counts the user's remaining redemption times; the interface returns structured data, for example:
[0116]
[0117] 3. Reward redemption execution process
[0118] After a user initiates a redemption request, the execution engine module sequentially performs the following steps: configuration pre-verification, verifying the validity of the material ID and checking whether the prize pool is within the active period; during the permission verification phase, it dynamically loads the configured biometric module and calls the facial recognition service to verify the user's identity; during the points operation phase, it retrieves the user's real-time points from the game center microservice and performs atomic operations, simultaneously deducting points and pre-occupied inventory; during the core resource update phase, it generates a globally unique serial number and persistently stores the redemption record, which includes key fields: serial number, prize distribution status, user's remaining points, and prize remaining inventory; and during the post-processing trigger phase, it calls the configured logistics service to generate a shipping order and push a successful redemption notification to the user. The entire process utilizes TCC distributed transactions to ensure atomicity, effectively reducing error rates.
[0119] 4. Redemption Record Backtracking Process
[0120] When a user queries historical records, the record query module receives the filtering parameters (time range / prize ID / paging settings), constructs an optimized query, sorts in reverse order by redemption time, searches the partitioned database based on the time range, and automatically applies field filtering rules; it returns paginated results, such as:
[0121] {
[0122] "records":[
[0123] {
[0124] "tx_id":"TX202406151008",
[0125] "item_id":"item_01",
[0126] "exchange_time":"2024-06-15 10:08:23",
[0127] "status": "shipped"
[0128] },
[0129] ... / / Other 9 records
[0130] ],
[0131] "total_pages":42
[0132] }
[0133] 5. Extension mechanism implementation
[0134] When a new face recognition service is added, a new permission verification module is developed, a standard input and output interface is implemented, the input is user information + prize pool conditions, the output is a boolean type permission judgment result, and a configuration file mapping relationship is updated, such as:
[0135] extension_points:
[0136] auth_strategy: com.modules.FaceRecognitionV3 # New extension module
[0137] The new module is hot-loaded without interrupting the service, and all subsequent exchange requests automatically apply the new verification logic. This implementation confirms that the three-stage interface (query-execute-record) is dynamically driven through the configuration file, establishes a complete reward exchange life cycle management mechanism, and achieves the technical effect of zero coding to extend new activities.
[0138] The above is only a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.
Claims
1. A general reward redemption method, characterized in that: include: Creating a configuration file, wherein the configuration file includes at least configuration information related to rewards in the activity; Create a redemption information query interface, which is configured to use user information and part of the configuration information as input parameters, query the reward redemption information corresponding to the current user, generate reward redemption information and return it to the user; Creating a reward redemption execution interface, configured to use the user information and part of the configuration information as input parameters, execute a reward redemption-related process, generate reward redemption information, and store the reward redemption information in a database; Create a redemption record query interface, which is configured to use the user information and part of the configuration information as input parameters, query part of the reward redemption information from the database, and return it to the user.
2. The method according to claim 1, characterized in that The configuration file also includes configuration information related to the activity.
3. The method according to claim 1 or 2, characterized in that The reward-related configuration information includes at least one prize pool configuration, which includes a prize pool identifier, a redemption time range, points required for activation, a total inventory limit for each prize in the prize pool, a personal inventory limit, and points required for redemption.
4. The method according to claim 3, characterized in that The execution of the exchange information query interface includes: Dynamically calculate the opening status of each prize pool based on the redemption time range and the points required to open it in the configuration file; The returned data includes: prize pool opening status, user unlocking status, total remaining prize inventory value, and remaining number of user redemptions.
5. The method according to claim 4, characterized in that The reward redemption information includes: redemption serial number, prize issuance status, user remaining points value and prize remaining inventory value.
6. The method according to claim 5, characterized in that The redemption record query interface supports paging filtering. The input parameters include the time range and prize identifier, and the returned data is sorted in reverse order of redemption time.
7. The method according to claim 6, characterized in that The execution process of the reward redemption execution interface includes: a) Verify whether the prize pool configuration information exists; b) Permission verification step: Calling differentiated permission verification logic to determine the user's redemption authority; c) Points data source acquisition step: calling the differentiated points data source acquisition logic; d) Deduct user points and update inventory; e) Post-processing step: calling the differentiation post-processing logic; Steps b), c), and e) support customized implementation through injection of extension points.
8. The method according to claim 7, characterized in that The differentiated logic of the permission verification step is completed by implementing a preset permission verification interface. The input of the interface includes user information and prize pool opening conditions, and the output is a Boolean value indicating whether the permission is met.
9. A universal reward redemption device, characterized in that: include: A configuration management module is configured to create a configuration file, wherein the configuration file at least includes configuration information related to rewards in the activity; An information query module, including a redemption information query interface, is configured to use user information and part of the configuration information as input parameters, query the reward redemption information corresponding to the current user, generate reward redemption information and return it to the user; an execution engine module, comprising a reward redemption execution interface, configured to use the user information and part of the configuration information as input parameters, execute reward redemption-related processes, generate reward redemption information, and store the reward redemption information in a database; The record query module includes a redemption record query interface, which is configured to use the user information and part of the configuration information as input parameters, query part of the reward redemption information from the database, and return it to the user.
10. An electronic device, characterized in that: include: processor and memory; The memory stores a computer program, which, when executed by the processor, implements the method described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that Storing computer instructions, when the instructions are executed by a processor, implements the method as described in any one of claims 1-8.
12. A computer program product, characterized in that Contains program code, which, when run on a computing device, executes the method described in any one of claims 1 to 8.