Commodity bidding method, platform, equipment and medium

By using distributed locks and delayed queue mechanisms, the problems of data competition and process disruption in high-concurrency bidding transactions on e-commerce platforms are solved, realizing automated management of bidding transactions and data consistency, and improving the stability and reliability of the system.

CN120912286APending Publication Date: 2025-11-07SHENZHEN QIHEWANG TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510931749.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Traditional e-commerce platforms are prone to data competition in bidding transactions with high concurrency users. Their business processes lack automation and fault tolerance, resulting in problems such as process breaks and delayed exception handling.

Method used

A distributed lock mechanism is used to lock customer quotation information, determine compliance, create bidding orders and set delay information, process bidding termination operations through a delay queue, and combine distributed scheduling tasks for compensation, thereby realizing the automated flow of bidding sorting and order generation.

Benefits of technology

It solves the problems of high concurrency conflicts and insufficient business process automation, ensures data consistency and accuracy, avoids overbuying and overselling and duplicate pricing, and realizes automated flow of order status and precise control of business processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120912286A_ABST
    Figure CN120912286A_ABST
Patent Text Reader

Abstract

The invention provides a commodity bidding method, platform, equipment and medium, and the method comprises the steps: carrying out the locking operation of an order instance of customer quotation information through a distributed lock, and judging that the customer quotation information meets a preset information compliance condition in the lock; creating a bidding list according to the customer quotation information meeting the preset information compliance condition, and setting delay information to perform bidding countdown; performing bidding sorting on the target customer quotation information; when the bidding countdown time is reached, bidding ending operation of the bidding list is processed according to the delay information, and lock releasing operation is carried out on the order instance; and generating a commodity order according to a bidding sorting result. The problem of concurrency conflict of high-concurrency quotation is solved by using the distributed lock; the order expiration process is automatically triggered through the delay queue, and automatic circulation of the order state is achieved; through cooperation of the components, ordered conversion and accurate control of different business states are realized, and automation of business processes is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of network merchant platforms, and in particular to a commodity bidding method, platform, device and medium. BACKGROUND

[0002] With the deep development of the e-commerce industry, complex mall business scenarios such as bidding transactions have become a key link of network commodity transaction platforms. The platform needs to support high concurrency of users, ensure the compliance and security of the transaction process, and realize the full life cycle automation management of orders from order placement to transaction and delivery. In the traditional platform, multi-user concurrent operation (such as order placement, inventory deduction, etc.) in the core business of bidding is easy to cause data competition; the business process automation and fault tolerance capability are missing, and there are problems of process breakage and abnormal processing lag in multi-level processes. SUMMARY

[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0004] The purpose of the present application is to at least partially solve one of the technical problems in the related art. The embodiments of the present application provide a commodity bidding method, platform, device and medium, which can solve the problems of high concurrency conflict and insufficient business process automation.

[0005] In an embodiment of the first aspect of the present application, a commodity bidding method comprises:

[0006] receiving customer bid information;

[0007] locking the order instance of the customer bid information through a distributed lock, judging whether the customer bid information meets a preset information compliance condition in the lock, and recording the customer bid information meeting the preset information compliance condition as target customer bid information;

[0008] creating a bidding order according to the target customer bid information and setting a delay information, the delay time of the delay information being a bidding countdown time;

[0009] bidding sorting the target customer bid information;

[0010] when the bidding countdown time is reached, processing the bidding end operation of the bidding order according to the delay information, and determining a winning customer bid information from the target customer bid information;

[0011] in the lock, generating a commodity order according to the winning customer bid information, and releasing the lock operation of the order instance.

[0012] According to certain embodiments of the first aspect of the application, the preset information compliance condition comprises a no-repeating-offer operation; and the judging, in the lock, whether the customer offer information meets the preset information compliance condition and recording the customer offer information meeting the preset information compliance condition as target customer offer information comprises:

[0013] In the lock, it is queried whether there is a record of a historical offer of the user corresponding to the customer offer information for the goods corresponding to the customer offer information;

[0014] When there is no record of the historical offer, it is judged that the customer offer information meets the preset information compliance condition;

[0015] When there is a record of the historical offer, it is judged that the customer offer information does not meet the preset information compliance condition;

[0016] The customer offer information meeting the preset information compliance condition is recorded as target customer offer information.

[0017] According to certain embodiments of the first aspect of the application, the creating a bid order according to the target customer offer information and setting delay information comprises:

[0018] The bid order is created according to the target customer offer information;

[0019] A delay exchange and an order expiration processing queue are created, and the order expiration processing queue is bound to the delay exchange;

[0020] A delay message is generated according to the bid countdown time and the bid order;

[0021] The delay message is sent to the delay exchange;

[0022] The bid end operation of processing the bid order according to the delay information when the bid countdown time is reached comprises:

[0023] When the bid countdown time is reached, the delay exchange routes the delay message to the order expiration processing queue;

[0024] The delay message is obtained from the order expiration processing queue, and the bid end operation of processing the bid order according to the delay information.

[0025] According to certain embodiments of the first aspect of the application, the bid sorting of the target customer offer information comprises:

[0026] The target customer offer information is written into an ordered set;

[0027] The target customer offer information is bid sorted through the ordered set;

[0028] When the ordering change of the ordered set is monitored, the updated ordered set is sent to the client for display.

[0029] According to certain embodiments of the first aspect of the application, the releasing the lock operation on the order instance in the lock, comprises:

[0030] In the lock, reading the inventory quantity of the commodity corresponding to the winning client bid information, comparing the commodity quantity of the winning client bid information with the inventory quantity;

[0031] When the commodity quantity of the client bid information is less than or equal to the inventory quantity, generating a commodity order according to the winning client bid information, and releasing the lock operation on the order instance of the winning client bid information;

[0032] When the commodity quantity of the client bid information is greater than the inventory quantity, the generation of the commodity order fails, and the lock operation on the order instance corresponding to the winning client bid information is released.

[0033] According to certain embodiments of the first aspect of the application, after the generation of the commodity order fails, the method further comprises:

[0034] sending a scanning instruction to the executor deployed in the business processing layer through the dispatching center;

[0035] scanning the commodity order in the database through the executor after receiving the scanning instruction, and obtaining a failed order marked as a failure state;

[0036] In the lock, generating a commodity order according to the client bid information corresponding to the failed order;

[0037] When the generation of the commodity order is successful, marking the failed order as a success state, and releasing the lock operation on the order instance of the failed order marked as the success state.

[0038] According to certain embodiments of the first aspect of the application, after the receiving of the client bid information, the method comprises:

[0039] obtaining and verifying the user information in the client bid information;

[0040] When the user information is in the blacklist, deleting the client bid information.

[0041] Embodiments of the second aspect of the application, a commodity bidding platform, comprising:

[0042] a client;

[0043] a gateway;

[0044] a business processing layer, the client connects with the business processing layer through the gateway, the business processing layer applies the commodity bidding method as described in the embodiment of the first aspect of the application to process commodity bidding business;

[0045] an infrastructure layer, the infrastructure layer is connected with the business processing layer, the infrastructure layer is used to store intermediate processing data and processing results in the process of commodity bidding business, and send the processing results to the client.

[0046] In the embodiment of the third aspect of the application, an electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the commodity bidding method as described in the embodiment of the first aspect of the application when executing the computer program.

[0047] In the embodiment of the fourth aspect of the application, a computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the commodity bidding method as described in the embodiment of the first aspect of the application.

[0048] The above scheme has at least the following beneficial effects: the distributed lock is used to solve the problems of overbuying and overselling of inventory, repeated bidding of the same user or order, and other concurrent conflicts caused by high-concurrency bidding; through the mutual exclusion of the lock, the operation on the key resource is serialized at the same time, and the data consistency is maintained; the ranking calculation and data update demand generated by real-time bidding can be processed, the performance bottleneck of the traditional database under high concurrency is avoided, and the timeliness and accuracy of data reading and writing are ensured; the order expiration process is automatically triggered through the delay queue, without manual timing inspection, and the automatic flow of the order state is realized; the failure caused by network or component abnormality in the process is automatically processed through the compensation task; through the cooperation of each component, the orderly conversion and precise control of different business states are realized, and the business process automation is realized. BRIEF DESCRIPTION OF DRAWINGS

[0049] The accompanying drawings are used to provide a further understanding of the technical scheme of the application, and constitute a part of the specification, and are used to explain the technical scheme of the application together with the embodiments of the application, and do not constitute a limitation on the technical scheme of the application.

[0050] Figure 1 is a step diagram of the commodity bidding method;

[0051] Figure 2 is a step diagram of the locking operation on the current commodity through the distributed lock when the preset information compliance condition is no repeated bidding operation;

[0052] Figure 3 is a step diagram of creating a bidding order according to the target customer bidding information and setting delay information;

[0053] Figure 4 is a step diagram of bidding and sorting target customer offer information;

[0054] Figure 5 is a step diagram of generating a commodity order according to the winning customer offer information in the lock, and releasing the order instance from the lock;

[0055] Figure 6 is a step diagram of a timing compensation step;

[0056] Figure 7 is a structural diagram of a commodity bidding platform;

[0057] Figure 8 is a flowchart of a commodity bidding process of the commodity bidding platform;

[0058] Figure 9 is a flowchart of a hanging order process of the commodity bidding platform;

[0059] Figure 10 is a flowchart of a picking order process of the commodity bidding platform. DETAILED DESCRIPTION

[0060] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and do not limit the present application.

[0061] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims or above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0062] The embodiments of the present application will be further described below in combination with the drawings.

[0063] The embodiments of the present application provide a commodity bidding platform.

[0064] The commodity bidding platform is built based on blockchain. It has a decentralized architecture, with nodes scattered and parallel everywhere. All transaction records, commodity information, user data, etc. are distributed on multiple nodes in the network, reducing the risk of single point failure and improving the reliability and stability of the system. Using the tamper-proofing feature of blockchain, all bidding records, commodity information, etc. once written into the blockchain cannot be tampered with or deleted, ensuring the authenticity and credibility of the data. All bidding transaction records will be recorded in the blockchain and publicly visible to all participants. The initial price of the commodity, the amount of each bid, the information of the bidder, and the timestamp of the bidding, etc. can be queried and traced in real time; transaction information is transparent. Although the transaction records on the blockchain are transparent, the privacy of users can be protected through the use of encryption technology and zero-knowledge proof privacy protection mechanisms. Advanced encryption algorithms are used to encrypt user personal information, transaction data, etc. to ensure data security during transmission and storage. Only authorized users can decrypt and access related data, preventing user information leakage and data tampering risks.

[0065] Reference Figure 7 The commodity bidding platform comprises a client 110, a gateway 120, a business processing layer 130, and an infrastructure layer 140. The client 110 is connected to the business processing layer 130 through the gateway 120, and the business processing layer 130 processes commodity bidding business. The infrastructure layer 140 is connected to the business processing layer 130, and the infrastructure layer 140 is used to store intermediate processing data and processing results in the process of commodity bidding business and send processing results to the client 110.

[0066] The client 110 is provided with a general gateway 120, which has functions such as bidding terminal, ranking board, order placement, and quotation. The API gateway 120 has functions such as load balancing, request routing, authentication and authorization, process control, protocol conversion, and monitoring logs. The business processing layer 130 includes service functions and business processing functions. The service functions include order service, audit service, contract service, message center, websocket service, and timing task Xxl-job sub-functions. The business processing functions include real-time computing engine, asynchronous message, distributed lock, RabbitMQ, and websocket sub-functions. Dynamic ranking calculation and multi-dimensional sorting are performed through the real-time computing engine. Delayed queue and compensation retry mechanism are implemented through asynchronous message. Data consistency and interface idempotency are achieved through distributed lock. Ranking real-time refresh and high-concurrency throughput are realized through RabbitMQ and websocket. The infrastructure layer 140 is provided with middle platform services and databases for persistence and caching. The middle platform services include user single sign-on, OA approval, SMS sending, and file service functions. The databases include MySQL, Redis, and RibbtMQ corresponding databases.

[0067] The Redis cluster in the product bidding platform serves to hold real-time data, such as product prices, countdowns, and bidding rankings from customer bids; it updates real-time data after a customer submits a bid, supporting real-time dashboards and countdown displays. The RabbitMQ in the product bidding platform enables asynchronous decoupling, handling expiration events through a delayed queue; it sends delayed messages when a bid is created and triggers the termination process upon expiration. The WebSocket in the product bidding platform allows the server to proactively push real-time change information to the client. The XXL-job in the product bidding platform provides fault tolerance and compensation, covering bids that do not end normally. It periodically scans the database for customer bid information, orders, contracts, etc., and executes a compensation process for failed data. The MySQL database in the product bidding platform stores persistent business data, including orders, bids, and user information, serving as an authoritative data source for subsequent queries.

[0068] The business processing layer 130 uses the following product bidding method to process product bidding business.

[0069] Reference Figure 1 The product bidding method includes the following steps:

[0070] Step S100: Receive customer quotation information;

[0071] Step S200: Lock the order instance of customer quotation information using a distributed lock, determine whether the customer quotation information meets the preset information compliance conditions within the lock, and record the customer quotation information that meets the preset information compliance conditions as the target customer quotation information.

[0072] Step S300: Create a bidding order based on the target customer's quotation information and set delay information. The delay time of the delay information is the bidding countdown time.

[0073] Step S400: Sort the target customer's quotation information by bidding.

[0074] Step S500: When the countdown time for bidding is reached, the bidding process ends based on the delay information, and the winning bidder's bid information is determined from the target customer's bid information.

[0075] Step S600: Within the lock, generate a product order based on the winning customer's quotation information, and release the lock on the order instance.

[0076] After registering on the product bidding platform, users log in through client 110 via API gateway 120 and enter the order system of the product bidding platform. Client 110 includes web-based and mini-program versions.

[0077] The order system of the commodity bidding platform is provided with a bidding participation entrance, and a user enters the bidding participation entrance through the client 110 to participate in bidding.

[0078] The user sends customer bid information through the client 110, and the customer bid information includes user, user associated enterprise, commodity, commodity quantity, commodity bid, transaction rule and the like. The commodity bidding platform receives the customer bid information.

[0079] The user places an order through the client 110, and the order placing is a process of a seller initiating a transaction intention, and the order placing is double-checked by enterprise internal approval and platform audit to ensure transaction compliance.

[0080] Referring to Figure 9 , the process of the order placing is as follows: the seller submits order placing information (commodity, price, transaction rule and the like) as customer bid information, and a new order is created according to the order placing information and is marked as NEW (new). If the seller voluntarily cancels or the system forcibly terminates, the order is invalidated through CANCEL, the order terminates, and the process ends. Otherwise, the order enters an enterprise internal audit state and is marked as OA_PENDING_APPROVAL (pending OA approval), and the order needs to be audited for enterprise compliance; when the enterprise rejects, it is marked as OA_REJECT (enterprise rejection) and is rolled back to NEW; when the OA passes, it enters PENDING_APPROVAL (pending platform approval). When the order enters the pending platform approval state, information such as commodity qualification and rule compliance is submitted for platform audit; when the platform rejects, it is marked as FAILURE (platform rejection) and is rolled back to NEW; when the platform passes (PASSED), it is marked as COMPLETED_APPROVAL (approval passed). When the approval passes, the order enters a publishable state. The order is published and is marked as RELEASE (published); the order enters a transaction pool and is visible to the outside, and a buyer can take the order. Before a transaction is reached, the seller can voluntarily cancel, the order is invalidated through CANCEL, the order terminates, and the process ends. When a transaction is reached, the order is marked as FINAL_CLOSE (transaction reached), and the transaction is completed.

[0081] After the commodity bidding platform receives the customer bid information, the commodity bidding platform acquires and verifies the user information in the customer bid information; when the user information is in a blacklist, the customer bid information is deleted. When the user information indicates that the user is an enterprise, enterprise bidding is performed, and the enterprise qualification and state are verified, for example, whether the enterprise information is compliant, whether the enterprise is in a blacklist and the like.

[0082] The commodity bidding platform also checks whether the user account balance meets the bidding amount according to the total bid of the commodity in the customer bid information to prevent overspending, and freezes the account funds of the user.

[0083] The commodity bidding platform determines the current commodity according to the commodity information of the customer bid information, locks the order instance of the customer bid information through a distributed lock, judges in the lock whether the customer bid information meets the preset information compliance condition, and records the customer bid information meeting the preset information compliance condition as target customer bid information.

[0084] For example, the user needs to purchase a computer, and the commodity of the customer bid information is a computer. The computer is determined as the current commodity according to the commodity information of the customer bid information.

[0085] In a distributed system, the customer bid information sent by one customer is one order, and each order is respectively assigned with an order ID as unique identification information. One order instance is processed through a single thread to realize distributed concurrent control management. For example, Redisson RLock is used to lock according to the order ID. In this way, it can be ensured that only one service instance can perform an operation at the same time.

[0086] In the formula, the reference Figure 2 When the preset information compliance condition is a non-repeated bid operation, whether the customer bid information meets the preset information compliance condition is judged in the lock, and the customer bid information meeting the preset information compliance condition is recorded as target customer bid information, including the following steps:

[0087] Step S211, in the lock, whether the historical bid of the user corresponding to the customer bid information for the commodity corresponding to the customer bid information is recorded is queried;

[0088] Step S212, when there is no record of historical bid, the customer bid information is determined as customer bid information meeting the preset information compliance condition;

[0089] Step S213, when there is a record of historical bid, the customer bid information is determined as customer bid information not meeting the preset information compliance condition;

[0090] Step S214, the customer bid information meeting the preset information compliance condition is recorded as target customer bid information.

[0091] Through the above distributed lock operation, repeated bid operation of the same user for the same commodity is avoided.

[0092] Of course, in other embodiments, the preset information compliance condition can also include non-blank bid operation, etc., that is, it is detected that the commodity, price, quantity and other information cannot be empty.

[0093] When the customer bid information meets the preset information compliance condition, the customer bid information meeting the preset information compliance condition is recorded as target customer bid information, and the target customer bid information is recorded and stored in the MySQL database.

[0094] According to the target customer quotation information, a bidding sheet is created, and the target customer quotation information is ranked by bidding.

[0095] Referring to Figure 3 According to the target customer quotation information, a bidding sheet is created, and delay information is set, including the following steps:

[0096] In step S310, a bidding sheet is created according to the target customer quotation information.

[0097] In step S320, a delay exchange and an order expiration processing queue are created, and the order expiration processing queue is bound to the delay exchange.

[0098] In step S330, a delay message is generated according to the bidding countdown time and the bidding sheet.

[0099] In step S340, the delay message is sent to the delay exchange.

[0100] Specifically, a delay exchange and an order expiration processing queue are created, the order expiration processing queue is bound to the delay exchange, and a routing key is specified. According to the target customer quotation information (including user, user associated enterprise, commodity, commodity quantity, commodity quotation, transaction rules, etc.), a bidding sheet is created. When the bidding sheet is created, a delay message is sent to the delay exchange. When the message is sent, the 'x-delay' parameter (in milliseconds) of the message is set, indicating the time the message needs to be delayed. The delay exchange will determine the delay time of the message according to the x-delay parameter in the message header. Before the delay time arrives, the message will be stored in the memory, for example, persisted to the disk.

[0101] When the bidding countdown time is reached, the bidding end operation of the bidding sheet is processed according to the delay information, including the following steps: when the bidding countdown time is reached, the delay exchange routes the delay message to the order expiration processing queue; the delay message is obtained from the order expiration processing queue, and the bidding end operation of the bidding sheet is processed according to the delay information. The bidding end operation includes operations such as determining the winning bidder, formulating the contract, and closing the order. The final quotation data of MySQL is read, and the winning supplier is determined according to the rules; the funds of the non-winning bidders are unfrozen, and the frozen funds of the winning bidder are deducted; the order status is updated, the winning order in MySQL is marked as "has been won", and the non-winning order in MySQL is marked as "has been ended".

[0102] Among them, the buyer participates in the order transaction by taking orders, and determines the winning bid according to the customer quotation information. The winning customer quotation information is determined from the target customer quotation information.

[0103] Referring to Figure 10, the process of taking an order is as follows: the buyer submits order taking application information (including bid, quantity, etc.), a new order is created, and the status of the order is marked as NEW. When the buyer's account balance is sufficient, the account balance is frozen, and the transaction waiting period is entered, and the status of the order is marked as FROZEN_FUND. If the balance is insufficient, it fails and reverts to NEW. In the transaction waiting period, the funds are successfully frozen, and the order is waiting for the result of the order transaction (such as bid countdown, seller confirmation), and the status of the order is marked as PENDING_COMPLETED. If the bid is successful, the frozen funds are deducted, and the status of the order is marked as COMPLETED. If the order is cancelled, it is not successful, and the process ends, and the status of the order is marked as CANCEL. If the order expires or the current buyer does not win the bid, the frozen funds are unfrozen, the process ends, and the status of the order is marked as FINAL_CLOSE.

[0104] Referring to Figure 4 In the bid sorting process, the target customer bid information is sorted, including the following steps:

[0105] Step S410, write the target customer bid information into the ordered set;

[0106] Step S420, sort the target customer bid information through the ordered set;

[0107] Step S430, when the ordered set is sorted, the updated ordered set is sent to the client for display.

[0108] Specifically, in the commodity bidding platform, Redis cluster is used to realize the dynamic update of the bid ranking on the board. By using the data structure characteristics of Redis ordered set, each element is associated with a score (the bid amount, bid time, etc. can be used as the basis for sorting), and Redis will automatically sort the set elements according to the score. In addition, if the bid amount is the same, the ranking needs to be distinguished (such as the first bidder), the score can be designed as a combination value. Combined with WebSocket technology, the backend listens to the changes of the Redis ordered set (such as by subscribing to the Keyspace event, or triggering after each ZADD / ZREM), and pushes the latest ranking data (such as the top N) to the front-end board. The front-end calls the back-end interface regularly (such as every 5 seconds), and the back-end queries the Redis ordered set to obtain the ranking data and returns it. In addition, by hashing and sharding the order ID, the ranking data of different bidding orders is evenly distributed in each master node of the Redis cluster, which can prevent the pressure on a single node from being too large.

[0109] The data cleaning and expiration strategy of the Redis ordered set can be cleaned according to the business cycle. If the bidding has a time limit (such as an auction ending in 24 hours), the key of the corresponding ordered set can be deleted after the bidding ends to release the cluster resources. The expiration time of the ordered set key is set to allow Redis to automatically clean up the expired bidding ranking data.

[0110] With the ordered set and distributed characteristics of the Redis cluster, the real-time update of the bidding ranking on the board in the mall can be efficiently realized, supporting high concurrency and high availability business scenarios, so that users can see the bidding dynamics in real time.

[0111] The lock of the order instance corresponding to the winning customer bid information is acquired, and in the lock, a commodity order is generated according to the winning customer bid information to ensure the concurrency control of the order generation process.

[0112] Referring to Figure 5 In the lock, a commodity order is generated according to the winning customer bid information, and a release lock operation is performed on the order instance, including the following steps:

[0113] Step S610, in the lock, reading the inventory quantity of the goods corresponding to the winning customer bid information, comparing the quantity of the goods of the winning customer bid information with the inventory quantity;

[0114] Step S620, when the quantity of the goods of the customer bid information is less than or equal to the inventory quantity, generating a commodity order according to the winning customer bid information, and performing a release lock operation on the order instance of the winning customer bid information;

[0115] Step S630, when the quantity of the goods of the customer bid information is greater than the inventory quantity, the generation of the commodity order fails, and a release lock operation is performed on the order instance corresponding to the winning customer bid information.

[0116] The above distributed lock operation avoids the occurrence of overbuying and overselling behaviors.

[0117] After locking the order instance corresponding to the winning customer bid information, the tryLock method is used to attempt to acquire the lock, and the parameters are respectively the waiting time, the lock automatic release time, and the time unit. The waiting time is set to wait for 100 milliseconds, and if the lock is not acquired within 100 milliseconds, a failure is returned. The holding time of the lock is set to 10 seconds to prevent a certain thread from obtaining the lock and not releasing it, causing the lock resource to be occupied for a long time.

[0118] Under the protection of the lock, the current inventory quantity is read from the database or cache, and it is judged whether it is greater than or equal to the quantity to be deducted. If the inventory is sufficient, the deduction operation is performed. After the deduction is completed, the lock is released to allow other requests to acquire the lock for operation. If an exception occurs during the deduction process, the lock also needs to be released in the exception handling to ensure that the system does not occur deadlock.

[0119] If an exception occurs during execution after acquiring the lock (such as an operation exception in Redis), enter the catch block, return an error message, and release the lock in the finally block. The release of the lock needs to be done in the finally block to ensure that the lock is released regardless of success or failure.

[0120] In addition, Redisson provides a watchdog mechanism that can automatically renew the lock when the business execution time is longer, preventing the problem of automatic release of the lock because the business is not executed. At the same time, if the service is down, the lock will also be released after the timeout, avoiding deadlock. For example, when using the tryLock method, if the leaseTime is set to -1, the watchdog mechanism is enabled. The automatic release time is set to 10 seconds, so the watchdog is not enabled. If the business execution time exceeds 10 seconds, you need to set the leaseTime to be long enough or set it to -1 to enable the watchdog.

[0121] Perform idempotent processing at the business interface level. For example, generate a unique request ID for each quote request and use it as an idempotent identifier, storing it in Redis or a database. When processing the quote, first check if the request ID has been processed. If it has been processed, return the previous result directly; if it has not been processed, perform the subsequent operation. In this way, even if the lock mechanism fails, repeated quotes can be avoided to some extent.

[0122] During the locking and business processing process, exception handling is required. If the locking fails, a friendly prompt can be returned to the user to retry later; if an exception occurs during business execution (such as database write failure), reasonable retries or log recording can be performed to facilitate problem troubleshooting, and the lock is released to avoid affecting subsequent requests.

[0123] Through the above steps, relying on the mutual exclusion of distributed locks, combined with business verification, idempotent design, and other means, repeated quotes for the same user / order can be effectively prevented, concurrent write conflicts can be avoided, and the stability and data consistency of the mall platform quote function can be ensured.

[0124] According to the bidding sorting result, generate a commodity order. Use the distributed scheduling task Xxl-job for timing compensation.

[0125] Referring to Figure 6 , the timing compensation step includes the following steps:

[0126] Step S641, send a scanning instruction to the executor deployed in the business processing layer through the scheduling center;

[0127] Step S642, scan the commodity order in the database through the executor after receiving the scanning instruction, and obtain the failed order marked as a failure state;

[0128] Step S643, in the lock, according to the customer quote information corresponding to the failed order to regenerate the commodity order;

[0129] Step S644, when the commodity order is regenerated successfully, mark the failed order as a success state, and release the lock operation of the order instance of the failed order marked as a success state.

[0130] In the Xxl-job task, including Xxl-job scheduling center, Xxl-job executor and order database. The scheduling center is deployed in the central node, responsible for managing timing tasks, distributing tasks to the executor cluster, and ensuring task sharding execution. The executor is deployed in the service node of the business processing layer 130, receives the instruction of the scheduling center, and executes the compensation logic. The order database is MySQL, responsible for storing order status and recording failure reasons, etc.

[0131] Xxl-job as a distributed task scheduling platform, will trigger the corresponding compensation task according to the pre-set time rule (for example, every few minutes, every hour, etc. Periodic). When the set trigger time point is reached, the scheduling center of Xxl-job will trigger the compensation task; then a node in the executor cluster will get the task lock and start scanning the orders in the database with the state of "generation failure"; finally, the order tries to execute the generation logic again.

[0132] After the executor receives the task instruction, it will connect to the order database and retrieve order information according to certain query conditions. These query conditions will focus on order records marked as failure or contract generation failure, such as filtering orders that meet the failure state by querying the order status field.

[0133] Because there may be a large amount of order data in the mall platform, in order to prevent excessive scanning of data from causing excessive pressure on the database and to avoid long task execution time, a paging query method is usually used. All executors receive tasks at the same time, scan different data intervals according to the sharding parameters. Each time only a certain number of failed orders are scanned, and then the scanning range is gradually advanced until all orders that meet the conditions in the entire database are scanned. At the same time, some flow limiting mechanisms are also set to limit the number of orders processed in a unit of time to ensure the stability of the system and the normal operation of other businesses.

[0134] For the scanned failed orders, the system uses the tryLock method to try to acquire the lock. After obtaining the lock corresponding to a failed order, the order generation related business logic code and interface is reinvoked within the lock to try to recreate the orders. This includes recalculating the order amount, checking the product inventory, updating the order status, and a series of operations, just like handling a new normal order, except that this time the operation is a compensation for the previous failure. The purpose is to make these originally failed orders as normal as possible to be successfully generated under the current system environment (such as the network being restored to normal, related components Redis, RabbitMQ, etc. being restored to normal work). The automatic compensation operation of the order within the lock has the effect of concurrent protection.

[0135] When the order regeneration is successful, the system further triggers the related process of contract generation. According to the normal business logic, the contract content is reassembled according to the regenerated order information, the contract generation interface and service are called, the contract file is regenerated and stored, and the contract state and other related information are updated, so that the contract can correspond to the successfully compensated order, and the integrity and consistency of the business process are guaranteed.

[0136] In the entire compensation process, whether it is order regeneration or contract regeneration, as long as a certain link is successful or failed, the corresponding record state will be updated in time. For example, the order state is updated from "failed to reach" to "re-generated successfully" or "re-generated failed (and record the failure reason)", and the contract state is correspondingly modified, so that the subsequent monitoring, statistics and re-compensation operation can be accurately based on the latest state information. At the same time, the system will record the execution process of each compensation task in detail, including the scanned order range, the detailed information of each order regeneration and contract regeneration (such as the time of success, the specific error information of failure, etc.). These log information is stored in log files or special log databases, which on the one hand facilitates the developers and maintenance personnel to troubleshoot and analyze when problems occur, and on the other hand can be used for subsequent data analysis to evaluate the effectiveness of the compensation mechanism and the impact on business, etc.

[0137] Through the Xxl-job timing compensation mechanism, the order reaching and contract generation failure caused by network or related component sudden abnormality can be automatically responded to a certain extent, the reliability and stability of the mall platform business are improved, and the loss caused by these temporary faults to the business is reduced.

[0138] Reference Figure 8In general, the commodity bidding process of the commodity bidding platform is as follows. Multiple clients 110 (for example, client 1, client 2, client 3, and the like) enter the bidding process through an API gateway 120 from a bidding portal of an order system of the commodity bidding platform. The user makes a bid through the client 110, and the commodity bidding platform receives the client bid information. The system checks the associated enterprise of the user, verifies whether the associated enterprise meets the requirements through enterprise qualification and status information, and checks the account funds of the user, judges whether the account funds of the user are sufficient. The commodity bidding platform determines the current commodity according to the client bid information, locks the order instance through a distributed lock, judges whether the client bid information meets the preset information compliance conditions (including no repeated bidding operation, etc.) in the lock, and records the client bid information meeting the preset information compliance conditions as target client bid information. The funds of the user account corresponding to the client bid information meeting the preset information compliance conditions are frozen. According to the target client bid information, the target client bid information is written into a MySQL database. According to the target client bid information, a bidding order is created, delay information is set, and the delay information is sent to a RabbitMQ cluster to realize bidding countdown. In the process of bidding countdown, the target client bid information is ranked by a real-time ranking engine, and the real-time ranking result is written into the MySQL database. The real-time data such as the commodity price of the client bid information, the countdown, and the bidding ranking is carried by a Redis cluster, and the commodity price of the client bid information, the countdown, and the bidding ranking are sent to the board of the client 110 for display. The commodity bidding platform and the client 110 realize the push and reception of real-time change information through a websocket cluster. When the bidding countdown time is reached, the bidding end operation of the bidding order is processed according to the delay information, the winning bidder and the winning client bid information are determined. The lock of the order instance corresponding to the winning client bid information is acquired, and whether the winning client bid information exists in the overbuying or overselling situation is judged according to the inventory of the commodity in the lock. When the winning client bid information meets the inventory requirement, a commodity order is generated according to the winning client bid information, and a contract is signed between the winning bidder and the winning client according to the client bid information provided by the winning bidder; the order, the contract and the like are written into the MySQL database. The winning bidder is notified by a short message, and the winning message is sent to the client 110 of the winning bidder. In addition, a distributed scheduling task Xxl-job is used for timing compensation. The Xxl-job timing task will scan the order and contract information regularly, and regenerate the failed order or contract.

[0139] Embodiments of the present application provide an electronic device. The electronic device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the commodity bidding method as described above when executing the computer program.

[0140] The electronic device can be any intelligent terminal including a computer.

[0141] Generally, for the hardware structure of the electronic device, the processor can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the embodiments of the present application.

[0142] The memory can be implemented in the form of a ROM (ReadOnly Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), etc. The memory can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are saved in the memory and are called and executed by the processor to implement the method of the embodiments of the present application.

[0143] The input / output interface is used to realize information input and output.

[0144] The communication interface is used to realize the communication interaction between the device and other devices, and the communication can be realized by a wired manner (for example, a USB, a network cable, etc.) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.).

[0145] The bus transmits information between various components (for example, the processor, the memory, the input / output interface, and the communication interface) of the device. The processor, the memory, the input / output interface, and the communication interface realize the communication connection between each other in the device through the bus.

[0146] The embodiments of the present application provide a computer storage medium. The computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the commodity bidding method as described above.

[0147] Those of ordinary skill in the art will appreciate that all or some steps, systems of the above disclosed methods can be implemented as software, firmware, hardware, or appropriate combinations of them. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on computer readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer 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, data structures, program modules or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, it should be appreciated by those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. In the foregoing description of the present specification, reference has been made to descriptive terms such as "one embodiment / implementation", "another embodiment / implementation", or "some embodiments / implementations" etc. It is appreciated that such descriptive terms are not intended to necessarily limit or restrict the scope of the embodiments or examples to the particular embodiments or examples described. Also, the description of features or aspects of the described implementations as being "one embodiment / implementation", "another embodiment / implementation", or "some embodiments / implementations" etc. does not limit or restrict the scope of the described implementations to just those embodiments or examples described. Also, the described features or aspects of the implementations can be combined together in any combination to make up some embodiments or examples of the described implementations.

[0148] Those of ordinary skill in the art will appreciate that all or some steps, systems, functional modules / units in the above disclosed methods can be implemented as software, firmware, hardware, or appropriate combinations of them.

[0149] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected to achieve the purposes of the embodiments according to actual needs.

[0150] In addition, each of the functional units in the 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 implemented in the form of hardware, or in the form of a software functional unit.

[0151] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially, or parts contributing to the prior art, or all or a part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and various other media that can store programs.

[0152] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other ways. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the above units is only a logical function division, and actual implementation can have another division manner, for example, 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 coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms. Although the embodiments of the present application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.

[0153] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A method of auctioning goods, characterized by, The method comprises the following steps: receiving customer offer information; locking the order instance of the customer offer information through a distributed lock, judging in the lock whether the customer offer information meets preset information compliance conditions, and recording the customer offer information meeting the preset information compliance conditions as target customer offer information; creating a bid sheet according to the target customer offer information and setting delay information, the delay time of the delay information being a bid countdown time; sorting the target customer offer information according to the bid; when the bid countdown time is reached, processing the bid end operation of the bid sheet according to the delay information, and determining the winning customer offer information from the target customer offer information; in the lock, generating a commodity order according to the winning customer offer information, and releasing the lock operation of the order instance.

2. The method of claim 1, wherein, The preset information compliance conditions include no repeated offer operation; the step of judging in the lock whether the customer offer information meets the preset information compliance conditions and recording the customer offer information meeting the preset information compliance conditions as target customer offer information comprises the following steps: in the lock, querying whether there is a record of historical offers of the customer offer information corresponding to the user corresponding to the customer offer information on the commodity corresponding to the customer offer information; when there is no record of the historical offers, judging that the customer offer information is customer offer information meeting the preset information compliance conditions; when there is a record of the historical offers, judging that the customer offer information is customer offer information not meeting the preset information compliance conditions; recording the customer offer information meeting the preset information compliance conditions as target customer offer information.

3. The method of claim 1, wherein, The step of creating a bid sheet according to the target customer offer information and setting delay information comprises the following steps: creating a bid sheet according to the target customer offer information; creating a delay exchange and an order expiration processing queue, and binding the order expiration processing queue to the delay exchange; generating a delay message according to the bid countdown time and the bid sheet; sending the delay message to the delay exchange; The step of processing the bid end operation of the bid sheet according to the delay information when the bid countdown time is reached comprises the following steps: when the bid countdown time is reached, the delay exchange routes the delay message to the order expiration processing queue; obtaining the delay message from the order expiration processing queue, and processing the bid end operation of the bid sheet according to the delay information.

4. The method of claim 1, wherein, The step of sorting the target customer offer information according to the bid comprises the following steps: writing the target customer offer information into an ordered set; sorting the target customer offer information through the ordered set; when a sorting change of the ordered set is listened to, sending the updated ordered set to a client for display.

5. The method of claim 1, wherein, The step of generating a commodity order according to the winning customer offer information in the lock and releasing the lock operation of the order instance comprises the following steps: in the lock, reading the inventory quantity of the commodity corresponding to the winning customer offer information, and comparing the commodity quantity of the winning customer offer information with the inventory quantity; when the commodity quantity of the customer offer information is less than or equal to the inventory quantity, generating a commodity order according to the winning customer offer information, and releasing the lock operation of the order instance of the winning customer offer information. When the commodity quantity of the client bid information is greater than the inventory quantity, the generation of the commodity order fails, and a lock releasing operation is performed on an order instance corresponding to the winning client bid information.

6. The method of claim 1, wherein, After the generation of the commodity order fails, the method further includes: sending a scanning instruction to an executor deployed in the business processing layer by the dispatching center at a regular time; scanning the database for a commodity order by the executor after receiving the scanning instruction, and obtaining a failed order marked as a failure state; regenerating a commodity order according to client bid information corresponding to the failed order in the lock; when the regeneration of the commodity order succeeds, marking the failed order as a success state, and performing a lock releasing operation on an order instance of the failed order marked as the success state.

7. The merchandise bidding method of claim 1, wherein, After the client bid information is received, the method includes: obtaining and verifying user information in the client bid information; when the user information is in a blacklist, deleting the client bid information.

8. A commodity bidding platform characterized by, The method includes: a client; a gateway; a business processing layer, the client being connected to the business processing layer through the gateway, and the business processing layer applying the commodity bidding method according to any one of claims 1 to 7 to process a commodity bidding business; an infrastructure layer, the infrastructure layer being connected to the business processing layer, and the infrastructure layer being configured to store intermediate processing data and processing results in a commodity bidding business process, and send the processing results to the client.

9. An electronic device, comprising: The method includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the commodity bidding method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that, The computer executable instructions are stored in the memory, and the computer executable instructions are used to execute the commodity bidding method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Distributed processing method and device of automatic bank bond quotation system

    CN113590641A

  • Network bidding system and method for avoiding abnormal ending of bidding

    CN115660793A

  • Online auction system and method

    CN117876082A

  • Method for realizing combined execution of bidding countdown and business processing based on memory

    CN118521317A