Inventory updating method and device, electronic equipment and computer readable medium
By generating inventory retrieval tasks in the consumer healthcare system and storing them in a message queue, asynchronous decoupling calls to supplier system interfaces solved the problem of scheduling data accuracy and improved user experience and system stability.
Patent Information
- Application Number
- CN202410888500.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2026-01-06
AI Technical Summary
In existing consumer healthcare systems, the accuracy of scheduling data cannot be guaranteed, and unstable supplier system interfaces cause business processes to become unusable. Existing technical solutions cannot effectively solve this problem.
By receiving new package notifications pushed by the open platform, an inventory retrieval task is generated, stored in a message queue, and the store identifier and package identifier are used as input parameters to call the supplier system's query interface to retrieve scheduling data and store it locally. Inventory synchronization is performed in an asynchronous and decoupled manner, eliminating the strong dependence on the supplier system interface.
This ensures the accuracy of scheduling data and improves user experience. Even if the supplier's system interface is unstable or unavailable, the accuracy of scheduling data and the smoothness of user service purchase can still be guaranteed.
Smart Images

Figure CN121277946A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more particularly to an inventory update method, apparatus, electronic device, and computer-readable medium. Background Technology
[0002] Consumer healthcare systems primarily offer appointment booking capabilities. A crucial factor in the appointment process that assists users in deciding whether to order a service is the date they can visit the store for the service (such as a physical examination, teeth cleaning, or in-home diagnostics). Therefore, the accuracy of scheduling and inventory management in a consumer healthcare system is a critical capability.
[0003] Currently, there are two main technical solutions for building scheduling and inventory systems in the consumer healthcare sector: 1. Directly calling the interface provided by the supplier's system to obtain scheduling data. This solution uses caching at the interface layer to ensure a good front-end experience. However, the interfaces provided by the supplier's system are unstable, and interface-level caching cannot guarantee the accuracy of the scheduling data; in addition, if the interface is unavailable, the business process will become unavailable. 2. Generating scheduling data periodically based on templates configured by the merchant, and then storing the scheduling data locally. However, this solution also cannot guarantee the accuracy of the scheduling data. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide an inventory update method, apparatus, electronic device, and computer-readable medium to solve the technical problem of being unable to guarantee the accuracy of scheduling data.
[0005] To achieve the above objectives, according to one aspect of the present invention, an inventory update method is provided, comprising: receiving a new package notification pushed by an open platform, the new package notification carrying a store identifier and a package identifier; generating an inventory retrieval task based on the new package notification, and storing the inventory retrieval task in a message queue; retrieving the inventory retrieval task from the message queue, using the store identifier and the package identifier as input parameters, calling a query interface provided by a supplier system to retrieve scheduling data corresponding to the store identifier and the package identifier, the scheduling data including at least one scheduling date and the inventory corresponding to each scheduling date; and storing the scheduling data corresponding to the store identifier and the package identifier locally.
[0006] Optionally, the method further includes: receiving an inventory change message pushed by the open platform, the inventory change message carrying a store identifier, a package identifier, and scheduling data; and updating the scheduling data corresponding to the store identifier and the package identifier stored locally according to the inventory change message.
[0007] Optionally, the method further includes: receiving an inventory change message pushed by the open platform, the inventory change message carrying a store identifier and a package identifier; using the store identifier and the package identifier as input parameters, calling the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; and updating the scheduling data corresponding to the store identifier and the package identifier stored locally.
[0008] Optionally, the method further includes: receiving a reservation request sent by a user, the reservation request carrying a store identifier, a package identifier, a schedule, and reservation inventory; deducting the store identifier, the package identifier, and the inventory corresponding to the schedule according to the reservation request; using the store identifier, the package identifier, and the reservation inventory corresponding to the schedule as input parameters, calling the inventory interface provided by the supplier system so that the supplier system deducts the store identifier, the package identifier, and the inventory corresponding to the schedule; receiving an inventory change message pushed by the open platform, the inventory change message carrying the store identifier, the package identifier, the schedule, and the deducted inventory; and updating the store identifier, the package identifier, and the inventory corresponding to the schedule stored locally according to the inventory change message.
[0009] Optionally, the method further includes: if an exception occurs during the process of calling the inventory interface provided by the supplier system, or if an exception occurs during the process of updating the store identifier, the package identifier, and the inventory corresponding to the schedule according to the inventory change message, then the query interface provided by the supplier system is called with the store identifier, the package identifier, and the schedule as input parameters to retrieve the inventory corresponding to the store identifier, the package identifier, and the schedule; and the inventory corresponding to the store identifier, the package identifier, and the schedule stored locally is updated.
[0010] Optionally, the method further includes: periodically generating an inventory retrieval task, using the store identifier and the package identifier as input parameters, calling the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; determining whether the retrieved scheduling data corresponding to the store identifier and the package identifier is consistent with the scheduling data corresponding to the store identifier and the package identifier stored locally; if not, updating the retrieved scheduling data corresponding to the store identifier and the package identifier to the local machine.
[0011] Optionally, the method further includes: receiving a package deletion message pushed by the open platform, the package deletion message carrying a store identifier and a package identifier; and deleting the scheduling data corresponding to the store identifier and the package identifier.
[0012] In addition, according to another aspect of the present invention, an inventory update apparatus is provided, comprising: a receiving module, configured to receive a new package message pushed by an open platform, the new package message carrying a store identifier and a package identifier; a pulling module, configured to generate an inventory pulling task based on the new package message and store the inventory pulling task in a message queue; a calling module, configured to retrieve the inventory pulling task from the message queue, and using the store identifier and the package identifier as input parameters, call a query interface provided by a supplier system to pull the scheduling data corresponding to the store identifier and the package identifier, the scheduling data including at least one scheduling and the inventory corresponding to each scheduling; and a storage module, configured to store the scheduling data corresponding to the store identifier and the package identifier locally.
[0013] Optionally, the device further includes a change module, configured to: receive an inventory change message pushed by the open platform, the inventory change message carrying a store identifier, a package identifier, and scheduling data; and update the scheduling data corresponding to the store identifier and the package identifier stored locally according to the inventory change message.
[0014] Optionally, the device further includes a change module, configured to: receive an inventory change message pushed by the open platform, the inventory change message carrying a store identifier and a package identifier; use the store identifier and the package identifier as input parameters to call the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; and update the scheduling data corresponding to the store identifier and the package identifier stored locally.
[0015] Optionally, the device further includes a reservation module, configured to: receive a reservation request sent by a user, the reservation request carrying a store identifier, a package identifier, a schedule, and reserved inventory; deduct the store identifier, the package identifier, and the inventory corresponding to the schedule according to the reservation request; use the store identifier, the package identifier, and the reserved inventory corresponding to the schedule as input parameters to call the inventory interface provided by the supplier system, so that the supplier system deducts the store identifier, the package identifier, and the inventory corresponding to the schedule; receive an inventory change message pushed by the open platform, the inventory change message carrying the store identifier, the package identifier, the schedule, and the deducted inventory; and update the store identifier, the package identifier, and the inventory corresponding to the schedule stored locally according to the inventory change message.
[0016] Optionally, the reservation module is further configured to: if an exception occurs during the process of calling the inventory interface provided by the supplier system, or if an exception occurs during the process of updating the store identifier, the package identifier, and the inventory corresponding to the schedule based on the inventory change message, then use the store identifier, the package identifier, and the schedule as input parameters to call the query interface provided by the supplier system to retrieve the store identifier, the package identifier, and the inventory corresponding to the schedule; and update the locally stored store identifier, package identifier, and inventory corresponding to the schedule.
[0017] Optionally, it also includes a compensation module, used to: periodically generate an inventory retrieval task, using the store identifier and the package identifier as input parameters, call the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; determine whether the retrieved scheduling data corresponding to the store identifier and the package identifier is consistent with the scheduling data corresponding to the store identifier and the package identifier stored locally, and if not, update the retrieved scheduling data corresponding to the store identifier and the package identifier to the local machine.
[0018] Optionally, the change module is further configured to: receive a package deletion message pushed by the open platform, the package deletion message carrying a store identifier and a package identifier; and delete the scheduling data corresponding to the store identifier and the package identifier.
[0019] According to another aspect of the present invention, an electronic device is also provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0020] According to another aspect of the present invention, a computer-readable medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the methods described in any of the above embodiments.
[0021] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.
[0022] One embodiment of the above invention has the following advantages or beneficial effects: By employing a technique that generates an inventory retrieval task based on the new package message, stores the inventory retrieval task in a message queue, retrieves the inventory retrieval task from the message queue, uses the store identifier and package identifier as input parameters, calls the query interface provided by the supplier system, thereby retrieving the scheduling data corresponding to the store identifier and package identifier, and stores it locally, the technical problem of not being able to guarantee the accuracy of scheduling data in the prior art is overcome. This embodiment of the invention performs inventory synchronization in an asynchronous and decoupled manner, eliminating the strong dependence of the inventory system on the supplier system's interface. Even if the interface is unstable or unavailable, it will not affect the user's service purchase, thus not only ensuring the accuracy of scheduling data but also improving the user experience.
[0023] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart of an inventory update method according to an embodiment of the present invention.
[0026] Figure 2 This is a system architecture diagram for implementing the inventory update method of this invention.
[0027] Figure 3 This is a schematic diagram of a data model according to an embodiment of the present invention.
[0028] Figure 4 This is a flowchart of an inventory update method according to a possible embodiment of the present invention.
[0029] Figure 5 This is a flowchart of an inventory update method according to another possible embodiment of the present invention.
[0030] Figure 6 This is a schematic diagram of an inventory update device according to an embodiment of the present invention.
[0031] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied.
[0032] Figure 8This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0033] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0034] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0035] The inventory of consumer healthcare services differs significantly from the inventory of physical goods on shelves. Physical goods are primarily accounted for through physical receipt and inventory checks by warehouse managers to accurately calculate inventory. However, services within the consumer healthcare system (such as physical examinations, dental cleanings, and in-home diagnostics) are inventoryed based on scheduled timeframes, which may extend to the day, morning / afternoon, or specific time periods. Therefore, the consumer healthcare system requires a comprehensive inventory management system for these services to ensure the accuracy of scheduled inventory.
[0036] Figure 1 This is a flowchart of an inventory update method according to an embodiment of the present invention. As one embodiment of the present invention, such as... Figure 1 As shown, the inventory update method is applied to the inventory system and may include: Step 101: Receive the package addition message pushed by the open platform. The package addition message carries the store identifier and package identifier.
[0037] like Figure 2 As shown, when a supplier needs to add packages for a new store, it pushes a package addition message to the open platform through the supplier system. This package addition message carries both a store identifier and a package identifier. After receiving the package addition message from the supplier system, the open platform pushes it to the inventory system of the consumer healthcare system.
[0038] It should be noted that the supplier system maintains the scheduling data under the store-package. Each store can set up multiple packages, each package can have multiple schedules (which can be days, mornings or afternoons, or time periods), and each schedule can have multiple inventory (that is, the number of people who can make reservations).
[0039] Step 102: Generate an inventory retrieval task based on the new package message, and store the inventory retrieval task in a message queue.
[0040] After receiving the new package notification pushed by the open platform, the inventory system generates an inventory retrieval task based on the notification. The inventory retrieval task includes a store identifier and a package identifier. The inventory retrieval task is then stored in a message queue. This prevents multiple merchant systems from simultaneously pushing new package notifications to the open platform, avoiding excessive pressure on the inventory system and database, and preventing the HTTP thread pool from becoming full.
[0041] Step 103: Retrieve the inventory retrieval task from the message queue, and use the store identifier and the package identifier as input parameters to call the query interface provided by the supplier system to retrieve the schedule data corresponding to the store identifier and the package identifier. The schedule data includes at least one schedule and the inventory corresponding to each schedule.
[0042] The inventory system listens to the message queue. If a message is detected, it retrieves the inventory retrieval task from the head of the queue and sends it to the task, thus obtaining the store identifier and package identifier. Then, using the store identifier and package identifier as input parameters, it calls the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and package identifier. Figure 2 As shown in the figure, this embodiment of the invention retrieves scheduling data asynchronously, which ensures both the real-time nature and accuracy of the scheduling data, without placing significant pressure on the inventory system and database.
[0043] Step 104: Store the schedule data corresponding to the store identifier and the package identifier locally.
[0044] After retrieving the scheduling data corresponding to the store identifier and the package identifier, it is then processed according to... Figure 3 The data model shown is stored locally so that users can view the scheduling data. For example... Figure 3 As shown, the inventory system abstracts an underlying data model used to store the scheduling data for service products under various categories. The basic data includes store identifiers and their corresponding package identifiers, while the scheduling data includes the schedule and its corresponding inventory. Optionally, the scheduling data is directly stored in the consumer healthcare system as a database table.
[0045] The relationship between the operation and maintenance SKUs and scheduling data of the consumer healthcare system allows users to purchase service products at the terminal. At this time, the scheduling data that users query at the terminal is the consumer healthcare system's own data, which greatly improves performance and user experience.
[0046] Optionally, the method further includes: receiving an inventory change message pushed by the open platform, the inventory change message carrying a store identifier, a package identifier, and scheduling data; and updating the scheduling data corresponding to the store identifier and the package identifier stored locally according to the inventory change message. In some embodiments of the present invention, when the scheduling data of the supplier system changes, the supplier system pushes an inventory change message to the open platform, the inventory change message carrying a store identifier, a package identifier, and scheduling data. After receiving the inventory change message, the open platform pushes the inventory change message to the inventory system. After receiving the inventory change message, the inventory system updates the scheduling data corresponding to the store identifier and the package identifier stored locally according to the inventory change message. Since inventory change messages are usually not updated in batches, scheduling data can be directly carried in the inventory change message, and the inventory system can directly consume the inventory change message to ensure the accuracy of the scheduling data.
[0047] Optionally, the method further includes: receiving an inventory change message pushed by the open platform, the inventory change message carrying a store identifier and a package identifier; using the store identifier and the package identifier as input parameters, calling a query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; and updating the scheduling data corresponding to the store identifier and the package identifier stored locally. In other embodiments of the present invention, when the scheduling data of the supplier system changes, the supplier system pushes an inventory change message to the open platform, the inventory change message carrying a store identifier and a package identifier. After receiving the inventory change message, the open platform pushes the inventory change message to the inventory system. After receiving the inventory change message, the inventory system uses the store identifier and the package identifier as input parameters, calls a query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier, and then updates the scheduling data corresponding to the store identifier and the package identifier stored locally based on the retrieved scheduling data.
[0048] Optionally, the method further includes: receiving a package deletion message pushed by the open platform, the package deletion message carrying a store identifier and a package identifier; and deleting the scheduling data corresponding to the store identifier and the package identifier. In embodiments of the present invention, suppliers can not only push package addition messages to the open platform through the supplier system, but also push package deletion messages to the open platform through the supplier system. After receiving the package deletion message pushed by the supplier system, the open platform pushes the package deletion message to the inventory system. After receiving the package deletion message, the inventory system deletes the scheduling data corresponding to the store identifier and the package identifier stored locally to ensure the accuracy of the scheduling data.
[0049] Based on the various embodiments above, it can be seen that the present invention solves the technical problem of not being able to guarantee the accuracy of scheduling data in the prior art by generating an inventory retrieval task based on the new package message, storing the inventory retrieval task in a message queue, retrieving the inventory retrieval task from the message queue, using the store identifier and package identifier as input parameters, calling the query interface provided by the supplier system, thereby retrieving the scheduling data corresponding to the store identifier and package identifier, and storing it locally. The present invention also achieves inventory synchronization through asynchronous decoupling, eliminating the strong dependence of the inventory system on the supplier system's interface. Even if the interface is unstable or unavailable, it will not affect users' service purchases, thus not only ensuring the accuracy of scheduling data but also improving the user experience.
[0050] Figure 4 This is a flowchart of an inventory update method according to a possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 4 As shown, the inventory update method may include: Step 401: Receive the package addition message pushed by the open platform. The package addition message carries the store identifier and package identifier.
[0051] Step 402: Generate an inventory retrieval task based on the new package message, and store the inventory retrieval task in a message queue.
[0052] Step 403: Retrieve the inventory retrieval task from the message queue, and use the store identifier and the package identifier as input parameters to call the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier. The scheduling data includes at least one scheduling period and the inventory corresponding to each scheduling period.
[0053] Step 404: Store the schedule data corresponding to the store identifier and the package identifier locally.
[0054] like Figure 5As shown, when a supplier needs to add packages for a new store, it pushes a package addition message to the open platform through the supplier system. This message carries a store identifier and a package identifier. Upon receiving the package addition message from the supplier system, the open platform pushes it to the inventory system of the consumer healthcare system. After receiving the package addition message from the open platform, the inventory system generates an inventory retrieval task based on the message. This task includes the store identifier and the package identifier, and is then stored in a message queue. The inventory system can periodically retrieve the inventory retrieval task from the head of the message queue and send it to the system to obtain the store identifier and package identifier. Then, using these identifiers as input parameters, it calls the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and package identifier.
[0055] When the scheduling data in the supplier system changes, the supplier system pushes an inventory change message to the open platform. The inventory change message carries the store identifier, package identifier, and scheduling data. After receiving the inventory change message, the open platform pushes the inventory change message to the inventory system. After receiving the inventory change message, the inventory system updates the scheduling data corresponding to the store identifier and package identifier stored locally according to the inventory change message to ensure the accuracy of the scheduling data.
[0056] Step 405: Receive a reservation request sent by the user. The reservation request carries the store identifier, package identifier, schedule, and reservation inventory.
[0057] Step 406: Deduct the store identifier, the package identifier, and the inventory corresponding to the schedule based on the reservation request.
[0058] like Figure 5 As shown, users can view the schedule data for each store and each package through the terminal. They can also make reservations for a specific store, package, and schedule through the terminal, which is equivalent to purchasing a service product. When a user purchases a service product for a specific schedule, the inventory system deducts the corresponding inventory stored locally based on the reservation request, including the store identifier, package identifier, and schedule. If a user purchases one service product, one inventory item is deducted; if a user purchases two service products, two inventory items are deducted, and so on. Further details are omitted.
[0059] Step 407: Using the store identifier, the package identifier, and the reserved inventory corresponding to the schedule as input parameters, call the inventory interface provided by the supplier system so that the supplier system deducts the store identifier, the package identifier, and the inventory corresponding to the schedule.
[0060] like Figure 5As shown, after the inventory system deducts the local inventory, it uses the store identifier, the package identifier, and the reserved inventory corresponding to the schedule as input parameters to call the inventory interface provided by the supplier system, so that the supplier system can deduct the corresponding inventory based on the store identifier, the package identifier, and the reserved inventory corresponding to the schedule.
[0061] Step 408: Receive the inventory change message pushed by the open platform. The inventory change message carries the store identifier, the package identifier, the schedule, and the deducted inventory.
[0062] To ensure the accuracy of data on the consumer healthcare system side, after the supplier system deducts inventory, it will push an inventory change message to the open platform. The inventory change message carries the store identifier, the package identifier, and the deducted inventory corresponding to the schedule (that is, the latest inventory). After receiving the inventory change message pushed by the supplier system, the open platform will push the inventory change message to the inventory system on the consumer healthcare system side.
[0063] Step 409: Update the store identifier, the package identifier, and the inventory corresponding to the schedule stored locally according to the inventory change message.
[0064] After receiving the inventory change message pushed by the open platform, the inventory system updates the inventory stored locally for the store identifier, the package identifier, and the corresponding schedule, so that the local inventory data is consistent with the inventory data in the supplier system.
[0065] Optionally, the method further includes: if an exception occurs during the process of calling the inventory interface provided by the supplier system, or if an exception occurs during the process of updating the store identifier, the package identifier, and the inventory corresponding to the schedule based on the inventory change message, then using the store identifier, the package identifier, and the schedule as input parameters, the query interface provided by the supplier system is called to retrieve the inventory corresponding to the store identifier, the package identifier, and the schedule; and the locally stored inventory corresponding to the store identifier, the package identifier, and the schedule is updated. Figure 5 As shown, if an anomaly occurs during the interface interaction between the inventory system and the supplier system, the query interface provided by the supplier system is called with the store identifier, the package identifier, and the schedule as input parameters to retrieve the inventory corresponding to the store identifier, the package identifier, and the schedule. Then, the inventory corresponding to the store identifier, the package identifier, and the schedule stored locally is updated to correct the inventory and ensure the accuracy of the schedule data.
[0066] Optionally, the method further includes: periodically generating an inventory retrieval task, using the store identifier and the package identifier as input parameters, calling the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; determining whether the retrieved scheduling data corresponding to the store identifier and the package identifier is consistent with the scheduling data corresponding to the store identifier and the package identifier stored locally; if not, updating the retrieved scheduling data corresponding to the store identifier and the package identifier to the local storage. Figure 5 As shown, in an embodiment of the present invention, an inventory retrieval task is generated periodically by a scheduled task. Then, the store identifier and the package identifier are used as input parameters to call the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier. Next, it is determined whether the retrieved scheduling data is consistent with the scheduling data stored locally. If it is, the process ends; otherwise, the retrieved scheduling data is updated locally to correct the inventory and ensure the consistency of the scheduling data.
[0067] Furthermore, the specific implementation details of the inventory update method in one of the reference embodiments of the present invention have been described in detail in the above-described inventory update method, so the details will not be repeated here.
[0068] Figure 6 This is a schematic diagram of an inventory update device according to an embodiment of the present invention. Figure 5 As shown, the inventory update device 600 includes a receiving module 601, a pulling module 602, a calling module 603, and a storage module 604. The receiving module 601 receives a new package notification pushed by the open platform, the notification carrying a store identifier and a package identifier. The pulling module 602 generates an inventory pulling task based on the new package notification and stores the task in a message queue. The calling module 603 retrieves the inventory pulling task from the message queue, uses the store identifier and the package identifier as input parameters, and calls the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier. The scheduling data includes at least one scheduling date and the inventory corresponding to each scheduling date. The storage module 604 stores the scheduling data corresponding to the store identifier and the package identifier locally.
[0069] Optionally, the device further includes a change module, configured to: receive an inventory change message pushed by the open platform, the inventory change message carrying a store identifier, a package identifier, and scheduling data; and update the scheduling data corresponding to the store identifier and the package identifier stored locally according to the inventory change message.
[0070] Optionally, the device further includes a change module, configured to: receive an inventory change message pushed by the open platform, the inventory change message carrying a store identifier and a package identifier; use the store identifier and the package identifier as input parameters to call the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; and update the scheduling data corresponding to the store identifier and the package identifier stored locally.
[0071] Optionally, the device further includes a reservation module, configured to: receive a reservation request sent by a user, the reservation request carrying a store identifier, a package identifier, a schedule, and reserved inventory; deduct the store identifier, the package identifier, and the inventory corresponding to the schedule according to the reservation request; use the store identifier, the package identifier, and the reserved inventory corresponding to the schedule as input parameters to call the inventory interface provided by the supplier system, so that the supplier system deducts the store identifier, the package identifier, and the inventory corresponding to the schedule; receive an inventory change message pushed by the open platform, the inventory change message carrying the store identifier, the package identifier, the schedule, and the deducted inventory; and update the store identifier, the package identifier, and the inventory corresponding to the schedule stored locally according to the inventory change message.
[0072] Optionally, the reservation module is further configured to: if an exception occurs during the process of calling the inventory interface provided by the supplier system, or if an exception occurs during the process of updating the store identifier, the package identifier, and the inventory corresponding to the schedule based on the inventory change message, then use the store identifier, the package identifier, and the schedule as input parameters to call the query interface provided by the supplier system to retrieve the store identifier, the package identifier, and the inventory corresponding to the schedule; and update the locally stored store identifier, package identifier, and inventory corresponding to the schedule.
[0073] Optionally, it also includes a compensation module, used to: periodically generate an inventory retrieval task, using the store identifier and the package identifier as input parameters, call the query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier; determine whether the retrieved scheduling data corresponding to the store identifier and the package identifier is consistent with the scheduling data corresponding to the store identifier and the package identifier stored locally, and if not, update the retrieved scheduling data corresponding to the store identifier and the package identifier to the local machine.
[0074] Optionally, the change module is further configured to: receive a package deletion message pushed by the open platform, the package deletion message carrying a store identifier and a package identifier; and delete the scheduling data corresponding to the store identifier and the package identifier.
[0075] It should be noted that the specific implementation details of the inventory update device described in this invention have been described in detail in the inventory update method described above, so the details will not be repeated here.
[0076] Figure 7 An exemplary system architecture 700 is shown that can be applied to the inventory update method or inventory update apparatus of embodiments of the present invention.
[0077] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0078] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0079] Terminal devices 701, 702, and 703 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0080] Server 705 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 701, 702, and 703 (this is just an example). The backend management server can analyze and process data such as received item information query requests, and then feed the processing results back to the terminal devices.
[0081] It should be noted that the inventory update method provided in this embodiment of the invention is generally executed by server 705, and correspondingly, the inventory update device is generally set in server 705.
[0082] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0083] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 800 suitable for implementing a terminal device of the present invention. Figure 8The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0084] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0085] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0086] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.
[0087] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-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 thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer programs according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0089] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including a receiving module, a fetching module, a calling module, and a storage module. The names of these modules do not necessarily limit the functionality of the module itself.
[0090] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device implements the following method: receiving a new package notification pushed by an open platform, the new package notification carrying a store identifier and a package identifier; generating an inventory retrieval task based on the new package notification, and storing the inventory retrieval task in a message queue; retrieving the inventory retrieval task from the message queue, using the store identifier and the package identifier as input parameters, calling a query interface provided by the supplier system to retrieve the scheduling data corresponding to the store identifier and the package identifier, the scheduling data including at least one scheduling date and the inventory corresponding to each scheduling date; and storing the scheduling data corresponding to the store identifier and the package identifier locally.
[0091] In another aspect, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.
[0092] According to the technical solution of this invention, by generating an inventory retrieval task based on the new package message, storing the inventory retrieval task in a message queue, retrieving the inventory retrieval task from the message queue, and then calling the query interface provided by the supplier system using the store identifier and package identifier as input parameters to retrieve the scheduling data corresponding to the store identifier and package identifier, and storing it locally, this technical approach overcomes the technical problem of not being able to guarantee the accuracy of scheduling data in the prior art. This invention also achieves inventory synchronization through asynchronous decoupling, eliminating the strong dependence of the inventory system on the supplier system's interface. Even if the interface is unstable or unavailable, it will not affect users' service purchases, thus not only ensuring the accuracy of scheduling data but also improving the user experience.
[0093] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An inventory updating method characterized by comprising: The method comprises the following steps: receiving a package addition message pushed by an open platform, the package addition message carrying a store identifier and a package identifier; generating an inventory pulling task according to the package addition message, and storing the inventory pulling task in a message queue; taking the inventory pulling task from the message queue, calling a query interface provided by a supplier system with the store identifier and the package identifier as input parameters, and thus pulling scheduling data corresponding to the store identifier and the package identifier, the scheduling data comprising at least one schedule and inventory corresponding to each schedule; storing the scheduling data corresponding to the store identifier and the package identifier in a local device.
2. The method of claim 1, wherein, The method further comprises the following steps: receiving an inventory change message pushed by the open platform, the inventory change message carrying a store identifier, a package identifier and scheduling data; updating the scheduling data corresponding to the store identifier and the package identifier stored in the local device according to the inventory change message.
3. The method of claim 1, wherein, The method further comprises the following steps: receiving an inventory change message pushed by the open platform, the inventory change message carrying a store identifier and a package identifier; calling a query interface provided by a supplier system with the store identifier and the package identifier as input parameters, and thus pulling scheduling data corresponding to the store identifier and the package identifier; updating the scheduling data corresponding to the store identifier and the package identifier stored in the local device.
4. The method of claim 1, wherein, The method further comprises the following steps: receiving a reservation request sent by a user, the reservation request carrying a store identifier, a package identifier, a schedule and reservation inventory; deducting inventory corresponding to the store identifier, the package identifier and the schedule according to the reservation request; calling an inventory interface provided by a supplier system with the reservation inventory corresponding to the store identifier, the package identifier and the schedule as input parameters, so that the supplier system deducts the inventory corresponding to the store identifier, the package identifier and the schedule; receiving an inventory change message pushed by the open platform, the inventory change message carrying the store identifier, the package identifier, the schedule and the deducted inventory; updating the inventory corresponding to the store identifier, the package identifier and the schedule stored in the local device according to the inventory change message.
5. The method of claim 4, wherein, The method further comprises the following steps: if an exception occurs in the process of calling the inventory interface provided by the supplier system, or if an exception occurs in the process of updating the inventory corresponding to the store identifier, the package identifier and the schedule according to the inventory change message, calling a query interface provided by a supplier system with the store identifier, the package identifier and the schedule as input parameters, and thus pulling the inventory corresponding to the store identifier, the package identifier and the schedule; updating the inventory corresponding to the store identifier, the package identifier and the schedule stored in the local device.
6. The method of claim 1, wherein, The method further comprises the following steps: generating an inventory pulling task at a regular time, calling a query interface provided by a supplier system with the store identifier and the package identifier as input parameters, and thus pulling scheduling data corresponding to the store identifier and the package identifier; Judge whether the pulled store identifier and the package identifier corresponding scheduling data is consistent with the store identifier and the package identifier corresponding scheduling data stored locally, if not, update the pulled store identifier and the package identifier corresponding scheduling data to local.
7. The method of claim 1, wherein, The method further comprises: Receiving the package deletion message pushed by the open platform, wherein the package deletion message carries a store identifier and a package identifier; Delete the scheduling data corresponding to the store identifier and the package identifier.
8. An inventory updating apparatus characterized by comprising: Comprise: A receiving module for receiving a package addition message pushed by an open platform, wherein the package addition message carries a store identifier and a package identifier; A pulling module for generating an inventory pulling task according to the package addition message, and storing the inventory pulling task into a message queue; A calling module for taking the inventory pulling task from the message queue, taking the store identifier and the package identifier as input parameters, calling a query interface provided by a supplier system, thereby pulling the scheduling data corresponding to the store identifier and the package identifier, wherein the scheduling data comprises at least one scheduling and inventory corresponding to each scheduling; A storage module for storing the scheduling data corresponding to the store identifier and the package identifier to local.
9. An electronic device, comprising: Comprise: One or more processors; Storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-7.
10. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-7.
11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1-7.
Citation Information
Patent Citations
Service change message processing method and device
CN114422577A
Cache refreshing method and device based on message queue
CN117194452A
Information processing method and device, electronic equipment and storage medium
CN117632973A
