WO2019047516A1 - 信息输出方法和装置 - Google Patents

信息输出方法和装置 Download PDF

Info

Publication number
WO2019047516A1
WO2019047516A1 PCT/CN2018/081956 CN2018081956W WO2019047516A1 WO 2019047516 A1 WO2019047516 A1 WO 2019047516A1 CN 2018081956 W CN2018081956 W CN 2018081956W WO 2019047516 A1 WO2019047516 A1 WO 2019047516A1
Authority
WO
WIPO (PCT)
Prior art keywords
order
item
inventory
cache
storage location
Prior art date
Application number
PCT/CN2018/081956
Other languages
English (en)
French (fr)
Inventor
孙晓野
Original Assignee
北京京东尚科信息技术有限公司
北京京东世纪贸易有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京京东尚科信息技术有限公司, 北京京东世纪贸易有限公司 filed Critical 北京京东尚科信息技术有限公司
Publication of WO2019047516A1 publication Critical patent/WO2019047516A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/087Inventory or stock management, e.g. order filling, procurement or balancing against orders
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24539Query rewriting; Transformation using cached or materialised query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0639Item locations

Definitions

  • the present application relates to the field of computer technologies, and in particular, to the field of Internet technologies, and in particular, to an information output method and apparatus.
  • the warehouse system After the warehouse operator operates the positioning, the warehouse system records the orders to be allocated in the database, and then randomly distributes them in an asynchronous manner. In the asynchronous positioning, the concurrent mode is adopted. When different orders are included, when the same product is included, the inventory of the same product is competed. After the competition fails, the operation needs to be repeated multiple times to complete the positioning. This leads to the need to read the database multiple times, which reduces the efficiency of positioning.
  • the purpose of the embodiments of the present application is to provide an information output method and apparatus to solve the technical problems mentioned in the above background art.
  • an embodiment of the present application provides an information output method, which includes: acquiring a to-be-processed order set stored in a cache, where each order in the order set includes an item name and an item demand amount;
  • the inventory database for storing inventory information reads the inventory information set into the cache, wherein each inventory information in the inventory information set includes an item storage location, an item name, and an item inventory amount corresponding to the item storage location; for each of the order collections
  • the order is as follows: performing an allocation step of: determining, according to each inventory information stored in the cache, an item storage location matching the order and an item inventory quantity matching the order; if the item storage location stored in the inventory database matches the item
  • the inventory quantity of the item is not less than the inventory quantity of the item matching the order, and the inventory information in the inventory database is modified according to the storage location of the item matching the order and the inventory quantity of the item matched with the order, and the item matching the order is output.
  • the storage location and the inventory of items matching the order is determining, according to each inventory information
  • the method prior to obtaining the set of orders to be processed pre-stored in the cache, the method further comprises: in response to receiving the order, storing the received order in the queue of the queue of orders in the cache.
  • the order includes a delivery time; and prior to obtaining the set of orders to be processed pre-stored in the cache, the method further comprises: in response to receiving the order, storing the received order in an order queue in the cache Orders in the order queue are sorted in order of delivery time from first to last.
  • determining, according to each inventory information stored in the cache, an item storage location that matches the order and an item inventory quantity that matches the order including: generating a total demand scale according to the item demand quantity of each order, wherein The total demand scale is used to represent the correspondence between the item name and the sum of the item requirements corresponding to the item name; the total inventory amount is generated according to the item inventory quantity of each inventory information in the inventory information set stored in the cache, wherein the total inventory The scale is used to represent the correspondence between the item name and the item inventory sum corresponding to the item name; for each item name in the total demand amount table, if the item inventory quantity corresponding to the item name is not less than the item demand corresponding to the item name The sum of the quantity determines the item storage location and the item inventory amount corresponding to the item name; for each order in the order set, if each item name of the order has determined the corresponding item storage location and the item inventory quantity, the update is performed.
  • the method further comprises: re-reading the inventory information set from the inventory database if the inventory amount of the item corresponding to the item storage location of the item stored in the inventory database is less than the item inventory quantity matching the order Go to the cache and repeat the above allocation steps.
  • the method further comprises: responsive to detecting that the log file of the inventory database has changed, reading the changed inventory information set from the inventory database to the cache based on the log file.
  • an embodiment of the present application provides an information output apparatus, where the apparatus includes: an acquiring unit, configured to acquire a to-be-processed order set stored in a cache, where each order in the order set includes an item name and An item demand quantity; a reading unit, configured to read the inventory information set from the inventory database for storing the inventory information into the cache, wherein each inventory information in the inventory information set includes an item storage location, an item name, and an item storage location corresponding to The item inventory quantity is used for performing, for each order in the order set, an allocation step of: determining, according to each inventory information stored in the cache, an item storage location matching the order and an item inventory quantity matching the order If the inventory quantity of the item corresponding to the item storage location matched by the order stored in the inventory database is not less than the item inventory quantity matching the order, according to the item storage location matching the order and the item inventory quantity matching the order Modify the inventory information in the inventory database and output the items that match the order Storage locations and inventory items that match the orders.
  • the apparatus further includes a first storage unit configured to: in response to receiving the order, store the received order in an order in the cache prior to acquiring the set of orders to be processed pre-stored in the cache The tail of the queue.
  • the order includes a delivery time; and the apparatus further includes a second storage unit for storing the received order in response to receiving the order prior to acquiring the set of orders to be processed pre-stored in the cache
  • the order queue in the cache causes the orders in the order queue to be sorted in order of delivery time from first to last.
  • the positioning unit is further configured to: generate a total demand amount table according to the item demand amount of each order, wherein the total demand amount table is used to represent a correspondence relationship between the item name and the item demand amount corresponding to the item name;
  • the total inventory quantity table is generated by the item inventory quantity of each inventory information in the inventory information set stored in the cache, wherein the total inventory quantity table is used to represent the correspondence relationship between the item name and the item inventory sum corresponding to the item name; For each item name in the table, if the sum of the item inventory corresponding to the item name is not less than the sum of the item requirements corresponding to the item name, the item storage location and the item inventory amount corresponding to the item name are determined; for each item in the order set An order, if each item name of the order has determined the corresponding item storage location and the item inventory quantity, updating the item storage corresponding to each item name of the order in each inventory information in the inventory information set stored in the cache Location and item inventory.
  • the reading unit is further configured to: read the inventory from the inventory database again if the inventory amount of the item corresponding to the item storage location matched by the order stored in the inventory database is less than the inventory amount of the item matching the order
  • the information is aggregated into the cache; and the positioning unit is further configured to repeatedly perform the above assigning steps.
  • the apparatus further includes an inventory update unit for: in response to detecting that the log file of the inventory database has changed, reading the changed inventory information set from the inventory database to the cache based on the log file.
  • an embodiment of the present application provides a server, including: one or more processors; and a storage device, configured to store one or more programs, when one or more programs are executed by one or more processors, One or more processors are caused to implement the method of any of the first aspects.
  • the embodiment of the present application provides a computer readable storage medium, where a computer program is stored, and when the program is executed by the processor, the method of any one of the first aspects is implemented.
  • the information output method and device provided by the embodiment of the present application, by reading the inventory information of the inventory database into the cache, and locating the items required by the order according to the inventory information stored in the cache, thereby avoiding repeated reading during the positioning process. Inventory database, thus improving the efficiency of positioning.
  • FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;
  • FIG. 2 is a flow chart of one embodiment of an information output method according to the present application.
  • 3a, 3b, 3c, and 3d are schematic diagrams showing an application scenario of an information output method according to the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of an information output apparatus according to the present application.
  • FIG. 6 is a block diagram showing the structure of a computer system suitable for implementing the server of the embodiment of the present application.
  • FIG. 1 illustrates an exemplary system architecture 100 in which an embodiment of an information output method or information output device of the present application may be applied.
  • system architecture 100 can include terminal devices 101, 102, 103, network 104, and server 105.
  • the network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105.
  • Network 104 may include various types of connections, such as wired, wireless communication links, fiber optic cables, and the like.
  • the user can interact with the server 105 over the network 104 using the terminal devices 101, 102, 103 to receive or transmit messages and the like.
  • Various communication client applications such as a distribution application, a web browser application, a shopping application, a search application, an instant communication tool, a mailbox client, a social platform software, and the like, may be installed on the terminal devices 101, 102, and 103.
  • the terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting information browsing, including but not limited to smart phones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic The video specialist compresses the standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV) player, laptop portable computer and desktop computer, and the like.
  • MP3 players Motion Picture Experts Group Audio Layer III, dynamic The video specialist compresses the standard audio layer 3
  • MP4 Moving Picture Experts Group Audio Layer IV
  • the server 105 may be a server that provides various services, such as a background positioning server that provides support for storage locations and storage amount information of items required for order display on the terminal devices 101, 102, and 103.
  • the background positioning server may analyze and process data such as the item positioning request required by the received order, and feed back the processing result (for example, the storage location of the item required for the order, the storage quantity information) to the terminal device.
  • the information output method provided by the embodiment of the present application is generally performed by the server 105. Accordingly, the information output device is generally disposed in the server 105.
  • terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices, networks, and servers.
  • the information output method includes the following steps:
  • Step 201 Acquire a set of orders to be processed pre-stored in the cache.
  • the electronic device (for example, the server shown in FIG. 1) on which the information output method runs can obtain an order from a terminal that the user performs the order placing operation by using a wired connection method or a wireless connection method, and the order is received.
  • the cache Stored in the cache.
  • Each order in the order set has an order number, and each order includes an item name and an item demand amount, and each order may include demand information of at least one item.
  • the order includes 5 H-card pencils and 2 B-card rubbers.
  • the cache can be a Redis cache (an open source, written in standard C language, a support network, a log-based, key-value database that can be persisted based on memory).
  • Redis cache Use the single-threaded feature of Redis cache to ensure the consistency of inventory information in memory. Scan the unprocessed queue in the Redis cache every predetermined time interval, for example every 10 seconds (unprocessed orders are stored in the unprocessed queue), and the names of the items to be assigned for the orders to be allocated in the orders in the unprocessed queue And the item demand is taken out for pre-processing and stored in the pending queue.
  • the received order in response to receiving the order, may be stored in the queue of the order queue in the cache, and each unprocessed order constitutes an unprocessed queue.
  • RPUSH insert all specified values, stored in the tail of the list
  • the order is placed in the order queue in the order from the first to the last in the order in which the order was received.
  • the data structure of each node in the List takes a String type: the value is the order key in the primary key of the order.
  • the order includes a delivery time for specifying the user's receipt time.
  • the method of storing the order includes: in response to receiving the order, storing the received order in the cached order queue so that the orders in the order queue are sorted in a first-to-last order according to the delivery time, and each unprocessed order constitutes an unprocessed queue. .
  • the order is placed in the order queue in the order of the delivery time in the received order.
  • the order A delivery time is 9 on the 9th
  • the order B delivery time is on the 9th and 16 o'clock
  • the order A is placed in front of the order B, when the delivery time is received at 8:16
  • order C order C is placed in front of order A and order B. That is, the newly received orders can be queued to ensure delivery timeliness. If some orders specify the delivery time and some orders do not specify the delivery time, orders with no specified delivery time are stored at the end of the order queue.
  • Step 202 Read an inventory information set from the inventory database for storing inventory information into the cache.
  • the inventory database may be, for example, a MySQL database (a general-purpose relational database).
  • Each inventory information in the inventory information set includes the item storage location, the item name, and the item inventory quantity corresponding to the item storage location, for example, storage position 1, H card pencil, inventory 20; storage position 2, M brand pencil, inventory of 200 pieces Storage level 3, H rubber, 20 stocks.
  • the inventory information in the inventory database can be considered as actual inventory, and the inventory information in the cache can be considered as quasi-real-time inventory. When positioning an order, it is allocated in quasi-real-time inventory, instead of reading the inventory information of the inventory database in real time. After the inventory information is read into the cache, it can be processed to store the inventory information corresponding to the same item in the same linked list. For example, for the inventory information of the H-card pencil, as shown in FIG. 3c, the same item may be stored in different locations, and the inventory quantity of each location may also be different.
  • Step 203 For each order in the order set, determine, according to each inventory information stored in the cache, an item storage location that matches the order and an item inventory quantity that matches the order.
  • the storage location of the items listed in the order and the storage location are sequentially located according to the order of the queue to be processed in the cache.
  • the storage information stored in the cache includes: storage 1, H pencil, stock 20; storage 2, M pencil, 200 stock; storage 3, H rubber, stock 20; storage 4, H brand pencil, 200 stocks.
  • the order includes: H pencil, which requires 100 pieces. Then, 100 H-shaped pencils in the storage position 4 can be located. It is also possible to locate 20 H-card pencils in storage 1 and 80 H-card pencils in storage 4.
  • the algorithm for specific positioning is determined according to the different needs of users. It is possible to give priority to emptying the inventory of the storage space, and also to pick up the goods in one storage location in order to save the transportation cost.
  • determining, according to each inventory information stored in the cache, an item storage location that matches the order and an item inventory quantity that matches the order including: an item demand quantity according to each order.
  • the scale, wherein the total inventory scale is used to represent the correspondence between the item name and the item inventory sum corresponding to the item name; for each item name in the total demand amount table, if the item inventory quantity corresponding to the item name is not less than
  • the sum of the item requirements corresponding to the item name determines the item storage location and the item inventory amount corresponding to the item name; for each order in the order set, if each item name of the order has determined the corresponding item storage location And the inventory quantity of the item, and updating each inventory information in the inventory information set stored in the cache
  • the inventory information is aggregated, the total inventory scale is newly created by the item, and the Map data structure of the Redis cache is used.
  • the data structure is defined as follows:
  • the timing of the maintenance of the total inventory is to aggregate the inventory information of the same item after the inventory information is read into the cache, and update the inventory quantity and the pointer of the items in the total inventory table in the Redis buffer.
  • the final collated data structure can be as shown, for example, in Figure 3c.
  • the total demand scale can be generated according to the demand for the items of each order. Then, according to the total demand scale, each item is sequentially determined to store the items of the items satisfying each order. That is, the orders in the current pending queue are uniformly positioned to avoid the situation that the inventory quantity of an item within a predetermined time does not satisfy all the orders, and only the inventory quantity is allocated to an order, and is not allocated to other orders.
  • the allocation status identifier of the order is modified, the positioning is successfully updated, and the allocation status identifier is successful. If the inventory is insufficient, the allocation status identifier is updated as unsuccessful. As long as one item in the order has insufficient stock, even if the other items are in sufficient stock, the order status of the order is marked as unsuccessful, and the order is stopped. After the stock is sufficient, the position is repositioned.
  • Step 204 For each order in the order set, determine whether the item inventory amount corresponding to the item storage location matched with the order stored in the inventory database is less than the item inventory quantity matching the order.
  • the inventory information stored in the cache since the inventory information stored in the cache is not real-time, the inventory information in the cache may be inconsistent with the actual inventory information stored in the inventory database.
  • the stock quantity can only be allocated to the order if the actual stock quantity can satisfy the order, otherwise it will be redistributed until the actual stock quantity increases until the order can be satisfied.
  • Step 205 If the inventory quantity of the item corresponding to the item storage location matched by the order stored in the inventory database is not less than the item inventory quantity matching the order, according to the item storage location matching the order and the item matching the order The inventory modifies the inventory information in the inventory database and outputs the item storage location that matches the order and the inventory amount of the item that matches the order.
  • the positioning is successful, and the actual inventory information is modified according to the positioning result, that is, the amount of inventory corresponding to the already stored storage location is subtracted from the quantity required by the order.
  • the storage information stored in the cache includes: storage space 1, H-card pencil, and inventory of 20.
  • the order includes: H pencil, which requires 10 pieces. Then, after positioning 10 H-card pencils in the storage position 1, the inventory information in the inventory database is modified to the storage position 1, the H-card pencil, and the inventory 10 pieces.
  • FIGS. 3a-3d are schematic diagrams of application scenarios of the information output method according to the present embodiment.
  • the electronic device after receiving the order sent by the user through the terminal, the electronic device places the order into an unprocessed queue (not shown) of the Redis buffer 300.
  • the item name and item demand amount of the order in the unprocessed queue are then read into the pending queue 301 at predetermined intervals of 10 seconds.
  • the inventory information set 303 is read from the inventory database 302 for storing inventory information into the Redis cache 300 in accordance with the inventory database log file 3021.
  • the inventory information set is stored in a linked list and the inventory information has been organized to produce a data structure as shown in Figure 3d.
  • the location of each item in the queue 301 to be processed and the amount of inventory to be provided at that location are determined based on the inventory information set 303.
  • the inventory information in the inventory database 302 is modified, and the positioning information 304 of each item matching the order is output, wherein the positioning information includes the item storage location and the item inventory amount matching the order.
  • the method provided by the above embodiment of the present application reduces the number of interactions with the inventory database, reduces the database access pressure, and improves the positioning efficiency by using the inventory information read into the cache to locate the items required by the order.
  • the flow 400 of the information output method includes the following steps:
  • Step 401 Acquire a set of orders to be processed that are pre-stored in the cache.
  • Step 402 reading the inventory information set from the inventory database for storing the inventory information into the cache.
  • Step 403 For each order in the order set, determine, according to each inventory information stored in the cache, an item storage location that matches the order and an item inventory quantity that matches the order.
  • Step 404 For each order in the order set, determine whether the item inventory amount corresponding to the item storage location of the item stored in the inventory database is less than the item inventory quantity matching the order.
  • Steps 401-404 are substantially the same as steps 201-204, and therefore will not be described again.
  • Step 405 If the inventory quantity of the item corresponding to the item storage location matched by the order stored in the inventory database is smaller than the item inventory quantity matching the order, the inventory information set is read from the inventory database and into the cache. Repeat the above allocation steps.
  • the inventory information stored in the cache may be inconsistent with the inventory information stored in the inventory database, it is necessary to reload the inventory information stored in the inventory database into the cache.
  • the above steps 204-205 are performed again until the positioning is successful.
  • the changed inventory information set in response to detecting a change in the log file of the inventory database, is read from the inventory database into the cache based on the log file. In this way, the inventory information can be changed without directly querying the database, and the changed inventory information is synchronously updated into the cache, which can reduce the query pressure of the inventory database.
  • the flow 400 of the information output method in the present embodiment highlights the inventory information stored in the synchronization cache and the inventory database when the order positioning fails. The steps of the inventory information. Thereby improving the positioning success rate.
  • the present application provides an embodiment of an information output device, and the device embodiment corresponds to the method embodiment shown in FIG. Used in a variety of electronic devices.
  • the information output apparatus 500 of the present embodiment includes an acquisition unit 501, a reading unit 502, and a positioning unit 503.
  • the obtaining unit 501 is configured to acquire a to-be-processed order set stored in the cache, where each order in the order set includes an item name and an item demand amount; and the reading unit 502 is configured to use the item for storing the inventory information.
  • the database reads the inventory information set into the cache, wherein each inventory information in the inventory information set includes an item storage location, an item name, and an item inventory amount corresponding to the item storage location; the positioning unit 503 is configured to use, for each order in the order set, Performing the following allocation step: determining, according to each inventory information stored in the cache, an item storage location matching the order and an item inventory quantity matching the order; if the item corresponding to the item storage location stored in the inventory database matches the order If the inventory quantity is not less than the inventory quantity of the item matching the order, the inventory information in the inventory database is modified according to the item storage location matched with the order and the item inventory quantity matching the order, and the item storage location matching the order is output. The amount of inventory of the item that matches the order.
  • the specific processing of the obtaining unit 501 and the reading unit 502 of the information output device 500 may refer to step 201 and step 202 in the corresponding embodiment of FIG. 2 .
  • the positioning unit 503 reference may be made to step 203, step 204, and step 205 in the corresponding embodiment of FIG.
  • the apparatus 500 further includes a first storage unit (not shown) for: in response to receiving the order before acquiring the set of orders to be processed pre-stored in the cache , the received order is stored in the queue at the end of the order queue.
  • a first storage unit (not shown) for: in response to receiving the order before acquiring the set of orders to be processed pre-stored in the cache , the received order is stored in the queue at the end of the order queue.
  • the order includes a delivery time; and the apparatus 500 further includes a second storage unit (not shown) for: prior to obtaining the set of orders to be processed pre-stored in the cache In response to receiving the order, the received order is stored in the cached order queue so that the orders in the order queue are sorted in a first to last order according to the delivery time.
  • the positioning unit 503 is further configured to: generate a total demand amount table according to the item demand quantity of each order, where the total demand quantity table is used to represent the item corresponding to the item name and the item name Corresponding relationship of the sum of demand; generating a total inventory scale according to the inventory amount of each inventory information in the inventory information set stored in the cache, wherein the total inventory scale is used to represent the sum of the inventory amount of the article corresponding to the article name and the article name Corresponding relationship; for each item name in the total demand amount, if the sum of the item inventory corresponding to the item name is not less than the sum of the item requirements corresponding to the item name, the item storage location and the item inventory corresponding to the item name are determined. For each order in the order set, if each item name of the order has determined the corresponding item storage location and the item inventory quantity, the inventory information in the inventory information set stored in the cache is updated with the order The item storage location and the item inventory amount corresponding to each item name.
  • the reading unit 502 is further configured to: if the inventory quantity of the item corresponding to the item storage location matched by the order stored in the inventory database is less than the inventory quantity of the item matching the order, The inventory information set is then read from the inventory database into the cache; and the location unit 502 is further configured to repeatedly perform the above allocation steps.
  • the apparatus 500 further includes an inventory update unit (not shown) for: reading changes from the inventory database based on the log file in response to detecting a change in the log file of the inventory database The inventory information is aggregated into the cache.
  • an inventory update unit (not shown) for: reading changes from the inventory database based on the log file in response to detecting a change in the log file of the inventory database The inventory information is aggregated into the cache.
  • FIG. 6 a block diagram of a computer system 600 suitable for use in implementing a server of an embodiment of the present application is shown.
  • the server shown in FIG. 6 is merely an example, and should not impose any limitation on the function and scope of use of the embodiments of the present application.
  • computer system 600 includes a central processing unit (CPU) 601 that can be loaded into a program in random access memory (RAM) 603 according to a program stored in read only memory (ROM) 602 or from storage portion 608. And perform various appropriate actions and processes.
  • RAM random access memory
  • ROM read only memory
  • RAM random access memory
  • various programs and data required for the operation of the system 600 are also stored.
  • the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also coupled to bus 604.
  • the following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a storage portion 608 including a hard disk or the like. And a communication portion 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the Internet.
  • Driver 610 is also coupled to I/O interface 605 as needed.
  • a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like, is mounted on the drive 610 as needed so that a computer program read therefrom is installed into the storage portion 608 as needed.
  • an embodiment of the present disclosure includes a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via communication portion 609, and/or installed from removable media 611.
  • the central processing unit (CPU) 601 the above-described functions defined in the method of the present application are performed.
  • the computer readable medium described herein may be a computer readable signal medium or a computer readable storage medium or any combination of the two.
  • the computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, 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 of the foregoing.
  • a computer readable storage medium may be any tangible medium that can contain or store a program, which can be used by or in connection with an instruction execution system, apparatus or device.
  • a computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, carrying computer readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer readable signal medium can also be any computer readable medium other than a computer readable storage medium, which can transmit, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device.
  • Program code embodied on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the logic functions for implementing the specified.
  • Executable instructions can also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present application may be implemented by software or by hardware.
  • the described unit may also be provided in the processor, for example, as a processor including an acquisition unit, a reading unit, and a positioning unit.
  • the names of these units do not constitute a limitation on the unit itself in some cases.
  • the obtaining unit may also be described as “a unit that acquires a set of orders to be processed that are stored in advance in the cache”.
  • the present application also provides a computer readable medium, which may be included in the apparatus described in the above embodiments, or may be separately present and not incorporated into the apparatus.
  • the computer readable medium carries one or more programs, when the one or more programs are executed by the device, causing the device to: acquire a set of orders to be processed pre-stored in a cache, wherein each of the order sets The order includes an item name and an item demand amount; the inventory information set is read from the inventory database for storing the inventory information into the cache, wherein each inventory information in the inventory information set includes an item storage location, an item name, and an item storage location.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Human Resources & Organizations (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种信息输出方法和装置。该方法包括:获取预先存储在缓存中的待处理的订单集合(201);从用于存储库存信息的库存数据库读取库存信息集合到缓存中(202);对于订单集合中每个订单,根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量(203);对于订单集合中每个订单,若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量(204),则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量(205)。该方法减少了读取库存数据库的次数,提高了定位效率。

Description

信息输出方法和装置
相关申请的交叉引用
本专利申请要求于2017年9月7日提交的、申请号为201710801348.4、发明名称为“信息输出方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本申请涉及计算机技术领域,具体涉及互联网技术领域,尤其涉及信息输出方法和装置。
背景技术
随着互联网行业的广泛与深入的发展,网上购物被越来越多的人群采纳。用户在网上商城下单后,订单信息会下传到电商物流体系中的仓储系统平台,该平台能够协助仓库作业人员确定订单中商品在仓库中的具体位置,并最终完成商品的配送,仓库中查找商品所在位置的这个过程被称作定位。定位在仓库生产环节是一个重要的步骤,起到承上启下的作用,定位完成后,商品由承运商配送给客户。
仓库操作人员操作定位后,仓储系统将待分配的订单记录在数据库中,然后采用异步方式,随机分配。异步定位时采用并发方式,不同订单中,当包含相同商品时,对同一个商品的库存产生竞争,竞争失败后,需要重复多次运行,才能完成定位。导致需要反复多次读取数据库,从而降低了定位的效率。
发明内容
本申请实施例的目的在于提出一种信息输出方法和装置,来解决以上背景技术部分提到的技术问题。
第一方面,本申请实施例提供了一种信息输出方法,该方法包括:获取预先存储在缓存中的待处理的订单集合,其中,订单集合中每个 订单包括物品名称和物品需求量;从用于存储库存信息的库存数据库读取库存信息集合到缓存中,其中,库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量;对于订单集合中每个订单,执行如下分配步骤:根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量;若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
在一些实施例中,在获取预先存储在缓存中的待处理的订单集合之前,该方法还包括:响应于接收到订单,将所接收的订单存入缓存中的订单队列的队尾。
在一些实施例中,订单包括配送时间;以及在获取预先存储在缓存中的待处理的订单集合之前,该方法还包括:响应于接收到订单,将所接收的订单存入缓存中的订单队列使得订单队列中的订单按照配送时间由先到后的顺序排序。
在一些实施例中,根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量,包括:根据各订单的物品需求量生成总需求量表,其中,总需求量表用于表征物品名称和物品名称对应的物品需求量总和的对应关系;根据缓存中存储的库存信息集合中每条库存信息的物品库存量生成总库存量表,其中,总库存量表用于表征物品名称和物品名称对应的物品库存量总和的对应关系;对于总需求量表中每个物品名称,若该物品名称对应的物品库存量总和不小于该物品名称对应的物品需求量总和,则确定该物品名称对应的物品存储位置和物品库存量;对于订单集合中每个订单,若该订单的每个物品名称已经确定出了对应的物品存储位置和物品库存量,则更新缓存中存储的库存信息集合中每条库存信息中与该订单的各个物品名称对应的物品存储位置和物品库存量。
在一些实施例中,该方法还包括:若库存数据库中存储的与该订 单匹配的物品存储位置对应的物品库存量小于与该订单匹配的物品库存量,则重新从库存数据库读取库存信息集合到缓存中并重复执行上述分配步骤。
在一些实施例中,该方法还包括:响应于检测到库存数据库的日志文件发生变化,根据日志文件从库存数据库读取变化的库存信息集合到缓存中。
第二方面,本申请实施例提供了一种信息输出装置,该装置包括:获取单元,用于获取预先存储在缓存中的待处理的订单集合,其中,订单集合中每个订单包括物品名称和物品需求量;读取单元,用于从用于存储库存信息的库存数据库读取库存信息集合到缓存中,其中,库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量;定位单元,用于对于订单集合中每个订单,执行如下分配步骤:根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量;若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
在一些实施例中,该装置还包括第一存储单元,用于:在获取预先存储在缓存中的待处理的订单集合之前,响应于接收到订单,将所接收的订单存入缓存中的订单队列的队尾。
在一些实施例中,订单包括配送时间;以及装置还包括第二存储单元,用于:在获取预先存储在缓存中的待处理的订单集合之前,响应于接收到订单,将所接收的订单存入缓存中的订单队列使得订单队列中的订单按照配送时间由先到后的顺序排序。
在一些实施例中,定位单元进一步用于:根据各订单的物品需求量生成总需求量表,其中,总需求量表用于表征物品名称和物品名称对应的物品需求量总和的对应关系;根据缓存中存储的库存信息集合中每条库存信息的物品库存量生成总库存量表,其中,总库存量表用于表征物品名称和物品名称对应的物品库存量总和的对应关系;对于 总需求量表中每个物品名称,若该物品名称对应的物品库存量总和不小于该物品名称对应的物品需求量总和,则确定该物品名称对应的物品存储位置和物品库存量;对于订单集合中每个订单,若该订单的每个物品名称已经确定出了对应的物品存储位置和物品库存量,则更新缓存中存储的库存信息集合中每条库存信息中与该订单的各个物品名称对应的物品存储位置和物品库存量。
在一些实施例中,读取单元进一步用于:若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量小于与该订单匹配的物品库存量,则重新从库存数据库读取库存信息集合到缓存中;以及定位单元进一步用于重复执行上述分配步骤。
在一些实施例中,该装置还包括库存更新单元,用于:响应于检测到库存数据库的日志文件发生变化,根据日志文件从库存数据库读取变化的库存信息集合到缓存中。
第三方面,本申请实施例提供了一种服务器,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如第一方面中任一的方法。
本申请实施例提供的信息输出方法和装置,通过将库存数据库的库存信息读取到缓存中,根据缓存中存储的库存信息对订单所需的物品进行定位,从而避免在定位过程中反复读取库存数据库,因此提高了定位的效率。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1是本申请可以应用于其中的示例性系统架构图;
图2是根据本申请的信息输出方法的一个实施例的流程图;
图3a、3b、3c、3d是根据本申请的信息输出方法的一个应用场景的示意图;
图4是根据本申请的信息输出方法的又一个实施例的流程图;
图5是根据本申请的信息输出装置的一个实施例的结构示意图;
图6是适于用来实现本申请实施例的服务器的计算机系统的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了可以应用本申请的信息输出方法或信息输出装置的实施例的示例性系统架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如配送应用、网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。
终端设备101、102、103可以是具有显示屏并且支持信息浏览的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计 算机和台式计算机等等。
服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103上显示的订单所需物品的存储位置、存储数量信息提供支持的后台定位服务器。后台定位服务器可以对接收到的订单所需物品定位请求等数据进行分析等处理,并将处理结果(例如订单所需物品的存储位置、存储数量信息)反馈给终端设备。
需要说明的是,本申请实施例所提供的信息输出方法一般由服务器105执行,相应地,信息输出装置一般设置于服务器105中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,示出了根据本申请的信息输出方法的一个实施例的流程200。该信息输出方法,包括以下步骤:
步骤201,获取预先存储在缓存中的待处理的订单集合。
在本实施例中,信息输出方法运行于其上的电子设备(例如图1所示的服务器)可以通过有线连接方式或者无线连接方式从用户利用其进行下订单操作的终端获取订单,并将订单存储在缓存中。订单集合中每个订单具有订单号,并且每个订单包括物品名称和物品需求量,每个订单中可以包括至少一种物品的需求信息。例如,订单中包括H牌铅笔5支,B牌橡皮2块。该缓存可以是Redis缓存(一个开源的使用标准C语言编写、支持网络、可基于内存亦可持久化的日志型、键值数据库)。利用Redis缓存的单线程特性,保证内存中库存信息的一致性。每隔预定时间间隔,例如每隔10秒扫描Redis缓存中的未处理队列(未处理的订单存储在未处理队列中),将未处理队列中的订单中需要分配的订单的待分配的物品名称和物品需求量取出来做预处理,存储在待处理队列中。
在本实施例的一些可选的实现方式中,响应于接收到订单,可以将所接收的订单存入缓存中的订单队列的队尾,各未处理的订单组成未处理队列。例如,借助Redis缓存的列表数据结构,当有新的数据进入的时候,使用RPUSH(插入所有指定的值,在存储在列表的键尾部)命令保证数据处理的有序性。此时是按照接收到订单的时间由先 到后的顺序将订单放入订单队列中。List(列表)中的每一个节点的数据结构采用String(字符串)类型:值为订单号在订单的主键。
在本实施例的一些可选的实现方式中,订单包括配送时间,用于指定用户的收货时间。存储订单的方法包括:响应于接收到订单,将所接收的订单存入缓存中的订单队列使得订单队列中的订单按照配送时间由先到后的顺序排序,各未处理的订单组成未处理队列。此时是按照接收到订单中的配送时间由先到后的顺序将订单放入订单队列中。例如,订单队列中原有两个订单,订单A配送时间为9号9点,订单B配送时间为9号16点,订单A排在订单B的前面,当接收到配送时间为8点16号的订单C时,将订单C排在订单A和订单B的前面。即,新接收的订单可以插队,从而可以保证配送时效。如果有的订单指定了配送时间,有的订单没指定配送时间,则将未指定配送时间的订单存储在订单队列的末尾。
步骤202,从用于存储库存信息的库存数据库读取库存信息集合到缓存中。
在本实施例中,库存数据库可以是例如MySQL数据库(通用的关系型数据库)。库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量,例如,储位1,H牌铅笔,库存20支;储位2,M牌铅笔,库存200支;储位3,H牌橡皮,库存20块。在本申请中,库存数据库中的库存信息可看作实际库存,而缓存中的库存信息可看作准实时库存。定位订单时是按准实时库存进行分配的,而不用实时地同步读取库存数据库的库存信息。库存信息读取到缓存后,可进行处理,将相同的物品对应的库存信息保存在同一链表中。例如,对于H牌铅笔的库存信息,可如图3c所示,同一物品可以存储在不同的位置,每个位置的库存数量也可以不同。
步骤203,对于订单集合中每个订单根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
在本实施例中,可根据缓存中存储的各库存信息而不是根据库存数据库中存储的各库存信息,按照缓存中待处理队列的顺序依次定位 订单所列出的物品的存储位置和该存储位置上应取出的数量。例如,缓存中存储的存储信息包括:储位1,H牌铅笔,库存20支;储位2,M牌铅笔,库存200支;储位3,H牌橡皮,库存20块;储位4,H牌铅笔,库存200支。订单包括:H牌铅笔,需要100支。则可定位出储位4中100支H牌铅笔。也可以定位出储位1中20支H牌铅笔,和储位4中80支H牌铅笔。具体定位的算法根据用户的不同需求确定。可以优先清空储位的库存量,也可以为了节省搬运成本而尽量在一个储位取货。
在本实施例的一些可选的实现方式中,根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量,包括:根据各订单的物品需求量生成总需求量表,其中,总需求量表用于表征物品名称和物品名称对应的物品需求量总和的对应关系;根据缓存中存储的库存信息集合中每条库存信息的物品库存量生成总库存量表,其中,总库存量表用于表征物品名称和物品名称对应的物品库存量总和的对应关系;对于总需求量表中每个物品名称,若该物品名称对应的物品库存量总和不小于该物品名称对应的物品需求量总和,则确定该物品名称对应的物品存储位置和物品库存量;对于订单集合中每个订单,若该订单的每个物品名称已经确定出了对应的物品存储位置和物品库存量,则更新缓存中存储的库存信息集合中每条库存信息中与该订单的各个物品名称对应的物品存储位置和物品库存量。
将库存信息进行聚合处理,按物品新建立总库存量表,使用Redis缓存的Map(映射)数据结构,数据结构定义如下:
物品:{物品库存量,数据链表地址}
其中,总库存量表维护的时机为当将库存信息读取到缓存后,将相同物品的库存信息聚合在一起,更新Redis缓存中的总库存量表中物品库存量以及指针。最后整理后的数据结构可以例如图3c所示。
为了防止对不同订单定位时起冲突导致定位失败,可根据各订单的物品需求量生成总需求量表。然后按照总需求量表每种物品依次确定满足各订单的物品的存储位置。即,对当前待处理队列中的订单统 一定位,避免出现对于预定时间内的某物品的库存量不满足所有订单,而只将库存量分配给某个订单,不分配给其它订单的情况。对待处理队列中每个订单中的每个物品定位完成之后,会修改订单的分配状态标识,定位成功更新该分配状态标识为成功,库存不足时,则更新该分配状态标识为未成功。只要该订单中有一个物品库存不足,即使其它物品库存充足,仍将该订单的分配状态标识为未成功,停止定位该订单,待库存足够后,再次定位。
步骤204,对于订单集合中每个订单,确定库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量是否小于与该订单匹配的物品库存量。
在本实施例中,由于缓存中存储的库存信息并不是实时的,因此缓存中的库存信息可能会与库存数据库存储的实际的库存信息不一致。只有在实际的库存量能够满足订单时才能将该库存量分配给订单,否则等到实际的库存量增加到能够满足订单时再分配。
步骤205,若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
在本实施例中,若实际库存量能够满足订单时,才定位成功,并根据定位结果修改实际的库存信息,即将已经定位好的存储位置对应的库存量减去订单所需要的量。例如,缓存中存储的存储信息包括:储位1,H牌铅笔,库存20支。订单包括:H牌铅笔,需要10支。则可定位出储位1中10支H牌铅笔后,将库存数据库中的库存信息修改为储位1,H牌铅笔,库存10支。
继续参见图3a-3d,图3a-3d是根据本实施例的信息输出方法的应用场景的一个示意图。在图3a-3c的应用场景中,上述电子设备收到用户通过终端发送的订单后,将订单放入Redis缓存300的未处理队列(未示出)中。然后以预定间隔10秒读取未处理队列中的订单的物品名称和物品需求量到待处理队列301中。如图3b所示,根据库存数 据库日志文件3021从用于存储库存信息的库存数据库302读取库存信息集合303到Redis缓存300中。如图3c所示,库存信息集合以链表形式存储,并且库存信息已经被整理生成如图3d所示的数据结构。根据库存信息集合303确定出到待处理队列301中各物品的位置和该位置需要提供的库存量。当物品的库存量满足订单需求量时,修改库存数据库302中的库存信息,并输出与订单匹配的各物品的定位信息304,其中,定位信息包括物品存储位置和与订单匹配的物品库存量。
本申请的上述实施例提供的方法通过利用读取到缓存中的库存信息对订单所需的物品进行定位,减少了与库存数据库交互的次数,减轻数据库访问压力,提高了定位效率。
进一步参考图4,其示出了信息输出方法的又一个实施例的流程400。该信息输出方法的流程400,包括以下步骤:
步骤401,获取预先存储在缓存中的待处理的订单集合。
步骤402,从用于存储库存信息的库存数据库读取库存信息集合到缓存中。
步骤403,对于订单集合中每个订单根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
步骤404,对于订单集合中每个订单,确定库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量是否小于与该订单匹配的物品库存量。
步骤401-404与步骤201-204基本相同,因此不再赘述。
步骤405,若所述库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量小于与该订单匹配的物品库存量,则重新从库存数据库读取库存信息集合到所述缓存中并重复执行上述分配步骤。
在本实施例中,由于缓存中存储的库存信息与库存数据库中存储的库存信息可能不一致,因此需要重新加载库存数据库中存储的库存信息到缓存中。再执行上述步骤204-205,直到定位成功。
在本实施例的一些可选的实现方式中,响应于检测到库存数据库的日志文件发生变化,根据日志文件从库存数据库读取变化的库存信 息集合到缓存中。这样可以不直接查询数据库即可知道库存信息发生变化,并将变化的库存信息同步更新到缓存中,可以降低库存数据库的查询压力。
从图4中可以看出,与图2对应的实施例相比,本实施例中的信息输出方法的流程400突出了在对订单定位失败时,同步缓存中存储的库存信息与库存数据库中存储的库存信息的步骤。从而提高定位成功率。
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种信息输出装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,本实施例的信息输出装置500包括:获取单元501、读取单元502和定位单元503。其中,获取单元501用于获取预先存储在缓存中的待处理的订单集合,其中,订单集合中每个订单包括物品名称和物品需求量;读取单元502用于从用于存储库存信息的库存数据库读取库存信息集合到缓存中,其中,库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量;定位单元503用于对于订单集合中每个订单,执行如下分配步骤:根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量;若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
在本实施例中,信息输出装置500的获取单元501、读取单元502的具体处理可以参考图2对应实施例中的步骤201和步骤202。定位单元503的具体处理可以参考图2对应实施例中的步骤203、步骤204和步骤205。
在本实施例的一些可选的实现方式中,装置500还包括第一存储单元(未示出),用于:在获取预先存储在缓存中的待处理的订单集合之前,响应于接收到订单,将所接收的订单存入缓存中的订单队列的 队尾。
在本实施例的一些可选的实现方式中,订单包括配送时间;以及装置500还包括第二存储单元(未示出),用于:在获取预先存储在缓存中的待处理的订单集合之前,响应于接收到订单,将所接收的订单存入缓存中的订单队列使得订单队列中的订单按照配送时间由先到后的顺序排序。
在本实施例的一些可选的实现方式中,定位单元503进一步用于:根据各订单的物品需求量生成总需求量表,其中,总需求量表用于表征物品名称和物品名称对应的物品需求量总和的对应关系;根据缓存中存储的库存信息集合中每条库存信息的物品库存量生成总库存量表,其中,总库存量表用于表征物品名称和物品名称对应的物品库存量总和的对应关系;对于总需求量表中每个物品名称,若该物品名称对应的物品库存量总和不小于该物品名称对应的物品需求量总和,则确定该物品名称对应的物品存储位置和物品库存量;对于订单集合中每个订单,若该订单的每个物品名称已经确定出了对应的物品存储位置和物品库存量,则更新缓存中存储的库存信息集合中每条库存信息中与该订单的各个物品名称对应的物品存储位置和物品库存量。
在本实施例的一些可选的实现方式中,读取单元502进一步用于:若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量小于与该订单匹配的物品库存量,则重新从库存数据库读取库存信息集合到缓存中;以及定位单元502进一步用于重复执行上述分配步骤。
在本实施例的一些可选的实现方式中,装置500还包括库存更新单元(未示出),用于:响应于检测到库存数据库的日志文件发生变化,根据日志文件从库存数据库读取变化的库存信息集合到缓存中。
下面参考图6,其示出了适于用来实现本申请实施例的服务器的计算机系统600的结构示意图。图6示出的服务器仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608 加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基 带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取单元、读取单元和定位单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取预先存储在缓存中的待处理的订单集合的单元”。
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:获 取预先存储在缓存中的待处理的订单集合,其中,订单集合中每个订单包括物品名称和物品需求量;从用于存储库存信息的库存数据库读取库存信息集合到缓存中,其中,库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量;对于订单集合中每个订单,执行如下分配步骤:根据缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量;若库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (14)

  1. 一种信息输出方法,其特征在于,所述方法包括:
    获取预先存储在缓存中的待处理的订单集合,其中,所述订单集合中每个订单包括物品名称和物品需求量;
    从用于存储库存信息的库存数据库读取库存信息集合到所述缓存中,其中,所述库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量;
    对于所述订单集合中每个订单,执行如下分配步骤:
    根据所述缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量;
    若所述库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改所述库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
  2. 根据权利要求1所述的方法,其特征在于,在所述获取预先存储在缓存中的待处理的订单集合之前,所述方法还包括:
    响应于接收到订单,将所接收的订单存入缓存中的订单队列的队尾。
  3. 根据权利要求1所述的方法,其特征在于,所述订单包括配送时间;以及
    在所述获取预先存储在缓存中的待处理的订单集合之前,所述方法还包括:
    响应于接收到订单,将所接收的订单存入所述缓存中的订单队列使得所述订单队列中的订单按照配送时间由先到后的顺序排序。
  4. 根据权利要求1-3之一所述的方法,其特征在于,所述根据所 述缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量,包括:
    根据各订单的物品需求量生成总需求量表,其中,所述总需求量表用于表征物品名称和物品名称对应的物品需求量总和的对应关系;
    根据所述缓存中存储的库存信息集合中每条库存信息的物品库存量生成总库存量表,其中,所述总库存量表用于表征物品名称和物品名称对应的物品库存量总和的对应关系;
    对于所述总需求量表中每个物品名称,若该物品名称对应的物品库存量总和不小于该物品名称对应的物品需求量总和,则确定该物品名称对应的物品存储位置和物品库存量;
    对于所述订单集合中每个订单,若该订单的每个物品名称已经确定出了对应的物品存储位置和物品库存量,则更新所述缓存中存储的库存信息集合中每条库存信息中与该订单的各个物品名称对应的物品存储位置和物品库存量。
  5. 根据权利要求1-3之一所述的方法,其特征在于,所述方法还包括:
    若所述库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量小于与该订单匹配的物品库存量,则重新从库存数据库读取库存信息集合到所述缓存中并重复执行上述分配步骤。
  6. 根据权利要求1-3之一所述的方法,其特征在于,所述方法还包括:
    响应于检测到所述库存数据库的日志文件发生变化,根据所述日志文件从库存数据库读取变化的库存信息集合到所述缓存中。
  7. 一种信息输出装置,其特征在于,所述装置包括:
    获取单元,用于获取预先存储在缓存中的待处理的订单集合,其中,所述订单集合中每个订单包括物品名称和物品需求量;
    读取单元,用于从用于存储库存信息的库存数据库读取库存信息 集合到所述缓存中,其中,所述库存信息集合中每条库存信息包括物品存储位置、物品名称和物品存储位置对应的物品库存量;
    定位单元,用于对于所述订单集合中每个订单,执行如下分配步骤:
    根据所述缓存中存储的各库存信息确定出与该订单匹配的物品存储位置和与该订单匹配的物品库存量;
    若所述库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量不小于与该订单匹配的物品库存量,则根据与该订单匹配的物品存储位置和与该订单匹配的物品库存量修改所述库存数据库中的库存信息,并输出与该订单匹配的物品存储位置和与该订单匹配的物品库存量。
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括第一存储单元,用于:
    在所述获取预先存储在缓存中的待处理的订单集合之前,响应于接收到订单,将所接收的订单存入缓存中的订单队列的队尾。
  9. 根据权利要求7所述的装置,其特征在于,所述订单包括配送时间;以及所述装置还包括第二存储单元,用于:
    在所述获取预先存储在缓存中的待处理的订单集合之前,响应于接收到订单,将所接收的订单存入所述缓存中的订单队列使得所述订单队列中的订单按照配送时间由先到后的顺序排序。
  10. 根据权利要求7-9之一所述的装置,其特征在于,所述定位单元进一步用于:
    根据各订单的物品需求量生成总需求量表,其中,所述总需求量表用于表征物品名称和物品名称对应的物品需求量总和的对应关系;
    根据所述缓存中存储的库存信息集合中每条库存信息的物品库存量生成总库存量表,其中,所述总库存量表用于表征物品名称和物品名称对应的物品库存量总和的对应关系;
    对于所述总需求量表中每个物品名称,若该物品名称对应的物品库存量总和不小于该物品名称对应的物品需求量总和,则确定该物品名称对应的物品存储位置和物品库存量;
    对于所述订单集合中每个订单,若该订单的每个物品名称已经确定出了对应的物品存储位置和物品库存量,则更新所述缓存中存储的库存信息集合中每条库存信息中与该订单的各个物品名称对应的物品存储位置和物品库存量。
  11. 根据权利要求7-9之一所述的装置,其特征在于,所述读取单元进一步用于:
    若所述库存数据库中存储的与该订单匹配的物品存储位置对应的物品库存量小于与该订单匹配的物品库存量,则重新从库存数据库读取库存信息集合到所述缓存中;以及
    所述定位单元进一步用于重复执行上述分配步骤。
  12. 根据权利要求7-9之一所述的装置,其特征在于,所述装置还包括库存更新单元,用于:
    响应于检测到所述库存数据库的日志文件发生变化,根据所述日志文件从库存数据库读取变化的库存信息集合到所述缓存中。
  13. 一种服务器,包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-6中任一所述的方法。
  14. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-6中任一所述的方法。
PCT/CN2018/081956 2017-09-07 2018-04-04 信息输出方法和装置 WO2019047516A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710801348.4 2017-09-07
CN201710801348.4A CN110019330B (zh) 2017-09-07 2017-09-07 信息输出方法和装置

Publications (1)

Publication Number Publication Date
WO2019047516A1 true WO2019047516A1 (zh) 2019-03-14

Family

ID=65634548

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081956 WO2019047516A1 (zh) 2017-09-07 2018-04-04 信息输出方法和装置

Country Status (2)

Country Link
CN (1) CN110019330B (zh)
WO (1) WO2019047516A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113537852A (zh) * 2020-04-14 2021-10-22 成都鼎桥通信技术有限公司 秒杀处理方法及系统
CN113689155A (zh) * 2020-05-18 2021-11-23 北京京东乾石科技有限公司 出库方法和出库装置
CN113780924A (zh) * 2021-01-29 2021-12-10 北京京东振世信息技术有限公司 用于生成信息的方法和装置
CN113807760A (zh) * 2021-01-07 2021-12-17 北京沃东天骏信息技术有限公司 库存信息处理方法、装置及可读存储介质和电子设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111785346A (zh) * 2020-05-29 2020-10-16 北京沃东天骏信息技术有限公司 处方订单派发方法、系统、装置和存储介质
CN112765277A (zh) * 2021-01-28 2021-05-07 树根互联股份有限公司 数据同步方法、装置和系统
CN113052536A (zh) * 2021-04-06 2021-06-29 北京京东振世信息技术有限公司 订单处理方法、装置及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103426072A (zh) * 2013-07-16 2013-12-04 无限极(中国)有限公司 一种高并发竞争库存的订单处理系统及其处理方法
CN104021481A (zh) * 2014-07-01 2014-09-03 浪潮软件股份有限公司 一种高效的烟草行业订单批量订单处理方法
CN106709071A (zh) * 2017-02-03 2017-05-24 北京小米移动软件有限公司 网络交易处理方法及装置
CN106803158A (zh) * 2015-11-26 2017-06-06 阿里巴巴集团控股有限公司 仓储物流系统中仓储数据的处理方法、装置以及系统
CN107038629A (zh) * 2017-06-13 2017-08-11 舒达家居用品(深圳)有限公司 一种商品交易中的订单处理方法、装置及服务器

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515391B (zh) * 2009-03-20 2010-08-11 北京理工大学 基于闭架书库的自动化图书管理系统
CN104978639B (zh) * 2014-04-09 2018-11-30 菜鸟智能物流控股有限公司 一种展示库存量的方法和装置
CN105096065B (zh) * 2014-04-16 2019-08-20 阿里巴巴集团控股有限公司 一种库存扣减方法和装置
US10582001B2 (en) * 2015-08-11 2020-03-03 Oracle International Corporation Asynchronous pre-caching of synchronously loaded resources
CN106997546A (zh) * 2016-01-26 2017-08-01 中国移动通信集团安徽有限公司 一种订单处理方法及装置
CN106886938B (zh) * 2017-02-21 2021-02-12 驼队重卡(北京)物流信息技术有限责任公司 一种大宗商品货运吞吐信息的更新方法及装置
CN106875262B (zh) * 2017-02-28 2021-03-26 阿里巴巴(中国)有限公司 用于订单处理的方法、装置和计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103426072A (zh) * 2013-07-16 2013-12-04 无限极(中国)有限公司 一种高并发竞争库存的订单处理系统及其处理方法
CN104021481A (zh) * 2014-07-01 2014-09-03 浪潮软件股份有限公司 一种高效的烟草行业订单批量订单处理方法
CN106803158A (zh) * 2015-11-26 2017-06-06 阿里巴巴集团控股有限公司 仓储物流系统中仓储数据的处理方法、装置以及系统
CN106709071A (zh) * 2017-02-03 2017-05-24 北京小米移动软件有限公司 网络交易处理方法及装置
CN107038629A (zh) * 2017-06-13 2017-08-11 舒达家居用品(深圳)有限公司 一种商品交易中的订单处理方法、装置及服务器

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113537852A (zh) * 2020-04-14 2021-10-22 成都鼎桥通信技术有限公司 秒杀处理方法及系统
CN113689155A (zh) * 2020-05-18 2021-11-23 北京京东乾石科技有限公司 出库方法和出库装置
CN113807760A (zh) * 2021-01-07 2021-12-17 北京沃东天骏信息技术有限公司 库存信息处理方法、装置及可读存储介质和电子设备
CN113780924A (zh) * 2021-01-29 2021-12-10 北京京东振世信息技术有限公司 用于生成信息的方法和装置
CN113780924B (zh) * 2021-01-29 2024-04-16 北京京东振世信息技术有限公司 用于生成信息的方法和装置

Also Published As

Publication number Publication date
CN110019330B (zh) 2021-07-06
CN110019330A (zh) 2019-07-16

Similar Documents

Publication Publication Date Title
WO2019047516A1 (zh) 信息输出方法和装置
CN109840429B (zh) 智能合约部署、调用方法和装置
CN109254733B (zh) 用于存储数据的方法、装置和系统
CN108846753B (zh) 用于处理数据的方法和装置
CN110866709B (zh) 合并订单的方法和装置
CN106844372B (zh) 一种物流信息查询方法和装置
US11620444B2 (en) Providing action associated with event detected within communication
US8280917B1 (en) Batching content management operations to facilitate efficient database interactions
CN110019263B (zh) 信息存储方法和装置
CN111028009B (zh) 可领取业务实体处理方法和装置
TW201401210A (zh) 業務對象推送的方法以及裝置
WO2023040612A1 (zh) 用于处理订单的方法和装置
CN111324786A (zh) 咨询问题信息的处理方法和装置
CN115455058A (zh) 缓存数据的处理方法、装置、计算机设备及存储介质
CN107291923B (zh) 信息处理方法和装置
WO2019033676A1 (zh) 订单处理方法和装置
CN112148705A (zh) 数据迁移的方法和装置
CN110858199A (zh) 一种单据数据分布式计算的方法和装置
US7979451B2 (en) Data manipulation command method and system
WO2021244233A1 (zh) 一种处理订单数据的方法和装置
CN113592470A (zh) 业务处理方法、装置、电子设备以及存储介质
US9898493B2 (en) Runtime generation of a mapping table for uploading data into structured data marts
EP3455805A1 (en) Enhancing contact card based on knowledge graph
CN110309121B (zh) 日志处理方法及装置、计算机可读介质和电子设备
CN113222680A (zh) 一种生成订单的方法和装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18853773

Country of ref document: EP

Kind code of ref document: A1