Sales locking method and system based on caching

A locking system and caching technology, applied in the field of sales locking method and system based on caching, can solve the problems of DB performance bottleneck, single system inventory structure, low TPS processing capacity, etc., to improve efficiency, improve processing efficiency, and ensure consistency sexual effect

Active Publication Date: 2020-10-09
SUNING COM CO LTD
View PDF2 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] In order to solve the problems of the prior art, the embodiment of the present invention provides a cache-based sales locking method and device to overcome the DB performance bottleneck in the prior art of sales locking w

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Sales locking method and system based on caching
  • Sales locking method and system based on caching
  • Sales locking method and system based on caching

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0057] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Some, but not all, embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0058] The cache-based sales locking method and device provided by the embodiments of the present invention operate the inventory cache, and synchronize the inventory changes in the cache library with the inventory quantity of the DB (database) in an asynchronous manner through the second-level JOB, Ensure that the number in the cache library is consistent with the num...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a sales locking method and system based on caching, and the method comprises the following steps: S1, dividing commodity information into a plurality of parts according to themodulus of a commodity code, and respectively storing the commodity information in a cache library of a corresponding code of Redis according to a preset rule; S2, obtaining and analyzing a sales locking request of the commodity to obtain a request list; S3, recording an inventory change intermediate table in the same transaction according to the request list, and then updating the commodity information in the cache library of the corresponding code of the Redis; and S4, asynchronously updating the commodity information in the database by using the second-level JOB according to the inventory change intermediate table. According to the method, the use of a single Redis cache library for storing a large amount of data is avoided; query efficiency is improved, atomicity of LUA scripts is usedfor replacing database affairs to guarantee data consistency, inventory concurrency control is conducted by means of the characteristics of Redis single threads, and the gray scale state is used forsolving the problem that cache and database data are inconsistent due to data processing when requests come in the process of switching the data to the cache.

Description

technical field [0001] The invention relates to the technical field of computer software, in particular to a cache-based sales locking method and system. Background technique [0002] With the development of the Internet, traditional stores are gradually replaced by online shopping platforms. More and more users choose to shop online, and at the same time, in order to attract users, online shopping platforms have launched a variety of promotional activities, such as flash sales, rush purchases, group purchases, etc. Promotional activities will generate instantaneous high concurrency, which puts forward high requirements on the processing efficiency of the entire transaction link. The maintenance of inventory quantity is a core part of it, and efficient processing is also crucial. [0003] In the current inventory deduction method, the sales lock (temporary lock + official lock) and delivery lock (logistics delivery) adopt the scheme based on database + application lock tech...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F16/23G06F16/2455G06F16/2458G06Q10/08
CPCG06F16/2343G06F16/24552G06F16/2471G06Q10/087G06F16/23G06F16/2455G06F16/2458G06Q10/08
Inventor 杨庆枫司孝波秦刚王康龙李磊
Owner SUNING COM CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products