Historical inventory recording method, device, electronic device and storage medium

By constructing index data and updating it within a preset period, and using a distributed processing model to process historical inventory records, the problem of inefficient inventory records in the existing technology is solved, and rapid retrieval and accurate inventory records are achieved.

CN118690059BActive Publication Date: 2024-11-15SHENZHEN BAHT BAOYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411184652.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-15
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

In the prior art, historical inventory recording methods have low performance during query and aggregation statistics, especially when the data volume is large, resulting in low inventory recording efficiency.

Method used

By building indexed data, including normal fields and backup fields, and initializing and updating indexed data within a preset period, data processing and writing is used to ensure the accuracy and immediacy of historical inventory records.

Benefits of technology

It improves the efficiency and accuracy of historical inventory records, ensures rapid retrieval and update of inventory records, and solves the problem of inefficiency in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690059B_ABST
    Figure CN118690059B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for recording historical inventory, and relates to the technical field of inventory recording. The method includes: constructing index data, wherein the index data includes common fields and backup fields corresponding to the common fields; initializing the index data based on a preset first time period; acquiring inventory data based on a preset second time period, and updating the backup fields in the index data based on the inventory data, generating a historical inventory recording result, wherein the second time period is less than the first time period. The present application solves the problem of low efficiency of historical inventory recording in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of inventory records, and in particular to a historical inventory recording method, device, electronic device and storage medium. Background Art

[0002] As the supply chain becomes more complex, companies are paying more and more attention to inventory management. As one of the important data for enterprise management and operation, historical inventory records are of great significance for making production plans, purchasing decisions, sales forecasts, etc. By analyzing past inventory conditions, we can better understand product sales trends, seasonal changes and market demand, and provide a reference for future business decisions.

[0003] However, in the existing inventory recording methods, database-based retrieval solutions such as the MongoDB method store inventory history data in the form of an array in the nested field history of MongoDB, and use built-in MapReduce and aggregation pipeline functions to process data. However, in the absence of indexes, the query performance is low, and the retrieval performance is not enough to support combined queries and aggregate statistics for inventory data with a large number of attribute fields.

[0004] The storage method based on parent-child documents stores data based on parent-child documents. Each record of the child document is treated as an independent document. However, when aggregating, if the related calculations involving the parent document and the child document are involved, only custom scripts can be used to perform the aggregation calculations, which greatly reduces the performance (less than 1 / 10 of the ordinary aggregation). When the amount of data is large, the aggregation query directly times out, resulting in low efficiency of inventory records.

[0005] Through the Elastic Search dynamic field storage method, daily historical data is created as a field in the document by date. However, as the date progresses, more and more fields are dynamically created by ES, which will cause the volume of ES mapping to increase sharply, seriously affecting the performance and stability of the index. When the number of fields exceeds the ES index limit, the index will not be able to write documents, resulting in low inventory record efficiency.

[0006] From the above, it can be seen that the problem of how to improve the efficiency of historical inventory records in the prior art still needs to be solved. Summary of the invention

[0007] The present application provides a method, device, electronic device and storage medium for recording historical inventory, which can solve the problem of low efficiency of historical inventory recording in related technologies. The technical solution is as follows:

[0008] According to one aspect of the present application, a historical inventory recording method is characterized by comprising:

[0009] Constructing index data, wherein the index data includes common fields and backup fields corresponding to the common fields;

[0010] Initializing the index data based on a preset first time period;

[0011] The inventory data is acquired based on a preset second time period, and the backup field in the index data is updated based on the inventory data to generate a historical inventory record result, wherein the second time period is shorter than the first time period.

[0012] According to one aspect of the present application, a historical inventory recording device is characterized by comprising:

[0013] A data acquisition module, used to construct index data, wherein the index data includes common fields and backup fields corresponding to the common fields;

[0014] An initialization module, used to initialize the index data based on a preset first time period;

[0015] An updating module is used to obtain inventory data based on a preset second time period, and update the backup field in the index data based on the inventory data to generate a historical inventory record result, wherein the second time period is shorter than the first time period.

[0016] In an exemplary embodiment, the initialization module includes:

[0017] A first time period unit, used to set at least one initialization time period based on a preset first time period;

[0018] The initialization unit is used to initialize the backup field in the index data for each of the initialization time periods to obtain the index data corresponding to each of the initialization time periods.

[0019] In an exemplary embodiment, the update module includes:

[0020] A second time period unit, used to set at least one detection time period based on a preset second time period, and perform inventory detection based on each of the detection time periods to obtain inventory data corresponding to each of the detection time periods;

[0021] An updating unit is used to generate a backup field corresponding to each of the common fields based on each of the inventory data, and write the backup field into the index data to update the index data.

[0022] In an exemplary embodiment, the updating unit comprises:

[0023] A data determination subunit, configured to determine corresponding index data based on a detection time period corresponding to each of the inventory data;

[0024] A query subunit, configured to perform data query on the inventory data based on the common fields in the index data, and obtain inventory data corresponding to each common field in the index data;

[0025] A field generation subunit, used to generate corresponding backup fields based on the inventory data corresponding to each common field;

[0026] The updating subunit is used to write the backup field into the backup field corresponding to the common field based on the distributed processing model, so as to update the index data and generate the historical inventory record result.

[0027] In an exemplary embodiment, the distributed processing model is a data processing algorithm model including a producer unit, a message queue unit, and a consumer unit, wherein the producer unit is used to write backup fields to the message queue unit, the message queue unit is used to store the backup fields, and the consumer unit is used to write the backup fields in the queue unit into the index data.

[0028] In an exemplary embodiment, the apparatus further comprises:

[0029] An instruction acquisition module, used for acquiring correction instructions;

[0030] A correction module is used to correct the backup field in the index data based on the correction instruction.

[0031] In an exemplary embodiment, the correction instruction includes a correction time period and a correction field;

[0032] The correction module comprises:

[0033] a data determination unit, configured to determine the index data within the correction time period indicated by the correction instruction according to the initialization time period corresponding to the index data;

[0034] The correction unit is used to correct the backup field of the index data within the correction time period to the correction field indicated by the correction instruction.

[0035] According to one aspect of the present application, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the historical inventory recording method as described above.

[0036] According to one aspect of the present application, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement the historical inventory recording method as described above.

[0037] According to one aspect of the present application, a computer program product includes computer-readable instructions, which are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the historical inventory recording method as described above.

[0038] The beneficial effects of the technical solution provided by this application are:

[0039] In the above technical solution, by constructing index data and initializing it through a preset first time period, and obtaining inventory data through a preset second time period to update the index data, it is ultimately guaranteed that a historical inventory record result that can accurately indicate historical inventory changes is generated, and the historical inventory record can be quickly retrieved through the index data. By continuously initializing the index data through the first time period, it is ensured that the number of fields in the index data is controllable, thereby ensuring the efficiency of the inventory record. By obtaining inventory data through the second time period to update the index data, it is ensured that the accuracy and timeliness of the inventory record are guaranteed, and ultimately the efficiency of the historical inventory record is improved, and the effect of the historical inventory record is improved, thereby effectively solving the problem of low efficiency of the historical inventory record existing in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0041] Figure 1 It is a schematic diagram of the implementation environment involved in this application;

[0042] Figure 2 is a flow chart of a historical inventory recording method according to an exemplary embodiment;

[0043] Figure 3 yes Figure 2 A flowchart of step 230 in one embodiment corresponding to the embodiment;

[0044] Figure 4 yes Figure 2 A flowchart of an embodiment corresponding to step 250 in an embodiment;

[0045] Figure 5 yes Figure 3 A flowchart of step 253 in one embodiment corresponding to the embodiment;

[0046] Figure 6 is a flow chart of a historical inventory recording method according to an exemplary embodiment;

[0047] Figure 7 yes Figure 6 A flowchart of step 630 in one embodiment corresponding to the embodiment;

[0048] Figure 8a It is a specific implementation effect diagram of a historical inventory recording method in an application scenario;

[0049] Figure 8b It is another specific implementation effect diagram of a historical inventory recording method in an application scenario;

[0050] Fig. 9 is a structural block diagram of a historical inventory recording device according to an exemplary embodiment;

[0051] Fig.10 is a hardware structure diagram of a server according to an exemplary embodiment;

[0052] Fig.11 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0053] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0054] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0055] The historical inventory recording method provided in the present application can effectively improve the accuracy of historical inventory records. Accordingly, the historical inventory recording method is applicable to a historical inventory recording device, which can be deployed in an electronic device. The electronic device can be a computer device configured with a von Neumann architecture, for example, the computer device includes a desktop computer, a laptop computer, a server, etc.; the electronic device can also be an electronic device with a central control function, for example, the electronic device includes a gateway, etc.; the electronic device can also refer to a portable and mobile electronic device, for example, the electronic device includes a smart phone, a tablet computer, etc.

[0056] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0057] Figure 1 It is a schematic diagram of an implementation environment involved in a historical inventory recording method. It should be noted that this implementation environment is only an example adapted to the present invention and cannot be considered as providing any limitation on the scope of use of the present invention.

[0058] The implementation environment includes a collection end 110 and a service end 130 .

[0059] Specifically, the collection terminal 110 can also be considered as an inventory data collection device, including but not limited to electronic devices with data collection functions such as computers and sensors. For example, the collection terminal 110 is an inventory management computer.

[0060] The server 130 may be an electronic device such as a desktop computer, a laptop computer, a server, etc., or may be a computer cluster composed of multiple servers, or even a cloud computing center composed of multiple servers. The server 130 is used to provide background services, for example, background services include but are not limited to historical inventory record services, etc.

[0061] The server 130 and the collection terminal 110 establish a network communication connection in advance through wired or wireless means, and the data transmission between the server 130 and the collection terminal 110 is realized through the network communication connection. The transmitted data includes but is not limited to: inventory data and the like.

[0062] In an application scenario, through the interaction between the collection end 110 and the server end 130 , the collection end 110 collects inventory data and uploads the inventory data to the server end 130 to request the server end 130 to provide a historical inventory record service.

[0063] For the server 130, after receiving the inventory data uploaded by the acquisition terminal 110, it calls the historical inventory record service, updates the index data in the server based on the inventory data, and generates historical inventory record results, so as to solve the problem of low efficiency of historical inventory records in related technologies.

[0064] See also Figure 2 The present application embodiment provides a historical inventory recording method, which is applicable to an electronic device, which may be Figure 1 The server 130 in the illustrated implementation environment may also be a desktop computer, a laptop computer, a server, and the like.

[0065] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.

[0066] like Figure 2 As shown, the method may include the following steps:

[0067] Step 210: construct index data.

[0068] The index data includes common fields and backup fields corresponding to the common fields.

[0069] Specifically, the common fields in the index data are used to record the basic properties of the items in the inventory, such as the name of the inventory item, etc. The backup fields in the index data correspond to the common fields and are used to record the historical information of the items in the inventory, such as the inventory quantity, weight, cost price and other historical information of the inventory items.

[0070] It should be noted that in the inventory record system, the information recorded in the ordinary fields does not need to be based on the backup historical information, so the ordinary fields exist in the form of independent fields, and the backup fields need to record the historical information corresponding to the inventory items in different time periods according to the changes in inventory time, so the backup fields include fields recorded in the form of time series.

[0071] In one possible implementation, the backup field includes a history field for recording the storage date and a corresponding structure field for storing specific information. For example, history.2020-11-16.c=1, history.2020-11-17.c=2, indicating that on November 16, 2020, the inventory quantity was 1, and on November 17, 2020, the inventory quantity changed to 2.

[0072] In one possible implementation, the index data is stored in a MySQL database.

[0073] Step 230: Initialize index data based on a preset first time period.

[0074] It can be understood that by presetting a first time period, when the inventory time reaches each new time period, the storage index data is initialized and a new index data is generated, so that each first time period can correspond to a separate index data, thereby preventing the number of fields in each index data from being too large.

[0075] In one possible implementation, the first time period is one month, and the inventory time is calculated by a timer. When the inventory time reaches one month, the current index data is backed up, and the index data corresponding to the next month is created by initialization. For example, the index data index_2024_01 is backed up at the end of January 2024, and the index data index_2024_02 is generated by initialization, indicating the index data corresponding to January 2024 and the index data corresponding to February 2024.

[0076] Step 250: Acquire inventory data based on a preset second time period, and update the backup field in the index data based on the inventory data to generate a historical inventory record result.

[0077] The second duration period is shorter than the first duration period.

[0078] Specifically, by setting a second time period that is shorter than the first time period, changes of the backup fields in the index data in each second time period are recorded between the generation of new index data through initialization and the next index data initialization.

[0079] Through the above process, by distinguishing between common fields and backup fields in the index data, it is possible to focus on recording information with large changes in inventory data, thereby improving recording efficiency, and historical inventory records can be quickly retrieved based on common fields, thereby improving retrieval efficiency. By continuously initializing the index data in the first time period, it is possible to ensure that the number of fields in the index data is controllable, thereby ensuring inventory recording efficiency. By acquiring inventory data in the second time period to update the index data, it is possible to ensure the accuracy and timeliness of the inventory records, ultimately improving the efficiency of historical inventory records and improving the effect of historical inventory records, thereby effectively solving the problem of low efficiency of historical inventory records existing in related technologies.

[0080] In an exemplary embodiment, if Figure 3 As shown, step 230 may include the following steps:

[0081] Step 231: setting at least one initialization time period based on a preset first time period.

[0082] The initialization time period is a time period generated by dividing the inventory time according to the first time period. For example, when the first time period is one month, an initialization time period is generated every time one month of inventory time passes.

[0083] Step 233 , initializing the backup fields in the index data for each initialization time period, and obtaining the index data corresponding to each initialization time period.

[0084] The time point for initialization is determined by the initialization time period, thereby updating the index data.

[0085] In one possible implementation, when the first time period is one month, the index data of the current month is backed up at the end of each month, new index data is created, and the common fields in the index data of the current month are written into the new index data to complete initialization to obtain the index data corresponding to the next month.

[0086] In the above process, by initializing with the first time period, the index data is generated automatically and simultaneously the index data is generated continuously, thereby ensuring the efficiency and accuracy of the historical inventory records.

[0087] In an exemplary embodiment, if Figure 4 As shown, step 250 may include the following steps:

[0088] Step 251, at least one detection time period is set based on a preset second time period, and inventory detection is performed based on each detection time period to obtain inventory data corresponding to each detection time period.

[0089] In one possible implementation, the second time period is one day, the inventory time is calculated by a timer, and at zero o'clock every day, the real-time inventory data of the items in the inventory is obtained, and the historical information of the items in the inventory on the previous day is recorded through a backup field.

[0090] Step 253: Generate backup fields corresponding to the common fields based on the inventory data, and write the backup fields into the index data to update the index data.

[0091] In an exemplary embodiment, if Figure 5 As shown, step 253 may include the following steps:

[0092] Step 2531, determining corresponding index data based on the detection time period corresponding to each inventory data.

[0093] Specifically, when performing inventory detection on items in inventory, the detection time period for performing the inventory detection is recorded, and the index data to be recorded is determined according to the initialization time period corresponding to the index data.

[0094] For example, when performing inventory detection in February 2024, search for index data with an initialization time period of February 2024 for historical inventory records.

[0095] Step 2533: perform data query in the inventory data based on the common fields in the index data to obtain the inventory data corresponding to each common field in the index data.

[0096] Specifically, since the inventory data includes information corresponding to a large number of items, data query is performed through the common fields in the index data to quickly obtain the correspondence between the information of each item in the inventory data and the common fields in the index data, and then the inventory data is classified into inventory data corresponding to each common field.

[0097] Step 2535, generating corresponding backup fields based on the inventory data corresponding to each common field.

[0098] After obtaining the inventory data corresponding to the common fields, the inventory data is structured and written into the backup fields in a fixed format.

[0099] Step 2537, based on the distributed processing model, write the backup field into the backup field corresponding to the normal field to update the index data.

[0100] The writing process of the backup field is performed through multi-threaded concurrent writing through a distributed processing model.

[0101] In an exemplary embodiment, the distributed processing model is a data processing algorithm model including a producer unit, a message queue unit, and a consumer unit, wherein the producer unit is used to write backup fields to the message queue unit, the message queue unit is used to store the backup fields, and the consumer unit is used to write the backup fields in the queue unit into the index data.

[0102] In one possible implementation, the distributed processing model is a Kafka cluster. While obtaining the backup fields, the backup fields are written to the message queue in real time and concurrently through the producer unit of the Kafka cluster. The data is then consumed by the consumer unit, and the corresponding index data is written according to the ordinary fields and historical fields corresponding to the backup fields.

[0103] In the above process, the backup fields corresponding to each common field are determined to achieve the accuracy of backup data writing. The backup data is written through a distributed processing model to ensure the efficiency of backup data writing, so that historical inventory records can be carried out in real time, ensuring the efficiency and accuracy of historical inventory records.

[0104] In an exemplary embodiment, if Figure 6 As shown, the historical inventory method also includes the following steps:

[0105] Step 610, obtaining a correction instruction.

[0106] The correction instruction includes a correction time period and a correction field.

[0107] It can be understood that the correction instructions can be generated based on the user's operations such as adding orders across days and deleting orders during the historical inventory record process that will cause changes to historical information. The correction instructions input by the user can determine the specific correction time period for the historical inventory that the user needs to modify, as well as the correction fields such as the item name and item quantity that need to be modified.

[0108] Step 630: modify the backup field in the index data based on the modification instruction.

[0109] In an exemplary embodiment, if Figure 7 As shown, step 630 may include the following steps:

[0110] Step 631, determining the index data within the correction time period indicated by the correction instruction according to the initialization time period corresponding to the index data.

[0111] It can be understood that after obtaining the correction time period according to the correction instruction, a query can be performed in the index data to determine the index data whose initialization time period is within the correction time period as the target for correction.

[0112] In one possible implementation, the Elastic Search distributed search and analysis engine is used to perform full-text search, structured search, and statistical analysis of data.

[0113] In one possible implementation, the index data is queried by entering a normal field, a date field, and a conditional field. For example, when querying the product information with the item name being 001 on November 16, 2020, by obtaining the query instruction with ID: 001.history.2020-11-16.c > 0, the normal field is 001 and the index data in the backup field whose inventory quantity is greater than 0 on November 16, 2020 is queried.

[0114] Step 633: modify the backup fields of the index data within the modification time period to the modification fields indicated by the modification instruction.

[0115] The backup field in the index data is modified according to the correction instruction to obtain the backup data that meets the correction instruction.

[0116] Through the above process, the index data is corrected through the correction instruction, the interaction between the historical inventory record and the user is realized, and the human-computer interaction efficiency and historical record efficiency of the historical inventory record are improved.

[0117] Figure 8aThis is a specific implementation diagram of a historical inventory record method in an application scenario. In this application scenario, the Elastic Search distributed search and analysis engine is used to perform full-text search, structured search, and statistical analysis of data.

[0118] At the end of each month, a timer is used to pre-create and initialize new index data for the next month.

[0119] At midnight every day, the timer is used to query all the in-stock (pre-ordered, locked) products in the inventory system to obtain inventory data. The backup data with the historical field of 2020-11-16 is obtained based on the inventory data, and then the backup data is written to the message queue of the Kafka cluster concurrently using multiple threads. Then, the queue consumer of the Kafka cluster starts consuming data, and determines whether to write the backup data by determining whether the ES record in the Elastic Search distributed search and analysis engine exists. If not, it writes the ordinary field to generate the corresponding ES record. Otherwise, the read backup record is written to the history.2020-11-16 field of the corresponding index (index_2020_11) by the product id.

[0120] Figure 8b It is a flow chart for users to conduct cross-day business. When cross-day order replenishment, order deletion and other businesses occur, the user generates a correction instruction based on the changes in the subscription data, retrieves all index data within the time period indicated by the correction instruction, and writes the backup field indicated by the correction instruction into all the retrieved index data.

[0121] In this application scenario, index data is constructed and initialized through a preset first time period, and inventory data is obtained through a preset second time period to update the index data, ultimately ensuring that a historical inventory record result that can accurately indicate historical inventory changes is generated, and historical inventory records can be quickly retrieved through the index data. Continuously initializing the index data through the first time period can ensure that the number of fields in the index data is controllable, thereby ensuring inventory record efficiency. Obtaining inventory data through the second time period to update the index data can ensure accuracy and timeliness of inventory records, ultimately improving the efficiency of historical inventory records and improving the effect of historical inventory records, thereby effectively solving the problem of low efficiency of historical inventory records in related technologies.

[0122] The following is an embodiment of the device of the present application, which can be used to execute the historical inventory recording method involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the historical inventory recording method involved in the present application.

[0123] See also Fig. 9In an embodiment of the present application, a historical inventory recording device 900 is provided, including but not limited to: a data acquisition module 910, an initialization module 930, and an update module 950.

[0124] The data acquisition module 910 is used to construct index data, wherein the index data includes common fields and backup fields corresponding to the common fields.

[0125] The initialization module 930 is used to initialize the index data based on a preset first time period.

[0126] The updating module 950 is used to obtain inventory data based on a preset second time period, and update the backup field in the index data based on the inventory data to generate a historical inventory record result, wherein the second time period is shorter than the first time period.

[0127] It should be noted that the historical inventory recording device provided in the above embodiment only uses the division of the above functional modules as an example when performing historical inventory recording. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the historical inventory recording device will be divided into different functional modules to complete all or part of the functions described above.

[0128] In addition, the historical inventory recording device and the historical inventory recording method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs operations has been described in detail in the method embodiments, which will not be repeated here.

[0129] Fig.10 A schematic diagram of the structure of a server is shown according to an exemplary embodiment. The server is suitable for Figure 1 A server 130 in an implementation environment is shown.

[0130] It should be noted that the server is only an example adapted to the present application and cannot be considered to provide any limitation on the scope of use of the present application. The server cannot be interpreted as requiring dependence on or having Fig.10 One or more components of exemplary server 2000 are shown.

[0131] The hardware structure of the server 2000 may vary greatly due to different configurations or performances, such as Fig.10 As shown, the server 2000 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .

[0132] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the server 2000 .

[0133] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Figure 1 The interaction between the collection end 110 and the service end 130 in the implementation environment is shown.

[0134] Of course, in other examples adapted by the present application, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Fig.10 As shown, this is not intended to be a specific limitation.

[0135] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.

[0136] Among them, the operating system 251 is used to manage and control the hardware devices and application programs 253 on the server 2000 to enable the central processor 270 to calculate and process the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0137] The application program 253 is a computer-readable instruction that performs at least one specific task based on the operating system 251, and may include at least one module ( Fig.10 (not shown), each module may respectively include computer-readable instructions for the server 2000. For example, the historical inventory recording device may be regarded as an application 253 deployed on the server 2000.

[0138] The data 255 may be data stored in a disk, etc., stored in the memory 250 .

[0139] The central processor 270 may include one or more processors and is configured to communicate with the memory 250 through at least one communication bus to read the computer-readable instructions stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the historical inventory recording method is completed by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.

[0140] In addition, the present application can also be implemented through hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present application is not limited to any specific hardware circuits, software, or a combination of the two.

[0141] See also Fig.10In an embodiment of the present application, an electronic device 4000 is provided, and the electronic device 4000 may include: a desktop computer, a laptop computer, a server, etc.

[0142] exist Fig.11 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0143] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0144] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0145] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0146] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 4000, but is not limited to this.

[0147] Computer-readable instructions are stored in the memory 4003 , and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .

[0148] The computer-readable instructions are executed by one or more processors 4001 to implement the historical inventory recording method in the above-mentioned embodiments.

[0149] In addition, an embodiment of the present application provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement the above historical inventory recording method.

[0150] In an embodiment of the present application, a computer program product is provided. The computer program product includes computer-readable instructions. The computer-readable instructions are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the above-mentioned historical inventory recording method.

[0151] Compared with the related art, by distinguishing between common fields and backup fields in the index data, the information with large changes in the inventory data can be recorded, which improves the recording efficiency, and the historical inventory records can be quickly retrieved according to the common fields, which improves the retrieval efficiency. The index data can be initialized continuously in the first time period to ensure that the number of fields in the index data is controllable, thereby ensuring the efficiency of inventory recording. The index data can be updated by obtaining the inventory data in the second time period to ensure the accuracy and immediacy of the inventory records, and finally improve the efficiency of the historical inventory records and the effect of the historical inventory records, thereby effectively solving the problem of low efficiency of the historical inventory records in the related art. By initializing in the first time period, the index data can be generated coherently while ensuring the automation of generating the index data, thereby ensuring the efficiency and accuracy of the historical inventory records. By performing data query through the common fields in the index data, the corresponding relationship between the information of each item in the inventory data and the common fields in the index data can be quickly obtained, and then the inventory data can be classified into the inventory data corresponding to each common field. Determine the backup fields corresponding to each common field, achieve the accuracy of backup data writing, write backup data through a distributed processing model, ensure the efficiency of backup data writing, and thus enable historical inventory records to be carried out in real time, ensuring the efficiency and accuracy of historical inventory records. Correction of index data through correction instructions realizes the interaction between historical inventory records and users, and improves the human-computer interaction efficiency and historical record efficiency of historical inventory records.

[0152] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0153] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for recording historical inventory, It is characterized in that include: Constructing index data, wherein the index data includes common fields and backup fields corresponding to the common fields; Initializing the index data based on a preset first time period; The inventory data is acquired based on a preset second time period, and the backup field in the index data is updated based on the inventory data to generate a historical inventory record result, wherein the second time period is less than the first time period, wherein the backup field is written into the backup field corresponding to the ordinary field based on a distributed processing model to update the index data, and the distributed processing model is a data processing algorithm model including a producer unit, a message queue unit, and a consumer unit, wherein the producer unit is used to write the backup field to the message queue unit, the message queue unit is used to store the backup field, and the consumer unit is used to write the backup field in the queue unit into the index data, wherein the index data is initialized based on the preset first time period, including: Setting at least one initialization time period based on a preset first time period; Initializing the backup fields in the index data for each of the initialization time periods to obtain the index data corresponding to each of the initialization time periods; The acquiring of inventory data based on a preset second time period and updating of the backup field in the index data based on the inventory data comprises: setting at least one detection time period based on the preset second time period, performing inventory detection based on each detection time period, and obtaining inventory data corresponding to each detection time period; Generating backup fields corresponding to the common fields based on the inventory data, and writing the backup fields into the index data to update the index data; The step of generating a backup field corresponding to each of the common fields based on each of the inventory data and writing the backup field into the index data to update the index data comprises: determining the corresponding index data based on the detection time period corresponding to each of the inventory data; Performing data query on the inventory data based on the common fields in the index data to obtain inventory data corresponding to each common field in the index data; Generate corresponding backup fields based on the inventory data corresponding to each common field; The backup field is written into the backup field corresponding to the common field based on the distributed processing model to update the index data.

2. The method according to claim 1, It is characterized in that After acquiring inventory data based on a preset second time period and updating the backup field in the index data based on the inventory data, the method further includes: Get correction instructions; The backup field in the index data is modified based on the modification instruction.

3. The method according to claim 2, It is characterized in that The correction instruction includes a correction time period and a correction field; The modifying the backup field in the index data based on the modification instruction includes: Determine the index data within the correction time period indicated by the correction instruction according to the initialization time period corresponding to the index data; The backup fields of the index data within the correction time period are corrected to the correction fields indicated by the correction instruction.

4. A historical inventory recording device, It is characterized in that include: A data acquisition module, used to construct index data, wherein the index data includes common fields and backup fields corresponding to the common fields; An initialization module, used to initialize the index data based on a preset first time period; An update module, used to obtain inventory data based on a preset second time period, and update the backup field in the index data based on the inventory data to generate a historical inventory record result, wherein the second time period is less than the first time period, wherein the backup field is written into the backup field corresponding to the ordinary field based on a distributed processing model to update the index data, and the distributed processing model is a data processing algorithm model including a producer unit, a message queue unit, and a consumer unit, wherein the producer unit is used to write the backup field to the message queue unit, the message queue unit is used to store the backup field, and the consumer unit is used to write the backup field in the queue unit into the index data, wherein the initialization of the index data based on the preset first time period includes: setting at least one initialization time period based on the preset first time period; initializing the backup field in the index data for each of the initialization time periods, and obtaining the index data corresponding to each of the initialization time periods; wherein the acquisition of inventory based on the preset second time period The method comprises: setting at least one detection time period based on a preset second time period, performing inventory detection based on each detection time period, and obtaining inventory data corresponding to each detection time period; generating a backup field corresponding to each common field based on each inventory data, and writing the backup field into the index data to update the index data; wherein, generating a backup field corresponding to each common field based on each inventory data, and writing the backup field into the index data to update the index data comprises: determining the corresponding index data based on the detection time period corresponding to each inventory data; performing data query in the inventory data based on the common fields in the index data, and obtaining inventory data corresponding to each common field in the index data; generating a corresponding backup field based on the inventory data corresponding to each common field; and writing the backup field into the backup field corresponding to the common field based on a distributed processing model to update the index data.

5. An electronic device, It is characterized in that include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors so that the electronic device implements the historical inventory recording method according to any one of claims 1 to 3.

6. A storage medium having computer-readable instructions stored thereon, It is characterized in that The computer readable instructions are executed by one or more processors to implement the historical inventory recording method according to any one of claims 1 to 3.