The invention provides a red envelope grabbing method,
system and device in a high-
concurrency scene and a storage medium, and the method comprises the steps: receiving a red envelope creation request, synchronously deducting the account fund of a sender, pre-distributing the amount by using a double mean value
algorithm, generating an amount
list, and storing the
list, an inventory counter and a user deduplication set into Redis. And when a grabbing request is received, executing Redis Lua script atomization operation: verifying user de-duplication, checking red envelope inventory, deducting the inventory after the red envelope inventory passes, popping up money from a
list, and recording grabbing information. If the script is executed successfully, judging that grabbing succeeds, generating a success message to a
message queue, and asynchronously updating the balance of the
receiver and recording a flow by the
consumer. And a grading reconciliation mechanism is adopted to ensure that the
robbing record is consistent with the fund flow. And after the red envelope is sent for a preset time, scanning the unscrambled amount and returning the unscrambled amount to the sender account. According to the invention, a high-performance, high-reliability, safe and flexible red envelope grabbing
system can be constructed.