Snapshot data generation method and device, storage medium and electronic equipment

By obtaining multiple inventory snapshot configuration information and generating corresponding snapshot data acquisition tasks, the problem of inefficient snapshot data backload in the prior art is solved, and efficient snapshot data generation and resource conservation are achieved.

CN120029972APending Publication Date: 2025-05-23BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311577095.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the prior art, the snapshot data backload method is difficult to expand, and due to the different needs of snapshot data backload of different users, resources are wasted and inefficient.

Method used

By obtaining multiple inventory snapshot configuration information, a snapshot data acquisition task with execution time within the first period is generated, and snapshot data acquisition is performed sequentially according to the task table to generate the current snapshot data. This method supports asynchronous task execution, adapting to different number of snapshot data demanders.

Benefits of technology

It has achieved the improvement of snapshot data generation efficiency, saved computing resources, and achieved better snapshot data generation results while serving multiple snapshot data demanders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029972A_ABST
    Figure CN120029972A_ABST
Patent Text Reader

Abstract

The invention provides a snapshot data generation method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring multiple pieces of inventory snapshot configuration information at a first moment; according to each piece of inventory snapshot configuration information, generating each snapshot data acquisition task of which the execution time is in a first time period correspondingly, and according to each snapshot data acquisition task, generating a first task table corresponding to the first time period; wherein the starting moment of the first time period is later than or equal to the first moment; and in the first time period, according to the execution time of each snapshot data acquisition task in the first task table, performing snapshot data acquisition in sequence to generate each piece of current snapshot data corresponding to each piece of inventory snapshot configuration information. According to the method, the generation efficiency of the snapshot data can be integrally improved, computing resources are saved, and a better snapshot data generation effect is achieved under the condition of serving a plurality of snapshot data demanders.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the development of computer technology and intelligent logistics technology, the scale of warehousing business is getting bigger and bigger, and the number of users served by warehousing business is also increasing. These users can require the logistics inventory center of warehousing business to regularly send back corresponding snapshot data.

[0003] In the related art, different users customize their own feedback methods to the logistics inventory center. Since these feedback methods are different, the feedback methods in the related art are difficult to expand; and since a large amount of resources are required to meet the snapshot data feedback needs of different users, the overall efficiency of snapshot data feedback is low.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a snapshot data generation method, device, electronic device and storage medium, which can improve the overall efficiency of snapshot data generation, save computing resources, and achieve better snapshot data generation effect while serving multiple snapshot data demanders.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a snapshot data generation method is provided, comprising: acquiring multiple inventory snapshot configuration information at a first moment; generating respective snapshot data collection tasks with execution times within a first time period according to respective inventory snapshot configuration information, and generating a first task table corresponding to the first time period according to respective snapshot data collection tasks; wherein the start time of the first time period is later than or equal to the first moment; within the first time period, snapshot data collection is performed sequentially according to the execution times of respective snapshot data collection tasks in the first task table to generate respective current snapshot data corresponding to respective inventory snapshot configuration information.

[0008] In one embodiment of the present disclosure, a snapshot data collection task includes a target task; wherein, within a first time period, snapshot data collection is performed in sequence according to the execution time of each snapshot data collection task in a first task table to generate each current snapshot data corresponding to each inventory snapshot configuration information, including: when the execution time of the target task is reached, according to the first inventory snapshot configuration information corresponding to the target task, determining the target database and target data type conditions; and generating the first current snapshot data corresponding to the first inventory snapshot configuration information according to the inventory data in the target database that meets the target data type conditions.

[0009] In one embodiment of the present disclosure, each snapshot data collection task has status information; wherein, based on the inventory data in the target database that meets the target data type condition, first current snapshot data corresponding to the first inventory snapshot configuration information is generated, including: determining the inventory data in the target database that meets the target data type condition as the snapshot data to be stored; updating the status information of the target task to being executed, and sending a message containing the snapshot data to be stored; consuming the message to store the snapshot data to be stored in a designated distributed data storage medium; after determining that the snapshot data to be stored is successfully stored, updating the status information of the target task to being executed, and determining the snapshot data to be stored as the first current snapshot data.

[0010] In one embodiment of the present disclosure, the snapshot data generation method also includes: if it is determined that the storage of the snapshot data to be stored fails, the status information of the target task is updated to suspended, and the execution time of the target task is postponed to the retry execution time; when the retry execution time of the target task is reached, snapshot data is collected again according to the target task to generate the first current snapshot data corresponding to the first inventory snapshot configuration information.

[0011] In one embodiment of the present disclosure, multiple inventory snapshot configuration information include second inventory snapshot configuration information, and the second inventory snapshot configuration information corresponds to the target snapshot data demander; the current snapshot data includes second current snapshot data corresponding to the second inventory snapshot configuration information; wherein the snapshot data generation method also includes: obtaining historical snapshot data corresponding to the target snapshot data demander; verifying the second current snapshot data according to the historical snapshot data to obtain a snapshot verification result; and when it is determined that the snapshot verification result is normal, transmitting the second current snapshot data back to the target snapshot data demander.

[0012] In one embodiment of the present disclosure, the second current snapshot data includes the current data volume of the target category items, and the historical snapshot data includes multiple historical data volumes of the target category items collected recently; wherein, the second current snapshot data is verified according to the historical snapshot data to obtain a snapshot verification result, including: determining the first historical data volume collected most recently among the multiple historical data volumes; when the current data volume is greater than or equal to the first historical data volume, verifying the current data volume according to the first historical data volume to obtain a current data volume verification result; when the current data volume is less than the first historical data volume, verifying the current data volume according to multiple historical data volumes to obtain a current data volume verification result; and determining the snapshot verification result according to the current data volume verification result.

[0013] In one embodiment of the present disclosure, the current data amount is verified according to the first historical data amount to obtain a current data amount verification result, including: if the first historical data amount is 0, determining the current data amount verification result is normal; if the first historical data amount is not 0, determining the current difference ratio according to the first historical data amount and the current data amount; if the current difference ratio is less than or equal to the first threshold, determining the current data amount verification result is normal; if the current difference ratio is greater than the first threshold, determining the current data amount verification result is abnormal.

[0014] In one embodiment of the present disclosure, the current data volume is verified based on multiple historical data volumes to obtain a current data volume verification result, including: determining a current difference ratio based on a first historical data volume and the current data volume, and determining a mean of the historical difference ratios based on multiple historical data volumes; determining a difference between the current difference ratio and the mean of the historical difference ratios; if the difference is less than or equal to a second threshold, determining that the current data volume verification result is normal; if the difference is greater than the second threshold, determining that the current data volume verification result is abnormal.

[0015] In one embodiment of the present disclosure, a snapshot verification result is determined based on a current data volume verification result, including: when the current data volume verification result is normal, determining that the snapshot verification result is normal; when the current data volume verification result is abnormal, issuing an alarm notification to perform a secondary verification on the second current snapshot data; receiving the secondary verification result of the second current snapshot data, and determining the snapshot verification result based on the secondary verification result.

[0016] In one embodiment of the present disclosure, the snapshot data generation method further includes: when determining that the snapshot verification result is abnormal, deleting the second current snapshot data; creating a secondary collection task based on the second inventory snapshot configuration information, and then re-collecting the snapshot data according to the secondary collection task.

[0017] In one embodiment of the present disclosure, the snapshot data generation method also includes: re-acquiring multiple inventory snapshot configuration information at a second moment later than the first moment, so as to generate a second task table corresponding to a second time period based on the re-acquired multiple inventory snapshot configuration information; within the second time period, performing snapshot data collection according to the second task table; wherein the time difference between the first moment and the second moment and the duration of the second time period are both the same as the duration of the first time period.

[0018] According to another aspect of the present disclosure, a snapshot data generating device is provided, including: an acquisition module, used to acquire multiple inventory snapshot configuration information at a first moment; a task generation module, used to generate each snapshot data collection task with an execution time within a first time period according to each inventory snapshot configuration information, and generate a first task table corresponding to the first time period according to each snapshot data collection task; wherein the starting time of the first time period is later than or equal to the first moment; and the acquisition module, used to perform snapshot data collection in sequence according to the execution time of each snapshot data collection task in the first task table within the first time period, so as to generate each current snapshot data corresponding to each inventory snapshot configuration information.

[0019] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned snapshot data generating method is implemented.

[0020] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned snapshot data generating method by executing the executable instructions.

[0021] The snapshot data generation method provided by the embodiment of the present disclosure can, on the one hand, realize batch unified acquisition of multiple inventory snapshot configuration information, can be applied to different numbers of snapshot data demanders, has strong scalability, and can avoid customizing the acquisition method of inventory snapshot configuration information for each snapshot data demander. On the other hand, after uniformly acquiring multiple inventory snapshot configuration information and generating a first task table corresponding to the multiple inventory snapshot configuration information, the execution of each task can be asynchronously completed in the first period according to the execution time of each snapshot data acquisition task, so that the corresponding current snapshot data is generated one by one according to the time specified in each inventory snapshot configuration information and then used for snapshot data transmission. It can be seen that this scheme can well adapt to a variable number of snapshot data demanders, timely and uniformly batch acquire the stored inventory snapshot configuration information from multiple snapshot data demanders, and then generate a task table composed of asynchronous tasks (i.e., snapshot data acquisition tasks), and only according to the task table, the asynchronous tasks can be executed one by one to generate the required snapshot data at the time specified by each snapshot data demander, which not only has strong scalability and versatility, but also can improve the overall efficiency of snapshot data generation, save computing resources, and achieve a better snapshot data generation effect when serving multiple snapshot data demanders.

[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0024] Figure 1 A schematic diagram showing an exemplary system architecture to which the snapshot data generation method according to an embodiment of the present disclosure can be applied;

[0025] Figure 2 A flowchart of a method for generating snapshot data according to an embodiment of the present disclosure is shown;

[0026] Figure 3 A schematic diagram of a timed task scheduling parameter configuration page in a snapshot data generation method according to an embodiment of the present disclosure is shown;

[0027] Figure 4 A schematic diagram showing a configuration page in a snapshot data generation method according to an embodiment of the present disclosure is shown;

[0028] Figure 5 A schematic diagram showing a snapshot data acquisition task executed in a snapshot data generation method according to an embodiment of the present disclosure is shown;

[0029] Figure 6 A flowchart of verifying the second current snapshot data in the snapshot data generation method according to one embodiment of the present disclosure is shown;

[0030] Figure 7 A flowchart of verifying the second current snapshot data according to the historical snapshot data in the snapshot data generation method according to one embodiment of the present disclosure is shown;

[0031] Figure 8 A block diagram showing a snapshot data generating device according to an embodiment of the present disclosure; and

[0032] Fig. 9 A structural block diagram of a snapshot data generating computer device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0034] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0035] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0036] Figure 1 The diagram shows an exemplary system architecture to which the snapshot data generation method according to an embodiment of the present disclosure can be applied.

[0037] like Figure 1 As shown, the system architecture may include a server 101, a network 102, and a client 103. The network 102 is used to provide a medium for a communication link between the client 103 and the server 101. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables.

[0038] In an exemplary embodiment, the client 103 for data transmission with the server 101 may include, but is not limited to, electronic devices of types such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, AR (Augmented Reality) devices, VR (Virtual Reality) devices, and smart wearable devices. Optionally, the operating system running on the electronic device may include, but is not limited to, Android system, IOS system, Linux system, Windows system, and the like.

[0039] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some practical applications, server 101 can also be a server of a network platform, which can be, for example, a trading platform, a live broadcast platform, a social platform, or a music platform, etc., which is not limited in the embodiments of the present disclosure. Among them, the server can be a single server or a cluster formed by multiple servers, and the present disclosure does not limit the specific architecture of the server.

[0040] In an exemplary embodiment, a user who is a snapshot data demander can configure and design according to the demand for snapshot data on the client 103, and send an inventory snapshot return request to the server 101 through the client 103. The server 101 can determine the corresponding inventory snapshot configuration information based on the received inventory snapshot return request, and store the inventory snapshot configuration information in a designated database (such as Redis). When the first moment is reached, the server 101 can obtain the stored multiple inventory snapshot configuration information, and use the snapshot data generation method provided by the present disclosure to generate each current snapshot data corresponding to each inventory snapshot configuration information. And the current snapshot data confirmed as normal can be returned to the client 103 used by each snapshot data demander, so that the snapshot data demander can analyze their respective inventory data based on the current snapshot data.

[0041] In an exemplary embodiment, the process of server 101 for implementing the snapshot data generation method may be: server 101 obtains multiple inventory snapshot configuration information at a first moment; server 101 generates snapshot data collection tasks with execution times within a first time period according to the respective inventory snapshot configuration information, and generates a first task table corresponding to the first time period according to the respective snapshot data collection tasks; wherein the start time of the first time period is later than or equal to the first moment; within the first time period, server 101 performs snapshot data collection in sequence according to the execution time of the respective snapshot data collection tasks in the first task table, so as to generate respective current snapshot data corresponding to the respective inventory snapshot configuration information.

[0042] In addition, it should be noted that Figure 1 What is shown is only one application environment of the snapshot data generation method provided by the present disclosure. Figure 1 The numbers of servers 101, networks 102 and clients 103 are merely illustrative, and any number of clients, networks and servers may be provided according to actual needs.

[0043] In order to enable ordinary persons in the art to better understand the technical solution of the present disclosure, each step of the snapshot data generating method in the exemplary embodiment of the present disclosure will be described in more detail below with reference to the accompanying drawings and embodiments.

[0044] Figure 2 A flowchart of a method for generating snapshot data according to an embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be performed as follows: Figure 1 The server 101 or the client 103 shown is executed, but the present disclosure is not limited to this.

[0045] In the following examples, the server 101 is used as the execution subject for illustration.

[0046] like Figure 2 As shown, the snapshot data generation method provided by the embodiment of the present disclosure may include the following steps.

[0047] Step S201: obtaining a plurality of inventory snapshot configuration information at a first moment.

[0048] In this step, the inventory snapshot configuration information can reflect the needs of the corresponding snapshot data demander for snapshot data feedback. For example, the inventory snapshot configuration information can indicate the batch category, inventory category, item category, feedback time and other information of the items for which snapshot data will be returned.

[0049] The inventory snapshot configuration information may be configuration data generated according to a request from a snapshot data demander, and the inventory snapshot configuration information may be stored in a specified storage medium, such as Redis (RemoteDictionary Server). At the first moment, all stored inventory snapshot configuration information may be obtained. In this step, a scheduled task for reading configuration may be created through the Clover (a scheduled task cluster used for task delay or periodic execution) tool, so that multiple inventory snapshot configuration information may be uniformly obtained by executing the scheduled task.

[0050] Among them, the first moment can be a moment for reading multiple inventory snapshot configuration information based on the reading frequency setting. The preset frequency can be set according to the return frequency of the snapshot data return. For example, the reading frequency and the return frequency can both be once every 24 hours or once every 12 hours. Taking the example that the reading frequency and the return frequency are both once every 24 hours, a time point for reading configuration information can be set every 24 hours, and the inventory snapshot configuration information read at each time point can be used for the snapshot data return of a time period after the time point. For example, multiple inventory snapshot configuration information can be read in batches at 11 o'clock every night, and the read inventory snapshot configuration information can be used for the snapshot data return that meets multiple snapshot data demand parties in the time period from 0 o'clock to 24 o'clock the next day.

[0051] This step can realize the batch unified acquisition of multiple inventory snapshot configuration information, which can be applied to different numbers of snapshot data demanders. It has strong scalability and can avoid customizing the acquisition method of inventory snapshot configuration information for each snapshot data demander. It can also provide a data basis for the common snapshot data generation method in subsequent steps, which is conducive to the overall versatility and scalability of the snapshot data generation process.

[0052] Step S203, generating snapshot data collection tasks with execution time within the first time period according to the inventory snapshot configuration information, and generating a first task table corresponding to the first time period according to the snapshot data collection tasks; wherein the start time of the first time period is later than or equal to the first time.

[0053] In this step, before the first time period, a first task table corresponding to the first time period can be generated according to each inventory snapshot configuration information, so as to execute the snapshot data collection tasks in the task table within the first time period, wherein the snapshot data collection tasks are all asynchronously executable tasks.

[0054] In some practical applications, multiple snapshot data collection tasks can be created in sequence according to a certain order of inventory snapshot configuration information (such as the order of reading configuration information or the order of random composition). In this process, each snapshot data collection task with an execution time can be created and inserted into the first task table according to the execution time of the task, so that the snapshot data collection tasks in the first task table can be sorted according to the execution time to facilitate the execution of tasks in subsequent steps.

[0055] In some practical applications, after triggering the scheduled task created by the Clover tool, in addition to obtaining multiple inventory snapshot configuration information in a unified manner, multiple snapshot data collection tasks can also be created based on the scheduled task according to each inventory snapshot configuration information.

[0056] Figure 3A schematic diagram of a timed task scheduling parameter configuration page in a snapshot data generation method according to an embodiment of the present disclosure is shown. Figure 3 As shown, in the timed task scheduling parameter configuration page 300, multiple items can be configured, wherein the control corresponding to "Number of servers" can configure the number of parallel threads that need to be opened, the control corresponding to "Get each time (pieces)" can configure the number of inventory snapshot configuration information that the server reads each time, the control corresponding to "Execute each time (pieces)" can configure the number of inventory snapshot configuration information that can be processed by one thread of the server each time, the control corresponding to "Data interval (0-600 seconds)" can configure the processing interval time when the snapshot configuration information is read, the control corresponding to "No data interval (0-1800 seconds)" can configure the processing interval time when the snapshot configuration information is not read, the control corresponding to "Number of threads (1-20)" can configure the maximum number of threads that exist at the same time, the control corresponding to "Number of data retries (1-10)" can configure the maximum number of retries for successfully creating a corresponding asynchronous task (i.e., snapshot data collection task) according to an inventory snapshot configuration information, and the control corresponding to "Server timeout (seconds)" can configure the maximum time for requesting to read the snapshot configuration information.

[0057] Step S205 , within the first time period, snapshot data collection is performed in sequence according to the execution time of each snapshot data collection task in the first task table to generate each current snapshot data corresponding to each inventory snapshot configuration information.

[0058] In this step, a tool with a task scanning function can be used to process the first task table corresponding to the first time period to obtain snapshot data collection tasks that reach their respective execution times. For example, Schedule (an open source automatic scanning tool) can be used to scan the first task table in the first time period. Assuming that the execution time of a task is 10 a.m., when the time reaches 10 a.m. in the first time period, the task in the first task table can be scanned out by Schedule, and then Schedule can send the task to the tool with a task execution function to process the task using the tool with a task execution function, complete the data collection work corresponding to the task, and obtain the corresponding current snapshot data.

[0059] Through this step, after uniformly acquiring multiple inventory snapshot configuration information and generating a first task table corresponding to the multiple inventory snapshot configuration information, the execution of each task can be completed asynchronously within the first time period according to the execution time of each snapshot data collection task, thereby generating corresponding current snapshot data one by one according to the time specified in each inventory snapshot configuration information and then using it for snapshot data transmission.

[0060] In some embodiments, the snapshot data generation method also includes: re-acquiring multiple inventory snapshot configuration information at a second moment later than the first moment, so as to generate a second task table corresponding to a second time period based on the re-acquired multiple inventory snapshot configuration information; within the second time period, performing snapshot data collection according to the second task table; wherein the time difference between the first moment and the second moment and the duration of the second time period are the same as the duration of the first time period.

[0061] For example, at 11 o'clock yesterday evening (i.e., the first moment), multiple stored inventory snapshot configuration information can be uniformly batch-acquired and a first task list can be generated, and the execution time of multiple snapshot data collection tasks in the first task list is between 0:00 a.m. and 24:00 p.m. today (i.e., within the first time period); between 0:00 a.m. and 24:00 p.m. today, the first task list can be scanned, and when each execution time is reached, the corresponding snapshot data collection task can be processed to generate the corresponding current snapshot data; and, at 11 o'clock today evening (i.e., the second moment), the multiple stored inventory snapshot configuration information can be re-uniformly batch-acquired and a second task list can be generated, and then between 0:00 a.m. and 24:00 p.m. tomorrow (i.e., within the second time period), snapshot data collection can be performed according to the second task list, and so on, to achieve continuous snapshot data collection.

[0062] Through the snapshot data generation method provided by the present disclosure, multiple inventory snapshot configuration information can be uniformly obtained at the first moment, and then multiple snapshot data collection tasks with execution times within the first time period can be generated based on the information, and a first task table can be formed; then the first task table can be scanned within the first time period, and snapshot data collection can be performed in sequence according to the execution time of each snapshot data collection task in the first task table, so as to generate each current snapshot data corresponding to each inventory snapshot configuration information. On the one hand, this solution can realize batch uniform acquisition of multiple inventory snapshot configuration information, which can be applied to different numbers of snapshot data demanders, has strong scalability, and can avoid customizing the acquisition method of inventory snapshot configuration information for each snapshot data demander. On the other hand, after uniformly acquiring multiple inventory snapshot configuration information and generating the first task table corresponding to multiple inventory snapshot configuration information, the solution can asynchronously complete the execution of each task within the first time period according to the execution time of each snapshot data collection task, so as to generate the corresponding current snapshot data one by one according to the time specified in each inventory snapshot configuration information and then use it for snapshot data transmission. It can be seen that this solution can adapt well to a variable number of snapshot data demanders, and can timely and uniformly batch-acquire the stored inventory snapshot configuration information from multiple snapshot data demanders, and then generate a task table consisting of asynchronous tasks (i.e., snapshot data collection tasks). Only according to the task table, the asynchronous tasks can be executed one by one to generate the required snapshot data at the time specified by each snapshot data demander. It not only has strong scalability and versatility, but also can improve the overall efficiency of snapshot data generation, save computing resources, and achieve better snapshot data generation effects while serving multiple snapshot data demanders.

[0063] In some embodiments, before acquiring multiple inventory snapshot configuration information at the first moment, the snapshot data generation method may further include: receiving multiple inventory snapshot return requests sent one by one by multiple snapshot data demanders, the inventory snapshot return requests including data collection requirements and data collection time; and generating corresponding inventory snapshot configuration information according to the data collection requirements and data collection time in each inventory snapshot return request.

[0064] After the inventory snapshot configuration information is generated, the inventory snapshot configuration information can be stored in a specified database, such as Redis; Redis supports multiple data structures (such as strings, hash tables, lists, etc.), so that Redis can flexibly process various forms of inventory snapshot configuration information; and Redis can store data in memory and can quickly respond to read and write access requests, thereby providing troubleshooting for the efficient implementation of the step of "obtaining multiple inventory snapshot configuration information at the first moment".

[0065] Based on this, "generating each snapshot data collection task with an execution time within the first time period according to each inventory snapshot configuration information" in step S203 may include: creating each asynchronous snapshot data collection task one by one according to each inventory snapshot configuration information, and determining the execution time of each snapshot data collection task according to the data collection time in each inventory snapshot configuration information.

[0066] Among them, the data collection time can be the time specified by the snapshot data demander to obtain the snapshot data, for example, it can be two o'clock in the afternoon of every day; the execution time of the snapshot data collection task needs to be within the first time period (such as the whole day tomorrow), so according to the information of "two o'clock in the afternoon of every day", the execution time of the corresponding snapshot data collection task in this step can be set to two o'clock tomorrow afternoon.

[0067] In addition, the execution time determined according to the data collection time can be regarded as the initial task execution time of the snapshot data collection task. If the collection failure is found during the execution process, the execution time of the snapshot data collection task can be reset (such as delayed by 5 minutes).

[0068] In some practical applications, the snapshot data demander may be a merchant user, who may configure in advance on his or her own client to apply for snapshot upload. In the configuration page on the client, the merchant user may configure in multiple aspects according to his or her own needs. After the configuration is completed, the merchant user may click the save control on the configuration page, and then send an inventory snapshot upload request to the server that executes this solution through the client to insert the configured content data into Redis.

[0069] Among them, the multiple aspects configured by the merchant user can be selected from all configurable items. For example, assuming that the configurable items include the storage type of the item (such as batch storage, business unit storage), coding information, item inventory type (such as actual inventory quantity, saleable inventory quantity), environment type (such as production environment, pre-release environment, test environment), collection time, and data format, then the merchant user can select one or several items for configuration. For example, the coding information of the item can be specified as "business unit code EBU4418054875952" and the actual inventory quantity of the item can be specified to be collected.

[0070] Figure 4 A schematic diagram of a configuration page in a snapshot data generation method according to an embodiment of the present disclosure is shown. Figure 4 As shown, in the configuration page 400, you can fill in the content of "Owner Code", check the option of "Environment", set the "Start Time" (i.e. data collection time), and enter custom query condition code data. Figure 3After clicking the "Save" control shown, the information carried in this page can be sent to the server to generate corresponding inventory snapshot configuration information on the server.

[0071] In some embodiments, the snapshot data collection task includes a target task; based on this, step S203 may include: when the execution time of the target task is reached, determining the target database and target data type conditions according to the first inventory snapshot configuration information corresponding to the target task; generating first current snapshot data corresponding to the first inventory snapshot configuration information according to the inventory data in the target database that meets the target data type conditions.

[0072] In some embodiments, each snapshot data collection task has status information; based on this, generating the first current snapshot data corresponding to the first inventory snapshot configuration information according to the inventory data in the target database that meets the target data type conditions may include: determining the inventory data in the target database that meets the target data type conditions as the snapshot data to be stored; updating the status information of the target task to being executed, and sending a message containing the snapshot data to be stored; consuming the message to store the snapshot data to be stored in a designated distributed data storage medium; after determining that the snapshot data to be stored is successfully stored, updating the status information of the target task to being executed, and determining the snapshot data to be stored as the first current snapshot data.

[0073] The designated distributed data storage medium may be ES (Elasticsearch, a distributed document storage engine). Using ES for storage can reduce the pressure on the database and make the query faster.

[0074] In some embodiments, the snapshot data generation method also includes: if it is determined that the storage of the snapshot data to be stored fails, the status information of the target task is updated to suspended, and the execution time of the target task is postponed to the retry execution time; when the retry execution time of the target task is reached, snapshot data is collected again according to the target task to generate a first current snapshot data corresponding to the first inventory snapshot configuration information.

[0075] The number of retries can be recorded. When the number of retries reaches a threshold (such as 5 times, 8 times, etc.), or it is detected that there is no task result within a predetermined time (such as 5 hours after the task, or the countdown of 1 hour in the first period), the task status can be determined to be failed. At this time, an alarm can be issued to execute the target task in other ways. For example, the target task can be manually executed through human intervention.

[0076] Figure 5 A schematic diagram of executing a snapshot data acquisition task in a snapshot data generation method according to an embodiment of the present disclosure is shown. Figure 5As shown, taking the executed snapshot data collection task as the target task as an example, the process of executing the target task to obtain the first current snapshot data may include the following steps.

[0077] Step S501 , in response to the arrival of the execution time of the target task, start executing the target task.

[0078] Step S503, according to the first inventory snapshot configuration information corresponding to the target task, determine the target database and the target data type conditions, determine the inventory data in the target database that meets the target data type conditions as the snapshot data to be stored, and determine the unique key of the snapshot data to be stored according to the first inventory snapshot configuration information and the current time, and group the snapshot data to be stored according to the unique key to form a data list.

[0079] Step S505, determine whether the data list is empty. If it is empty, it means that there is no data to be processed, and then step S509 can be executed; if it is not empty, it means that there is data to be stored and processed, and then step S507 can be executed.

[0080] Step S507, write the snapshot data to be stored of the current group into the ES, wherein the snapshot data to be stored and its unique key may be associated and written into the ES.

[0081] Step S509: determine whether the execution of the target task is completed.

[0082] In this embodiment, when Schedule is used to scan the target task, the execution interface of Search (a task execution tool) can be called to execute the target task. After Search is executed, the status of the database task will be written back, and an MQ message will be sent out at the same time. The message may contain snapshot data to be stored. When consuming the MQ message, the snapshot data to be stored will be written to ES based on the unique key generated by the business unit and date. When it is determined that the write is successful, the status information of the target task can be updated to execution completion.

[0083] In some embodiments, multiple inventory snapshot configuration information include second inventory snapshot configuration information, and the second inventory snapshot configuration information corresponds to the target snapshot data demander; the current snapshot data includes second current snapshot data corresponding to the second inventory snapshot configuration information; wherein the snapshot data generation method also includes verifying the second current snapshot data.

[0084] Figure 6 FIG. 4 shows a flow chart of verifying the second current snapshot data in a snapshot data generation method according to an embodiment of the present disclosure. Figure 6 As shown, this process includes the following steps.

[0085] Step S601: Obtain historical snapshot data corresponding to the target snapshot data requester.

[0086] Step S603: Verify the second current snapshot data based on the historical snapshot data to obtain a snapshot verification result.

[0087] Step S605: When it is determined that the snapshot verification result is normal, transmit the second current snapshot data back to the target snapshot data requester.

[0088] In some embodiments, after obtaining the snapshot verification result, the snapshot data generation method may further include: when it is determined that the snapshot verification result is abnormal, delete the second current snapshot data; create a secondary acquisition task based on the second inventory snapshot configuration information, and then re-acquire snapshot data according to the secondary acquisition task.

[0089] In this embodiment, in response to being written into ES, the index of ES will automatically create a monitoring task for verifying whether the current snapshot data is normal during writing. Through the monitoring tool, real-time perception of the change amount of data acquisition can be achieved, the snapshot verification result of whether the current snapshot data is normal can be obtained in a timely manner, and problems can be processed at the first moment to minimize losses in the shortest time.

[0090] In some embodiments, the second current snapshot data includes the current data volume of the target category of items, and the historical snapshot data includes multiple historical data volumes of the target category of items collected in recent times. Based on this, Figure 7 The flowchart shows the verification of the second current snapshot data based on the historical snapshot data in the snapshot data generation method according to an embodiment of the present disclosure. As Figure 7 shown, step S603 may include the following steps.

[0091] Step S701: Determine the first historical data volume collected most recently among the multiple historical data volumes. For example, assuming that the collection frequency is once every 24 hours, the first historical data volume may be the data collected one day before the current data volume for the same item.

[0092] Step S703: When the current data volume is greater than or equal to the first historical data volume, verify the current data volume based on the first historical data volume to obtain a current data volume verification result.

[0093] In some embodiments, step S703 may further include: if the first historical data volume is 0, determining that the current data volume verification result is normal; if the first historical data volume is not 0, determining the current difference ratio based on the first historical data volume and the current data volume; if the current difference ratio is less than or equal to the first threshold, determining that the current data volume verification result is normal; if the current difference ratio is greater than the first threshold, determining that the current data volume verification result is abnormal.

[0094] According to the first historical data volume N 1 and the current data volume N 0 The current variance ratio can be determined by:

[0095] The first threshold value may be a value set based on the actual application production environment. For example, if the floating data of the purchase quantity in the production environment does not normally exceed 20%, the first threshold value may be set to 0.2. If it is found that the current difference ratio is greater than 0.2, it can be considered that the current data volume verification result is abnormal and there may be a problem.

[0096] Step S705: When the current data volume is smaller than the first historical data volume, verify the current data volume according to multiple historical data volumes to obtain a current data volume verification result.

[0097] In some embodiments, step S705 may further include: determining a current difference ratio based on a first historical data volume and a current data volume, and determining a mean of historical difference ratios based on multiple historical data volumes; determining a difference between the current difference ratio and the mean of historical difference ratios; if the difference is less than or equal to a second threshold, determining that the current data volume verification result is normal; if the difference is greater than the second threshold, determining that the current data volume verification result is abnormal.

[0098] Among them, it is assumed that the M historical data volumes are N 1 、N 2 ,…,N M , then the way to determine the mean of the historical difference ratio based on these M historical data volumes can be:

[0099] Among them, the second threshold can be set to a smaller value, such as 0.1, 0.05, etc. The second threshold is used to compare with the difference between the current difference ratio and the historical difference ratio average, and the historical difference ratio average can reflect the fluctuation of the amount of item data in the past period of time. Therefore, if the difference is greater than the second threshold, it can be considered that the current difference ratio corresponding to the current data volume has a larger fluctuation compared with the previous data. Therefore, it can be considered that the current data volume is abnormal and there may be problems.

[0100] Step S707, determining the snapshot verification result according to the current data volume verification result.

[0101] Specifically, in some embodiments, step S707 may include: when the current data volume verification result is normal, determining that the snapshot verification result is normal; when the current data volume verification result is abnormal, issuing an alarm notification to perform a secondary verification on the second current snapshot data; receiving the secondary verification result of the second current snapshot data, and determining the snapshot verification result based on the secondary verification result.

[0102] After the alarm notification is issued, different methods can be used for secondary verification according to actual needs and conditions, such as manual verification and data legitimacy inspection to perform secondary verification on the second current snapshot data.

[0103] If the collected data is determined to be abnormal or missing after the second verification, you need to use a cleaning tool to delete the abnormal data and Redis anti-duplication. After clearing, go to the task configuration page again and regenerate the data by manually executing the task.

[0104] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0105] Figure 8 FIG. 8 is a block diagram of a snapshot data generating device 800 according to an embodiment of the present disclosure; Figure 8 As shown, it includes: an acquisition module 801, which is used to acquire multiple inventory snapshot configuration information at a first moment; a task generation module 802, which is used to generate each snapshot data collection task with an execution time within a first time period according to each inventory snapshot configuration information, and generate a first task table corresponding to the first time period according to each snapshot data collection task; wherein the start time of the first time period is later than or equal to the first moment; a collection module 803, which is used to collect snapshot data in sequence according to the execution time of each snapshot data collection task in the first task table within the first time period, so as to generate each current snapshot data corresponding to each inventory snapshot configuration information

[0106] Through the snapshot data generation device provided by the embodiment of the present disclosure, on the one hand, it is possible to realize batch unified acquisition of multiple inventory snapshot configuration information, which can be applicable to different numbers of snapshot data demanders, has strong scalability, and can avoid customizing the acquisition method of inventory snapshot configuration information for each snapshot data demander. On the other hand, after uniformly acquiring multiple inventory snapshot configuration information and generating a first task table corresponding to the multiple inventory snapshot configuration information, the execution of each task can be asynchronously completed according to the execution time of each snapshot data acquisition task within the first period, so that the corresponding current snapshot data is generated one by one according to the time specified in each inventory snapshot configuration information and then used for snapshot data transmission. It can be seen that this scheme can well adapt to a variable number of snapshot data demanders, timely and uniformly batch acquire the stored inventory snapshot configuration information from multiple snapshot data demanders, and then generate a task table composed of asynchronous tasks (i.e., snapshot data acquisition tasks), and only according to the task table, the asynchronous tasks can be executed one by one to generate the required snapshot data at the time specified by each snapshot data demander, which not only has strong scalability and versatility, but also can improve the overall efficiency of snapshot data generation, save computing resources, and achieve a better snapshot data generation effect when serving multiple snapshot data demanders.

[0107] In some embodiments, the snapshot data collection task includes a target task; wherein, within a first time period, the collection module 803 performs snapshot data collection in sequence according to the execution time of each snapshot data collection task in the first task table to generate each current snapshot data corresponding to each inventory snapshot configuration information, including: when the execution time of the target task is reached, according to the first inventory snapshot configuration information corresponding to the target task, determining the target database and target data type conditions; based on the inventory data in the target database that meets the target data type conditions, generating the first current snapshot data corresponding to the first inventory snapshot configuration information.

[0108] In some embodiments, each snapshot data collection task has status information; wherein, the collection module 803 generates first current snapshot data corresponding to the first inventory snapshot configuration information based on the inventory data in the target database that meets the target data type conditions, including: determining the inventory data in the target database that meets the target data type conditions as the snapshot data to be stored; updating the status information of the target task to being executed, and sending a message containing the snapshot data to be stored; consuming the message to store the snapshot data to be stored in a designated distributed data storage medium; after determining that the snapshot data to be stored is successfully stored, updating the status information of the target task to being executed, and determining the snapshot data to be stored as the first current snapshot data.

[0109] In some embodiments, the collection module 803 is also used for: if it is determined that the storage of the snapshot data to be stored fails, the status information of the target task is updated to suspended, and the execution time of the target task is postponed to the retry execution time; when the retry execution time of the target task is reached, the snapshot data is collected again according to the target task to generate the first current snapshot data corresponding to the first inventory snapshot configuration information.

[0110] In some embodiments, multiple inventory snapshot configuration information include second inventory snapshot configuration information, and the second inventory snapshot configuration information corresponds to the target snapshot data demander; the current snapshot data includes second current snapshot data corresponding to the second inventory snapshot configuration information; wherein the snapshot data generation device also includes a verification module 804, and the verification module 804 is used to obtain historical snapshot data corresponding to the target snapshot data demander; verify the second current snapshot data according to the historical snapshot data to obtain a snapshot verification result; when it is determined that the snapshot verification result is normal, the second current snapshot data is transmitted back to the target snapshot data demander.

[0111] In some embodiments, the second current snapshot data includes the current data volume of the target category items, and the historical snapshot data includes multiple historical data volumes of the target category items collected recently; wherein, the verification module 804 verifies the second current snapshot data according to the historical snapshot data to obtain a snapshot verification result, including: determining the first historical data volume collected most recently among the multiple historical data volumes; when the current data volume is greater than or equal to the first historical data volume, verifying the current data volume according to the first historical data volume to obtain a current data volume verification result; when the current data volume is less than the first historical data volume, verifying the current data volume according to multiple historical data volumes to obtain a current data volume verification result; determining the snapshot verification result according to the current data volume verification result.

[0112] In some embodiments, the verification module 804 verifies the current data volume based on the first historical data volume to obtain a current data volume verification result, including: if the first historical data volume is 0, determining that the current data volume verification result is normal; if the first historical data volume is not 0, determining the current difference ratio based on the first historical data volume and the current data volume; if the current difference ratio is less than or equal to the first threshold, determining that the current data volume verification result is normal; if the current difference ratio is greater than the first threshold, determining that the current data volume verification result is abnormal.

[0113] In some embodiments, the verification module 804 verifies the current data volume based on multiple historical data volumes to obtain a current data volume verification result, including: determining a current difference ratio based on a first historical data volume and the current data volume, and determining a mean of historical difference ratios based on multiple historical data volumes; determining a difference between the current difference ratio and the mean of historical difference ratios; if the difference is less than or equal to a second threshold, determining that the current data volume verification result is normal; if the difference is greater than the second threshold, determining that the current data volume verification result is abnormal.

[0114] In some embodiments, the verification module 804 determines the snapshot verification result based on the current data volume verification result, including: when the current data volume verification result is normal, determining that the snapshot verification result is normal; when the current data volume verification result is abnormal, issuing an alarm notification to perform a secondary verification on the second current snapshot data; receiving the secondary verification result of the second current snapshot data, and determining the snapshot verification result based on the secondary verification result.

[0115] In some embodiments, the snapshot data generating device further includes a re-collection module 805, which is used to delete the second current snapshot data when determining that the snapshot verification result is abnormal; create a secondary collection task based on the second inventory snapshot configuration information, and then re-collect the snapshot data according to the secondary collection task.

[0116] In some embodiments, the acquisition module 801 is also used to re-acquire multiple inventory snapshot configuration information at a second moment later than the first moment, and the task generation module 802 is also used to generate a second task table corresponding to the second time period based on the re-acquired multiple inventory snapshot configuration information; the collection module 803 is also used to collect snapshot data according to the second task table within the second time period; wherein the time difference between the first moment and the second moment and the duration of the second time period are the same as the duration of the first time period.

[0117] Figure 8 For other contents of the embodiment, reference can be made to the other embodiments mentioned above.

[0118] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0119] Fig. 9The structural block diagram of a snapshot data generating computer device in the embodiment of the present disclosure is shown. It should be noted that the electronic device shown in the figure is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present invention.

[0120] Refer to the following Fig. 9 An electronic device 900 according to this embodiment of the present invention will be described. Fig. 9 The electronic device 900 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.

[0121] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).

[0122] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 910 can perform the following steps: Figure 2 The method shown in .

[0123] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .

[0124] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0125] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0126] The electronic device 900 can also communicate with one or more external devices 1000 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 950. Moreover, the electronic device 900 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 960. As shown in the figure, the network adapter 960 communicates with other modules of the electronic device 900 through the bus 930. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0127] In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium on which a program product capable of implementing the above method of this specification is stored. In some possible implementation manners, various aspects of the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.

[0128] The program product for implementing the above method according to an embodiment of the present invention can be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.

[0129] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0130] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0132] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0133] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0134] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0135] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0136] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations of the above-mentioned embodiments.

[0137] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A snapshot data generation method, It is characterized in that include: Get multiple inventory snapshot configuration information at the first moment; Generate snapshot data collection tasks with execution time within a first time period according to each inventory snapshot configuration information, and generate a first task table corresponding to the first time period according to each snapshot data collection task; wherein the start time of the first time period is later than or equal to the first time; In the first time period, snapshot data collection is performed in sequence according to the execution time of each snapshot data collection task in the first task table to generate each current snapshot data corresponding to each inventory snapshot configuration information.

2. The method according to claim 1, It is characterized in that The snapshot data collection task includes a target task; wherein, within the first time period, snapshot data collection is performed in sequence according to the execution time of each snapshot data collection task in the first task table to generate each current snapshot data corresponding to each inventory snapshot configuration information, including: When the execution time of the target task is reached, determining the target database and target data type conditions according to the first inventory snapshot configuration information corresponding to the target task; According to the inventory data in the target database that meets the target data type condition, first current snapshot data corresponding to the first inventory snapshot configuration information is generated.

3. The method according to claim 2, It is characterized in that Each snapshot data collection task has status information; wherein, according to the inventory data in the target database that meets the target data type condition, generating the first current snapshot data corresponding to the first inventory snapshot configuration information includes: Determine the inventory data in the target database that meets the target data type condition as snapshot data to be stored; The status information of the target task is updated to being executed, and a message containing the snapshot data to be stored is sent; Consume the message to store the snapshot data to be stored in a designated distributed data storage medium; After determining that the snapshot data to be stored is successfully stored, the status information of the target task is updated to execution completion, and the snapshot data to be stored is determined as the first current snapshot data.

4. The method according to claim 3, It is characterized in that The method further comprises: If it is determined that the storage of the snapshot data to be stored fails, the state information of the target task is updated to suspended, and the execution time of the target task is postponed to the retry execution time; When the retry execution time of the target task is reached, snapshot data collection is performed again according to the target task to generate first current snapshot data corresponding to the first inventory snapshot configuration information.

5. The method according to claim 1, It is characterized in that The plurality of inventory snapshot configuration information includes second inventory snapshot configuration information, and the second inventory snapshot configuration information corresponds to the target snapshot data demander; the current snapshot data includes second current snapshot data corresponding to the second inventory snapshot configuration information; wherein the method further includes: Acquire historical snapshot data corresponding to the target snapshot data demander; Verifying the second current snapshot data according to the historical snapshot data to obtain a snapshot verification result; When it is determined that the snapshot verification result is normal, the second current snapshot data is transmitted back to the target snapshot data demander.

6. The method according to claim 5, It is characterized in that The second current snapshot data includes the current data volume of the target category items, and the historical snapshot data includes multiple historical data volumes of the target category items collected recently; The step of verifying the second current snapshot data according to the historical snapshot data to obtain a snapshot verification result includes: Determine a first historical data amount that is most recently collected among the multiple historical data amounts; When the current data volume is greater than or equal to the first historical data volume, verifying the current data volume according to the first historical data volume to obtain a current data volume verification result; In the case where the current data volume is less than the first historical data volume, verifying the current data volume according to the multiple historical data volumes to obtain a current data volume verification result; The snapshot verification result is determined according to the current data volume verification result.

7. The method according to claim 6, It is characterized in that Verifying the current data volume according to the first historical data volume to obtain a current data volume verification result includes: If the first historical data volume is 0, determining that the current data volume verification result is normal; If the first historical data amount is not 0, determining a current difference ratio according to the first historical data amount and the current data amount; If the current difference ratio is less than or equal to the first threshold, the current data volume verification result is determined to be normal; if the current difference ratio is greater than the first threshold, the current data volume verification result is determined to be abnormal.

8. The method according to claim 6, It is characterized in that Verifying the current data volume according to the multiple historical data volumes to obtain a current data volume verification result includes: Determining a current difference ratio according to the first historical data volume and the current data volume, and determining an average of historical difference ratios according to the multiple historical data volumes; determining a difference between the current variance ratio and an average of the historical variance ratios; If the difference is less than or equal to the second threshold, the current data volume verification result is determined to be normal; if the difference is greater than the second threshold, the current data volume verification result is determined to be abnormal.

9. The method according to claim 6, It is characterized in that Determining the snapshot verification result according to the current data volume verification result includes: In the case where the current data volume verification result is normal, determining that the snapshot verification result is normal; When the current data volume verification result is abnormal, issuing an alarm notification to perform a secondary verification on the second current snapshot data; A secondary verification result of the second current snapshot data is received, and the snapshot verification result is determined according to the secondary verification result.

10. The method according to claim 5, It is characterized in that The method further comprises: If it is determined that the snapshot verification result is abnormal, deleting the second current snapshot data; A secondary collection task is created based on the second inventory snapshot configuration information, and then snapshot data collection is performed again according to the secondary collection task.

11. The method according to claim 1, It is characterized in that The method further comprises: Re-acquiring a plurality of inventory snapshot configuration information at a second time later than the first time, so as to generate a second task table corresponding to a second time period according to the re-acquired plurality of inventory snapshot configuration information; During the second time period, snapshot data collection is performed according to the second task table; wherein the time difference between the first moment and the second moment and the duration of the second time period are both the same as the duration of the first time period.

12. A snapshot data generating device, It is characterized in that include: An acquisition module, used for acquiring a plurality of inventory snapshot configuration information at a first moment; A task generation module, configured to generate, according to each inventory snapshot configuration information, each snapshot data collection task with an execution time within a first time period, and generate, according to each snapshot data collection task, a first task table corresponding to the first time period; wherein the start time of the first time period is later than or equal to the first time; The collection module is used to collect snapshot data in sequence according to the execution time of each snapshot data collection task in the first task table within the first time period to generate each current snapshot data corresponding to each inventory snapshot configuration information.

13. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for generating snapshot data according to any one of claims 1 to 11 is implemented.

14. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the snapshot data generation method according to any one of claims 1 to 11.