Disclosure of Invention
The present application is directed to a method and apparatus for determining an inventory of items for a server system, which solves the technical problems mentioned in the background section above.
In a first aspect, an embodiment of the present application provides a method for determining an inventory of an item for a server system, where the server system includes a processing server and a plurality of server sets, each server set processing an order request of one type; the method comprises the following steps: when an order confirmation request is received, determining an article identifier included in the order confirmation request; generating an inventory statistic message based on the article identification; sending the inventory statistics message to the processing server so that the processing server sends the inventory statistics message to other server sets; counting the inventory of the articles indicated by the article identifiers in the warehouse and generating an inventory result message; and sending the inventory result message to the processing server, and receiving the inventory result message generated by other server sets sent by the processing server.
In some embodiments, the generating an inventory statistics message based on the item identifier includes: determining a warehouse identifier of at least one warehouse to which the article indicated by the article identifier belongs; and generating inventory statistical information according to the article identifier and the at least one warehouse identifier.
In some embodiments, the counting the stock amount of the item indicated by the item identifier in the warehouse and generating the stock result message includes: inquiring the article identification in a preset article inventory statistics list, and determining the inventory corresponding to the article identification, wherein the article inventory statistics list comprises the inventory corresponding to each article identification; and generating an inventory result message according to the inventory amount, the article identifier, the at least one warehouse identifier and the identifier of the current server set.
In some embodiments, the above method further comprises: analyzing the inventory result messages generated by other server sets, and determining other inventory quantities of the articles indicated by the article identifiers in the warehouse counted by other server sets; comparing the other stock quantities with the current stock quantity counted by the current server set, and determining whether differences exist between the other stock quantities and the current stock quantity; in response to the difference, the stock quantity of the difference is displayed.
In some embodiments, the above method further comprises: and responding to the difference, alarming and sending the different inventory to a preset contact way.
In a second aspect, an embodiment of the present application provides an apparatus for determining an inventory of an item for a server system, where the server system includes a processing server and a plurality of server sets, each server set processing an order request of one type; the above-mentioned device includes: the order confirmation system comprises an item identification determining unit, a confirmation unit and a confirmation unit, wherein the item identification determining unit is used for determining an item identification included in an order confirmation request when the order confirmation request is received; the inventory statistics message generating unit is used for generating inventory statistics messages based on the article identifiers; an inventory statistics message sending unit, configured to send the inventory statistics message to the processing server, so that the processing server sends the inventory statistics message to another server set; the inventory result message generating unit is used for counting the inventory quantity of the articles indicated by the article identification in the warehouse and generating inventory result messages; and the inventory result message sending unit is used for sending the inventory result message to the processing server and receiving the inventory result message generated by the other server set sent by the processing server.
In some embodiments, the inventory statistics message generating unit is further configured to: determining a warehouse identifier of at least one warehouse to which the article indicated by the article identifier belongs; and generating inventory statistical information according to the article identifier and the at least one warehouse identifier.
In some embodiments, the inventory result message generating unit includes: the inventory determining module is used for inquiring the article identifier in a preset article inventory statistics list and determining the inventory corresponding to the article identifier, wherein the article inventory statistics list comprises the inventory corresponding to each article identifier; and the stock result message generating module is used for generating the stock result message according to the stock quantity, the article identifier, the at least one warehouse identifier and the identifier of the current server set.
In some embodiments, the above apparatus further comprises: the inventory result message analyzing unit is used for analyzing inventory result messages generated by other server sets and determining other inventory quantities of the articles indicated by the article identifiers in the warehouse counted by other server sets; a stock quantity comparing unit for comparing each of the other stock quantities and a current stock quantity counted by the current server set, and determining whether there is a difference between each of the other stock quantities and the current stock quantity; and a difference response unit for displaying the stock quantity with difference in response to the difference.
In some embodiments, the difference response unit is further configured to: and responding to the difference, alarming and sending the different inventory to a preset contact way.
In a third aspect, an embodiment of the present application provides a server, including: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method described in any of the above embodiments.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method described in any of the above embodiments.
According to the method and the device for determining the inventory of the articles for the server system, when each server set receives an order confirmation request, the article identification included in the order confirmation request is determined, then an inventory statistics message is generated based on the article identification, the inventory statistics message is sent to the processing server, so that the processing server sends the inventory statistics message to other server sets, then the current server set counts the inventory amount of the articles indicated by the article identification in the warehouse, an inventory result message is generated, then the inventory result message is sent to the processing server, and meanwhile the inventory result message sent by the processing server and generated by other server sets is received. According to the method provided by the embodiment, when the inventory of the article in the order request processed by any one server set changes, the inventory of the article can be counted, and meanwhile, other server sets can simultaneously count the inventory of the article, so that the accurate counting of the inventory of the article is realized, the time for inventory counting is reduced on one hand, and the computing resources are saved on the other hand.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the present method for determining an inventory of items for a server system or an apparatus for determining an inventory of items for a server system may be applied.
As shown in fig. 1, the system architecture 100 may include a processing server 101, a set of servers 1021, 1022, 1023, terminal devices 1031, 1032, and a network (not shown in fig. 1). The network is a medium used to provide communication links between the processing server 101 and the server sets 1021, 1022, and 1023, and between the server sets 1021, 1022, and 1023 and the terminal devices 1031 and 1032. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 1031, 1032 to interact with the server sets 1021, 1022, 1023 over the network to send various requests, etc. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 1031, 1032 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like.
The server sets 1021, 1022, 1023 can be server sets that process various types of order requests, which can take items from the same warehouse for further shipping, etc. Therefore, the inventory statistics for the same item should be the same for each server set 1021, 1022, 1023.
The processing server 105 may be a server that provides various services, such as a backend server that broadcasts messages sent by the respective server sets 1021, 1022, 1023. The backend server may process or resend the received message.
It should be noted that, the method for determining inventory of items for a server system provided in the embodiment of the present application is generally performed by each server set 1021, 1022, and 1023, and accordingly, the apparatus for determining inventory of items for a server system is generally disposed in the server sets 1021, 1022, and 1023.
It should be understood that the number of terminal devices, server sets, and processing servers in fig. 1 are merely illustrative. There may be any number of terminal devices, server sets, and processing servers, as desired for an implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for a server system to determine an inventory of items is shown, in accordance with the present application. The method for determining the inventory of the articles for the server system comprises the following steps:
step 201, when an order confirmation request is received, determining an item identifier included in the order confirmation request.
In the present embodiment, the electronic device (e.g., the server set shown in fig. 1) on which the method for determining an inventory of items for the server system operates may receive an order confirmation request from a terminal with which a user makes a purchase of an item through a wired connection manner or a wireless connection manner. The order confirmation request includes an item identifier of an item purchased by the user. The article identifier may be a bar code of a package of the article, or may be an identification code set for the article to facilitate inventory management of the article.
It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Step 202, generating an inventory statistics message based on the item identifier.
After determining the item identifier included in the order confirmation request, each server set may generate an inventory statistics message based on the item identifier. The inventory statistics message is used for enabling other server sets to carry out statistics on the inventory of the item indicated by the item identification.
In some optional implementation manners of this embodiment, when generating the inventory statistics message, the warehouse identifier of at least one warehouse to which the article indicated by the article identifier belongs may be determined first, and then the inventory statistics message may be generated according to the article identifier and the at least one warehouse identifier.
When the stock of a certain article is large, the article can be stored in a plurality of warehouses, each warehouse is provided with a warehouse identification, and the server set can only count the stock of the article in a certain warehouse, so that the stock statistics is more targeted, and meanwhile, the efficiency of the stock statistics is improved.
Step 203, sending the inventory statistics message to the processing server, so that the processing server sends the inventory statistics message to other server sets.
After the server set generates the inventory statistics message, the server set may send the inventory statistics message to the processing server. After receiving the inventory statistics message, the processing server may send the inventory statistics message to other server sets in a broadcast manner, so that the other server sets perform statistics on the inventory of the item indicated by the item identifier included in the inventory statistics message after receiving the inventory statistics message.
And step 204, counting the inventory quantity of the articles indicated by the article identifiers in the warehouse and generating an inventory result message.
After the current server set sends the inventory statistics message to the processing server, the current server set may perform statistics on the inventory of the items indicated by the item identifiers stored in the warehouse, and then generate an inventory result message based on the inventory obtained through statistics.
In some optional implementations of this embodiment, when generating the inventory result message, the following steps not shown in fig. 2 may be implemented:
inquiring article identification in a preset article inventory statistics list, and determining the inventory corresponding to the article identification, wherein the article inventory statistics list comprises the inventory corresponding to each article identification; and generating an inventory result message according to the inventory amount, the item identifier, the at least one warehouse identifier and the identifier of the current server set.
In this implementation manner, each server set may set one item inventory statistics list, and the item identifier of each item and the inventory amount of the item are recorded in the item inventory statistics list. When inquiring the stock quantity of a certain item, the server set can directly inquire the item identifier of the item in the item stock statistical list and then determine the stock quantity. And then combining the stock quantity, the article identification, the warehouse identification of the warehouse to be counted and the identification of the current server set to generate an inventory result message.
Step 205, sending the inventory result message to the processing server, and receiving the inventory result message generated by the other server set sent by the processing server.
After generating the inventory result message, the server set may send the inventory result message to the processing server. In this way, the processing server may receive the inventory result messages sent by each server set, and then the processing server may send the inventory result statistics messages generated by at least one other server set to at least one server set.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for determining an inventory of an item for a server system according to the present embodiment. In the application scenario of fig. 3, the server set 1, after receiving the order confirmation request, determines the item identifier included in the order confirmation request, and then generates an inventory statistics message. And sends the inventory statistics message to the processing server 302, and the processing server 302 receives the inventory statistics message and sends the inventory statistics message to the server set 2 and the server set 3, respectively. Then, each server set respectively counts the stock quantity to respectively generate a stock result message 1, a stock result message 2 and a stock result message 3. The server sets respectively transmit the generated inventory result message to the processing server 2, and then the processing server transmits the inventory result message 2 and the inventory result message 3 to the server set 1.
In the method for determining the inventory of the item for the server system according to the embodiment of the application, when each server set receives an order confirmation request, the item identifier included in the order confirmation request is determined, then an inventory statistics message is generated based on the item identifier, the inventory statistics message is sent to the processing server, so that the processing server sends the inventory statistics message to other server sets, then the current server set counts the inventory amount of the item indicated by the item identifier in the warehouse, and generates an inventory result message, and then the inventory result message is sent to the processing server, and meanwhile, the inventory result message sent by the processing server and generated by other server sets is received. According to the method provided by the embodiment, when the inventory of the article in the order request processed by any one server set changes, the inventory of the article can be counted, and meanwhile, other server sets can simultaneously count the inventory of the article, so that the accurate counting of the inventory of the article is realized, the time for inventory counting is reduced on one hand, and the computing resources are saved on the other hand.
With continued reference to fig. 4, a flow 400 of another embodiment of a method for determining inventory of items for a server system according to the present application is shown. As shown in fig. 4, after the server set receives the inventory result message generated by the other server set sent by the processing server, steps 401 to 403 may be executed.
Step 401, analyzing the inventory result message generated by other server sets, and determining other inventory amounts of the item indicated by the item identifier in the warehouse counted by other server sets.
After receiving the inventory result message generated by the other server sets, the current server set may analyze the inventory result message to determine other inventory amounts of the item indicated by the item identifier in the warehouse counted by the other server sets.
Step 402, comparing the other stocks with the current stock counted by the current server set, and determining whether differences exist between the other stocks and the current stock.
And comparing the current inventory counted by the current server set with each other inventory counted by other server sets to determine whether the difference exists.
In response to the difference, the stock quantity of the difference is displayed, step 403.
When the stock quantities are different, the stock quantities with the difference can be displayed for further confirmation by workers. It is understood that, in the present embodiment, when the stock amounts are displayed, the entire stock amounts may be displayed while highlighting the stock amounts having a difference.
In some optional implementations of this embodiment, when it is determined that there is a difference between the stock amounts, an alarm may be issued to attract further attention of the staff, and the stock amounts with the difference may also be sent to a preset contact manner. The preset contact way can comprise a mobile phone, a mail and the like, and the staff is informed to process the difference in time.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the web page generation method in the present embodiment highlights the processing steps when there is a difference in the stock amounts. Therefore, the scheme described in the embodiment can realize more accurate statistics of the inventory of each article, and provide accurate inventory information for the shopping website.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for determining an inventory of an item for a server system, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices.
The server system of the present embodiment includes a processing server and a plurality of server sets, each of which processes one type of order request. As shown in fig. 5, the apparatus 500 for determining an inventory of an item for a server system of the present embodiment includes: an item identification determination unit 501, an inventory statistics message generation unit 502, an inventory statistics message transmission unit 503, an inventory result message generation unit 504, and an inventory result message transmission unit 505.
The item identifier determining unit 501 is configured to determine an item identifier included in an order confirmation request when the order confirmation request is received.
An inventory statistics message generating unit 502 is configured to generate an inventory statistics message based on the item identifier.
An inventory statistics message sending unit 503, configured to send an inventory statistics message to the processing server, so that the processing server sends the inventory statistics message to other server sets.
An inventory result message generating unit 504, configured to count the inventory amount of the item indicated by the item identifier in the warehouse, and generate an inventory result message.
An inventory result message sending unit 505, configured to send an inventory result message to the processing server, and receive an inventory result message generated by the other server set sent by the processing server.
In some optional implementations of this embodiment, the inventory statistics message generating unit 502 may be further configured to: determining a warehouse identifier of at least one warehouse to which the article indicated by the article identifier belongs; and generating inventory statistical information according to the article identifier and the at least one warehouse identifier.
In some optional implementations of this embodiment, the inventory result message generating unit 504 may further include an inventory amount determining module and an inventory result message generating module, which are not shown in fig. 5.
The inventory determining module is used for inquiring the article identifier in a preset article inventory statistics list and determining the inventory corresponding to the article identifier.
The item inventory statistics list comprises inventory corresponding to each item identifier.
And the stock result message generating module is used for generating the stock result message according to the stock quantity, the article identifier, the at least one warehouse identifier and the identifier of the current server set.
In some optional implementations of this embodiment, the apparatus 500 may further include an inventory result message parsing unit, an inventory quantity comparison unit, and a difference response unit, which are not shown in fig. 5.
The inventory result message analyzing unit is used for analyzing inventory result messages generated by other server sets and determining other inventory quantities of the articles indicated by the article identifiers in the warehouse counted by other server sets.
And the inventory comparison unit is used for comparing other inventories with the current inventory counted by the current server set and determining whether differences exist among the other inventories and between the other inventories and the current inventory.
And a difference response unit for displaying the stock quantity with difference in response to the difference.
In some optional implementations of this embodiment, the difference response unit may be further configured to: and responding to the difference, alarming and sending the different inventory to a preset contact way.
The apparatus for determining an inventory of an item in a server system according to the above embodiment of the present application determines an item identifier included in an order confirmation request when each server set receives the order confirmation request, generates an inventory statistics message based on the item identifier, sends the inventory statistics message to a processing server, so that the processing server sends the inventory statistics message to another server set, then the current server set counts the inventory amount of the item indicated by the item identifier in a warehouse, generates an inventory result message, sends the inventory result message to the processing server, and receives the inventory result message sent by the processing server and generated by another server set. The device provided by the embodiment can count the inventory of the article when the inventory of the article in the order request processed by any one server set changes, and simultaneously, other server sets can count the inventory of the article at the same time, so that the accurate counting of the inventory of the article is realized, the time of inventory counting is reduced on one hand, and the computing resource is saved on the other hand.
It should be understood that units 501 to 505, respectively, recited in the apparatus 500 for determining an inventory of items for a server system correspond to respective steps in the method described with reference to fig. 2. Thus, the operations and features described above with respect to the method for determining an inventory of items for a server system are equally applicable to the apparatus 500 and the units included therein and will not be described again here. The corresponding elements of the apparatus 500 may cooperate with elements in a server to implement aspects of embodiments of the present application.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a server according to embodiments of the present application. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 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. The driver 610 is also connected to the 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 necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an item identification determination unit, an inventory statistics message generation unit, an inventory statistics message transmission unit, an inventory result message generation unit, and an inventory result message transmission unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the item identification determination unit may also be described as "a unit that determines an item identification included in an order confirmation request when the order confirmation request is received".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: when an order confirmation request is received, determining an article identifier included in the order confirmation request; generating an inventory statistic message based on the article identification; sending inventory statistics information to a processing server so that the processing server sends the inventory statistics information to other server sets; counting the inventory of the articles indicated by the article identifiers in the warehouse and generating an inventory result message; and sending the inventory result message to the processing server, and receiving the inventory result message generated by the other server set sent by the processing server.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.