A method and device for inventory data management
By monitoring inventory change information, screening hot items and performing heat analysis tasks, the system pressure problem caused by the comparison of the differential inventory in the existing technology is solved, and more efficient data management and accurate difference comparison are achieved.
Patent Information
- Application Number
- CN202210600801.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In the prior art, the inventory difference comparison is usually a timely scanning of the full inventory data, which leads to a surge in the data volume at high scanning frequency, causing system pressure, wasted resources, and is not conducive to the improvement of data management efficiency.
By monitoring the inventory change information of items, determine the list of hot items to be analyzed, and generate a heat analysis task for each hot item. By performing the heat analysis task, calculate the heat value of the hot items to be compared, filter out the hot items to be compared for inventory data difference comparison, and avoid full comparison.
It effectively alleviates system pressure, saves resources, improves data management efficiency, and improves the accuracy of inventory data difference comparison.
Smart Images

Figure CN114971472B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for inventory data management. Background Art
[0002] Inventory refers to the items actually stored in the warehouse. Enterprises can maintain the inventory quantity within a reasonable range by reasonably configuring and controlling inventory data, which can meet business needs without occupying too many resources. The accuracy of inventory data plays a vital guiding role in the business decision-making of enterprises. The logistics order management system (OMS) manages and tracks orders and dynamically manages the quantity of inventory items in order to accurately obtain information on all aspects of inventory business. At present, the inventory pre-occupancy of the logistics order management system (OMS) has been upgraded to use Redis for inventory pre-occupancy. By comparing the differences in inventory data between Redis and the system database DB, the data differences of inventory items are compared, ensuring the consistency and accuracy of inventory data.
[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:
[0004] Currently, inventory difference comparison usually involves periodically scanning the entire inventory data and comparing all inventory items. In actual inventory data, there are many inactive items with static inventory quantities. When this full inventory difference comparison method is used, the amount of comparison data soars when the scanning frequency is very high, which puts tremendous pressure on the online production system, wastes resources, and is not conducive to improving data management efficiency. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for inventory data management, which determines the hot items to be analyzed and the corresponding thermal analysis tasks based on the monitored inventory change information of the items, obtains the thermal values of the hot items to be analyzed by executing the thermal analysis tasks, and selects the hot items to be compared from the hot items to be analyzed according to the thermal values of the hot items to perform inventory data difference comparison, thereby avoiding the inventory data difference comparison of all items, effectively alleviating the system pressure, saving resources, and improving data management efficiency.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for inventory data management is provided, comprising:
[0007] Determine a list of hot items to be analyzed according to the monitored item inventory change information, and generate a heat analysis task for each hot item, wherein the heat analysis task includes at least one subtask;
[0008] For each subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the popularity value of the hot items corresponding to the subtask is calculated;
[0009] In response to the inventory data difference comparison request, the hot items to be compared are screened out according to the popularity value of each of the hot items, and the inventory data difference comparison of the hot items to be compared is performed.
[0010] Optionally, the subtask has a preset time interval, and whether a new subtask needs to be added is determined based on the heat value of the hot item corresponding to the subtask.
[0011] Optionally, the heat value includes real-time heat and historical average heat; the subtask includes a start time and an end time; based on the heat value of the hot item corresponding to the subtask, determine whether a new subtask needs to be added, including: obtaining the previous subtask of the subtask, the previous subtask is a subtask whose end time is less than and closest to the start time of the subtask; obtaining the historical average heat of the hot item corresponding to the previous subtask, and adding a new subtask when the real-time heat of the hot item corresponding to the subtask is greater than the historical average heat of the hot item corresponding to the previous subtask.
[0012] Optionally, the real-time popularity is acquired in the following manner: based on the start time and end time of the subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the total inventory operation amount of the hot items within the time interval between the start time and the end time is obtained; based on the total inventory operation amount and the time interval, the real-time popularity of the hot items corresponding to the subtask is calculated.
[0013] Optionally, the historical average heat is obtained in the following manner: taking the previous subtask as a starting point, calculating the historical average heat of the hot items corresponding to the subtask by a sliding window method.
[0014] Optionally, taking the previous subtask as the starting point, the historical average heat of the hot items corresponding to the subtask is calculated by a sliding window method, including: taking the previous subtask as the starting point, obtaining a subtask set of the hot items that meet a preset collection number in descending order of time; accumulating the real-time heat values of the hot items corresponding to the subtask set, and combining the real-time heat of the hot items corresponding to the subtask and the preset collection number to obtain the historical average heat of the hot items corresponding to the subtask.
[0015] Optionally, performing an inventory data difference comparison of the hot items to be compared includes: periodically obtaining the historical average heat of the hot items to be compared, and when the historical average heat is greater than a preset heat threshold, increasing the comparison frequency of the inventory data difference comparison; performing an inventory data difference comparison of the hot items to be compared according to the comparison frequency.
[0016] Optionally, performing inventory data difference comparison of the hot items to be compared also includes: establishing static checkpoints for the data details of the hot items to be compared in the database; respectively obtaining the available inventory, the reserved inventory, and the inventory in the data details of the database of the hot items to be compared in the cache database; comparing the sum of the available inventory and the reserved inventory with the inventory to perform inventory data difference comparison of the hot items to be compared.
[0017] Optionally, based on the heat value of each of the hot items, the hot items to be compared are screened out, including: based on the heat value of each of the hot items, the hot items with heat values less than a preset deletion threshold are deleted from the list of hot items to be analyzed to obtain the hot items to be compared.
[0018] Optionally, the inventory data difference comparison includes an inventory data difference comparison between a cache database and a database, and an inventory data difference comparison between order inventory data and warehouse inventory data.
[0019] According to a second aspect of an embodiment of the present invention, there is provided an inventory data management device, comprising:
[0020] A task generation module, used to determine a list of hot items to be analyzed according to the monitored item inventory change information, and generate a heat analysis task for each hot item, wherein the heat analysis task includes at least one subtask;
[0021] A heat value acquisition module is used to calculate the heat value of the hot item corresponding to each subtask by collecting the inventory flow information of the hot item corresponding to the subtask;
[0022] The difference comparison module is used to respond to the inventory data difference comparison request, screen out the hot items to be compared according to the popularity value of each of the hot items, and perform inventory data difference comparison on the hot items to be compared.
[0023] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for managing inventory data, characterized in that it includes:
[0024] one or more processors;
[0025] a storage device for storing one or more programs,
[0026] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.
[0027] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.
[0028] An embodiment of the invention has the following advantages or beneficial effects: by determining a list of hot items to be analyzed based on the monitored inventory change information of the items, and generating a thermal analysis task for each hot item, the thermal analysis task includes at least one subtask; for each subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the thermal value of the hot item corresponding to the subtask is calculated; in response to an inventory data difference comparison request, the hot items to be compared are screened out according to the thermal value of each hot item, and the technical solution of inventory data difference comparison of the hot items to be compared is realized, and the hot items to be analyzed and the corresponding thermal analysis tasks are determined based on the monitored inventory change information of the items, and the thermal values of the hot items to be analyzed are obtained by executing the thermal analysis tasks. According to the thermal values of the hot items, the hot items to be compared are screened from the hot items to be analyzed for inventory data difference comparison, thereby avoiding inventory data difference comparison of all items, effectively alleviating system pressure, saving resources, and improving data management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0030] Figure 1 is a schematic diagram of the main process of the inventory data management method according to an embodiment of the present invention;
[0031] Figure 2 It is a schematic diagram of the overall execution flow of the heat analysis task of the hot items to be analyzed in an embodiment of the present invention;
[0032] Figure 3 It is a schematic diagram of the subtask execution process and inventory data difference comparison process of an embodiment of the present invention;
[0033] Figure 4 is a schematic diagram of main modules of an inventory data management device according to an embodiment of the present invention;
[0034] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0035] Figure 6 It 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
[0036] 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.
[0037] Currently, inventory difference comparison usually involves periodically scanning the entire inventory data and comparing all inventory items. In actual inventory data, there are many inactive items with static inventory quantities. When this full inventory difference comparison method is used, the amount of comparison data soars when the scanning frequency is very high, which puts tremendous pressure on the online production system, wastes resources, and is not conducive to improving data management efficiency.
[0038] In order to solve the above problems existing in the prior art, the present invention proposes an inventory data management method, which determines the hot items to be analyzed and the corresponding thermal analysis tasks based on the monitored inventory change information of the items, and obtains the thermal values of the hot items to be analyzed by executing the thermal analysis tasks. According to the thermal values of the hot items, the hot items to be compared are screened from the hot items to be analyzed for inventory data difference comparison, thereby avoiding inventory data difference comparison of all items, effectively alleviating system pressure, saving resources, and improving data management efficiency.
[0039] In the introduction to the embodiments of the present invention, the terms and their meanings are as follows:
[0040] Quartz: is an open source project in the field of job scheduling. Quartz can be used alone or integrated with the spring framework. In actual development, the latter is generally used. Quartz can be used to develop one or more scheduled tasks, and each scheduled task can specify its execution time separately.
[0041] OMS: Order Management System is a part of the logistics management system. It manages and tracks orders placed by customers, dynamically monitors the progress and completion of orders, improves operational efficiency in the logistics process, saves operating time and operating costs, and improves the market competitiveness of logistics companies.
[0042] WMS: Warehouse Management System, a management system that comprehensively utilizes batch management, material correspondence, inventory counting, quality inspection management, virtual warehouse management and real-time inventory management through functions such as warehousing business, outbound business, warehouse transfer, inventory transfer and virtual warehouse management;
[0043] Redis: is a high-performance key-value database.
[0044] Figure 1 FIG. 1 is a schematic diagram of the main process of the inventory data management method according to an embodiment of the present invention. Figure 1 As shown, the inventory data management method of the embodiment of the present invention includes the following steps S101 to S103.
[0045] Step S101: determine a list of hot items to be analyzed based on monitored inventory change information of items, and generate a thermal analysis task for each hot item, wherein the thermal analysis task includes at least one subtask.
[0046] Specifically, by monitoring the inventory change message of the item, the item details in the inventory change message are obtained, and the hot item list to be analyzed is queried to see whether there is a hot item to be analyzed that is consistent with the item details. If not, the item details are added to the hot item list to be analyzed. The item details include the sku value (commodity code) of the item and the warehouse number where it is located. For each hot item in the hot item list to be analyzed, a heat analysis task is generated. Considering the real-time nature of the heat analysis task, the heat analysis task needs to be divided into multiple subtasks.
[0047] According to an embodiment of the present invention, the subtask has a preset time interval.
[0048] Specifically, for each thermal analysis task of a hot item to be analyzed, the execution time interval of the subtasks of the thermal analysis task is set according to the scenario and business needs. It can be an agreed time interval, and the thermal analysis task for a future period of time is divided into multiple subtasks to be executed. For example, if the time interval is 10 minutes, the thermal analysis task in the next 24 hours will include 144 subtasks. It can also be a variety of different agreed time intervals, which are not limited.
[0049] Step S102: For each subtask, the popularity value of the hot item corresponding to the subtask is calculated by collecting the inventory flow information of the hot item corresponding to the subtask.
[0050] According to an embodiment of the present invention, the heat value includes real-time heat and historical average heat; the subtask includes a start time and an end time.
[0051] Specifically, in order to facilitate the recording of process data, an inventory heat table is established to store the heat values of hot items, a heat analysis task table is established to store all subtasks of hot items, and a heat analysis collection table is established to store the real-time heat data of the subtasks of hot items.
[0052] Exemplarily, for the hot items newly added to the list of hot items to be analyzed, the hot item information is initialized into the inventory heat table. Table 1 below is an example table of the main contents of the initialized inventory heat table of hot items. The real-time heat and historical average heat values of the initialized hot items are 1.
[0053] Table 1
[0054] thing Warehouse Number Real-time heat Historical average heat Collection end time slightly sku xxx 1 1 —— — …… …… …… …… …… ……
[0055] According to the hot items to be analyzed initialized in the inventory heat table, a heat analysis task table associated with this hot item is generated, and the heat analysis task table includes at least one subtask. The following Table 2 is an example table of the heat analysis task table of hot items. In the table, the heat analysis task of the hot item with sku warehouse number xxx has two subtasks to be executed. Since it has not been executed yet, the task status is initialized, and the start time and end time are 00:00~00:10 and 00:10~00:20 respectively.
[0056] Table 2
[0057]
[0058] According to another embodiment of the present invention, the real-time popularity is acquired in the following manner: based on the start time and end time of the subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the total inventory operation amount of the hot items within the time interval between the start time and the end time is obtained; based on the total inventory operation amount and the time interval, the real-time popularity of the hot items corresponding to the subtask is calculated.
[0059] Specifically, according to the subtask information in the above heat analysis task table, the start time and end time of the subtask related to the hot item are obtained. Taking the first subtask in Table 2 as an example, the start and end time are 00:00-00:10, and the inventory flow information of this hot item in the time interval of 00:00-00:10 is collected to obtain the total inventory operation amount T; the total inventory operation amount T of this hot item is divided by the time interval, that is, T / 10, to obtain the minute-level real-time heat r of the hot item corresponding to the first subtask, and this minute-level real-time heat is stored in the heat analysis collection table. Table 3 below is an example table of the heat analysis collection table of hot items. In the table, the real-time heat of the hot item sku warehouse number xxx in the time interval of 00:00-00:10 is 100, and the real-time heat in the time interval of 00:10-00:20 is 80.
[0060] Table 3
[0061]
[0062] According to yet another embodiment of the present invention, the previous subtask is a subtask whose end time is less than and closest to the start time of the subtask.
[0063] According to yet another embodiment of the present invention, the historical average heat is obtained in the following manner: taking the previous subtask as a starting point, the historical average heat of the hot items corresponding to the subtask is calculated by a sliding window method.
[0064] Specifically, based on the one-to-one correspondence between the subtasks in the heat analysis table and the collection records in the heat analysis collection table according to the start time and end time, according to the start time of the subtask being executed, the collection record whose collection end time is less than and closest to the start time of this subtask is searched from the heat analysis collection table as the previous collection record corresponding to the previous subtask; taking the previous collection record corresponding to the previous subtask as the starting point, the historical average heat of the hot items corresponding to the subtask is calculated by the sliding window method.
[0065] According to one embodiment of the present invention, taking the previous subtask as the starting point, the historical average heat of the hot items corresponding to the subtask is calculated by a sliding window method, including: taking the previous subtask as the starting point, obtaining a subtask set of the hot items that meet a preset number of collections in descending order of time; accumulating the real-time heat values of the hot items corresponding to the subtask set, and combining the real-time heat of the hot items corresponding to the subtask and the preset number of collections to obtain the historical average heat of the hot items corresponding to the subtask.
[0066] Specifically, the last collection record corresponding to the last subtask is taken as the starting point, according to the preset collection number n, which is set to 144 in the embodiment of the present invention, and the collection records corresponding to the subtasks of n-1 hot items are obtained from the heat analysis collection table in descending order of time, which is 143 in the embodiment of the present invention; the real-time heat values of the collection record sets corresponding to the n-1 subtasks are accumulated to obtain s, the real-time heat of the hot item corresponding to the current subtask is r, and the historical average heat avg of this subtask is calculated to be (s+r) / n, and the obtained historical average heat avg and real-time heat r are stored in the inventory heat table consistent with the hot item information. In addition, if the number of collection records of hot items obtained from the last collection record is less than the preset collection number n, the number of collection records of hot items actually obtained is taken as n, and the historical average heat avg is calculated. Finally, the task status in the heat task analysis table where the current subtask is located is updated to be completed.
[0067] According to another embodiment of the present invention, whether a new subtask needs to be added is determined based on the popularity value of the hot item corresponding to the subtask.
[0068] Specifically, in order to perform real-time heat analysis on hot items in a more scientific manner, it is determined whether a subtask for dynamically adding a hot item is needed based on the heat value of the corresponding hot item obtained after the subtask is executed.
[0069] According to another embodiment of the present invention, whether a new subtask needs to be added is determined based on the popularity value of the hot item corresponding to the subtask, including: obtaining the previous subtask of the subtask; obtaining the historical average popularity of the hot item corresponding to the previous subtask, and adding a new subtask when the real-time popularity of the hot item corresponding to the subtask is greater than the historical average popularity of the hot item corresponding to the previous subtask.
[0070] Specifically, taking the start time of the current subtask as the judgment basis, the previous subtask of the hot item corresponding to the current subtask is obtained from the inventory heat table, and the historical average heat avg- pre , compare the real-time heat r of the current subtask with the historical average heat avg- pre The size of r>avg- pre In the case of , add m subtasks, m is r / avg- preThe quotient is rounded down to an integer greater than 0. Furthermore, according to the time interval d between the start time and the end time of the next subtask of the hot item corresponding to the current subtask in the pre-established heat task analysis table, the next subtask is evenly divided according to the newly added m subtasks, and the start time and end time corresponding to the m subtasks can be obtained. In addition, if the time interval between the start time and the end time of the m subtasks after the even division is less than the minimum execution time of this subtask, the value of m can be dynamically adjusted to ensure that the newly added subtasks can be executed smoothly while taking into account the newly added subtasks.
[0071] Figure 2 The present invention is a schematic diagram of the overall execution process of the heat analysis task of the hot items to be analyzed in an embodiment of the present invention. In the figure, the inventory change message of the item is monitored in real time, and the item detail information (the sku value of the item and the warehouse number) in the inventory change message is obtained. When the sku of the item and the warehouse number are not in the inventory heat table, the item detail information is added to the inventory heat table as a newly added hot item to be analyzed, and the heat value is initialized; the scheduled task Quartz-1 is scheduled to pre-generate a heat analysis task for each hot item in the list of hot items to be analyzed in the future by scanning the inventory heat table, and the heat analysis task includes at least one subtask; the scheduled task Quartz-2 is scheduled to select the subtask to be executed from the heat analysis task according to the time of the current scheduled task, generate a subtask message, and execute the subtask by querying the inventory flow information of the hot item corresponding to the subtask; finally, according to the analysis and calculation results of the subtask, the real-time heat is inserted into the heat analysis collection table, the subtask to be added is dynamically inserted into the heat analysis task, and the heat value of the hot item corresponding to the subtask in the inventory heat table is updated.
[0072] By pre-statically generating the heat analysis subtasks for the hot items to be executed in the future, executing the heat analysis static subtasks, obtaining the heat values of the hot items, and determining whether new subtasks need to be dynamically generated based on the heat values, real-time analysis and calculation of the heat values of the hot items are achieved, providing reliable data support for the inventory data management of the present invention.
[0073] Step S103, in response to the inventory data difference comparison request, the hot items to be compared are screened out according to the popularity value of each of the hot items, and the inventory data difference comparison of the hot items to be compared is performed.
[0074] According to one embodiment of the present invention, the hot items to be compared are screened out according to the heat value of each of the hot items, including: according to the heat value of each of the hot items, the hot items with heat values less than a preset deletion threshold are deleted from the list of hot items to be analyzed, so as to obtain the hot items to be compared.
[0075] Specifically, by executing the above-mentioned heat analysis task for each hot item in the list of hot items to be analyzed, the heat value of each hot item in the list of hot items to be analyzed is obtained, and according to the preset deletion threshold, the hot items whose real-time heat and historical average heat are both less than the preset deletion threshold are deleted from the list of hot items to be analyzed to obtain the hot items to be compared.
[0076] According to another embodiment of the present invention, performing inventory data difference comparison of the hot items to be compared includes: periodically obtaining the historical average heat of the hot items to be compared, and when the historical average heat is greater than a preset heat threshold, increasing the comparison frequency of the inventory data difference comparison; performing inventory data difference comparison of the hot items to be compared according to the comparison frequency.
[0077] Specifically, after obtaining the hot items to be compared, the historical average heat of the heat values of the hot items to be compared is obtained at a fixed time (the default is 10 minutes in the embodiment of the present invention). When the historical average heat is greater than the preset heat threshold, the comparison frequency of the difference comparison is increased within the fixed time of the inventory data difference comparison, and the inventory data difference comparison is performed according to the comparison frequency. For example, the inventory data difference comparison is performed once every 10 minutes as default in the embodiment of the present invention. If the historical average heat of the hot items to be compared is greater than the preset heat threshold, a difference comparison is performed every 2 seconds within the next 10 minutes until the historical average heat is less than the preset heat threshold, and the default comparison is restored to once every 10 minutes. The data in this example is for illustrative purposes only, and the data may be different depending on the specific scenario.
[0078] Through this refined inventory data difference comparison, the inventory data difference comparison strategy can be adaptively adjusted according to the changes in the popularity of the hot items to be compared at different times, so as to better meet the inventory data difference comparison needs in actual applications.
[0079] According to another embodiment of the present invention, the inventory data difference comparison includes inventory data difference comparison between the cache database and the database, and inventory data difference comparison between the order inventory data and the warehouse inventory data. Through these two types of inventory data difference comparison, multi-dimensional inventory data difference comparison can be achieved, thereby improving the accuracy of inventory data comparison.
[0080] According to another embodiment of the present invention, performing inventory data difference comparison of the hot items to be compared also includes: establishing static checkpoints for the data details of the hot items to be compared in the database; respectively obtaining the available inventory, the reserved inventory, and the inventory in the data details of the database of the hot items to be compared in the data details of the cache database; comparing the sum of the available inventory and the reserved inventory with the inventory to perform inventory data difference comparison of the hot items to be compared.
[0081] Specifically, for the inventory data difference comparison between the above-mentioned cache database Redis and database DB, a row lock is added to the data detail row of the hot items to be compared in the database DB (select xxx for update where id), the scheduling task is blocked, and a static checkpoint is established; the available inventory and the reserved inventory in the data details of the hot items to be compared in Redis, as well as the inventory in the data details of the hot items to be compared in DB are obtained respectively; according to the comparison relationship equation: available inventory in Redis + reserved inventory = inventory in DB, inventory data is compared, and if they are not equal, the data synchronization of the available inventory and reserved inventory of Redis is performed according to the inventory in DB and the process quantity of all reserved tasks involving the hot items to be compared in the task library.
[0082] In addition, for the inventory data difference comparison between order inventory data and warehouse inventory data, compare whether the actual inventory of hot items in the order management system OMS and the actual inventory of the warehouse logistics management system WMS are equal. If not, establish inventory difference tasks and inventory difference work orders for operation personnel to handle, and trigger alarms to remind relevant personnel to check and process.
[0083] Figure 3 1 is a flow chart of the subtask execution process and inventory data difference comparison of an embodiment of the present invention. In the figure, according to the received heat analysis task message, the subtask in the heat analysis task is obtained, and the real-time heat r of the hot item corresponding to the current subtask is calculated by querying the inventory flow information within the time interval between the start time and the end time of the current subtask; the historical average heat avg of the hot item corresponding to the current subtask is calculated by querying the cumulative value of the real-time heat of the hot items corresponding to the subtasks before the current subtask in the heat analysis acquisition table; the historical average heat avg-1 of the hot item corresponding to the previous subtask of the current subtask is calculated by querying the inventory heat table. pre , combined with the real-time heat r of the hot items corresponding to the current subtask, determine whether a new subtask needs to be dynamically inserted. If r>avg- preThen m new subtasks are added and inserted into the heat analysis task, and the real-time heat r and historical average heat avg of the hot items corresponding to the current subtask are persistently stored in the heat analysis collection table and the inventory heat table, and the status of the current subtask is updated to the completed state; otherwise, only the real-time heat r and historical average heat avg of the hot items corresponding to the current subtask need to be persistently stored in the heat analysis collection table and the inventory heat table, and the status of the current subtask needs to be updated to the completed state; in response to the scheduling task of inventory data difference comparison, the inventory heat table is scanned regularly, and the hot items to be compared are screened out according to the heat value of each hot item, and the inventory data difference comparison of Redis-DB is performed on the hot items to be compared. If the inventory data of the two are inconsistent, the inventory data of Redis is repaired and synchronized through the inventory quantity (stock) of the database DB and the process quantity of all pre-occupied tasks involving the items to be compared in the task library (stock task).
[0084] Through the above calculation of the heat values of the hot items in the analysis list, the hot items to be compared are screened according to the heat value of each hot item, thereby realizing the conversion of the inventory data difference comparison of all items into the inventory data difference comparison of hot items. Moreover, through the refined and multi-dimensional inventory data difference comparison, not only the system pressure is effectively relieved, resources are saved, and data management efficiency is improved, but also the accuracy of inventory data difference comparison is improved.
[0085] Figure 4 Schematic diagram of the main modules of the inventory data management device according to an embodiment of the present invention. Figure 4 As shown, the inventory data management device 400 mainly includes a task generation module 401 , a heat value acquisition module 402 and a difference comparison module 403 .
[0086] The task generation module 401 is used to determine a list of hot items to be analyzed according to the monitored item inventory change information, and generate a heat analysis task for each hot item, wherein the heat analysis task includes at least one subtask;
[0087] The heat value acquisition module 402 is used to calculate the heat value of the hot item corresponding to each subtask by collecting the inventory flow information of the hot item corresponding to the subtask;
[0088] The difference comparison module 403 is used to respond to the inventory data difference comparison request, filter out the hot items to be compared according to the popularity value of each hot item, and perform inventory data difference comparison on the hot items to be compared.
[0089] According to an embodiment of the present invention, the subtasks have a preset time interval, and whether a new subtask needs to be added is determined based on the heat value of the hot item corresponding to the subtask.
[0090] According to another embodiment of the present invention, the heat value includes real-time heat and historical average heat; the subtask includes a start time and an end time; the inventory data management device 400 may also include a subtask generation module (not shown in the figure), which is used to: obtain the previous subtask of the subtask, the previous subtask is a subtask whose end time is less than and closest to the start time of the subtask; obtain the historical average heat of the hot item corresponding to the previous subtask, and add a new subtask when the real-time heat of the hot item corresponding to the subtask is greater than the historical average heat of the hot item corresponding to the previous subtask.
[0091] According to another embodiment of the present invention, the real-time popularity is acquired in the following manner: based on the start time and end time of the subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the total inventory operation amount of the hot items within the time interval between the start time and the end time is obtained; based on the total inventory operation amount and the time interval, the real-time popularity of the hot items corresponding to the subtask is calculated.
[0092] According to yet another embodiment of the present invention, the historical average heat is obtained in the following manner: taking the previous subtask as a starting point, the historical average heat of the hot items corresponding to the subtask is calculated by a sliding window method.
[0093] According to another embodiment of the present invention, the inventory data management device 400 may further include a historical average heat acquisition module (not shown in the figure), which is used to: take the previous subtask as the starting point, and acquire a subtask set of the hot items that meet a preset collection number in descending order of time; accumulate the real-time heat values of the hot items corresponding to the subtask set, and combine the real-time heat of the hot items corresponding to the subtask and the preset collection number to obtain the historical average heat of the hot items corresponding to the subtask.
[0094] According to another embodiment of the present invention, the difference comparison module 403 can also be used to: periodically obtain the historical average popularity of the hot items to be compared, and when the historical average popularity is greater than a preset popularity threshold, increase the comparison frequency of the inventory data difference comparison; and perform inventory data difference comparison of the hot items to be compared according to the comparison frequency.
[0095] According to another embodiment of the present invention, the difference comparison module 403 can also be used to: establish static checkpoints for the data details of the hot items to be compared in the database; respectively obtain the available inventory, the reserved inventory, and the inventory in the data details of the database of the hot items to be compared; compare the sum of the available inventory and the reserved inventory with the inventory to perform inventory data difference comparison of the hot items to be compared.
[0096] According to one embodiment of the present invention, the difference comparison module 403 can also be used to: according to the heat value of each of the hot items, delete the hot items with heat values less than a preset deletion threshold from the list of hot items to be analyzed to obtain the hot items to be compared.
[0097] According to another embodiment of the present invention, the inventory data difference comparison includes an inventory data difference comparison between a cache database and a database, and an inventory data difference comparison between order inventory data and warehouse inventory data.
[0098] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.
[0099] 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.
[0100] Users can use terminal devices 501, 502, 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications, such as inventory data management applications, etc., can be installed on terminal devices 501, 502, 503 (only as an example).
[0101] 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.
[0102] The server 505 may be a server that provides various services, such as a background management server that supports inventory data management performed by users using terminal devices 501, 502, and 503 (for example only). The background management server may determine a list of hot items to be analyzed based on the monitored inventory change information of the items, and generate a heat analysis task for each hot item, wherein the heat analysis task includes at least one subtask; for each subtask, the heat value of the hot item corresponding to the subtask is calculated by collecting the inventory flow information of the hot item corresponding to the subtask; in response to an inventory data difference comparison request, the hot items to be compared are screened out based on the heat value of each of the hot items, and the inventory data difference comparison and other processing of the hot items to be compared are performed, and the processing results (such as comparison results, etc. - for example only) are fed back to the terminal device.
[0103] It should be noted that the inventory data management method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the inventory data management device is generally disposed in the server 505 .
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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 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 thereof.
[0110] 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 module, program segment or a part of the 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 sequence different from that 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 the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor including: a task generation module, a heat value acquisition module and a difference comparison module.
[0112] Among them, the names of these modules do not constitute a limitation of the module itself in some cases. For example, the heat value acquisition module can also be described as "a module used to calculate the heat value of the hot items corresponding to each subtask by collecting the inventory flow information of the hot items corresponding to the subtask."
[0113] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or it may exist independently and not be assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes: determining a list of hot items to be analyzed based on the monitored inventory change information of the items, and generating a thermal analysis task for each hot item, wherein the thermal analysis task includes at least one subtask; for each subtask, calculating the thermal value of the hot item corresponding to the subtask by collecting the inventory flow information of the hot item corresponding to the subtask; in response to an inventory data difference comparison request, screening out the hot items to be compared based on the thermal value of each of the hot items, and performing an inventory data difference comparison of the hot items to be compared.
[0114] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by determining a list of hot items to be analyzed based on the monitored item inventory change information, and generating a thermal analysis task for each hot item, the thermal analysis task includes at least one subtask; for each subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the thermal value of the hot item corresponding to the subtask is calculated; in response to an inventory data difference comparison request, the hot items to be compared are screened out according to the thermal value of each hot item, and the technical solution of inventory data difference comparison of the hot items to be compared is realized, and the hot items to be analyzed and the corresponding thermal analysis tasks are determined based on the monitored item inventory change information, the thermal values of the hot items to be analyzed are obtained by executing the thermal analysis tasks, and the hot items to be compared are screened from the hot items to be analyzed according to the thermal values of the hot items for inventory data difference comparison, thereby avoiding inventory data difference comparison of all items, effectively alleviating system pressure, saving resources, and improving data management efficiency.
[0115] The specific implementation methods described herein do not constitute limitations on the scope of protection 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 modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for inventory data management, characterized in that: include: Determine a list of hot items to be analyzed according to the monitored item inventory change information, and generate a heat analysis task for each hot item, wherein the heat analysis task includes at least one subtask; For each subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the popularity value of the hot items corresponding to the subtask is calculated; In response to the inventory data difference comparison request, the hot items to be compared are screened out according to the popularity value of each of the hot items, and the inventory data difference comparison of the hot items to be compared is performed; The subtasks have a preset time interval, and whether a new subtask needs to be added is determined according to the heat value of the hot item corresponding to the subtask; The heat value includes real-time heat and historical average heat; The subtask includes a start time and an end time; Determining whether to add a subtask according to the popularity value of the hot item corresponding to the subtask includes: Obtaining a previous subtask of the subtask, the previous subtask being a subtask whose end time is less than and closest to the start time of the subtask; The historical average heat of the hot item corresponding to the previous subtask is obtained, and a new subtask is added when the real-time heat of the hot item corresponding to the subtask is greater than the historical average heat of the hot item corresponding to the previous subtask.
2. The method according to claim 1, characterized in that The real-time heat is obtained in the following way: According to the start time and end time of the subtask, by collecting the inventory flow information of the hot items corresponding to the subtask, the total inventory operation amount of the hot items within the time interval between the start time and the end time is obtained; The real-time popularity of the hot items corresponding to the subtask is calculated according to the total inventory operation amount and the time interval.
3. The method according to claim 2, characterized in that The historical average heat is obtained in the following way: Taking the previous subtask as the starting point, the historical average popularity of the hot items corresponding to the subtask is calculated using a sliding window method.
4. The method according to claim 3, characterized in that: Taking the previous subtask as the starting point, the historical average popularity of the hot items corresponding to the subtask is calculated by the sliding window method, including: Taking the previous subtask as the starting point, a subtask set of the hot items that meets a preset collection number is obtained in descending order of time; The real-time heat values of the hot items corresponding to the subtask set are accumulated, and combined with the real-time heat of the hot items corresponding to the subtask and the preset number of collections to obtain the historical average heat of the hot items corresponding to the subtask.
5. According to the method of claim 1, performing inventory data difference comparison of the hot items to be compared comprises: Periodically obtaining the historical average heat of the hot items to be compared, and when the historical average heat is greater than a preset heat threshold, increasing the comparison frequency of the inventory data difference comparison; The inventory data difference comparison of the hot items to be compared is performed according to the comparison frequency.
6. The method according to claim 1, performing inventory data difference comparison of the hot items to be compared, further comprising: Establishing static checkpoints for the data details of the hot items to be compared in the database; Respectively obtaining the available inventory, the reserved inventory, and the inventory in the data details of the database of the hot item to be compared in the data details of the cache database; The sum of the available inventory and the reserved inventory is compared with the inventory to perform a stock data difference comparison of the hot items to be compared.
7. The method according to claim 1, characterized in that According to the popularity value of each of the hot items, the hot items to be compared are screened out, including: According to the heat value of each of the hot items, the hot items whose heat value is less than a preset deletion threshold are deleted from the list of hot items to be analyzed, so as to obtain the hot items to be compared.
8. The method according to claim 1, characterized in that The inventory data difference comparison includes an inventory data difference comparison between a cache database and a database, and an inventory data difference comparison between order inventory data and warehouse inventory data.
9. An inventory data management device, characterized in that: include: A task generation module, used to determine a list of hot items to be analyzed according to the monitored item inventory change information, and generate a heat analysis task for each hot item, wherein the heat analysis task includes at least one subtask; A heat value acquisition module is used to calculate the heat value of the hot item corresponding to each subtask by collecting the inventory flow information of the hot item corresponding to the subtask; A difference comparison module, for responding to an inventory data difference comparison request, screening out hot items to be compared according to the heat value of each of the hot items, and performing inventory data difference comparison of the hot items to be compared; The subtask has a preset time interval, and determines whether a new subtask needs to be added according to the heat value of the hot item corresponding to the subtask; the heat value includes real-time heat and historical average heat; the subtask includes a start time and an end time; The device also includes a subtask generation module, which is used to: obtain a previous subtask of the subtask, wherein the previous subtask is a subtask whose end time is less than and closest to the start time of the subtask; The historical average heat of the hot item corresponding to the previous subtask is obtained, and a new subtask is added when the real-time heat of the hot item corresponding to the subtask is greater than the historical average heat of the hot item corresponding to the previous subtask.
10. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device 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 to 8.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Item inventory determining method and apparatus for server system
CN108960691A
Inventory quantity management method and system for e-commerce
CN111915259A