Cargo inventory pre-occupancy method and device and cargo inventory system

By splitting the goods records in the primary inventory into multiple secondary inventory records, each record independently adds the row lock to perform inventory pre-occupation, solving the problem of bank lock competition in the inventory system, improving the concurrent performance and throughput of inventory pre-occupation, and improving user experience.

CN113935694BActive Publication Date: 2025-03-21BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111254101.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2025-03-21
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

In the inventory system, when multiple sales orders arrive at the same time, there is a problem of row lock competition, resulting in limited inventory pre-occupation throughput, resulting in time-out of sales order processing and affecting user experience.

Method used

Split a first inventory record of goods in the first-level inventory to form multiple second inventory records in the second-level inventory. Each second inventory record can be independently added to the inventory pre-occupation, thereby reducing row lock competition and improving the concurrent performance and throughput of inventory pre-occupation.

Benefits of technology

By reducing row lock competition, the concurrent performance and throughput of inventory pre-occupation are improved, the user experience is improved, and sales orders are processed in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935694B_ABST
    Figure CN113935694B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a method and device for pre-occupying goods inventory and a goods inventory system, which relate to the field of computers. The present disclosure splits a first inventory record of goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory; pre-occupies at least one second inventory record of the goods in the secondary inventory based on a row lock and deducts the inventory according to the quantity of the goods requested by the caller; persists the inventory data of each second inventory record of the goods in the secondary inventory, and then releases the row lock of the pre-occupied second inventory record; asynchronously deducts the inventory data of the first inventory record of the goods in the primary inventory according to the inventory reduction amount of the goods in the secondary inventory. Each second inventory record can be separately added with a row lock for inventory pre-occupancy, thereby reducing row lock contention, improving the concurrency performance and throughput of inventory pre-occupancy, and improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, and in particular to a cargo inventory pre-occupancy method and device and a cargo inventory system. Background Art

[0002] For the goods outbound stage of a sales order, the inventory system needs to add a row lock to pre-occupy the inventory record of the goods, and deduct the inventory quantity of the goods in the inventory record according to the quantity of goods in the sales order. Only after the row lock is released can the next sales order of the goods be processed.

[0003] Research has found that when multiple sales orders for a certain product arrive at the same time, there is a row lock competition problem. The inventory system can only use row locks to pre-occupy the inventory records of the product in sequence. The inventory pre-occupancy throughput is limited, causing sales order processing timeouts and affecting user experience. Summary of the invention

[0004] A technical problem to be solved by the embodiments of the present disclosure is to reduce row lock contention and improve inventory pre-occupancy throughput.

[0005] The disclosed embodiment splits a first inventory record of goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory. Each second inventory record can be row-locked for inventory pre-occupancy, thereby reducing row lock contention, improving the concurrency performance and throughput of inventory pre-occupancy, and improving user experience.

[0006] Some embodiments of the present disclosure provide a method for pre-occupying goods inventory, including:

[0007] Splitting a first inventory record of a good in the primary inventory into a plurality of second inventory records of the good in the secondary inventory;

[0008] According to the quantity of the goods requested by the caller, at least one second inventory record of the goods in the secondary inventory is reserved based on the row lock and the inventory is deducted;

[0009] Persisting the inventory data of each second inventory record of the goods in the secondary inventory, and then releasing the occupied row lock of the second inventory record;

[0010] The inventory data of the first inventory record of the goods in the primary inventory is asynchronously deducted according to the inventory reduction of the goods in the secondary inventory.

[0011] In some embodiments, according to the quantity of the goods requested by the caller, pre-occupying at least one second inventory record of the goods in the secondary inventory based on a row lock and deducting the inventory includes:

[0012] Select a second inventory record from the secondary inventory, where the inventory quantity of the goods is greater than 0;

[0013] According to the quantity of the goods requested by the caller, pre-occupy the second inventory record currently selected for the goods based on the row lock and deduct the inventory;

[0014] Calculating the remaining inventory quantity of the second inventory record currently selected for the goods;

[0015] If the remaining inventory is greater than or equal to 0, it is determined that the inventory actually deducted from the second inventory record currently selected for the goods is the quantity of the goods requested by the caller, and the reservation is marked as successful.

[0016] In some embodiments, if the remaining inventory is less than 0, and the absolute value of the remaining inventory is less than the quantity of the goods requested by the caller, the remaining inventory of the second inventory record currently selected for the goods is updated to 0, and it is determined that the inventory actually deducted from the second inventory record currently selected for the goods is the difference between the quantity of the goods requested by the caller and the absolute value of the remaining inventory before the update, and it is determined that the secondary inventory needs to provide goods with a quantity equal to the absolute value of the remaining inventory before the update, and the process returns to the second inventory record selection step to select another second inventory record to continue execution.

[0017] In some embodiments, based on the inventory reduction of the goods in the secondary inventory, the inventory data of the first inventory record of the goods in the primary inventory is asynchronously deducted, including: based on the inventory reduction of the goods in the secondary inventory, pre-occupying the first inventory record of the goods in the primary inventory based on the row lock and deducting the inventory, and after the deduction is successful, releasing the row lock of the pre-occupied first inventory record.

[0018] In some embodiments, it also includes:

[0019] Monitoring the balance of the remaining inventory of all the second inventory records of the goods in the secondary inventory;

[0020] If the monitored balance degree indicates that the remaining inventory quantities of the second inventory records of the goods are unbalanced, row locks are added to all the second inventory records of the goods, and the total remaining inventory quantities of all the second inventory records of the goods are evenly distributed among the second inventory records of the goods, and then the row locks of all the second inventory records of the goods are released.

[0021] Some embodiments of the present disclosure provide a method for pre-occupying goods inventory, including:

[0022] Splitting a first inventory record of a good in the primary inventory into a plurality of second inventory records of the good in the secondary inventory;

[0023] According to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, at least one second inventory record of the goods in the secondary inventory is pre-occupied based on the row lock and the inventory is increased;

[0024] Persisting the inventory data of each second inventory record of the goods in the secondary inventory, and then releasing the occupied row lock of the second inventory record;

[0025] According to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, the inventory data of the first inventory record of the goods in the primary inventory is synchronously increased.

[0026] In some embodiments, according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, pre-occupying at least one second inventory record of the goods in the secondary inventory based on the row lock and increasing the inventory includes: according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, determining whether the inventory quantity that needs to be increased for the goods is less than the quantity of the second inventory record of the goods, and if not, adding row locks to all the second inventory records of the goods, and according to a preset balancing strategy, evenly adding the inventory quantity that needs to be increased for the goods to each second inventory record of the goods, and then releasing the row locks of all the second inventory records.

[0027] In some embodiments, if it is less than, a row lock is added to one of the second inventory records of the goods, the inventory quantity that needs to be increased of the goods is added to the second inventory record with the row lock, and then the row lock of the second inventory record is released.

[0028] In some embodiments, the step of evenly adding the required increased inventory quantity of the goods to each second inventory record of the goods according to a preset balancing strategy comprises:

[0029] Performing a modulo operation on the quantity of the second inventory record of the goods by the inventory quantity that needs to be increased;

[0030] If the modulo operation result is equal to 0, the inventory quantity that needs to be increased for the goods is evenly added to each second inventory record of the goods;

[0031] If the result of the modulo operation is not equal to 0, the inventory of one of the second inventory records of the goods is increased by a first value, and the inventory of the other second inventory records of the goods is increased by a second value respectively, wherein the second value is equal to the quotient of the inventory amount that needs to be increased for the goods divided by the quantity of the second inventory records of the goods, and the first value is equal to the sum of the second value and the result of the modulo operation.

[0032] In some embodiments, it also includes: using the inventory data of the first inventory record in the primary inventory to record the inventory operation flow.

[0033] Some embodiments of the present disclosure provide a cargo inventory pre-occupancy device, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the cargo inventory pre-occupancy method of each embodiment based on instructions stored in the memory.

[0034] Some embodiments of the present disclosure provide a device for pre-occupying goods inventory, including:

[0035] a splitting module configured to split a first inventory record of goods in the primary inventory into a plurality of second inventory records of the goods in the secondary inventory;

[0036] A secondary pre-occupancy and deduction module is configured to pre-occupy at least one second inventory record of the goods in the secondary inventory and deduct the inventory based on the row lock according to the quantity of the goods requested by the caller;

[0037] A persistence module is configured to persist the inventory data of each second inventory record of the goods in the secondary inventory, and then release the row lock of the occupied second inventory record;

[0038] The asynchronous deduction module is configured to asynchronously deduct the inventory data of the first inventory record of the goods in the primary inventory according to the inventory reduction of the goods in the secondary inventory.

[0039] Some embodiments of the present disclosure provide a device for pre-occupying goods inventory, including:

[0040] a splitting module configured to split a first inventory record of goods in the primary inventory into a plurality of second inventory records of the goods in the secondary inventory;

[0041] A secondary pre-occupancy and increase module is configured to pre-occupy at least one second inventory record of the goods in the secondary inventory based on the row lock and increase the inventory according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task;

[0042] A persistence module is configured to persist the inventory data of each second inventory record of the goods in the secondary inventory, and then release the row lock of the occupied second inventory record;

[0043] The synchronous increase module is configured to synchronously increase the inventory data of the first inventory record of the goods in the primary inventory according to the inventory quantity that needs to be increased of the goods indicated by the inventory increase task.

[0044] In some embodiments, it also includes:

[0045] A monitoring module configured to monitor the balance degree of the remaining inventory of all second inventory records of the goods in the secondary inventory;

[0046] The balancing module is configured to add row locks to all the second inventory records of the goods if the monitored balance degree indicates that the remaining inventory quantities of the second inventory records of the goods are unbalanced, and evenly distribute the total remaining inventory quantities of all the second inventory records of the goods among the second inventory records of the goods, and then release the row locks of all the second inventory records of the goods.

[0047] Some embodiments of the present disclosure propose a cargo inventory system, comprising: a primary inventory, a secondary inventory, and a cargo inventory pre-occupancy device for managing the primary inventory and the secondary inventory, wherein a first inventory record of the cargo in the primary inventory is split into multiple second inventory records of the cargo in the secondary inventory.

[0048] Some embodiments of the present disclosure provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the cargo inventory pre-occupancy method of each embodiment. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. The present disclosure can be more clearly understood according to the following detailed description with reference to the drawings.

[0050] Obviously, the drawings described below are only some embodiments of the present disclosure, and a person skilled in the art can obtain other drawings based on these drawings without creative work.

[0051] Figure 1 A schematic diagram showing a flow chart of a method for pre-occupying inventory of goods according to some embodiments of the present disclosure.

[0052] Figure 2 A schematic diagram showing a flow chart of a method for pre-occupying inventory of goods according to some embodiments of the present disclosure.

[0053] Figure 3 A schematic diagram showing a flow chart of a method for pre-occupying inventory of goods according to some embodiments of the present disclosure.

[0054] Figure 4 A schematic diagram showing a goods inventory system according to some embodiments of the present disclosure.

[0055] Figure 5 A schematic diagram showing a cargo inventory pre-occupancy device according to some embodiments of the present disclosure.

[0056] Figure 6 A schematic diagram showing the structure of a cargo inventory pre-occupancy device according to some embodiments of the present disclosure. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure.

[0058] Unless otherwise specified, descriptions such as “first” and “second” in the present disclosure are used to distinguish different objects and are not used to indicate meanings such as size or time sequence.

[0059] Figure 1 A flow chart of a cargo inventory pre-occupancy method according to some embodiments of the present disclosure is shown. The cargo inventory pre-occupancy method is, for example, executed by a cargo inventory pre-occupancy device and can be applied to cargo outbound scenarios.

[0060] like Figure 1 As shown, the cargo inventory pre-occupancy method of this embodiment includes: steps 110-140, and may also include step 150.

[0061] In step 110, a first inventory record of goods in the primary inventory is split to form a plurality of second inventory records of the goods in the secondary inventory.

[0062] For example, a first inventory record is split into 2n-th power second inventory records, where n is an integer greater than 0.

[0063] The following is an example of inventory splitting. Assume that a first inventory record in the primary inventory is shown in Table 1, and the inventory splitting configuration table is shown in Table 2. The inventory splitting configuration is performed for hot goods. The more popular the goods are, the larger the number of split rows can be configured. According to the splitting configuration information in Table 2, the first inventory record in Table 1 is split to obtain the four second inventory records in Table 3.

[0064] Table 1

[0065]

[0066] Table 2

[0067]

[0068]

[0069] Table 3

[0070]

[0071] In step 120, according to the quantity of the goods requested by the caller, at least one second inventory record of the goods in the secondary inventory is reserved based on a row lock and the inventory is deducted.

[0072] In some embodiments, according to the quantity of the goods requested by the caller, pre-occupying at least one second inventory record of the goods in the secondary inventory based on the row lock and deducting the inventory includes:

[0073] In step 120.1, a second inventory record whose inventory quantity of the goods is greater than 0 is selected from the secondary inventory, and the selection may be made in a random manner.

[0074] In step 120.2, according to the quantity of the goods requested by the caller, the second inventory record currently selected for the goods is pre-occupied based on a row lock and the inventory is deducted.

[0075] In step 120.3, the remaining inventory quantity of the currently selected second inventory record of the goods is calculated.

[0076] In step 120.3a, if the remaining inventory is greater than or equal to 0, it means that the inventory of the currently selected second inventory record is sufficient, and the actual deducted inventory of the currently selected second inventory record of the goods is determined to be the quantity of the goods requested by the caller, and the reservation is marked as successful.

[0077] In step 120.3b, if the remaining inventory is less than 0, and the absolute value of the remaining inventory is less than the quantity of the goods requested by the caller, the remaining inventory of the second inventory record currently selected for the goods is updated to 0, and the inventory curOccupyQty actually deducted from the second inventory record currently selected for the goods is determined to be the difference between the quantity of the goods requested by the caller |opQty| and the absolute value |X| of the remaining inventory before the update, and it is determined that the secondary inventory needs to provide goods with a quantity equal to the absolute value |X| of the remaining inventory before the update, and the process returns to the second inventory record selection step 120.1 to select another second inventory record to continue the loop execution. When step 120.2 is continued to be executed, the second inventory record currently selected for the goods is pre-occupied based on the row lock and the inventory is deducted according to the quantity of goods that the secondary inventory needs to provide.

[0078] After the preemption is successful, the subsequent step 130 is continued to be executed, and a preemption task is generated and added to the preemption task pool, and the preemption task in the preemption task pool is subscribed. The preemption task newly added to the preemption task pool will trigger the corresponding consumption task, and the consumption task reads the persistent secondary inventory data and calls the preemption interface of the primary inventory to execute step 140. In addition, a timer can be set to regularly check whether there are unprocessed preemption tasks in the preemption task pool. If unprocessed preemption tasks are detected, refer to the above method to process the preemption task.

[0079] In step 130, the inventory data of each second inventory record of the goods in the secondary inventory is persisted, and then the row lock of the occupied second inventory record is released.

[0080] In step 140, the inventory data of the first inventory record of the goods in the primary inventory is asynchronously deducted according to the inventory reduction of the goods in the secondary inventory.

[0081] According to the inventory reduction of the goods in the secondary inventory, the first inventory record of the goods in the primary inventory is pre-occupied based on the row lock and the inventory is deducted.

[0082] In step 150, after the first inventory record is successfully deducted, the inventory operation flow is recorded using the inventory data of the first inventory record in the primary inventory, and then the row lock of the first inventory record is released.

[0083] The above embodiment splits a first inventory record of goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory. Each second inventory record can be row-locked for inventory pre-occupancy, thereby reducing row lock contention, improving the concurrency performance and throughput of inventory pre-occupancy, and improving user experience.

[0084] When the secondary inventory is continuously pre-occupied, the inventory of each secondary inventory record will be unbalanced, and the inventory of some secondary inventory records will even be 0, which will affect the concurrency performance and throughput of inventory pre-occupancy. Therefore, when executing Figure 1 During the process of the method shown, it is also possible to execute Figure 2 The method shown is used to make the inventory quantities of each second inventory record of the goods as balanced as possible, thereby further improving the concurrency performance and throughput of inventory pre-occupancy.

[0085] Figure 2 A flow chart of a method for pre-occupying goods inventory in some embodiments of the present disclosure is shown. The method for pre-occupying goods inventory is executed, for example, by a device for pre-occupying goods inventory.

[0086] like Figure 2 As shown, the cargo inventory pre-occupancy method of this embodiment includes: steps 210-220.

[0087] In step 210, the balance degree of the remaining inventory quantities of all the second inventory records of the goods in the secondary inventory is monitored.

[0088] This monitoring can be performed periodically and the monitoring period can be configured.

[0089] In step 220, if the monitored balance level indicates that the remaining inventory quantities of the second inventory records of the goods are unbalanced, row locks are added to all the second inventory records of the goods, and the total remaining inventory quantities of all the second inventory records of the goods are evenly distributed among the second inventory records of the goods, and then the row locks of all the second inventory records of the goods are released.

[0090] Among them, the imbalance determination condition can be configured, for example, if the difference between the inventory quantities of the second inventory records is greater than a preset value or a preset ratio, it is considered to be imbalanced.

[0091] In some embodiments, the remaining total inventory of all second inventory records of the goods is evenly distributed among the second inventory records of the goods, including: setting the remaining total inventory of all second inventory records of the goods to N1, setting the quantity of all second inventory records of the goods to N2, N1 mod N2 = x, if x is equal to 0, the inventory quantity of each second inventory record of the goods is N1 / N2, if x is not equal to 0, the inventory quantity of one of the second inventory records of the goods (such as the first second inventory record) is N1 / N2+x, and the inventory quantity of the other second inventory records of the goods is N1 / N2. But it is not limited to the example.

[0092] Thus, the inventory quantities of each second inventory record of the goods are made as balanced as possible, further improving the concurrency performance and throughput of inventory pre-occupancy.

[0093] Inventory management includes not only the management of goods outbound after they are sold, but also the management of goods inbound after they are purchased. Figure 1 and Figure 2 The embodiment shown mainly relates to the management of goods out of warehouse after the goods are sold. Figure 3 Describe the management of goods entering the warehouse after the goods are purchased.

[0094] Figure 3 A flow chart of a method for pre-occupying a cargo inventory in some embodiments of the present disclosure is shown. The method for pre-occupying a cargo inventory is executed by a device for pre-occupying a cargo inventory, and can be applied to a cargo warehousing scenario.

[0095] like Figure 3 As shown, the cargo inventory pre-occupancy method of this embodiment includes: steps 310-340, and also includes step 350.

[0096] In step 310 , the first inventory record of the goods in the primary inventory is split to form a plurality of second inventory records of the goods in the secondary inventory. For details, please refer to step 110 .

[0097] In step 320, according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, at least one second inventory record of the goods in the secondary inventory is pre-occupied based on the row lock and the inventory is increased.

[0098] In some embodiments, step 320 specifically includes: according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, determining whether the inventory quantity that needs to be increased for the goods is less than the quantity of the second inventory record of the goods; if not, adding row locks to all the second inventory records of the goods, and according to a preset balancing strategy, adding the inventory quantity that needs to be increased for the goods to each second inventory record of the goods in a balanced manner, and then releasing the row locks of all the second inventory records; if less than, adding a row lock to one of the second inventory records of the goods, adding the inventory quantity that needs to be increased for the goods to the second inventory record with the row lock, and then releasing the row lock of the second inventory record.

[0099] In some embodiments, the step of evenly adding the required increased inventory quantity of the goods to each second inventory record of the goods according to a preset balancing strategy includes, for example: performing a modulo operation on the required increased inventory quantity of the goods and the number of the second inventory records of the goods; if the modulo operation result is equal to 0, adding the required increased inventory quantity of the goods to each second inventory record of the goods on average; if the modulo operation result is not equal to 0, increasing the inventory of one of the second inventory records of the goods by a first value, and increasing the inventory of the other second inventory records of the goods by a second value, respectively, wherein the second value is equal to the quotient of the required increased inventory quantity of the goods divided by the number of the second inventory records of the goods, and the first value is equal to the sum of the second value and the modulo operation result.

[0100] In step 330 , the inventory data of each second inventory record of the goods in the secondary inventory is persisted, and then the row lock of the occupied second inventory record is released. For details, please refer to step 130 .

[0101] In step 340, according to the inventory quantity of the goods that needs to be increased indicated by the inventory increase task, the inventory data of the first inventory record of the goods in the primary inventory is synchronously increased.

[0102] The first-level inventory usually has a first inventory record of a certain kind of goods in a warehouse. Therefore, according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, a row lock is added to the first inventory record of the goods in the first-level inventory, the corresponding inventory data is updated, and then the row lock of the first inventory record of the goods is released.

[0103] In step 350, after the primary inventory is increased successfully, the inventory operation flow is recorded using the inventory data of the first inventory record in the primary inventory.

[0104] The present disclosure adopts different technologies to realize inventory addition and subtraction according to the different business flow characteristics of goods outbound and goods inbound. Specifically, according to the characteristics of large business flow of goods outbound, the secondary inventory and the primary inventory adopt an asynchronous inventory reduction method, and according to the characteristics of small business flow of goods inbound, the secondary inventory and the primary inventory adopt a synchronous inventory increase method to improve the efficiency of warehousing.

[0105] Figure 4 A schematic diagram showing a goods inventory system according to some embodiments of the present disclosure.

[0106] like Figure 4 As shown, the cargo inventory system 400 of this embodiment includes: a primary inventory 410, a secondary inventory 420 and a cargo inventory pre-occupancy device 430 for managing the primary inventory and the secondary inventory, wherein a first inventory record of the cargo in the primary inventory is split into a plurality of second inventory records of the cargo in the secondary inventory, and the cargo inventory pre-occupancy device is configured to execute the cargo inventory pre-occupancy methods of the aforementioned embodiments.

[0107] For example, in an outbound scenario, the first inventory record of the goods in the primary inventory is split to form multiple second inventory records of the goods in the secondary inventory; according to the quantity of the goods requested by the caller, at least one second inventory record of the goods in the secondary inventory is pre-occupied based on the row lock and the inventory is deducted; the inventory data of each second inventory record of the goods in the secondary inventory is prolonged, and then the row lock of the pre-occupied second inventory record is released; according to the inventory reduction of the goods in the secondary inventory, the inventory data of the first inventory record of the goods in the primary inventory is asynchronously deducted.

[0108] For example, in a warehousing scenario, the first inventory record of the goods in the primary inventory is split to form multiple second inventory records of the goods in the secondary inventory; according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, at least one second inventory record of the goods in the secondary inventory is pre-occupied based on the row lock and the inventory is increased; the inventory data of each second inventory record of the goods in the secondary inventory is persisted, and then the row lock of the pre-occupied second inventory record is released; according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, the inventory data of the first inventory record of the goods in the primary inventory is synchronously increased.

[0109] Figure 5 A schematic diagram showing a cargo inventory pre-occupancy device according to some embodiments of the present disclosure.

[0110] like Figure 5As shown, the cargo inventory pre-occupancy device 430 of this embodiment includes: modules 510, 520a, 530, 540a that can be applied to the outbound scene, or / and modules 510, 520b, 530, 540b that can be used in the inbound scene. In addition, the cargo inventory pre-occupancy device 430 can also include modules 550-560.

[0111] The splitting module 510 is configured to split a first inventory record of goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory.

[0112] The secondary pre-occupancy and deduction module 520a is configured to pre-occupy at least one second inventory record of the goods in the secondary inventory based on the row lock and deduct the inventory according to the quantity of the goods requested by the caller.

[0113] The secondary pre-occupancy and deduction module 520a is configured to select a second inventory record whose inventory quantity of the goods is greater than 0 from the secondary inventory; pre-occupy the second inventory record currently selected by the goods based on the row lock and deduct the inventory according to the quantity of the goods requested by the caller; calculate the remaining inventory of the second inventory record currently selected by the goods; if the remaining inventory is greater than or equal to 0, determine that the inventory actually deducted from the second inventory record currently selected by the goods is the quantity of the goods requested by the caller, and mark the pre-occupancy successful; if the remaining inventory is less than 0, and the absolute value of the remaining inventory is less than the quantity of the goods requested by the caller, update the remaining inventory of the second inventory record currently selected by the goods to 0, determine that the inventory actually deducted from the second inventory record currently selected by the goods is the difference between the quantity of the goods requested by the caller and the absolute value of the remaining inventory before the update, and determine that the secondary inventory needs to provide goods with a quantity equal to the absolute value of the remaining inventory before the update, return to the second inventory record selection step to select another second inventory record to continue execution.

[0114] The secondary pre-occupancy and increase module 520b is configured to pre-occupy at least one second inventory record of the goods in the secondary inventory and increase the inventory based on the row lock according to the inventory quantity that needs to be increased indicated by the inventory increase task.

[0115] The secondary pre-occupancy and increase module 520b is configured to determine whether the inventory quantity required to be increased of the goods indicated by the inventory increase task is less than the quantity of the second inventory record of the goods. If not, all the second inventory records of the goods are row-locked, and the inventory quantity required to be increased of the goods is evenly increased to each second inventory record of the goods according to the preset balancing strategy, and then the row locks of all the second inventory records are released. If less, one of the second inventory records of the goods is row-locked, the inventory quantity required to be increased of the goods is increased to the second inventory record with the row lock, and then the row lock of the second inventory record is released. Wherein, according to the preset balancing strategy, evenly adding the inventory quantity that needs to be increased for the goods to each second inventory record of the goods includes: performing a modulo operation on the inventory quantity that needs to be increased for the goods and the quantity of the second inventory record of the goods; if the modulo operation result is equal to 0, evenly adding the inventory quantity that needs to be increased for the goods to each second inventory record of the goods; if the modulo operation result is not equal to 0, increasing the inventory of one of the second inventory records of the goods by a first value, and increasing the inventory of the other second inventory records of the goods by a second value respectively, wherein the second value is equal to the quotient of the inventory quantity that needs to be increased for the goods divided by the quantity of the second inventory record of the goods, and the first value is equal to the sum of the second value and the modulo operation result.

[0116] The persistence module 530 is configured to persist the inventory data of each second inventory record of the goods in the secondary inventory, and then release the row lock of the occupied second inventory record;

[0117] The asynchronous deduction module 540a is configured to asynchronously deduct the inventory data of the first inventory record of the goods in the primary inventory according to the inventory reduction of the goods in the secondary inventory. Specifically, the first inventory record of the goods in the primary inventory is pre-occupied based on the row lock and the inventory is deducted. After the deduction is successful, the row lock of the pre-occupied first inventory record is released.

[0118] The synchronous increasing module 540b is configured to synchronously increase the inventory data of the first inventory record of the goods in the primary inventory according to the inventory quantity that needs to be increased for the goods indicated by the inventory increasing task.

[0119] The monitoring module 550 is configured to monitor the balance degree of the remaining inventory of all the second inventory records of the goods in the secondary inventory;

[0120] The balancing module 560 is configured to add row locks to all the second inventory records of the goods if the monitored balance level indicates that the remaining inventory quantities of the second inventory records of the goods are unbalanced, and evenly distribute the total remaining inventory quantities of all the second inventory records of the goods among the second inventory records of the goods, and then release the row locks of all the second inventory records of the goods.

[0121] Figure 6 A schematic diagram showing the structure of a cargo inventory pre-occupancy device according to some embodiments of the present disclosure.

[0122] like Figure 6 As shown, the cargo inventory pre-occupancy device 430 of this embodiment includes: a memory 610 and a processor 620 coupled to the memory 610 , and the processor 620 is configured to execute the cargo inventory pre-occupancy method of any of the aforementioned embodiments based on the instructions stored in the memory 610 .

[0123] For example, in an outbound scenario, the first inventory record of the goods in the primary inventory is split to form multiple second inventory records of the goods in the secondary inventory; according to the quantity of the goods requested by the caller, at least one second inventory record of the goods in the secondary inventory is pre-occupied based on the row lock and the inventory is deducted; the inventory data of each second inventory record of the goods in the secondary inventory is prolonged, and then the row lock of the pre-occupied second inventory record is released; according to the inventory reduction of the goods in the secondary inventory, the inventory data of the first inventory record of the goods in the primary inventory is asynchronously deducted.

[0124] For example, in a warehousing scenario, the first inventory record of the goods in the primary inventory is split to form multiple second inventory records of the goods in the secondary inventory; according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, at least one second inventory record of the goods in the secondary inventory is pre-occupied based on the row lock and the inventory is increased; the inventory data of each second inventory record of the goods in the secondary inventory is persisted, and then the row lock of the pre-occupied second inventory record is released; according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, the inventory data of the first inventory record of the goods in the primary inventory is synchronously increased.

[0125] The memory 610 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.

[0126] The processor 620 may be implemented as a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gates or transistors or other discrete hardware components.

[0127] The device 430 may also include an input / output interface 630, a network interface 640, a storage interface 650, etc. These interfaces 630, 640, 650 and the memory 610 and the processor 620 may be connected, for example, via a bus 660. The input / output interface 630 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 640 provides a connection interface for various networked devices. The storage interface 650 provides a connection interface for external storage devices such as SD cards and USB flash drives. The bus 660 may use any of a variety of bus structures. For example, the bus structure includes, but is not limited to, an Industrial Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.

[0128] The embodiments of the present disclosure provide a non-transitory computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the cargo inventory pre-occupancy method of each embodiment are implemented.

[0129] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more non-transient computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer program code.

[0130] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0133] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A method for pre-occupying goods inventory, characterized in that: include: Splitting the first inventory record of the goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory, and adding row locks to each second inventory record for inventory pre-occupancy; According to the quantity of the goods requested by the caller, at least one second inventory record of the goods in the secondary inventory is concurrently pre-occupied based on the row lock and the inventory is deducted, including: selecting a second inventory record of the goods whose inventory quantity is greater than 0 from the secondary inventory; according to the quantity of the goods requested by the caller, pre-occupying the second inventory record currently selected by the goods based on the row lock and deducting the inventory; calculating the remaining inventory of the second inventory record currently selected by the goods; if the remaining inventory is greater than or equal to 0, determining that the inventory quantity actually deducted from the second inventory record currently selected by the goods is the quantity of the goods requested by the caller, and marking the pre-occupation successful; or, if the remaining inventory is less than 0, and the absolute value of the remaining inventory is less than the quantity of the goods requested by the caller, updating the remaining inventory of the second inventory record currently selected by the goods to 0, determining that the inventory quantity actually deducted from the second inventory record currently selected by the goods is the difference between the quantity of the goods requested by the caller and the absolute value of the remaining inventory before the update, and determining that the secondary inventory needs to provide goods with a quantity equal to the absolute value of the remaining inventory before the update, returning to the second inventory record selection step to select another second inventory record to continue execution; Persisting the inventory data of each second inventory record of the goods in the secondary inventory, and then releasing the occupied row lock of the second inventory record; The inventory data of the first inventory record of the goods in the primary inventory is asynchronously deducted according to the inventory reduction of the goods in the secondary inventory.

2. The method according to claim 1, characterized in that According to the inventory reduction amount of the goods in the secondary inventory, asynchronously deducting the inventory data of the first inventory record of the goods in the primary inventory includes: According to the inventory reduction of the goods in the secondary inventory, the first inventory record of the goods in the primary inventory is pre-occupied based on the row lock and the inventory is deducted. After the deduction is successful, the row lock of the pre-occupied first inventory record is released.

3. The method according to claim 1, characterized in that Also includes: Monitoring the balance of the remaining inventory of all the second inventory records of the goods in the secondary inventory; If the monitored balance degree indicates that the remaining inventory quantities of the second inventory records of the goods are unbalanced, row locks are added to all the second inventory records of the goods, and the total remaining inventory quantities of all the second inventory records of the goods are evenly distributed among the second inventory records of the goods, and then the row locks of all the second inventory records of the goods are released.

4. A method for pre-occupying goods inventory, characterized in that: include: Splitting the first inventory record of the goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory, and adding row locks to each second inventory record for inventory pre-occupancy; According to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, at least one second inventory record of the goods in the secondary inventory is concurrently pre-occupied based on row locks and the inventory is increased, including: according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, it is determined whether the inventory quantity that needs to be increased for the goods is less than the quantity of the second inventory record of the goods, and if it is not less than, row locks are added to all the second inventory records of the goods, and according to a preset balancing strategy, the inventory quantity that needs to be increased for the goods is evenly added to each second inventory record of the goods, and then the row locks of all the second inventory records are released, wherein the inventory quantity that needs to be increased for the goods is evenly added to each second inventory record of the goods according to the preset balancing strategy. The inventory is evenly added to each second inventory record of the goods, including: performing a modulo operation on the inventory amount of the goods that needs to be added and the number of the second inventory records of the goods; if the modulo operation result is equal to 0, the inventory amount of the goods that needs to be added is evenly added to each second inventory record of the goods; or, if the modulo operation result is not equal to 0, the inventory of one of the second inventory records of the goods is increased by a first value, and the inventory of the other second inventory records of the goods is increased by a second value respectively, wherein the second value is equal to the quotient of the inventory amount of the goods that needs to be added divided by the number of the second inventory records of the goods, and the first value is equal to the sum of the second value and the modulo operation result; Persisting the inventory data of each second inventory record of the goods in the secondary inventory, and then releasing the occupied row lock of the second inventory record; According to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, the inventory data of the first inventory record of the goods in the primary inventory is synchronously increased.

5. The method according to claim 4, characterized in that If it is less, a row lock is added to one of the second inventory records of the goods, the inventory quantity of the goods that needs to be increased is added to the second inventory record with the row lock, and then the row lock of the second inventory record is released.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: The inventory operation flow is recorded using the inventory data of the first inventory record in the primary inventory.

7. A device for pre-occupying goods inventory, characterized in that: include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the cargo inventory pre-occupancy method according to any one of claims 1 to 6 based on instructions stored in the memory.

8. A device for pre-occupying goods inventory, characterized in that: include: A splitting module is configured to split a first inventory record of goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory, and each second inventory record is respectively locked for inventory pre-occupancy; The secondary pre-occupancy and deduction module is configured to pre-occupy at least one second inventory record of the goods in the secondary inventory and deduct inventory based on the row lock concurrently according to the quantity of the goods requested by the caller, including: selecting a second inventory record of the goods whose inventory quantity is greater than 0 from the secondary inventory; pre-occupying the second inventory record currently selected for the goods and deducting inventory based on the row lock according to the quantity of the goods requested by the caller; calculating the remaining inventory of the second inventory record currently selected for the goods; if the remaining inventory is greater than or equal to 0, determining that the inventory quantity actually deducted from the second inventory record currently selected for the goods is the calling party's inventory quantity. The quantity of the goods requested by the caller is deducted, and the pre-occupancy is marked as successful; or, if the remaining inventory is less than 0, and the absolute value of the remaining inventory is less than the quantity of the goods requested by the caller, the remaining inventory of the second inventory record currently selected for the goods is updated to 0, and the actual inventory deducted from the second inventory record currently selected for the goods is determined to be the difference between the quantity of the goods requested by the caller and the absolute value of the remaining inventory before the update, and it is determined that the secondary inventory needs to provide goods with a quantity equal to the absolute value of the remaining inventory before the update, and the second inventory record selection step is returned to select another second inventory record to continue execution; A persistence module is configured to persist the inventory data of each second inventory record of the goods in the secondary inventory, and then release the row lock of the occupied second inventory record; The asynchronous deduction module is configured to asynchronously deduct the inventory data of the first inventory record of the goods in the primary inventory according to the inventory reduction of the goods in the secondary inventory.

9. A device for pre-occupying goods inventory, characterized in that: include: A splitting module is configured to split a first inventory record of goods in the primary inventory into multiple second inventory records of the goods in the secondary inventory, and each second inventory record is respectively locked for inventory pre-occupancy; The secondary pre-occupancy and increase module is configured to pre-occupy at least one second inventory record of the goods in the secondary inventory and increase the inventory based on the row lock concurrently according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, including: according to the inventory quantity that needs to be increased for the goods indicated by the inventory increase task, determine whether the inventory quantity that needs to be increased for the goods is less than the quantity of the second inventory record of the goods, and if not less than, add row locks to all the second inventory records of the goods, and according to a preset balancing strategy, evenly add the inventory quantity that needs to be increased for the goods to each second inventory record of the goods, and then release the row locks of all the second inventory records, wherein the inventory quantity that needs to be increased for the goods according to the preset balancing strategy is increased to each second inventory record of the goods. The method of evenly adding the inventory quantity that needs to be increased to each second inventory record of the goods comprises: performing a modulo operation on the inventory quantity that needs to be increased of the goods and the number of the second inventory records of the goods; if the modulo operation result is equal to 0, adding the inventory quantity that needs to be increased of the goods to each second inventory record of the goods on average; or, if the modulo operation result is not equal to 0, increasing the inventory of one of the second inventory records of the goods by a first value, and increasing the inventory of the other second inventory records of the goods by a second value respectively, wherein the second value is equal to the quotient of the inventory quantity that needs to be increased of the goods divided by the number of the second inventory records of the goods, and the first value is equal to the sum of the second value and the modulo operation result; A persistence module is configured to persist the inventory data of each second inventory record of the goods in the secondary inventory, and then release the row lock of the occupied second inventory record; The synchronous increase module is configured to synchronously increase the inventory data of the first inventory record of the goods in the primary inventory according to the inventory quantity that needs to be increased of the goods indicated by the inventory increase task.

10. The device according to claim 8 or 9, characterized in that Also includes: A monitoring module configured to monitor the balance degree of the remaining inventory of all second inventory records of the goods in the secondary inventory; The balancing module is configured to add row locks to all the second inventory records of the goods if the monitored balance degree indicates that the remaining inventory quantities of the second inventory records of the goods are unbalanced, and evenly distribute the total remaining inventory quantities of all the second inventory records of the goods among the second inventory records of the goods, and then release the row locks of all the second inventory records of the goods.

11. A cargo inventory system, characterized in that: include: A primary inventory, a secondary inventory, and a goods inventory pre-occupancy device as described in any one of claims 7 to 10 for managing the primary inventory and the secondary inventory, wherein a first inventory record of goods in the primary inventory is split into multiple second inventory records of the goods in the secondary inventory.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the cargo inventory pre-occupancy method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Order processing system of high concurrency competitive inventory and processing method thereof

    CN103426072A

  • Fragment-based inventory management method and device

    CN110310060A