A settlement processing method and system based on cache review and transaction admission control

CN122989254APending Publication Date: 2026-10-27SHANGHAI OUDIAN CLOUD INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611175123.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0014]本发明提供了一种基于缓存复核与交易准入控制的结算处理方法及系统,实现购物车与结算页全链路的准入规则统一、多维缓存高效复用、结算流程节点化管控,解决现有技术中入口规则分散、缓存维度不足、结算复核缺失、组合品计算不准确、O2O与非O2O规则混用等问题,降低超卖、错价与重复下单风险,提升交易链路的稳定性与处理效率

Benefits of technology

[0039]采用本发明提供的技术方案,与现有技术相比,具有如下有益效果:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989254A_ABST
    Figure CN122989254A_ABST
Patent Text Reader

Abstract

The application provides a settlement processing method and system based on cache review and transaction access control, and belongs to the technical field of e-commerce transactions. The application realizes full-link transaction entrance rule unification through a unified page operation capability object; integrates commodity prices, promotional prices, inventories, sales regions and combination product data through a price warehouse inventory aggregation service, adopts a multi-dimensional cache key for cache management, and separates O2O and non-O2O sales range judgment logic; the shopping cart supports multi-service type routing, anonymous session and automatic integration of the shopping cart with the member identity; the settlement process is divided into three stages of initialization, node calculation and pre-submission secondary review, and the shopping cart is accurately cleaned according to the settlement item after successful submission. The application has the beneficial effects that the transaction entrance judgment consistency is effectively improved, the over-selling, wrong pricing and repeated submission risks are reduced, and the cache efficiency and settlement link processing performance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention mainly relates to the field of e-commerce transaction system technology, specifically to a settlement processing method and system based on cache review and transaction access control. Background Technology

[0002] In the e-commerce transaction chain, the shopping cart and checkout page play a crucial role, connecting upstream product details, marketing campaigns, live streaming, search, and recommendation scenarios, and downstream order creation, payment, and fulfillment systems. The "Add to Cart," "Buy Now," and "Proceed to Checkout" buttons that users see on the product details page cannot be determined solely by the static product status; they also need to consider various dynamic factors such as product type, availability (on or off the shelves), regional availability, O2O delivery range, inventory, promotional inventory, member pricing, activity type, purchase limits, and inventory of bundled or sub-items.

[0003] If the shopping cart and checkout page lack a unified pre-processing and verification mechanism, the following problems may easily occur: the product details page shows that it can be added to the cart, but the shopping cart cannot be checked out; the price on the list page is inconsistent with the price on the checkout page; the promotional activity's inventory is sold out, but adding to the cart is still allowed; O2O stores are not within the delivery range, but checkout is allowed; the inventory of individual items in a bundled product is insufficient, but the bundled product is still shown as available; expired cached data leads to inconsistencies in price, inventory, and regional rules.

[0004] The existing technology has the following drawbacks in practical applications:

[0005] The shopping cart entry point is determined in a fragmented manner: the product details page, the list page, and the activity page each determine whether the item can be added to the cart, resulting in inconsistent rules and potentially leading to different results across different pages.

[0006] The checkout page lacks pre-submission review: If you only rely on cached results from the product details page or list page, there may be issues such as price changes, insufficient stock, or the end of the promotion when you submit your order.

[0007] Insufficient caching dimensions: Promotional prices, member prices, regional availability, and delivery range all have dimensions such as user, platform, activity, region, and store. An incomplete cache key design can lead to data misuse.

[0008] Mixing O2O and non-O2O rules: O2O requires latitude and longitude to determine the delivery range, while non-O2O requires regional code to determine the sales range. Using the same logic may lead to misjudgment.

[0009] Combination product inventory is difficult to calculate: Combination product inventory depends on the inventory of multiple sub-products, the quantity of sub-products, and selection rules. Simply reading the main product inventory cannot accurately determine whether it can be settled.

[0010] Promotional inventory is separated from product inventory: When promotional inventory is insufficient, the decision should be made based on the type of promotion to purchase at the original price, not purchase, or clear the promotional information. Traditional solutions are difficult to unify.

[0011] Insufficient message coordination: Asynchronous systems such as live streaming rooms, search caches, and in-site messages cannot detect pre-transaction events or changes in product status in a timely manner.

[0012] Therefore, there is an urgent need for a transaction process processing solution that unifies the orchestration of products, promotions, inventory, sales regions, delivery ranges, bundled products, caches, and messages for access control and real-time verification of shopping carts and checkout pages. Summary of the Invention

[0013] 1. The technical problem that the invention aims to solve:

[0014] This invention provides a settlement processing method and system based on cache review and transaction access control, which realizes unified access rules for the entire chain from shopping cart to checkout page, efficient reuse of multi-dimensional cache, and node-based management of the settlement process. It solves problems such as scattered entry rules, insufficient cache dimensions, lack of settlement review, inaccurate calculation of bundled products, and mixed use of O2O and non-O2O rules in the prior art, reduces the risk of overselling, incorrect pricing and duplicate orders, and improves the stability and processing efficiency of the transaction chain.

[0015] 2. Technical Solution:

[0016] To achieve the above objectives, the present invention adopts the following technical solution:

[0017] A settlement processing method based on cache review and transaction access control includes the following steps:

[0018] S1. Page Operation Routing and Admission Judgment: Receive front-end page operation requests and route them to the corresponding operation service based on the page type; merge channel configuration and product type configuration, combine product listing and delisting status, sales area rules and inventory information to generate a unified page operation capability object, and output the transaction entry button status.

[0019] S2. Price and Inventory Aggregation and Multidimensional Caching: Call the price and inventory aggregation service to aggregate the basic price of the product, promotional price, member price, product inventory, promotional inventory, bundled product information, and sales area verification results; construct a multidimensional cache key to cache and read / write the promotional price and sales area data, and retrieve the data from the corresponding source service when the cache is not hit.

[0020] S3, Shopping Cart Routing and Cache Management: Routes to the corresponding shopping cart processor based on the business type, generates a shopping cart cache key based on the user identifier or anonymous session identifier, and performs write, refresh, and verification operations on shopping cart items; Logged-in users automatically merge anonymous shopping cart and member shopping cart data.

[0021] S4. Settlement Initialization and Access Review: When a user enters the checkout page, the settlement initialization process is initiated, and a full access review is performed on the selected items in the shopping cart, including price, inventory, region, promotions, and bundled items. After the review is passed, a settlement object is generated and the settlement data is cached.

[0022] S5. Settlement Change Node-based Recalculation: When a change in settlement page parameters is detected, the recalculation start node is determined according to the change type. Node-based recalculation is performed based on the cached settlement object, updating the settlement data and writing it back to the cache.

[0023] S6. Order Submission and Cache Management: When receiving an order submission request, read the cached settlement object for secondary promotion review; after the review is passed, assemble the order data and call the order system to create the order; after successful submission, accurately clean up the settled items in the shopping cart according to the settlement item identifier and update the relevant cache.

[0024] Furthermore, the present invention also provides a settlement processing system based on cache review and transaction access control, comprising:

[0025] The page operation control module is used to receive front-end page operation requests, route them to the corresponding operation service according to the page type, merge channel configuration and product type configuration, and generate a unified page operation capability object.

[0026] The button access judgment module is used to generate the transaction entry button status based on channel configuration, product type configuration, product listing status, regional rules and inventory information;

[0027] The price and inventory aggregation module is used to aggregate basic product prices, promotional prices, member prices, product inventory, promotional inventory, bundled product information, and add-to-cart status.

[0028] The sales area and delivery range module is used to perform latitude and longitude delivery range verification or area code sales verification according to O2O and non-O2O scenarios respectively.

[0029] The multi-level caching module is used to store product prices, promotions, and sales region data through external caching and loading cache. When the cache is not hit, the corresponding service is retrieved from the origin server.

[0030] The bundled product calculation module is used to calculate the available inventory, default selected sub-items, and displayed prices for fixed and optional bundles.

[0031] The activity inventory and purchase limit module is used to handle pre-sales, group buying, community group buying, points pricing, member purchase limits and minimum order multiple rules;

[0032] The shopping cart routing module is used to select the corresponding shopping cart processor according to the business type;

[0033] The shopping cart caching module is used to generate cache keys based on user ID, anonymous session, and business type, and to store shopping cart objects, quantities, and view data.

[0034] The settlement process module is used to execute three types of processes: settlement initialization, settlement recalculation, and order submission.

[0035] The settlement cache module is used to cache settlement objects, settlement participants and settlement item identifiers, and supports settlement page recovery, prevention of duplicate submissions and post-submission cleanup;

[0036] The order creation integration module is used to convert transaction data into input parameters for the order system and call the order creation service;

[0037] The message coordination module is used to define add-to-cart message types and supports asynchronous notifications for product cache updates, points, and in-site messages.

[0038] 3. Beneficial effects:

[0039] Compared with the prior art, the technical solution provided by this invention has the following advantages:

[0040] The same price inventory and access rules can be reused on the product details page, list page, shopping cart and checkout page. The state of the transaction buttons across the entire chain is driven by a unified page operation capability object, avoiding inconsistencies caused by scattered rules on multiple pages and improving the consistency of transaction entry rules.

[0041] The checkout page performs a full review of product inventory, promotional inventory, and bundled product inventory. A second promotional verification is performed before order submission, effectively reducing submission failures and incorrect pricing issues caused by cache expiration and inventory changes, and lowering the risk of overselling and incorrect pricing.

[0042] A layered caching architecture is adopted to carry promotional price database, sales region, basic product data and self-pickup point data. The cache key is constructed through multi-dimensional parameters to reduce the pressure on remote services with high frequency access, while avoiding the cross-use of data from different dimensions, thereby improving the efficiency and accuracy of cache utilization.

[0043] Separate judgment logic is adopted for O2O and non-O2O scenarios. O2O uses latitude and longitude and store coverage to judge, while non-O2O uses area code and product sales area to judge, avoiding misjudgment of delivery range caused by mixing rules and improving the accuracy of area judgment.

[0044] Series products, fixed combination products, optional combination products, weighed products, and points-based products can all be expressed through a unified price database; complex promotions such as pre-sales, group buying, community group buying, and member purchase limits can all uniformly affect the add-to-cart and settlement status, supporting complex products and promotional formats;

[0045] Define standardized live stream add-to-cart messages, support asynchronous system linkage with search cache updates, in-site messages, etc., improve the real-time feedback capability of live stream and event scenarios, and enhance the collaborative capability of transaction messages;

[0046] Anonymous shopping carts in a logged-out state are automatically merged with logged-in member shopping carts, ensuring that items in the user's shopping cart before and after login are not lost, thus guaranteeing operational continuity and shopping cart data continuity.

[0047] The shopping cart object, quantity, and view are cached hierarchically, enabling fast response to list display and badge quantity queries; the checkout page supports node-based recalculation, so changes to coupons, points, etc. do not require a full re-initialization, reducing computational overhead and improving checkout and shopping cart performance;

[0048] By caching the order number, duplicate submissions are identified, preventing users from placing duplicate orders due to repeated clicks. After a successful submission, only the settled product rows are deleted, while unselected or unsettled products are retained in the shopping cart, reducing the risk of duplicate submissions and accidental deletions.

[0049] It should be noted that the structures not described in this invention are not related to the design points and improvement directions of this invention, and are the same as or can be implemented using existing technologies, and will not be elaborated here. Attached Figure Description

[0050] Figure 1 This is a system architecture diagram of the present invention;

[0051] Figure 2 This is a flowchart illustrating the pre-transaction process of the shopping cart and checkout page in this invention.

[0052] Figure 3 This is a flowchart of the cache processing of the present invention;

[0053] Figure 4 This is a flowchart of the settlement page review process of the present invention;

[0054] Figure 5 This is a flowchart illustrating the shopping cart caching and fusion process of the present invention;

[0055] Figure 6 This is a flowchart of the settlement initialization, recalculation, and submission process of the present invention. Detailed Implementation

[0056] To facilitate understanding of the present invention, a more complete description of the invention will be given below with reference to the accompanying drawings, which illustrate several embodiments of the invention. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of the invention will be more thorough and complete.

[0057] This invention proposes a settlement processing method and system based on cache review and transaction access control, which is applied to e-commerce front-end transaction scenarios. It covers the entire transaction front-end link, including product browsing, adding to cart, shopping cart management, settlement and order submission. The core of the system is to achieve the stability and efficiency of the transaction link through unified access rules, multi-dimensional cache review, and node-based settlement process.

[0058] I. Detailed Explanation of Core Processing Flow

[0059] 1. Front-end page operation and access control

[0060] When the front-end calls the page operation interface, the system first verifies the page type and page data, enumerates the corresponding service methods according to the page type, and calls the page operation service through reflection; taking the product details page as an example, the system enters the product details operation judgment process and returns a unified page operation capability object.

[0061] The system first reads the channel-level page operation configuration and enables basic button capabilities based on the current channel. Then, it reads the product-level configuration to obtain the sets of product types that cannot be added to the cart and those that cannot be checked out. If a product type falls into the set that cannot be added to the cart, the ability to add it to the cart is disabled; if a product type falls into the set that cannot be checked out, the ability to skip to checkout is disabled. This step supports dynamic configuration adjustments of transaction entry points for different channels and product types.

[0062] After the configuration is merged, the system queries the basic information of the products and performs access control: if the product is not available for sale on the front end, the ability to add to cart, buy now, go to checkout, and select combinations is disabled, and the product is marked as unavailable; if the product is not in the sales area, the area is marked as unavailable for sale; if the inventory is empty, the available inventory is empty, or the available inventory is zero, the ability to add to cart, buy now, and go to checkout is disabled, and the product is marked as sold out; if the product is a selectable combination, the user is allowed to enter the details page to select sub-items, but is not allowed to add the product directly to the cart from the list.

[0063] 2. Price and inventory aggregation and caching processing

[0064] When the shopping cart, product listing page, promotional page, or checkout page needs to refresh the product price database, the system invokes the price and inventory aggregation service. This service receives parameters such as product ID set, promotional platform, price type, inventory type, promotional ID, region code, promotional label on / off, pricing method, sub-item ID, and latitude and longitude, and performs aggregation processing.

[0065] Query basic information about product SKUs, sub-products, and combination products;

[0066] Whether to check the product price, promotional price, and member price depends on the price type;

[0067] Whether to query product inventory and promotional inventory depends on the inventory type;

[0068] Generate basic price and inventory results, and initially set the vehicle add-on status according to product type;

[0069] By combining the product's listing status, the status of bundled product selection, the activity type, and regional rules, the final verification of the ability to add items to the cart is completed.

[0070] For promotional pricing and event inventory, the system constructs a query object containing dimensions such as SKU, platform, event ID, user ID, company ID, promotion type, scenario, and event status. The dimension parameters are concatenated and hashed to serve as the cache key for the promotional price database. The system uses an external cache to read promotional prices and event inventory. When the cache is hit, the result is returned directly. When the cache is not hit, the system queries the origin promotional service and writes the result to the cache. The returned promotional price database result includes information such as promotion ID, promotion type, promotional price, promotional inventory, price tag, event time, purchase limit, minimum order quantity, and order multiple.

[0071] For sales regions and delivery ranges, the system converts sales region query parameters into a sorted Map and generates a query hash based on the parameter values ​​as the overall cache key. If the store is in O2O mode, the system calls the store coverage service based on the store ID, longitude, and latitude to determine if the current location is within delivery range; if not, the area is marked as unsellable. If the store is not in O2O mode, the system constructs a sub-cache key based on the product ID and region code, uses the sub-product sales region cache to read the results, and if the cache misses, calls the product sales region service; if unsellable, the area is marked as unsellable. In the community group-buying self-pickup point scenario, the system loads the self-pickup point cache to read the self-pickup point set and loads the activity cache to read the activity configuration, determining whether it can participate in settlement based on the self-pickup point type and the activity's self-pickup point set.

[0072] For inventory calculation of bundled products, the system constructs inventory query parameters based on the product, sub-product, and bundled product sub-products, and calls the inventory service in batches. For ordinary products, the available inventory of the SKU is used directly; for products with sub-products, the sub-product inventory is summarized, and if the sub-product is out of stock, the sub-product with stock and lower price is selected as the default SKU.

[0073] For bundled products: fixed bundled product inventory is calculated by dividing the inventory of each sub-product by the required quantity and taking the minimum value; optional bundled products are calculated by selecting the set of sub-products whose inventory can meet the optional quantity of each group and taking the minimum value of the quantity that can be met by each group; the crossed-out price of bundled products is calculated based on the price and quantity of the sub-products, and the commodity type and unit of measurement of the sub-products are supplemented for front-end display.

[0074] 3. Shopping cart link processing

[0075] When a user performs operations such as adding to the shopping cart, updating the quantity, deleting, clearing, switching bundled items, adding gifts or exchanging items, changing the address, or changing the selected status, the system first selects the shopping cart router based on the business type. Business types include ordinary shopping cart, community group buying shopping cart, scan-to-buy shopping cart, in-store shopping cart, and retail POS shopping cart.

[0076] The shopping cart caching process is as follows:

[0077] If the request does not include the shopping cart session identifier, the system reads the cart_session_id from the cookie; if the cookie does not exist, a new UUID is generated and written to the cookie.

[0078] The system generates a shopping cart cache key based on user ID or anonymous sessionId, business type, domain, activity, or store dimension;

[0079] The system reads the shopping cart object from Redis. If it does not exist and initialization is allowed, an empty shopping cart is created and written to Redis.

[0080] For logged-in users, the system reads the anonymous shopping cart and merges it with the member's shopping cart. The quantity of the same items is added up, and the information on gifts and redemptions is merged synchronously. After the merging is completed, the member's shopping cart is refreshed and the anonymous shopping cart is cleared.

[0081] After the shopping cart is modified, Redispipeline is used to synchronously write the shopping cart object, the number of items in the shopping cart, and the shopping cart view cache. When cleaning up the shopping cart, all three types of cache are deleted at the same time to avoid the front end reading old data.

[0082] The system performs procedural checks on items in the shopping cart, including product type verification, product availability verification, sales region verification, inventory verification, minimum order quantity and order multiple verification, and verification of promotional gifts and exchanges. For bundled items, the system calculates the available quantity based on the inventory and usage of each sub-item. For weighed items, the system compares the weight with the inventory. When the same item is occupied in multiple shopping cart rows, the system deducts the occupied quantity to determine the inventory status.

[0083] 4. Settlement process

[0084] The settlement process is divided into three core steps: initialization, recalculation, and submission.

[0085] (1) Settlement initialization process

[0086] When a user enters the checkout page from the shopping cart or product details page, the system initiates the checkout initialization process, generates a unique process number, and saves the business type, user, store, currency, shopping cart session, address, activity platform, and product row information in the context.

[0087] The settlement initialization nodes include: setting the delivery address or self-pickup point; preprocessing pickup cards; preprocessing data and goods; verifying purchase restrictions, pre-sales, inventory, salable status, store business hours, sales area, price-cutting, coupon items, group buying, and community group buying; splitting orders by merchant, store, delivery method, or order splitting rules; setting invoices, delivery methods, and calculating shipping costs; calling promotion calculations to obtain results such as discounts, coupons, promo codes, gifts, trade-ins, and free shipping; verifying minimum order quantity and order multiples; setting coupons, promo codes, points, commissions, and gift cards; summarizing order amounts and setting payment methods.

[0088] After the process is completed, the system caches the objects displayed on the settlement page, the settlement parameters, and the shopping cart item row IDs corresponding to this settlement, for subsequent recalculation, submission, prevention of duplicate submissions, and shopping cart cleanup.

[0089] (2) Settlement page change and recalculation process

[0090] When a user modifies coupons, discount codes, points, commissions, gift cards, shipping address, delivery method, payment method, remarks, or service time on the checkout page, the system reads the latest checkout item from the checkout cache and selects the recalculation scope based on the type of change.

[0091] When modifying coupons, update the user's coupon set and recalculate from the coupon setting node.

[0092] When modifying a discount code, update the discount code set and recalculate from the node where the discount code was set.

[0093] When modifying points, commissions, or gift cards, update the corresponding deduction items and recalculate from the corresponding point.

[0094] When changing the address, clear old coupons, discount codes and delivery information, re-execute the complete settlement initialization process, and re-verify the sales area, self-pickup point, delivery method and shipping fee;

[0095] When modifying the delivery method, the delivery method, self-pickup point and delivery time are verified. If the shipping cost changes, it is recalculated from the coupon point and the amount is redistributed.

[0096] When modifying payment methods, remarks, or service times, directly update the settlement object and write it back to the cache.

[0097] If the checkout object is not cached, the system determines that the checkout page has been viewed for too long and requires the user to re-enter the checkout page.

[0098] (3) Order submission and cache management

[0099] When a user submits an order, the system first reads the settlement object cache. If the cache does not exist but the order number cache does, it is determined that the order submission task is being executed, and duplicate submission is rejected; if neither exists, a new settlement is requested.

[0100] The order submission process includes:

[0101] Determine whether payment password verification is required based on the settlement object; if so, verify the payment password signature cache.

[0102] Clear old settlement cache and generate submission process number;

[0103] The promotion service is recalculated for the current order promotion. If the promotion items or discount information have changed, the submission is blocked and a new settlement is required.

[0104] Calculate the points awarded upon placing an order and the points awarded during promotions, and distribute them according to the parent order, child order, and product line; generate the parent order, child order, and product line structure according to the order splitting rules;

[0105] Convert the settlement object into order creation parameters, including order master information, delivery address, delivery method, invoice, product line, gifts, exchange, pre-sale, community group buying, discount sharing and rebate information;

[0106] Call the order system to create an order and obtain the order number, order status, payment status, and sub-order information;

[0107] After successful submission, the settled items in the shopping cart will be deleted based on the settlement item ID; in the community group buying scenario, the corresponding activity shopping cart will be deleted.

[0108] Refresh the shopping cart cache, cache the submitted order number, and count the number of orders and users participating in the promotional activity;

[0109] Clear the cache for checkout objects and shopping cart checkout items.

[0110] The system defines the "add to cart" message type in the live stream, with the message content indicating that the user has added the product to their shopping cart. When a user adds a product to their cart during a live stream, the front end or the messaging system can send this message, allowing the live stream to detect the transaction. Changes in product data can be updated via MQ notifications by searching the cache. Links such as check-in points and in-site messages can serve as an extended foundation for transaction activity notifications, add-to-cart reminders, and settlement reminders. Specific Implementation

[0111] Example 1: Control of the transaction entry button on the product details page

[0112] After a user opens the product details page, the front end sends a page operation interface request to the system. After receiving the request, the system first verifies that the page type is a product details page and then routes it to the product details operation judgment service.

[0113] The system first reads the page operation configuration of the current channel and enables basic button capabilities such as "Add to Cart", "Buy Now", and "Proceed to Checkout". The second step is to read the product dimension configuration and obtain the set of product types that cannot be added to the cart or checked out under the current channel. If the current product type falls into the set that cannot be added to the cart, the ability to add to cart and "Buy Now" is disabled. If it falls into the set that cannot be checked out, the ability to proceed to checkout is disabled.

[0114] After the configuration is merged, the system queries the product's basic information, sales area rules, and inventory data: If the product is unavailable, the ability to add it to the cart, buy now, proceed to checkout, and select a combination is disabled, and it is marked "unavailable"; if the product is not in the current user's sales area, it is marked "not available in this area"; if the product's available inventory is zero, the transaction entry button is disabled, and it is marked "sold out"; if the product is a combination item, the user is allowed to enter the details page to select sub-items, but is not allowed to add it to the cart directly.

[0115] Finally, the system generates a page operation capability object containing 8 status indicators and returns it to the front-end page to render the corresponding button status.

[0116] Example 2: Refreshing the price list and promotion status of items in the shopping cart

[0117] When a user opens the shopping cart page, the system extracts the set of product IDs in the shopping cart and sends them in batches to the price and inventory aggregation service.

[0118] After receiving the parameters, the price and inventory aggregation service first queries the basic product information and SKU information. Based on the configured price type, it queries the product's regular price and member price, and based on the inventory type, it queries the product's general inventory. Then, the system constructs promotion query parameters and queries the promotion price cache using a multi-dimensional cache key. If the cache is hit, it directly reads the promotion price, activity inventory, purchase limit rules, and promotional tags; if the cache is not hit, it retrieves the data from the origin promotion service and writes it to the cache.

[0119] The system combines product type and activity type to verify whether the product can be added to the cart and whether it can be settled: if the product is a group purchase activity product and the activity inventory is sold out, the system removes the promotional information of the product and displays the price and inventory according to the normal purchase logic; if the product is a points-based product and is added to the normal shopping cart, the normal settlement capability is disabled and the quantity already redeemed by the user is returned.

[0120] Finally, the system returns the aggregated price, inventory, promotional tags, and checkout status to the shopping cart page, completing the refresh of the shopping cart's item status.

[0121] Example 3: Delivery Range Verification on O2O Scenario Checkout Page

[0122] Users select products at O2O stores and proceed to the checkout page. After selecting a delivery address, the checkout process is triggered.

[0123] The system first obtains the current store ID and the latitude and longitude of the user's delivery address, and then calls the store coverage service to verify the delivery range. To improve query efficiency, the system constructs a cache key using the store ID and latitude and longitude, and prioritizes reading the delivery range cache; if the cache is not found, it retrieves the result from the origin store coverage service and writes it to the cache.

[0124] If the verification result shows that the user's address is not within the store's delivery range, the system marks the product as "not available for sale in the area," closes the product row's checkout capability, and prompts the user with the reason why delivery is not possible. If the verification result shows that the product is within the delivery range, the system continues to perform subsequent review steps such as product inventory, promotional activities, and minimum order quantity. After all steps are passed, the user is allowed to continue submitting the order.

[0125] Example 4: Inventory Calculation for Combined Items

[0126] When a user adds an optional bundle to their shopping cart and proceeds to checkout, the system performs inventory calculations for the bundle when checkout is triggered.

[0127] The system first reads the sub-item grouping configuration of the product combination, obtaining a list of sub-item IDs under each group and the default selection quantity for each sub-item. Then, the system batch queries the available inventory of all sub-items and calculates their sellability by group.

[0128] For the fixed combination portion, the available inventory of each sub-item is divided by the required quantity, and the minimum value of the calculated results for all sub-items is taken as the available quantity for sale in the fixed combination portion.

[0129] For the optional combination section, based on the selection quantity requirements of each optional group, select sub-items with sufficient inventory from the sub-items within the group, prioritize the sub-items with lower prices as the default selected items, and use the minimum quantity that can be met by each group as the available quantity for the optional combination section.

[0130] The system aggregates the calculation results of fixed and optional combinations to obtain the overall available inventory of the combined items. If any group cannot meet the purchase quantity selected by the user, the checkout page will disable the checkout function for that combination and indicate that the sub-item inventory is insufficient. If the inventory is sufficient, the system will calculate the displayed price of the combination based on the sub-item price and quantity, allowing the user to continue checkout.

[0131] Example 5: Remote order creation after activity approval

[0132] In business scenarios where the trial activity has been approved, the system automatically generates orders through the remote order creation process.

[0133] The system first reads the approved application records to obtain applicant information, activity information, product information, and shipping address information. Then, it queries the user master data to complete the user ID and username, and queries the product master data to complete the product specifications, attributes, price, and inventory information.

[0134] The system constructs order product rows according to the activity rules, setting product ID, store product ID, unit price, purchase quantity, promotional allocation amount, activity promotion identifier, warehouse information, and merchant store information; at the same time, it constructs the order delivery address and order owner information, converting the activity order model into the standard input parameter format of the order system.

[0135] The system calls the remote order creation service, passing in the assembled order data; after the order system is successfully created, it returns the order number and order status, and the system writes the order number and status back to the activity application record, completing the entire remote order creation process.

[0136] Example 6: Integration of Anonymous Shopping Cart and Member Shopping Cart

[0137] When a user adds multiple items to their shopping cart on the product details page without being logged in, the system receives the cart request. Upon detecting that the request does not include the user's login identifier, it reads the cart_session_id from the cookie. If the identifier does not exist in the cookie, a new UUID is generated as the anonymous session identifier and written to the cookie.

[0138] The system generates a shopping cart cache key using an anonymous sessionId, business type, and domain dimension, writes the items added by the user to the anonymous shopping cart cache, and updates the shopping cart quantity and view cache.

[0139] When a user logs in again and reopens the shopping cart page, the system detects that the user is logged in and reads the data from both the member's shopping cart and the anonymous shopping cart. The system merges the product rows from the anonymous shopping cart into the member's shopping cart: the purchase quantity of the same product is accumulated, and information on gifts and exchange items is merged synchronously. After the merge, a new member's shopping cart is generated, and the objects, quantities, and view cache of the member's shopping cart are updated in batches via Redispipeline. At the same time, all cached data from the anonymous shopping cart is deleted. After logging in, the user can directly see the products added when not logged in, without needing to add them to the cart again.

[0140] Example 7: Node-based recalculation of coupon changes on the checkout page

[0141] After the user completes initialization on the checkout page, they select a new coupon. Upon receiving the coupon change request, the system first reads the current checkout object data from the checkout cache. The system updates the set of available coupons for the user in the checkout object and marks the selected coupon as used. Since the change is a coupon, the system determines that a complete checkout initialization does not need to be re-executed. Instead, it starts the recalculation process from the "Set Coupon" node: recalculating the order discount allocation amount, synchronously updating the calculation base for points deduction and gift card deduction, re-summarizing the order payable amount, and updating the payment method availability status.

[0142] After recalculation, the system writes the updated settlement object back to the settlement cache, and the front-end page refreshes to display the latest discounted amount and the amount due. The entire process does not require re-verification of product inventory, sales region, and delivery information; it only performs calculations for discount-related nodes, significantly reducing recalculation overhead.

[0143] Example 8: Precise Cart Cleanup After Order Submission

[0144] The user selected 3 items in their shopping cart and proceeded to checkout, leaving 2 items unselected. During the checkout initialization phase, the system records the shopping cart row IDs of the 3 items corresponding to this checkout and stores them in the checkout cache.

[0145] After a user submits an order, the system completes a second review, assembles the order, and successfully creates the order in the order system. Then, it reads the list of settlement item IDs stored in the settlement cache. Based on this list of IDs, the system locates the corresponding 3 product rows in the shopping cart and deletes only these 3 settled product rows; the 2 unselected products remain in the shopping cart.

[0146] After the cleanup is complete, the system synchronously updates the shopping cart object, shopping cart quantity, and shopping cart view cache through Redispipeline, while also clearing the checkout object cache and checkout item ID cache, thus completing the entire post-submission cache management process.

[0147] III. System Implementation Examples

[0148] This embodiment provides a settlement processing system based on cache review and transaction access control, including the following modules:

[0149] Page operation control module: Receives front-end page operation requests, verifies page type and data, enumerates and routes to the corresponding operation service according to page type, and outputs unified page operation capability results.

[0150] Button access control module: merges channel configuration and product type configuration, and combines product listing / delisting, sales region, and inventory status to generate the availability status and abnormal indicators of buttons such as Add to Cart, Buy Now, and Proceed to Checkout.

[0151] Price and inventory aggregation module: Unifies and aggregates basic product price, promotional price, member price, product inventory, promotional inventory, bundled product information, and sales area verification results, and outputs standardized price database data for reuse throughout the entire supply chain.

[0152] Sales Area and Delivery Range Module: Differentiates between O2O and non-O2O scenarios, performs latitude and longitude delivery range verification and regional code sales range verification respectively, and outputs the sales status of the area.

[0153] Multi-level caching module: Includes two types of caching layers: external cache and loading cache, which respectively carry data such as promotional price database, sales region, basic product information, and self-pickup point configuration, and provide cache read and write and origin retrieval capabilities.

[0154] Bundled product calculation module: Performs inventory calculation, default sub-item selection and display price calculation for fixed bundled products and optional bundled products respectively, and outputs the sale status of bundled products.

[0155] Activity Inventory and Purchase Limit Module: Handles the rules for adding vehicles and settling accounts for special activities such as pre-sales, group buying, community group buying, and points-based pricing, and verifies purchase limits, minimum order quantities, and order multiples.

[0156] Shopping cart routing module: Based on business types such as regular, community group buying, scan-to-buy, in-store, and retail POS, it routes the cart to the corresponding shopping cart processor and executes differentiated processing logic.

[0157] Shopping cart caching module: Generates Redis cache keys based on user ID / anonymous session, business type, domain and other dimensions, and stores shopping cart objects, shopping cart quantity and shopping cart view data respectively, supporting batch writing and cleanup.

[0158] Settlement process module: includes three types of process engines: INIT_ORDER initialization, RECALCULATE recalculation, and SUBMIT_ORDER submission, which respectively handle scenarios of entering the settlement page, parameter changes, and order submission.

[0159] Settlement caching module: caches settlement display objects, settlement input parameters, submitted order numbers and settlement item IDs, supports settlement page recovery, prevents duplicate submissions, and clears the shopping cart after submission.

[0160] Order creation integration module: Converts settlement data or activity data into standard input parameters of the order system, calls the order creation service, and processes the returned results.

[0161] Message Collaboration Module: Defines the types of live-stream add-to-cart messages and supports asynchronous message linkage such as product cache update MQ, points notification, and in-site messages.

[0162] The above-described embodiments are merely illustrative of certain implementations of the present invention, and are described in a relatively specific and detailed manner. However, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements are all within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A settlement processing method based on cache review and transaction access control, characterized in that, Includes the following steps: S1. Receive front-end page operation requests, route to the corresponding operation service according to page type, merge channel configuration and product type configuration, combine product listing status, sales area rules and inventory information to generate a unified page operation capability object, and output the transaction entry button status. S2. Call the price and inventory aggregation service to aggregate the basic price of the product, the promotional price, the member price, the product inventory, the promotional inventory, the bundled product information and the sales area verification results. Use the multi-dimensional cache key to cache and read / write the promotional price database and the sales area data. If the data is not found, retrieve the data from the corresponding source service. S3. Based on the business type, route to the corresponding shopping cart processor, generate a shopping cart cache key based on the user identifier or anonymous session identifier, and perform write, refresh and verification operations on shopping cart items. Logged-in users automatically merge anonymous shopping cart and member shopping cart data. S4. When a user enters the checkout page, the checkout initialization process is initiated. A full-scale access review is performed on the selected items in the shopping cart, including price, inventory, region, promotions, and bundled items. After the review is passed, a checkout object is generated and the checkout data is cached. S5. When a change in the settlement page parameters is detected, the recalculation start node is determined according to the change type. Node-based recalculation is performed based on the cached settlement object, the settlement data is updated, and the cache is written back. S6. When receiving an order submission request, read the cached settlement object for secondary promotion review. After the review is passed, assemble the order data, call the order system to create the order, and after successful submission, accurately clean up the settled items in the shopping cart according to the settlement item identifier and update the cache.

2. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S1, the page operation capability objects include at least the status indicators of whether to display the shopping cart entry, whether to allow adding to the shopping cart, whether to allow immediate purchase, whether to allow proceeding to checkout, whether to display that the area is unavailable for sale, whether to display that the product is sold out, whether to display that the product is sold out, and whether to allow the selection of combination sub-items. The merging process of the channel configuration and the product type configuration is as follows: first, read the channel dimension page operation configuration to enable the basic button capabilities, and then read the product dimension configuration to obtain the set of product types that cannot be added to the cart and the set of product types that cannot be settled. If the product type falls into the set of products that cannot be added to the cart, then the ability to add to the shopping cart is disabled; if the product type falls into the set of products that cannot be settled, then the ability to proceed to checkout is disabled.

3. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S2, the construction process of the multidimensional cache key is as follows: For the promotional price library, the parameters of SKU, platform, activity ID, user ID, company ID, promotion type, scenario, and activity status are concatenated and a hash is calculated as the cache key; for the sales region, the query parameters are sorted and a query hash is generated as the overall cache key; in non-O2O scenarios, sub-cache keys are further constructed according to product ID and region code.

4. The settlement processing method based on cache review and transaction access control according to claim 3, characterized in that, In step S2, separate sales scope determination logic is used for O2O and non-O2O scenarios: In an O2O scenario, the store's coverage area service is invoked based on the store ID, longitude, and latitude to determine whether the user's location is within the delivery range. If the location is not within the range, the area is marked as unavailable for sale. In non-O2O scenarios, the product sales area service is invoked based on the product ID and area code to determine whether the product is available for sale in the current area. If it is not available for sale, the area is marked as unavailable for sale.

5. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S2, the calculation rule for the inventory of combined items is as follows: The minimum value for fixed-combination inventory is obtained by dividing the inventory of each sub-item by the required quantity. The optional combination is selected by filtering the set of sub-items that can be satisfied by the optional quantity of each group, and the minimum value of the quantity that can be satisfied by each group is taken as the available inventory of the combination. The price of a bundled product is calculated based on the price of each individual item and its corresponding quantity.

6. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S3, the shopping cart cache adopts a hierarchical caching structure, caching the shopping cart object, shopping cart quantity, and shopping cart view respectively. When the data changes, it is written in batches through Redispipeline. The merging rules for anonymous shopping carts and member shopping carts are as follows: the quantity of the same product row is accumulated, the gift and exchange information is merged synchronously, and after the merging is completed, the member shopping cart cache is refreshed and the anonymous shopping cart cache is cleared.

7. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S4, the settlement initialization process includes at least the following nodes: setting the delivery address or self-pickup point, pre-processing goods and verifying purchase restrictions, splitting orders according to rules, setting delivery methods and calculating shipping costs, calling promotion calculations, setting deduction items, summarizing order amounts, and setting payment methods. The content of the settlement page access review includes at least the front-end availability status of goods, regional availability, sufficiency of goods and promotional inventory, promotion effectiveness, price consistency, compliance of minimum order quantity and order multiple, and the effectiveness of inventory of bundled sub-items.

8. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S5, the recalculation rules corresponding to the changes in the settlement page parameters are as follows: When modifying coupons or discount codes, update the corresponding deduction set and recalculate from the node where the coupon or discount code was set. When modifying points, commissions, or gift cards, update the corresponding deduction items and recalculate from the corresponding deduction point; When modifying the delivery address, clear the original coupons, discount codes and delivery information, and re-execute the complete checkout initialization process; When modifying the delivery method, verify the delivery information; if the shipping cost changes, recalculate from the coupon node. When modifying payment methods, remarks, or service times, the settlement object is updated directly and the cache is written back.

9. The settlement processing method based on cache review and transaction access control according to claim 1, characterized in that, In step S6, if the promotional items or discount information change during the second promotion review, the order submission will be blocked and the user will be prompted to re-check out; when submitting an order, the duplicate submission status will be identified by the order number cache. If the order number exists in the cache, it will be determined that the order is being executed and the duplicate submission will be rejected. After successful submission, only the shopping cart row corresponding to the checkout item is deleted; unselected or unchecked items are retained in the shopping cart.

10. A settlement processing system based on cache review and transaction access control, characterized in that, include: The page operation control module is used to receive front-end page operation requests, route them to the corresponding operation service according to the page type, merge channel configuration and product type configuration, and generate a unified page operation capability object. The price and inventory aggregation module is used to aggregate product prices, promotional prices, member prices, product inventory, promotional inventory, bundled product information, and sales area verification results. The multi-level caching module is used to store promotional price database, sales region, and basic product data through a multi-dimensional cache key. When the cache is not hit, the corresponding service is retrieved from the origin server to obtain the data. The shopping cart routing and caching module is used to route to the corresponding shopping cart processor according to the business type, manage the shopping cart cache, and perform the fusion of anonymous shopping carts and member shopping carts; The settlement process module is used to execute the settlement initialization process, the settlement page change and recalculation process, and the order submission process, and to complete the settlement page access review, node-based recalculation, and pre-submission secondary review. The checkout caching module is used to cache checkout objects, checkout participants and checkout item identifiers, and supports checkout page recovery, prevention of duplicate submissions, and shopping cart cleanup after submission; The order integration module is used to assemble the order creation input parameters and call the order system to complete the order creation. The message coordination module is used to define and send add-to-cart messages, synchronize product cache updates, and asynchronously notify points and in-site messages.