Article inventory deduction method and device

By setting up inventory shards of multiple inventory subdomains for deducted items and performing inventory deduction based on the activated inventory subdomains in the target inventory shard, the problems of low inventory deduction efficiency and inability to cope with high concurrency in the existing technology are solved, and efficient inventory management is achieved.

CN119648105APending Publication Date: 2025-03-18BEIJING JINGDONG QIANSHITECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311191663.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, the item inventory deduction operation occupies a lot of database resources, has high performance requirements, and has low inventory deduction efficiency, so it is impossible to cope with inventory deduction operations in high concurrency scenarios.

Method used

By setting up inventory shards including multiple inventory subdomains for items to be deducted, and inventory deductions for items to be deducted based on the activation inventory subdomain in the target inventory shard, reducing database resource occupancy and performance requirements.

Benefits of technology

It improves inventory deduction efficiency and can cope with inventory deduction operations in high concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648105A_ABST
    Figure CN119648105A_ABST
Patent Text Reader

Abstract

The invention discloses an article inventory deduction method and device, and relates to the technical field of warehouse logistics. A specific embodiment of the method comprises the following steps: in response to an inventory deduction request of an article, obtaining an inventory deduction value of a to-be-deducted article and at least one inventory fragment corresponding to the to-be-deducted article; according to a preset inventory fragment determination rule and the inventory deduction value, selecting a target inventory fragment corresponding to the to-be-deducted article from the inventory fragments; according to the inventory deduction value, inventory deduction of the to-be-deducted article is carried out through the activated inventory sub-domain in the target inventory fragment, and inventory deduction information is generated; and in response to the fact that the inventory deduction synchronization rule is met, performing article inventory deduction on the inventory detail list according to the inventory deduction information. According to the embodiment, the database resources occupied by the inventory deduction operation of the articles and the performance requirements on the database can be reduced, the inventory deduction efficiency is improved, and the inventory deduction operation in a high-concurrency scene can be coped with.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of warehousing logistics, and in particular to a method and device for reducing the inventory of articles. Background Art

[0002] During the rush-buy promotions on shopping platforms, the number of items sold during peak hours is very large, and the inventory deduction operations on items in the database are very frequent. The current inventory deduction scheme for items is to deduct the inventory of items by adding hardware or using cache operations.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The inventory deduction operation of items occupies a lot of database resources, has high requirements on database performance, and has low inventory deduction efficiency, which cannot cope with inventory deduction operations in high-concurrency scenarios. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for inventory deduction of items. By setting an inventory shard including multiple inventory subdomains for the items to be deducted, and performing inventory deduction of the items to be deducted based on the activated inventory subdomain in the target inventory shard, the database resources occupied by the inventory deduction operation of the items and the performance requirements on the database can be reduced, the inventory deduction efficiency can be improved, and the inventory deduction operation in high concurrency scenarios can be handled.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for reducing inventory of items is provided.

[0007] A method for reducing inventory of an item comprises: in response to an inventory reduction request of an item, obtaining an inventory reduction value of the item to be reduced and at least one inventory shard corresponding to the item to be reduced, wherein each inventory shard comprises an activated inventory subdomain; according to a preset inventory shard determination rule, selecting a target inventory shard corresponding to the item to be reduced from the inventory shard according to the inventory reduction value; performing inventory reduction of the item to be reduced through the activated inventory subdomain in the target inventory shard according to the inventory reduction value, and generating inventory reduction information; in response to satisfying an inventory reduction synchronization rule, performing inventory reduction of the item on the inventory detail list according to the inventory reduction information.

[0008] Optionally, each inventory subdomain included in the inventory shard has a pre-occupied inventory value; and the method of determining the target inventory shard corresponding to the item to be deducted according to the inventory deduction value and in accordance with a preset inventory shard determination rule includes: selecting the target inventory shard corresponding to the item to be deducted from the inventory shard whose pre-occupied inventory value reaches the inventory deduction value according to the pre-occupied inventory value of the activated inventory subdomain of each inventory shard.

[0009] Optionally, the inventory deduction of the items to be deducted is performed according to the inventory deduction value through the activated inventory subdomain in the target inventory shard, including: calculating the pre-occupied inventory value after deduction according to the pre-occupied inventory value of the activated inventory subdomain in the target inventory shard and the inventory deduction value; and updating the pre-occupied inventory value of the activated inventory subdomain in the target inventory shard using the pre-occupied inventory value after deduction.

[0010] Optionally, after using the deducted pre-occupied inventory value to update the pre-occupied inventory value of the activated inventory subdomain in the target inventory shard, it also includes: comparing the deducted pre-occupied inventory value with a preset pre-occupied inventory first threshold; if the deducted pre-occupied inventory value does not reach the pre-occupied inventory first threshold, setting the activated inventory subdomain to a locked inventory subdomain, and determining a new activated inventory subdomain of the target inventory shard from the inventory subdomains to be activated included in the target inventory shard.

[0011] Optionally, after setting the activated inventory subdomain as the locked inventory subdomain, the method further includes: calculating the pre-occupied inventory value to be replenished of the locked inventory subdomain according to a preset pre-occupied inventory second threshold and the pre-occupied inventory value after deduction, obtaining the pre-occupied inventory of the pre-occupied inventory value to be replenished from a preset inventory pool and replenishing it into the locked inventory subdomain, and setting the locked inventory subdomain as the inventory subdomain to be activated.

[0012] Optionally, before obtaining the pre-occupied inventory of the pre-occupied inventory value to be replenished from the preset inventory pool, it also includes: judging whether there is pre-occupied inventory of the pre-occupied inventory value to be replenished in the preset inventory pool, and determining whether there is pre-occupied inventory of the pre-occupied inventory value to be replenished in the preset inventory pool.

[0013] Optionally, the method further includes: when all the inventory subdomains included in the target inventory shard are locked inventory subdomains, determining the number of inventory shards corresponding to the items to be deducted; when the number of inventory shards is greater than 1, adding the occupied inventory values ​​of all inventory subdomains included in the target inventory shard to a preset inventory pool, and deleting the target inventory shard.

[0014] Optionally, the method further includes: when the number of the inventory shards is less than or equal to 1, adding all the inventory in the preset inventory pool to the locked inventory subdomain of the target inventory shard, and setting the locked inventory subdomains as activated inventory subdomains one by one to perform inventory deduction of the items to be deducted through the activated inventory subdomains; in response to the pre-occupied inventory value of each inventory subdomain included in the target inventory shard being 0, deleting the target inventory shard.

[0015] Optionally, the inventory deduction synchronization rule includes: the current time reaches a preset inventory synchronization time, or the quantity of current inventory deduction information reaches a preset information quantity threshold.

[0016] According to another aspect of an embodiment of the present invention, a device for reducing inventory of items is provided.

[0017] A device for deducting inventory of an item, comprising: an inventory slice acquisition module, for obtaining, in response to an inventory deduction request of an item, an inventory deduction value of the item to be deducted, and at least one inventory slice corresponding to the item to be deducted, each inventory slice comprising an activated inventory subdomain; a target inventory slice selection module, for selecting, according to a preset inventory slice determination rule and the inventory deduction value, a target inventory slice corresponding to the item to be deducted from the inventory slice; an inventory deduction module, for performing inventory deduction of the item to be deducted through the activated inventory subdomain in the target inventory slice according to the inventory deduction value, and generating inventory deduction information; an inventory synchronization module, for performing inventory deduction of items on the inventory detail list according to the inventory deduction information in response to satisfying the inventory deduction synchronization rule.

[0018] Optionally, each inventory subdomain included in the inventory shard has a pre-occupied inventory value respectively; the target inventory shard selection module is also used to: according to the pre-occupied inventory value of the activated inventory subdomain of each inventory shard, select the target inventory shard corresponding to the item to be deducted from the inventory shard corresponding to the pre-occupied inventory value reaching the inventory deduction value.

[0019] Optionally, the inventory deduction module is also used to: calculate the pre-occupied inventory value after deduction based on the pre-occupied inventory value of the activated inventory subdomain in the target inventory shard and the inventory deduction value; and use the pre-occupied inventory value after deduction to update the pre-occupied inventory value of the activated inventory subdomain in the target inventory shard.

[0020] Optionally, the inventory deduction module is also used to: compare the occupied inventory value after the deduction with a preset first threshold of the occupied inventory; if the occupied inventory value after the deduction does not reach the first threshold of the occupied inventory, set the activated inventory subdomain to a locked inventory subdomain, and determine a new activated inventory subdomain of the target inventory shard from the inventory subdomains to be activated included in the target inventory shard.

[0021] Optionally, the inventory deduction module is also used to: calculate the pre-occupied inventory value to be replenished of the locked inventory subdomain based on a preset pre-occupied inventory second threshold and the pre-occupied inventory value after deduction, obtain the pre-occupied inventory of the pre-occupied inventory value to be replenished from a preset inventory pool and replenish it into the locked inventory subdomain, and set the locked inventory subdomain as the inventory subdomain to be activated.

[0022] Optionally, the inventory deduction module is further used to: determine whether there is pre-occupied inventory with the pre-occupied inventory value to be replenished in the preset inventory pool, and determine whether there is pre-occupied inventory with the pre-occupied inventory value to be replenished in the preset inventory pool.

[0023] Optionally, it also includes an inventory slice deletion module, which is used to: when all the inventory subdomains included in the target inventory slice are locked inventory subdomains, determine the number of inventory slices corresponding to the items to be deducted; when the number of inventory slices is greater than 1, add the occupied inventory values ​​of all inventory subdomains included in the target inventory slice to the preset inventory pool, and delete the target inventory slice.

[0024] Optionally, the inventory shard deletion module is further used to: when the number of the inventory shards is less than or equal to 1, add all the inventory in the preset inventory pool to the locked inventory subdomain of the target inventory shard, and set the locked inventory subdomains as activated inventory subdomains one by one to perform inventory deduction of the items to be deducted through the activated inventory subdomains; in response to the pre-occupied inventory value of each inventory subdomain included in the target inventory shard being 0, delete the target inventory shard.

[0025] Optionally, the inventory deduction synchronization rule includes: the current time reaches a preset inventory synchronization time, or the quantity of current inventory deduction information reaches a preset information quantity threshold.

[0026] According to yet another aspect of the embodiments of the present invention, an electronic device is provided.

[0027] An electronic device includes: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the inventory deduction method of items provided in an embodiment of the present invention.

[0028] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0029] A computer-readable medium stores a computer program, which, when executed by a processor, implements the inventory deduction method for items provided in an embodiment of the present invention.

[0030] An embodiment of the above invention has the following advantages or beneficial effects: by responding to an inventory deduction request of an item, the inventory deduction value of the item to be deducted and at least one inventory shard corresponding to the item to be deducted are obtained, and each inventory shard includes an activated inventory subdomain; according to a preset inventory shard determination rule, a target inventory shard corresponding to the item to be deducted is selected from the inventory shard according to the inventory deduction value; according to the inventory deduction value, the inventory deduction of the item to be deducted is performed through the activated inventory subdomain in the target inventory shard, and inventory deduction information is generated; in response to satisfying the inventory deduction synchronization rule, the technical solution of performing inventory deduction of the item on the inventory details list according to the inventory deduction information, by setting an inventory shard including multiple inventory subdomains for the item to be deducted, and performing inventory deduction of the item to be deducted based on the activated inventory subdomain in the target inventory shard, it is possible to reduce the database resources occupied by the inventory deduction operation of the item and the performance requirements on the database, improve the inventory deduction efficiency, and cope with the inventory deduction operation in a high concurrency scenario.

[0031] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0033] Figure 1 is a schematic diagram of main steps of a method for reducing inventory of items according to an embodiment of the present invention;

[0034] Figure 2 is a schematic diagram of the structure of a method for reducing inventory of items according to an embodiment of the present invention;

[0035] Figure 3 is a flow chart of a method for reducing inventory of items according to an embodiment of the present invention;

[0036] Figure 4 is a schematic diagram of main modules of an inventory deduction device for items according to an embodiment of the present invention;

[0037] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0038] Figure 6It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0040] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0041] Figure 1 1 is a schematic diagram of main steps of a method for reducing inventory of items according to an embodiment of the present invention.

[0042] like Figure 1 As shown, the inventory deduction method of an item according to an embodiment of the present invention mainly includes the following steps S101 to S104.

[0043] Step S101: in response to an inventory deduction request for an item, obtain an inventory deduction value of the item to be deducted and at least one inventory slice corresponding to the item to be deducted.

[0044] Specifically, the items to be deducted can be best-selling items or promotional items for promotional activities. Each item to be deducted has a pre-set number of inventory shards, each inventory shard can include a preset number of inventory subdomains, each inventory shard includes an activated inventory subdomain, and can also include an inventory subdomain to be activated, a locked inventory subdomain, etc., and each inventory subdomain has a pre-occupied inventory value. Among them, the inventory shard (Partition) can be constructed based on the redis (a high-performance database) storage unit. In an inventory shard, a certain amount of pre-occupied inventory will be stored. When a service is requested to deduct inventory, only one of the inventory shards needs to be selected, which can reduce the pressure on a single node. At the same time, based on the scalability of the redis cluster, the horizontal expansion of the inventory shard can be achieved. A certain amount of pre-occupied inventory value will be stored in each inventory subdomain included in the inventory shard, and the pre-occupied inventory value is not very large, which can ensure the dynamic pre-occupied inventory implementation, thereby solving the problem of inventory tilt.

[0045] Figure 2 Schematic diagram of an inventory deduction method for items according to an embodiment of the present invention.

[0046] like Figure 2 As shown, the items to be deducted have four corresponding inventory slices, namely inventory slice A, inventory slice B, inventory slice C and inventory slice D. Taking inventory slice A as an example, inventory slice A includes inventory subdomain A1 and inventory subdomain A2. The pre-occupied inventory value of inventory subdomain A1 is 100, and the pre-occupied inventory value of inventory subdomain A2 is 80. The activated inventory subdomain in inventory slice A is inventory subdomain A2, and the inventory subdomain to be activated in inventory slice A is inventory subdomain A1.

[0047] Step S102: According to the preset inventory slice determination rule and the inventory deduction value, a target inventory slice corresponding to the item to be deducted is selected from the inventory slices.

[0048] In one embodiment, according to a preset inventory shard determination rule, based on the inventory deduction value, selecting a target inventory shard corresponding to the item to be deducted from the inventory shards may include: based on the pre-occupied inventory value of the activated inventory subdomain of each inventory shard, selecting a target inventory shard corresponding to the item to be deducted from the inventory shards whose pre-occupied inventory value reaches the inventory deduction value.

[0049] Specifically, the inventory deduction value of the item to be deducted is, for example, 75. Figure 2 , the pre-occupied inventory value of the activated inventory subdomain of inventory shard A is 80, the pre-occupied inventory value of the activated inventory subdomain of inventory shard B is 70, the pre-occupied inventory value of the activated inventory subdomain of inventory shard C is 60, and the pre-occupied inventory value of the activated inventory subdomain of inventory shard D is 50. Then the inventory shard scheduler determines that the inventory shard that meets the inventory deduction value of the item to be deducted is inventory shard A, and inventory shard A can be selected as the target inventory shard corresponding to the item to be deducted. It should be noted that if there are multiple inventory shards that meet the inventory deduction value of the item to be deducted, the inventory shard corresponding to the pre-occupied inventory value of the largest activated inventory subdomain can be selected as the target inventory shard.

[0050] Step S103: According to the inventory deduction value, the inventory of the items to be deducted is deducted through the activated inventory subdomain in the target inventory slice, and the inventory deduction information is generated.

[0051] In one embodiment, inventory deduction of items to be deducted is performed according to the inventory deduction value through the activated inventory subdomain in the target inventory shard, which may include: calculating the occupied inventory value after deduction according to the occupied inventory value and the inventory deduction value of the activated inventory subdomain in the target inventory shard; and updating the occupied inventory value of the activated inventory subdomain in the target inventory shard using the occupied inventory value after deduction.

[0052] Specifically, the inventory deduction value of the item to be deducted is, for example, 75, the target inventory slice is inventory slice A, the activated inventory subdomain is inventory subdomain A2, and the reserved inventory value of inventory subdomain A2 is 80. Then, the reserved inventory value after deduction is 5, that is, the difference between 80 and 75. After the inventory deduction, the reserved inventory value of inventory subdomain A2 is updated to 5.

[0053] In one embodiment, after the occupied inventory value of the activated inventory subdomain in the target inventory shard is updated using the deducted occupied inventory value, the method may further include: comparing the deducted occupied inventory value with a preset first occupied inventory threshold; if the deducted occupied inventory value does not reach the first occupied inventory threshold, setting the activated inventory subdomain to a locked inventory subdomain, and determining a new activated inventory subdomain of the target inventory shard from the inventory subdomains to be activated included in the target inventory shard.

[0054] Specifically, the pre-occupied inventory value after deduction is 5, and the preset pre-occupied inventory first threshold is set to 10, for example. Then the pre-occupied inventory value after deduction does not reach the pre-occupied inventory first threshold, and at this time, the inventory subdomain A2 needs to be set as the locked inventory subdomain. The inventory subdomain to be activated included in the inventory shard A is the inventory subdomain A1, and the inventory subdomain A1 is set as the new activated inventory subdomain.

[0055] In one embodiment, after the activated inventory subdomain is set as the locked inventory subdomain, the method may further include: calculating the to-be-replenished pre-occupied inventory value of the locked inventory subdomain according to a preset second threshold of the pre-occupied inventory and the pre-occupied inventory value after deduction, obtaining the pre-occupied inventory value to be replenished from the preset inventory pool and replenishing it into the locked inventory subdomain, and setting the locked inventory subdomain as the to-be-activated inventory subdomain.

[0056] Specifically, the preset second threshold of pre-occupied inventory is set to 100, for example, the locked inventory subdomain is inventory subdomain A2, the pre-occupied inventory value after deduction of inventory subdomain A2 is 5, and the pre-occupied inventory value to be replenished in inventory subdomain A2 is 95, that is, the difference between 100 and 5. Through the pre-occupied inventory task trigger, 95 of pre-occupied inventory is obtained from the preset inventory pool and replenished into inventory subdomain A2, and inventory subdomain A2 is set as the inventory subdomain to be activated.

[0057] In one embodiment, before obtaining the pre-occupied inventory of the pre-occupied inventory value to be replenished from the preset inventory pool, the method may further include: determining whether there is pre-occupied inventory of the pre-occupied inventory value to be replenished in the preset inventory pool, and determining whether there is pre-occupied inventory of the pre-occupied inventory value to be replenished in the preset inventory pool. If there is no pre-occupied inventory of the pre-occupied inventory value to be replenished in the preset inventory pool, inventory replenishment is not performed on the locked inventory subdomain.

[0058] In one embodiment, when all the inventory subdomains included in the target inventory shard are locked inventory subdomains, the number of inventory shards corresponding to the items to be deducted can be determined; when the number of inventory shards is greater than 1, the occupied inventory values ​​of all inventory subdomains included in the target inventory shard can be added to the preset inventory pool, and the target inventory shard can be deleted.

[0059] Specifically, if all the inventory subdomains included in the target inventory shard are locked inventory subdomains, it means that the inventory in the preset inventory pool is about to be exhausted and the locked inventory subdomains cannot be replenished. At this time, if the inventory shard corresponding to the item to be deducted is greater than 1, the reserved inventory values ​​of all inventory subdomains included in the target inventory shard can be added to the preset inventory pool, and the target inventory shard can be deleted.

[0060] In one embodiment, when the number of inventory shards is less than or equal to 1, all the inventory in the preset inventory pool can be added to the locked inventory subdomain of the target inventory shard, and the locked inventory subdomains can be set as activated inventory subdomains one by one to perform inventory deductions for the items to be deducted through the activated inventory subdomains; in response to the pre-occupied inventory value of each inventory subdomain included in the target inventory shard being 0, the target inventory shard is deleted.

[0061] Specifically, when all the inventory subdomains included in the target inventory shard are locked inventory subdomains, if the inventory shard corresponding to the item to be deducted is less than or equal to 1, it means that the target inventory shard is the only inventory shard corresponding to the item to be deducted, and all the inventory in the preset inventory pool can be added to the locked inventory subdomain of the target inventory shard, and the inventory deduction is performed through the inventory subdomains in the target inventory shard until the reserved inventory value of each inventory subdomain included in the target inventory shard is 0, indicating that the inventory in the preset inventory pool is exhausted, and the target inventory shard is deleted.

[0062] Step S104: In response to satisfying the inventory deduction synchronization rule, deduct the item inventory from the inventory detail table according to the inventory deduction information. The inventory deduction synchronization rule may include: the current time reaches a preset inventory synchronization time (such as 1 second), or the number of current inventory deduction information reaches a preset information number threshold.

[0063] Specifically, in response to satisfying the inventory deduction synchronization rule, an inventory deduction message is generated through the recorded inventory deduction information, and the inventory detail table is subjected to item inventory deduction and synchronization based on the inventory deduction message.

[0064] Figure 3 It is a flowchart of a method for reducing inventory of items according to an embodiment of the present invention.

[0065] like Figure 3As shown, in one embodiment, the inventory deduction value of the item to be deducted and the multiple inventory slices corresponding to the item to be deducted are obtained, and the target inventory slice corresponding to the item to be deducted is selected from the inventory slices according to the inventory deduction value, and the inventory of the item to be deducted is deducted through the activated inventory subdomain in the target inventory slice according to the inventory deduction value, and the inventory of the item is deducted from the inventory detail table according to the inventory deduction information. The pre-occupied inventory value after deduction is compared with the preset pre-occupied inventory first threshold value, and when the pre-occupied inventory value after deduction does not reach the pre-occupied inventory first threshold value, the activated inventory subdomain is set as the locked inventory subdomain, and a new activated inventory subdomain of the target inventory slice is determined from the to-be-activated inventory subdomain included in the target inventory slice, and then the pre-occupied inventory is obtained from the preset inventory pool and added to the locked inventory subdomain, and the locked inventory subdomain is set as the to-be-activated inventory subdomain.

[0066] The embodiment of the present invention builds a distributed framework for inventory deductions based on the distributed management of the cache layer. At the same time, in order to avoid the data skew problem caused by access, the scalability of inventory deductions is achieved by setting inventory shards including multiple inventory subdomains for the deducted items, thereby improving the efficiency of inventory deductions and being able to cope with inventory deduction operations in high-concurrency scenarios.

[0067] Figure 4 Schematic diagram of main modules of an inventory deduction device for items according to an embodiment of the present invention.

[0068] like Figure 4 As shown, an inventory deduction device 400 for items according to an embodiment of the present invention mainly includes: an inventory slice acquisition module 401 , a target inventory slice selection module 402 , an inventory deduction module 403 , and an inventory synchronization module 404 .

[0069] The inventory slice acquisition module 401 is used to respond to the inventory deduction request of the item, obtain the inventory deduction value of the item to be deducted, and at least one inventory slice corresponding to the item to be deducted, each inventory slice may include an activated inventory subdomain.

[0070] The target inventory slice selection module 402 is used to select a target inventory slice corresponding to the item to be deducted from the inventory slices according to the preset inventory slice determination rule and the inventory deduction value.

[0071] The inventory deduction module 403 is used to perform inventory deduction of the items to be deducted according to the inventory deduction value through the activated inventory subdomain in the target inventory segment, and generate inventory deduction information.

[0072] The inventory synchronization module 404 is used to perform item inventory deduction on the inventory detail table according to the inventory deduction information in response to satisfying the inventory deduction synchronization rule.

[0073] In one embodiment, each inventory subdomain that may be included in the inventory slice has a pre-occupied inventory value; the target inventory slice selection module 402 is specifically used to: according to the pre-occupied inventory value of the activated inventory subdomain of each inventory slice, from the inventory slice corresponding to the pre-occupied inventory value reaching the inventory deduction value, select the target inventory slice corresponding to the item to be deducted.

[0074] In one embodiment, the inventory deduction module 403 is specifically used to: calculate the pre-occupied inventory value after deduction based on the pre-occupied inventory value and the inventory deduction value of the activated inventory subdomain in the target inventory shard; and use the pre-occupied inventory value after deduction to update the pre-occupied inventory value of the activated inventory subdomain in the target inventory shard.

[0075] In one embodiment, the inventory deduction module 403 is specifically used to: compare the occupied inventory value after deduction with a preset first threshold of occupied inventory; if the occupied inventory value after deduction does not reach the first threshold of occupied inventory, set the activated inventory subdomain to the locked inventory subdomain, and determine a new activated inventory subdomain of the target inventory shard from the inventory subdomains to be activated included in the target inventory shard.

[0076] In one embodiment, the inventory deduction module 403 is specifically used to: calculate the pre-occupied inventory value to be replenished in the locked inventory subdomain according to the preset pre-occupied inventory second threshold and the pre-occupied inventory value after deduction, obtain the pre-occupied inventory value to be replenished from the preset inventory pool and replenish it into the locked inventory subdomain, and set the locked inventory subdomain as the inventory subdomain to be activated.

[0077] In one embodiment, the inventory deduction module 403 is specifically used to: determine whether there is pre-occupied inventory to be replenished with the pre-occupied inventory value in the preset inventory pool, and determine whether there is pre-occupied inventory to be replenished with the pre-occupied inventory value in the preset inventory pool.

[0078] In one embodiment, it also includes an inventory slice deletion module (not shown in the figure), which is used to: when all the inventory subdomains included in the target inventory slice are locked inventory subdomains, determine the number of inventory slices corresponding to the items to be deducted; when the number of inventory slices is greater than 1, add the occupied inventory values ​​of all inventory subdomains included in the target inventory slice to the preset inventory pool, and delete the target inventory slice.

[0079] In one embodiment, the inventory shard deletion module is specifically used to: when the number of inventory shards is less than or equal to 1, add all the inventory in the preset inventory pool to the locked inventory subdomain of the target inventory shard, and set the locked inventory subdomains as activated inventory subdomains one by one to perform inventory deductions of the items to be deducted through the activated inventory subdomains; in response to the pre-occupied inventory value of each inventory subdomain included in the target inventory shard being 0, delete the target inventory shard.

[0080] In one embodiment, the inventory deduction synchronization rule may include: the current time reaches a preset inventory synchronization time, or the amount of current inventory deduction information reaches a preset information amount threshold.

[0081] In addition, the specific implementation content of the inventory deduction device for items in the embodiment of the present invention has been described in detail in the above inventory deduction method for items, so the repeated content will not be described here.

[0082] Figure 5 An exemplary system architecture 500 is shown to which the method for reducing inventory of items or the device for reducing inventory of items according to the embodiments of the present invention can be applied.

[0083] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0084] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 501, 502, 503, such as inventory deduction applications, warehousing applications, shopping applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0085] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0086] The server 505 may be a server that provides various services, such as a backend management server (for example only) that provides support for inventory deduction websites of items browsed by users using terminal devices 501, 502, and 503. The backend management server may respond to the inventory deduction request of the item and other data received, obtain the inventory deduction value of the item to be deducted, and at least one inventory slice corresponding to the item to be deducted, each inventory slice including an activated inventory subdomain; select a target inventory slice corresponding to the item to be deducted from the inventory slice according to the inventory deduction value according to the preset inventory slice determination rule; perform inventory deduction of the item to be deducted through the activated inventory subdomain in the target inventory slice according to the inventory deduction value, and generate inventory deduction information; in response to satisfying the inventory deduction synchronization rule, perform item inventory deduction and other processing on the inventory detail table according to the inventory deduction information, and feed back the processing result (for example, the inventory deduction result of the item - for example only) to the terminal device.

[0087] It should be noted that the inventory deduction method for items provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the inventory deduction device for items is generally disposed in the server 505 .

[0088] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0089] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 6 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0090] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0091] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0092] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0093] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0094] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0095] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, they may be described as: a processor including an inventory shard acquisition module, a target inventory shard selection module, an inventory deduction module, and an inventory synchronization module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the inventory shard acquisition module may also be described as "a module for responding to an inventory deduction request for an item, obtaining the inventory deduction value of the item to be deducted, and at least one inventory shard corresponding to the item to be deducted".

[0096] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to an inventory deduction request of an item, obtaining the inventory deduction value of the item to be deducted, and at least one inventory shard corresponding to the item to be deducted, each inventory shard including an activated inventory subdomain; according to a preset inventory shard determination rule, selecting a target inventory shard corresponding to the item to be deducted from the inventory shard according to the inventory deduction value; according to the inventory deduction value, performing inventory deduction of the item to be deducted through the activated inventory subdomain in the target inventory shard, and generating inventory deduction information; in response to satisfying the inventory deduction synchronization rule, performing inventory deduction of the item on the inventory detail list according to the inventory deduction information.

[0097] According to the technical solution of the embodiment of the present invention, in response to the inventory deduction request of the item, the inventory deduction value of the item to be deducted and at least one inventory shard corresponding to the item to be deducted are obtained, and each inventory shard includes an activated inventory subdomain; according to the preset inventory shard determination rule, according to the inventory deduction value, the target inventory shard corresponding to the item to be deducted is selected from the inventory shard; according to the inventory deduction value, the inventory deduction of the item to be deducted is performed through the activated inventory subdomain in the target inventory shard, and inventory deduction information is generated; in response to satisfying the inventory deduction synchronization rule, the inventory deduction of the item is performed on the inventory detail table according to the inventory deduction information. By setting an inventory shard including multiple inventory subdomains for the item to be deducted, and performing the inventory deduction of the item to be deducted based on the activated inventory subdomain in the target inventory shard, the database resources occupied by the inventory deduction operation of the item and the performance requirements on the database can be reduced, the inventory deduction efficiency is improved, and the inventory deduction operation in a high-concurrency scenario can be handled.

[0098] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for reducing inventory of an item, characterized in that: include: In response to an inventory deduction request for an item, obtaining an inventory deduction value of the item to be deducted and at least one inventory slice corresponding to the item to be deducted, each inventory slice including an activated inventory subdomain; According to a preset inventory shard determination rule and the inventory deduction value, a target inventory shard corresponding to the item to be deducted is selected from the inventory shards; According to the inventory deduction value, the inventory of the item to be deducted is deducted through the activated inventory subdomain in the target inventory slice, and inventory deduction information is generated; In response to satisfying the inventory deduction synchronization rule, item inventory deduction is performed on the inventory detail table according to the inventory deduction information.

2. The method according to claim 1, characterized in that Each inventory subdomain included in the inventory shard has a reserved inventory value; The step of selecting a target inventory slice corresponding to the item to be deducted from the inventory slice according to a preset inventory slice determination rule and the inventory deduction value includes: According to the pre-occupied inventory value of the activated inventory subdomain of each inventory shard, a target inventory shard corresponding to the item to be deducted is selected from the inventory shards corresponding to the pre-occupied inventory value reaching the inventory deduction value.

3. The method according to claim 1, characterized in that The step of performing inventory deduction of the item to be deducted according to the inventory deduction value through the activated inventory subdomain in the target inventory slice includes: Calculate the deducted reserved inventory value according to the reserved inventory value of the activated inventory subdomain in the target inventory slice and the inventory deduction value; The reserved inventory value of the activated inventory subdomain in the target inventory slice is updated using the deducted reserved inventory value.

4. The method according to claim 3, characterized in that After the deducted reserved inventory value is used to update the reserved inventory value of the activated inventory subdomain in the target inventory slice, the method further includes: Comparing the deducted reserved inventory value with a preset first reserved inventory threshold; When the deducted reserved inventory value does not reach the first reserved inventory threshold, the activated inventory subdomain is set as a locked inventory subdomain, and a new activated inventory subdomain of the target inventory shard is determined from the to-be-activated inventory subdomains included in the target inventory shard.

5. The method according to claim 4, characterized in that After the activated inventory subdomain is set as the locked inventory subdomain, the method further includes: According to the preset second threshold of the pre-occupied inventory and the pre-occupied inventory value after deduction, the pre-occupied inventory value to be replenished of the locked inventory subdomain is calculated, and the pre-occupied inventory of the pre-occupied inventory value to be replenished is obtained from the preset inventory pool and replenished into the locked inventory subdomain, and the locked inventory subdomain is set as the inventory subdomain to be activated.

6. The method according to claim 5, characterized in that Before obtaining the pre-occupied inventory to be replenished into the pre-occupied inventory value from the preset inventory pool, the method further includes: It is judged whether there is pre-occupied inventory with the pre-occupied inventory value to be replenished in the preset inventory pool, and it is determined that there is pre-occupied inventory with the pre-occupied inventory value to be replenished in the preset inventory pool.

7. The method according to claim 4, characterized in that The method further comprises: When all the inventory subdomains included in the target inventory shard are locked inventory subdomains, determining the number of inventory shards corresponding to the item to be deducted; When the number of the inventory shards is greater than 1, the reserved inventory values ​​of all inventory subdomains included in the target inventory shard are added to the preset inventory pool, and the target inventory shard is deleted.

8. The method according to claim 7, characterized in that The method further comprises: When the number of the inventory slices is less than or equal to 1, all the inventory in the preset inventory pool is added to the locked inventory subdomain of the target inventory slice, and the locked inventory subdomains are set as activated inventory subdomains one by one to perform inventory deduction of the items to be deducted through the activated inventory subdomains; In response to the pre-occupied inventory value of each inventory sub-domain included in the target inventory shard being 0, the target inventory shard is deleted.

9. The method according to claim 1, characterized in that: The inventory deduction synchronization rule includes: the current time reaches a preset inventory synchronization time, or the amount of current inventory deduction information reaches a preset information amount threshold.

10. An inventory deduction device for articles, characterized in that: include: An inventory slice acquisition module, configured to respond to an inventory deduction request for an item, acquire an inventory deduction value of the item to be deducted, and at least one inventory slice corresponding to the item to be deducted, each inventory slice including an activated inventory subdomain; A target inventory slice selection module is used to select a target inventory slice corresponding to the item to be deducted from the inventory slice according to a preset inventory slice determination rule and the inventory deduction value; An inventory deduction module, configured to perform inventory deduction of the item to be deducted according to the inventory deduction value through the activated inventory subdomain in the target inventory slice, and generate inventory deduction information; The inventory synchronization module is used to perform item inventory deduction on the inventory detail list according to the inventory deduction information in response to satisfying the inventory deduction synchronization rule.

11. An electronic device, characterized in that: include: one or more processors; A storage device, used for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-9.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Fragment-based inventory management method and device

    CN110310060A

  • E-commerce hotspot commodity inventory deduction control method and system

    CN112418747A

  • User request processing method and device

    CN113077220A

  • Distributed database inventory processing method and device

    CN114547200A

  • Redis cluster memory balancing method and device, electronic equipment and readable storage medium

    CN115470004A