A method and device for data synchronization
By calculating the changes in the commodity inventory of the sales system and the warehousing system and the inventory correction volume, the simultaneous commodity inventory of the sales system and the warehousing system without affecting the normal operation of the business, solving the need to suspend the line in the existing technology The problem of data synchronization on business has improved the efficiency and user experience of data synchronization.
Patent Information
- Application Number
- CN202010621824.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-30
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-06-30
AI Technical Summary
When the prior art realizes data synchronization between sales systems and warehousing systems, online services need to be suspended, resulting in the inability to provide online shopping services in real time, which brings inconvenience to users.
By determining the commodity inventory change amount from the previous data synchronization time to the current time of the first system and the second system, the inventory correction amount is calculated, and data synchronization is performed without affecting the normal operation of the business.
It realizes that the product inventory of sales and warehousing systems is synchronized without suspending online services, improving the efficiency and user experience of data synchronization.
Smart Images

Figure CN113869815B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data synchronization. Background Art
[0002] At present, the online shopping business is developing very rapidly, allowing users to buy the goods they need online anytime and anywhere, bringing great convenience to users' actual lives.
[0003] In actual applications, online shopping businesses usually require support from sales systems and warehousing systems. The sales system is mainly used to provide users with product information of various commodities, as well as to obtain and process user orders, while the warehousing system is mainly used to manage the inventory information of various commodities stored in the warehouse.
[0004] For online shopping business, it is particularly important to ensure that the inventory of goods recorded in the sales system is consistent with the inventory of goods counted in the warehousing system, so it is necessary to synchronize the data of the sales system and the warehousing system. In the existing data synchronization process, it is usually necessary to first suspend the online business of the sales system and the inventory operation of the warehousing system, and then compare the inventory of goods in the sales system and the inventory of goods in the warehousing system, and then adjust the inventory of goods in the sales system or the warehousing system according to the comparison results, so as to achieve data synchronization of the sales system and the warehousing system on the inventory of goods. However, in the existing data synchronization process, it is necessary to suspend the online business of the sales system, which cannot guarantee that the sales system can provide online shopping services to users in real time, which brings inconvenience to users.
[0005] Therefore, how to achieve data synchronization between the sales system and the warehousing system while ensuring the normal operation of the sales system and the warehousing system is an urgent problem to be solved. Summary of the invention
[0006] This specification provides a data synchronization method and device to partially solve the above problems existing in the prior art.
[0007] This manual adopts the following technical solutions:
[0008] This specification provides a data synchronization method, the method is used for data synchronization of a first system, and includes:
[0009] The first system determines the inventory of the commodity recorded by the first system at the current time as the inventory to be synchronized;
[0010] Determine the commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount, and determine the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as the second inventory change amount;
[0011] determining an inventory correction amount according to the first inventory change amount and the second inventory change amount;
[0012] Data synchronization is performed on the inventory quantity to be synchronized according to the inventory correction quantity.
[0013] Optionally, the first system determines the commodity inventory recorded by the first system at the current time as the inventory to be synchronized, including:
[0014] For each commodity, the first system determines the commodity inventory corresponding to the commodity at the current time recorded by the first system as the inventory to be synchronized corresponding to the commodity.
[0015] Optionally, determining a commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as a first inventory change amount includes:
[0016] Determine the data synchronization period to which the previous data synchronization time belongs as a first data synchronization period, and determine the data synchronization period to which the current time belongs as a second data synchronization period;
[0017] According to the inventory-related records of the commodity in the first system recorded in the first system, the commodity inventory change amount from the first data synchronization period to the second data synchronization period in the first system is determined as the first inventory change amount.
[0018] Optionally, determining a commodity inventory change amount of the second system from the last data synchronization time to the current time as a second inventory change amount includes:
[0019] Determine, according to the inventory-related record of the commodity in the second system recorded in the second system and acquired from the second system, an initial commodity inventory of the commodity in the second system in the first data synchronization period as the first initial commodity inventory, and determine, in the second system, an initial commodity inventory of the commodity in the second data synchronization period as the second initial commodity inventory;
[0020] According to the first initial commodity inventory and the second initial commodity inventory, a commodity inventory change amount of the commodity in the second system from the first data synchronization period to the second data synchronization period is determined as a second inventory change amount.
[0021] Optionally, determining the inventory correction amount according to the first inventory change amount and the second inventory change amount includes:
[0022] Determine, according to the first inventory change amount and the second inventory change amount, an inventory change difference value for the commodity between the first system and the second system from the first data synchronization period to the second data synchronization period;
[0023] Determine an initial inventory difference value for the commodity between the first system and the second system in the second data synchronization period according to the determined initial commodity inventory quantity of the commodity in the first system in the second data synchronization period and the initial commodity inventory quantity of the commodity in the second system in the second data synchronization period;
[0024] The inventory correction amount is determined according to the inventory change difference value and the initial inventory difference value.
[0025] Optionally, the method further comprises:
[0026] If it is determined that the time interval between the current time and the last data synchronization time does not exceed the set duration, data synchronization is performed on the inventory to be synchronized corresponding to the product based on the inventory correction amount corresponding to the current time and the inventory correction amount corresponding to the last data synchronization time.
[0027] Optionally, the method further comprises:
[0028] An inventory difference report is generated according to the inventory correction amount, and through the inventory difference report, a prompt is given to verify the inventory amount to be synchronized after data synchronization.
[0029] Optionally, the first system includes: a commodity sales system, and the second system includes: a warehousing system.
[0030] This specification provides a data synchronization system, including: a first system and a second system;
[0031] The first system determines the commodity inventory at the current time recorded by the first system as the inventory to be synchronized, determines the commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount, obtains the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as the second inventory change amount, determines the inventory correction amount according to the first inventory change amount and the second inventory change amount, and performs data synchronization on the inventory to be synchronized according to the inventory correction amount;
[0032] The second system sends to the first system the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time.
[0033] This specification provides a data synchronization device, including:
[0034] A first determination module is configured to determine the inventory of the commodity recorded by the device at the current time as the inventory to be synchronized;
[0035] A second determination module is configured to determine a commodity inventory change amount corresponding to the device from the last data synchronization time to the current time as a first inventory change amount, and to determine a commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as a second inventory change amount;
[0036] a correction amount determination module, configured to determine an inventory correction amount according to the first inventory change amount and the second inventory change amount;
[0037] A data synchronization module is configured to synchronize the data of the inventory quantity to be synchronized according to the inventory correction quantity.
[0038] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned data synchronization method is implemented.
[0039] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned data synchronization method when executing the program.
[0040] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0041] In the data synchronization method provided in the present specification, the first system can determine the commodity inventory recorded by the first system at the current time as the inventory to be synchronized, and determine the commodity inventory change corresponding to the first system from the last data synchronization time to the current time as the first inventory change, and determine the commodity inventory change corresponding to the first system from the last data synchronization time to the current time as the second inventory change, and then, determine the inventory correction amount based on the first inventory change amount and the second inventory change amount, and then perform data synchronization on the inventory to be synchronized based on the inventory correction amount.
[0042] It can be seen from the above method that the data synchronization implemented by the first system on the inventory quantity of the commodity at the current time recorded by the first system is implemented based on the historical data of the corresponding inventory quantity of the commodity recorded by the first system and the second system, and these historical data can be acquired in advance by the first system. This can effectively ensure that the first system and the second system complete the data synchronization of the commodity inventory while uninterrupted normal business, effectively improving the efficiency of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0044] Figure 1 A flowchart of a data synchronization method provided in this specification;
[0045] Figure 2 A schematic diagram of the specific process of data synchronization between the commodity sales system and the warehousing system provided in this manual;
[0046] Figure 3 A schematic diagram of a data synchronization device provided in this specification;
[0047] Figure 4 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of this specification clearer, the technical solutions in this specification will be clearly and completely described in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0049] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0050] Figure 1 A data synchronization method provided in this specification includes the following steps:
[0051] S101: The first system determines the inventory of commodities recorded by the first system at the current time as the inventory to be synchronized.
[0052] At present, the entire online shopping business is supported by the commodity sales system and the warehousing system. The commodity sales system is responsible for receiving the user's commodity orders and sending the shipping information to the warehousing system. The warehousing system is responsible for managing the in-and-out data, inventory and other information of various commodities stored in the warehouse. In actual applications, data synchronization between the commodity sales system and the warehousing system is particularly important. Therefore, it is necessary to synchronize the data between the commodity sales system and the warehousing system regularly to ensure that the commodity sales system can provide users with good online shopping services based on accurate commodity inventory information.
[0053] Based on this, in this specification, the first system can determine the commodity inventory recorded by itself at the current time as the inventory to be synchronized. That is, for the first system, the commodity inventory recorded by the first system at the current time may be inaccurate, so it is necessary to synchronize the commodity inventory as the inventory to be synchronized.
[0054] The first system mentioned here may refer to the commodity sales system mentioned above, and correspondingly, the second system mentioned later may refer to the warehousing system mentioned above. In this scenario, the data synchronization method provided in this specification can actually be understood as using the inventory data recorded by the warehousing system to calibrate the inventory data recorded by the commodity sales system, thereby achieving data synchronization between the commodity sales system and the warehousing system.
[0055] In this specification, the entire data synchronization process can be regarded as being completed by a data synchronization system, which includes a first system and a second system, wherein the first system synchronizes the current inventory of goods through its own historical data and the historical data recorded by the second system obtained from the second system, and the second system is used to provide the first system with the data required for the first system to perform data synchronization.
[0056] The commodity inventory recorded by the first system at the current time mentioned above may refer to the total inventory of all commodities. In this case, the first system actually needs to synchronize data on the total inventory of all commodities. Of course, the commodity inventory recorded by the first system at the current time may also refer to the inventory of a commodity recorded at the current time. In other words, the first system can synchronize data on the inventory of each commodity recorded at the current time according to actual needs.
[0057] S102: Determine the commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount, and determine the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as the second inventory change amount.
[0058] The first system can further determine the change in the commodity inventory corresponding to the last data synchronization time of the first system to the current time. The last data synchronization time mentioned here refers to the time when the first system last performed data synchronization. The change in the commodity inventory corresponding to the last data synchronization time to the current time can be determined specifically through inventory-related records such as commodity orders, commodity in-and-out information, and return information saved by the first system.
[0059] Specifically, in this specification, when data synchronization is performed on the inventory of a commodity at the current time (i.e., the inventory to be synchronized corresponding to the commodity), the first system can obtain the inventory-related records of the commodity from the last data synchronization time to the current time, such as the commodity order, in-and-out information, return information, and manually adjusted inventory (i.e., the staff of the first system manually adjusts the inventory of the commodity according to actual needs), and determine the inventory change of the commodity during this period as the first inventory change. The first inventory change is actually used to represent the change in the inventory of the commodity during this period as counted by the first system itself.
[0060] For example, if the first system determines that the number of orders for product A generated during this period (i.e., the period from the last data synchronization time to the current time) is 67, the actual number of shipments is 61, 6 items are returned, and the number of incoming items is 341, then it can be determined that the corresponding inventory change for product A during this period is: 280 items are incoming.
[0061] The above-mentioned first inventory change is data determined by the first system based on the inventory-related records of the product recorded by itself. Since the inventory-related records recorded by the first system itself for the product may be inaccurate, the determined first inventory change may also be inaccurate. This requires the first system to also determine the inventory change of the product in the second system from the last data synchronization time to the current time as the second inventory change, and in the subsequent process, determine the inventory difference between the two through these two inventory changes, and then based on this inventory difference, implement data synchronization of the product inventory recorded by the first system at the current time.
[0062] Specifically, the first system can obtain the inventory-related records of the product in the second system recorded in the second system from the second system, determine the product inventory corresponding to the last data synchronization time in the second system, and the product inventory corresponding to the current time in the second system, and then determine the product inventory change corresponding to the last data synchronization time to the current time in the second system based on these two product inventory quantities, as the second inventory change.
[0063] It should be noted that the inventory-related records of the commodity recorded by the second system in the second system are historical data, so the first system can obtain the historical data from the second system. However, since the second system will also manage the outbound delivery of the commodity according to the outbound delivery information sent by the first system when the first system synchronizes the data of the commodity inventory of the commodity at the current time, the inventory-related records corresponding to the commodity inventory of the commodity recorded by the second system at the current time are likely to be data that changes continuously in a short period of time. Similarly, the commodity inventory of the commodity recorded by the first system at the current time may also be data that changes continuously in a short period of time. However, based on the inventory-related records that change continuously in a short period of time, it may not be possible to accurately synchronize the data of the inventory to be synchronized recorded by the first system at the current time for the commodity.
[0064] Based on this, in this specification, the first system can synchronize the data of the commodity inventory corresponding to the commodity at every data synchronization cycle. Accordingly, the first system can synchronize the data of the commodity inventory corresponding to the current time in the first system based on the commodity inventory synchronized in the previous data synchronization cycle.
[0065] Therefore, the first system can determine the data synchronization cycle to which the previous data synchronization time belongs as the first data synchronization cycle, and determine the data synchronization cycle to which the current time belongs as the second data synchronization cycle. The so-called data synchronization cycle to which the current time belongs actually refers to which data synchronization cycle the current time is located in, and correspondingly, the data synchronization cycle to which the previous data synchronization time belongs refers to which data synchronization cycle in the past the previous data synchronization time is located in.
[0066] For example, assuming that the first system needs to synchronize the inventory of a commodity every day, a data synchronization cycle means one day. If the first system needs to synchronize the inventory of commodity B recorded by the first system at 10 am today, then 10 am today is the current time, and 10 am today belongs to today's data synchronization cycle. If the last data synchronization time was 9 am yesterday, then 9 am yesterday belonged to yesterday's data synchronization cycle.
[0067] After determining the first data synchronization cycle and the second data synchronization cycle, the first system can determine the inventory change of the commodity in the first system from the first data synchronization cycle to the second data synchronization cycle based on the inventory-related records of the commodity in the first system recorded in the first system as the first inventory change. At the same time, the inventory change of the commodity in the second system from the first data synchronization cycle to the second data synchronization cycle can be determined based on the inventory-related records of the commodity in the second system recorded by the second system obtained from the second system as the second inventory change.
[0068] The second inventory change mentioned here may refer to the inventory change between the commodity inventory of the commodity recorded by the second system during data synchronization in the first data synchronization cycle and the commodity inventory of the commodity recorded by the second system during data synchronization in the second data synchronization cycle. For example, assuming that the first data synchronization cycle is today, and the first system needs to synchronize data at 7 a.m. today, then the commodity inventory of the commodity recorded by the second system during data synchronization in the second data synchronization cycle refers to the commodity inventory of the commodity recorded by the second system at 7 a.m. today. If the last time the first system synchronized data was at 8 a.m. yesterday, then the commodity inventory of the commodity recorded by the second system during data synchronization in the first data synchronization cycle refers to the commodity inventory of the commodity recorded by the second system at 8 a.m. yesterday. Correspondingly, the second inventory change refers to the inventory change of the commodity generated in the second system from 8 a.m. yesterday to 7 a.m. today.
[0069] Of course, the second inventory change mentioned above may also refer to the inventory change between the initial inventory of the commodity recorded by the second system in the first data synchronization cycle and the initial inventory of the commodity recorded by the second system in the second data synchronization cycle. Continuing with the above example, if the first system needs to synchronize data at 7 a.m. today, then the initial inventory of the commodity recorded by the second system in the second data synchronization cycle refers to the inventory of the commodity in the second system at 0 a.m. today (because 0 a.m. is the beginning of the day, the inventory of the commodity at 0 a.m. can be called the initial inventory of the commodity), and the initial inventory of the commodity recorded by the second system in the first data synchronization cycle refers to the inventory of the commodity in the second system at 0 a.m. yesterday. Correspondingly, the second inventory change refers to the inventory change of the commodity in the second system from 0 a.m. yesterday to 0 a.m. today.
[0070] Of course, if the data synchronization cycle is divided into N hours, then the initial commodity inventory mentioned above refers to the commodity inventory corresponding to the commodity at the initial moment of the data synchronization cycle.
[0071] Furthermore, the first inventory change may refer to the inventory change between the commodity inventory of the commodity recorded by the first system during data synchronization in the first data synchronization cycle and the commodity inventory of the commodity recorded by the first system during data synchronization in the second data synchronization cycle. Of course, the first inventory change may also refer to the inventory change between the initial commodity inventory of the commodity recorded by the first system during the first data synchronization cycle and the initial commodity inventory of the commodity recorded by the first system during the second data synchronization cycle. For specific forms, refer to the above examples.
[0072] It should be noted that when determining the first inventory change and the second inventory change, it is not achieved by simply adding up the inventory, but needs to be determined comprehensively based on the product orders, return quantity, incoming quantity and other inventory-related records of the product. Taking the determination of the first inventory change as an example, assuming that the first system needs to synchronize data at 10 am today, and the last data synchronization was at 10 am yesterday, then the first system can determine the inventory change of the product from 0:00 yesterday to 0:00 today in the first system based on the product orders, return records, outbound quantity, incoming quantity and other inventory-related records of the product from 0:00 yesterday to 0:00 today.
[0073] The length of the data synchronization cycle can be determined according to actual needs. For example, each day can be divided into a data synchronization cycle, or the data synchronization cycle can be divided every N (N is a positive integer and less than 24) hours. It should be pointed out that in actual applications, if the length of the data synchronization cycle is longer (that is, the frequency of data synchronization is slower), the inventory difference between the first system and the second system will be greater. Conversely, if the length of the data synchronization cycle is shorter (that is, the frequency of data synchronization is faster), the inventory difference between the first system and the second system will be smaller.
[0074] S103: Determine an inventory correction amount according to the first inventory change amount and the second inventory change amount.
[0075] After determining the above-mentioned first inventory change amount and the second inventory change amount, the first system can further determine the inventory correction amount for the above-mentioned inventory amount to be synchronized based on the two inventory change amounts, and then implement data synchronization for the inventory amount to be synchronized in the subsequent process. Specifically, the first system can determine the inventory change difference value between the first system and the second system for the commodity from the first data synchronization cycle to the second data synchronization cycle based on the first inventory change amount and the second inventory change amount. Then, the first system can further determine the initial inventory difference value for the commodity between the first system and the second system in the first data synchronization cycle based on the initial commodity inventory amount of the commodity in the first data synchronization cycle in the second system and the initial commodity inventory amount of the commodity in the first data synchronization cycle in the first system determined through inventory-related records, and then determine the inventory correction amount for the commodity based on the inventory change difference value and the initial inventory difference value. This process is specifically explained by the following formula.
[0076] In actual applications, the inventory of the commodity recorded by the first system at the current time for the commodity can be expressed by the following formula:
[0077]
[0078] in, This means the inventory of the product at the current time recorded by the first system. Indicates the initial inventory of the product in the data synchronization period to which the product belongs at the current time, as recorded by the first system. It indicates the inventory change amount of the commodity in the first system from the initial moment of the data synchronization period to which the current time belongs to to the current time, which is calculated by the first system. n indicates the data synchronization period to which the current time belongs.
[0079] From the above formula, we can see that due to It is calculated by the first system within the data synchronization period of the current time, that is, it is calculated by the first system based on recent data, so it should be relatively accurate. The difference in inventory between the first system and the second system is often caused by the long time from the current time and the data between the two systems is not synchronized in the past, so There is a high possibility that there is data asynchrony between the initial inventory of the product in the data synchronization period to which the product belongs at the current time recorded by the second system. Based on this, when the first system synchronizes the data of the product inventory at the current time, theoretically, the initial inventory of the product in the data synchronization period to which the product belongs at the current time recorded by the second system can be replaced with the initial inventory of the product in the data synchronization period to which the product belongs at the current time in the above formula. Thus, data synchronization is achieved, as shown in the following formula.
[0080]
[0081] in, represents the initial inventory of the product in the data synchronization period to which the product belongs at the current time as recorded by the second system, and It is used to indicate the inventory quantity of the product corresponding to the current time in the first system after the first system performs data synchronization.
[0082] It should be noted that if the first system cannot obtain the above The first system can determine the above-mentioned initial commodity inventory based on the historical initial commodity inventory corresponding to the previous data synchronization cycle recorded by the second system previously obtained. Based on this, the above formula can be transformed to obtain the following formula:
[0083]
[0084] In the above formula, It is used to indicate the initial inventory of the commodity recorded by the first system in the previous data synchronization cycle (i.e., the first data synchronization cycle), D n-1 It indicates the inventory change of the product during the period from the initial time of the previous data synchronization cycle to the initial time of the data synchronization cycle to which the current time belongs (i.e., the second data synchronization cycle), determined by the first system. It indicates the initial inventory quantity of the product in the previous data synchronization cycle (ie, the first data synchronization cycle) recorded by the second system.
[0085] From the above formula, we can see that the difference in inventory between the first system and the second system for this product is mainly due to as well as Among them, due to It can be used to represent the inventory change of the product recorded by the second system from the initial time of the previous data synchronization cycle to the initial time of the data synchronization cycle to which the current time belongs. It can be used to indicate the difference in inventory changes between the first system and the second system in the previous data synchronization cycle. It is used to indicate the difference between the first system and the second system in the initial inventory of the commodity in the previous data synchronization cycle.
[0086] From the above content, it can be seen that the first system actually determines the difference in inventory change between the first system and the second system, as well as the difference between the initial commodity inventory of the first system and the second system based on the historical data recorded by the first system and the historical data recorded by the second system previously obtained from the second system, and then determines the inventory correction amount for the above-mentioned inventory to be synchronized based on these differences.
[0087] Furthermore, since the initial commodity inventory of the commodity in the first data synchronization cycle and the initial commodity inventory of the commodity in the second data synchronization cycle are data that can be clearly determined, even if the commodity inventory at the current time recorded by the first system or the second system is a constantly changing data that cannot be accurately determined, the first system can also determine the inventory correction amount of the inventory to be synchronized based on the initial commodity inventory of the commodity in the first data synchronization cycle and the second data synchronization cycle, and then synchronize the data of the inventory to be synchronized based on the inventory correction amount.
[0088] It should be noted that in actual applications, the first system may not perform data synchronization in every data synchronization cycle. Therefore, if the first system determines that data synchronization was not performed in the previous data synchronization cycle, it can determine the data synchronization cycle of the last data synchronization based on the data synchronization record, and determine the inventory correction amount for the above-mentioned inventory to be synchronized based on the historical data corresponding to the data synchronization cycle.
[0089] Based on this, if the above-mentioned second data synchronization cycle is the data synchronization cycle to which the current time belongs, then the above-mentioned first data synchronization cycle may refer to the data synchronization cycle in which the first system last performed data synchronization. Accordingly, the first system may determine the commodity inventory change amount of the commodity from the first data synchronization cycle to the second data synchronization cycle in the second system as the second inventory change amount based on the initial commodity inventory amount of the commodity in the first data synchronization cycle recorded by the second system and the initial commodity inventory amount of the commodity in the second data synchronization cycle recorded by the second system. At the same time, the commodity inventory change amount of the commodity in the first system from the first data synchronization cycle to the second data synchronization cycle is used as the first inventory change amount. The first system may determine the above-mentioned inventory correction amount based on the first inventory change amount and the second inventory change amount, and refer to the following formula for details.
[0090]
[0091] In this formula, Indicates the initial commodity inventory corresponding to the data synchronization cycle (i.e., the first data synchronization cycle) in which the first system last performed data synchronization on the commodity. It indicates the initial inventory quantity of the commodity recorded for the commodity in the data synchronization cycle (ie, the first data synchronization cycle) when the second system last performed data synchronization on the first system. It means that the first system will record the sum of the inventory changes of the product in each data synchronization cycle involved in this period from the data synchronization cycle of the last data synchronization to the data synchronization cycle of the current time, that is, the total inventory change of the product from the data synchronization cycle of the last data synchronization to the data synchronization cycle of the current time.
[0092] Since the first system has synchronized the inventory of the product in the last data synchronization, the first system will record the inventory of the product after data synchronization. Recorded with the second system should be the same in value. Based on this, use Substituting, we get the following formula:
[0093]
[0094] From this formula, we can see that is the second inventory change mentioned above, and This is the first inventory change mentioned above. Correspondingly, That is, the inventory correction amount for the above-mentioned inventory amount to be synchronized is determined by the first inventory change amount and the second inventory change amount. It should be pointed out that The corresponding data synchronization period may actually be any data synchronization period during which the first system performs data synchronization.
[0095] S104: Synchronizing the data of the inventory to be synchronized according to the inventory correction amount.
[0096] After determining the above inventory correction amount, the inventory to be synchronized can be corrected, thereby realizing data synchronization of the inventory of the commodity corresponding to the current time in the first system and the second system. In the above manner, the first system can synchronize the data of the commodity inventory of each commodity at the current time, and it can be seen from the above whole process that the data synchronization of the commodity inventory of the commodity recorded by the first system at the current time is based on the historical data of the corresponding inventory of the commodity recorded by the first system and the second system, and these historical data can be obtained in advance by the first system, which can effectively ensure that the first system and the second system complete the data synchronization of the commodity inventory while uninterrupted normal business, and effectively improve the efficiency of data synchronization.
[0097] It should be noted that in this specification, the first system can generate an inventory difference report based on the determined inventory correction amount. Specifically, in the process of determining the above-mentioned second inventory change amount, the first system can obtain inventory-related records from the second system, and the inventory-related records contain inventory change data such as the inbound quantity and outbound quantity of the commodity in the second system from the last data synchronization time to the current time. Similarly, in the process of determining the above-mentioned first inventory change amount, the first system uses the inventory-related records from the last data synchronization time to the current time, which also records the inventory change data such as the inbound quantity and outbound quantity of the commodity in the first system from the last data synchronization time to the current time. Therefore, once the above-mentioned inventory correction amount is determined, the data difference between the first system and the second system in each inventory change data can be determined, and then an inventory difference report can be generated based on the obtained data difference. The first system can send the inventory difference report to the checker to prompt the checker to verify the data to be synchronized after the data synchronization through the inventory difference report, and determine the cause of the data asynchronization through the inventory difference report, so as to make timely adjustments.
[0098] In the above content, the data synchronization method provided in this specification is described by taking the first system as a commodity sales system and the second system as a warehousing system as an example. In fact, in the scenario where the first system is a warehousing system and the second system is a commodity sales system, data synchronization of the commodity inventory corresponding to the commodity in the first system at the current time can also be achieved. The specific process is basically the same as the process recorded in the above content, and will not be described in detail here.
[0099] In order to further illustrate the data synchronization method provided in this specification, the first system is taken as a commodity sales system and the second system is taken as a warehousing system to illustrate the detailed process of the entire data synchronization. Figure 2 shown.
[0100] Figure 2 A schematic diagram of the specific process of data synchronization between the commodity sales system and the warehousing system provided in this manual.
[0101] When the commodity sales system needs to synchronize the inventory of commodity A corresponding to the current time in the commodity sales system, it can first determine whether the historical inventory data of commodity A in the warehousing system has been obtained from the warehousing system. If so, the first inventory change amount and the second inventory change amount can be determined based on the obtained historical inventory data and the historical inventory data of commodity A counted by the commodity sales system itself. The first inventory change amount refers to the determined inventory change amount of the commodity sales system corresponding to the last data synchronization time to the current time, and the second inventory change amount refers to the determined inventory change amount of the warehousing system corresponding to the last data synchronization time to the current time.
[0102] The commodity sales system can determine the inventory correction amount for commodity A based on the first inventory change amount and the second inventory change amount, and synchronize the commodity inventory amount of commodity A recorded by the commodity sales system at the current time (i.e., the inventory amount to be synchronized) through the inventory correction amount. At the same time, the commodity sales system can generate an inventory difference report based on the inventory correction amount, the historical inventory data of commodity A obtained from the warehousing system and the historical inventory data of commodity A recorded by the commodity sales system. The inventory difference report shows in which specific data (such as outbound quantity, inbound quantity, return quantity, etc.) of commodity A has an inventory difference, which can be used by staff for data analysis.
[0103] It should also be noted that in actual applications, the first system may perform multiple data synchronizations in a short period of time, for example, in a day in which data synchronization has already been performed once, another data synchronization needs to be performed. In this case, the first system may also first determine whether the time interval between the current time and the last data synchronization time exceeds the set time length. If it is determined that the time interval does not exceed the set time length, data synchronization may be performed on the inventory quantity to be synchronized corresponding to the product based on the inventory correction quantity corresponding to the current time and the inventory correction quantity corresponding to the last data synchronization time.
[0104] Among them, the first system can determine the actual inventory correction amount of the commodity inventory corresponding to the previous data synchronization time at the current time based on the inventory correction amount corresponding to the current time and the inventory correction amount corresponding to the previous data synchronization time, and then synchronize the data of the inventory to be synchronized corresponding to the current time based on the actual inventory correction amount.
[0105] That is to say, since the first system determines that the time of data synchronization this time is close to the time of the last data synchronization, and the inventory quantity of the goods at the last data synchronization has been corrected by the acquired historical inventory data during the last data synchronization, if data synchronization is performed on the inventory quantity of the goods corresponding to the current time according to the acquired historical inventory data, the inventory quantity difference generated in the historical inventory data needs to be removed from the determined inventory correction quantity corresponding to the current time to determine the actual inventory correction quantity corresponding to the current time. Then, the first system can perform data synchronization on the inventory quantity to be synchronized according to the actual inventory correction quantity.
[0106] The above is a data synchronization method provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding data synchronization device, such as Figure 3 shown.
[0107] Figure 3 A schematic diagram of a data synchronization device provided in this specification specifically includes:
[0108] A first determination module 301 is configured to determine the inventory of the commodity recorded by the device at the current time as the inventory to be synchronized;
[0109] A second determination module 302 is configured to determine a commodity inventory change amount corresponding to the device from the last data synchronization time to the current time as a first inventory change amount, and to determine a commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as a second inventory change amount;
[0110] A correction amount determination module 303, configured to determine an inventory correction amount according to the first inventory change amount and the second inventory change amount;
[0111] The data synchronization module 304 is configured to synchronize the data of the inventory quantity to be synchronized according to the inventory correction quantity.
[0112] Optionally, the first determination module 301 is configured to determine, for each commodity, the commodity inventory corresponding to the commodity at the current time recorded by the device as the inventory to be synchronized corresponding to the commodity.
[0113] Optionally, the second determination module 302 is configured to determine the data synchronization cycle to which the previous data synchronization time belongs as the first data synchronization cycle, and to determine the data synchronization cycle to which the current time belongs as the second data synchronization cycle; and to determine the inventory change amount of the commodity in the device from the first data synchronization cycle to the second data synchronization cycle as the first inventory change amount based on the inventory-related records of the commodity in the device recorded in the device.
[0114] Optionally, the second determination module 302 is configured to determine, based on inventory-related records of the commodity recorded in the second system acquired from the second system, an initial commodity inventory of the commodity in the second system in the first data synchronization cycle as the first initial commodity inventory, and determine the initial commodity inventory of the commodity in the second system in the second data synchronization cycle as the second initial commodity inventory; and determine, based on the first initial commodity inventory and the second initial commodity inventory, a change in commodity inventory of the commodity in the second system from the first data synchronization cycle to the second data synchronization cycle as the second inventory change.
[0115] Optionally, the correction amount determination module 303 is configured to determine, based on the first inventory change amount and the second inventory change amount, an inventory change difference value for the commodity between the device and the second system from the first data synchronization cycle to the second data synchronization cycle; determine, based on the determined initial commodity inventory of the commodity in the device in the first data synchronization cycle and the initial commodity inventory of the commodity in the second system in the first data synchronization cycle, an initial inventory difference value for the commodity between the device and the second system in the first data synchronization cycle; and determine the inventory correction amount based on the inventory change difference value and the initial inventory difference value.
[0116] Since the initial commodity inventory of the commodity in the first data synchronization cycle and the initial commodity inventory of the commodity in the second data synchronization cycle are data that can be clearly determined, even if the commodity inventory at the current time recorded by the device or the second system is a constantly changing data that cannot be accurately determined, the device can also determine the inventory correction amount of the inventory to be synchronized based on the initial commodity inventory of the commodity in the first data synchronization cycle and the second data synchronization cycle, and then synchronize the data of the inventory to be synchronized based on the inventory correction amount.
[0117] Optionally, the data synchronization module 304 is configured to synchronize data on the inventory to be synchronized corresponding to the product based on the inventory correction amount corresponding to the current time and the inventory correction amount corresponding to the previous data synchronization time if it is determined that the time interval between the current time and the previous data synchronization time does not exceed a set duration.
[0118] Optionally, the data synchronization module 304 is further configured to generate an inventory difference report according to the inventory correction amount, and prompt the user to verify the inventory amount to be synchronized after data synchronization through the inventory difference report.
[0119] Optionally, the device includes: a commodity sales system, and the second system includes: a warehousing system.
[0120] It can be seen from the above device that the data synchronization implemented by the device for the inventory quantity of the product at the current time recorded by the device itself is realized based on the historical data of the corresponding inventory quantity of the product recorded by the device and the second system, and these historical data can be acquired by the device in advance. This can effectively ensure that the device and the second system complete the data synchronization of the product inventory while uninterrupted normal business, effectively improving the efficiency of data synchronization.
[0121] The present specification also provides a computer-readable storage medium, which stores a computer program, and the computer program can be used to execute the above-mentioned data synchronization method.
[0122] This manual also provides Figure 4 The schematic structure diagram of the electronic device shown in FIG. Figure 4 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0123] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0124] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0125] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0126] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0127] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0128] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0131] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0132] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0133] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0134] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0135] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0136] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0137] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0138] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A method for data synchronization, characterized in that: The method is used for data synchronization of a first system, comprising: The first system determines the inventory of the commodity recorded by the first system at the current time as the inventory to be synchronized; Determine the commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount, and determine the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as the second inventory change amount; determining an inventory correction amount according to the first inventory change amount and the second inventory change amount; According to the inventory correction amount, data synchronization is performed on the inventory amount to be synchronized; The first system determines the commodity inventory at the current time recorded by the first system as the inventory to be synchronized, including: For each commodity, the first system determines the commodity inventory corresponding to the commodity at the current time recorded by the first system as the inventory to be synchronized corresponding to the commodity; The step of determining a commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount includes: Determine the data synchronization period to which the previous data synchronization time belongs as a first data synchronization period, and determine the data synchronization period to which the current time belongs as a second data synchronization period; Determine, according to the inventory-related records of the commodity in the first system recorded in the first system, a commodity inventory change amount of the commodity in the first system from the first data synchronization period to the second data synchronization period as a first inventory change amount; Wherein, determining the inventory correction amount according to the first inventory change amount and the second inventory change amount includes: Determine, according to the first inventory change amount and the second inventory change amount, an inventory change difference value for the commodity between the first system and the second system from the first data synchronization period to the second data synchronization period; Determine an initial inventory difference value for the commodity between the first system and the second system in the first data synchronization period according to the determined initial commodity inventory quantity of the commodity in the first system in the first data synchronization period and the initial commodity inventory quantity of the commodity in the second system in the first data synchronization period; Determining the inventory correction amount according to the inventory change difference value and the initial inventory difference value; Wherein, the first system includes: a commodity sales system, and the second system includes: a warehousing system.
2. The method according to claim 1, characterized in that Determining a commodity inventory change amount of the second system from the last data synchronization time to the current time as a second inventory change amount includes: Determine, according to the inventory-related record of the commodity in the second system recorded in the second system and acquired from the second system, an initial commodity inventory of the commodity in the second system in the first data synchronization period as the first initial commodity inventory, and determine, in the second system, an initial commodity inventory of the commodity in the second data synchronization period as the second initial commodity inventory; According to the first initial commodity inventory and the second initial commodity inventory, a commodity inventory change amount of the commodity in the second system from the first data synchronization period to the second data synchronization period is determined as a second inventory change amount.
3. The method according to claim 1, characterized in that The method further comprises: If it is determined that the time interval between the current time and the last data synchronization time does not exceed the set duration, data synchronization is performed on the inventory to be synchronized corresponding to the product based on the inventory correction amount corresponding to the current time and the inventory correction amount corresponding to the last data synchronization time.
4. The method according to claim 1, characterized in that The method further comprises: An inventory difference report is generated according to the inventory correction amount, and through the inventory difference report, a prompt is given to verify the inventory amount to be synchronized after data synchronization.
5. A data synchronization system, characterized in that: include: System I and System II; The first system determines the commodity inventory at the current time recorded by the first system as the inventory to be synchronized, determines the commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount, obtains the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time as the second inventory change amount, determines the inventory correction amount according to the first inventory change amount and the second inventory change amount, and performs data synchronization on the inventory to be synchronized according to the inventory correction amount; The second system sends to the first system the commodity inventory change amount corresponding to the second system from the last data synchronization time to the current time; The first system determines the commodity inventory at the current time recorded by the first system as the inventory to be synchronized, including: For each commodity, the first system determines the commodity inventory corresponding to the commodity at the current time recorded by the first system as the inventory to be synchronized corresponding to the commodity; The step of determining the commodity inventory change amount corresponding to the first system from the last data synchronization time to the current time as the first inventory change amount includes: Determine the data synchronization period to which the previous data synchronization time belongs as a first data synchronization period, and determine the data synchronization period to which the current time belongs as a second data synchronization period; Determine, according to the inventory-related records of the commodity in the first system recorded in the first system, a commodity inventory change amount of the commodity in the first system from the first data synchronization period to the second data synchronization period as a first inventory change amount; Wherein, determining the inventory correction amount according to the first inventory change amount and the second inventory change amount includes: Determine, according to the first inventory change amount and the second inventory change amount, an inventory change difference value for the commodity between the first system and the second system from the first data synchronization period to the second data synchronization period; Determine an initial inventory difference value for the commodity between the first system and the second system in the first data synchronization period according to the determined initial commodity inventory quantity of the commodity in the first system in the first data synchronization period and the initial commodity inventory quantity of the commodity in the second system in the first data synchronization period; Determining the inventory correction amount according to the inventory change difference value and the initial inventory difference value; Wherein, the first system includes: a commodity sales system, and the second system includes: a warehousing system.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Processing method and system of stock information of goods objects
CN106203894A
Commodity stock information determination method, device and system
CN107248052A