CN111292028A - Inventory information processing method and system, computer system and readable storage medium - Google Patents

Inventory information processing method and system, computer system and readable storage medium Download PDF

Info

Publication number
CN111292028A
CN111292028A CN201811490672.XA CN201811490672A CN111292028A CN 111292028 A CN111292028 A CN 111292028A CN 201811490672 A CN201811490672 A CN 201811490672A CN 111292028 A CN111292028 A CN 111292028A
Authority
CN
China
Prior art keywords
database
inventory
target product
type
transaction
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201811490672.XA
Other languages
Chinese (zh)
Inventor
李腾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811490672.XA priority Critical patent/CN111292028A/en
Publication of CN111292028A publication Critical patent/CN111292028A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The present disclosure provides an inventory information processing method, including: obtaining an updating operation; in response to the updating operation, updating the original inventory information of the target product stored in the first type database to obtain the updated inventory information of the target product; and transmitting the updated inventory information of the target product to a second type database so as to update the inventory information of the target product stored in the second type database, wherein the second type database is used for responding to the transaction operation when the target product is transacted. The present disclosure also provides an inventory information processing system, a computer system, and a computer-readable storage medium.

Description

Inventory information processing method and system, computer system and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an inventory information processing method and system, a computer system, and a computer-readable storage medium.
Background
With the continuous development of the technology, users can trade different products through the online trading platform. In order to ensure sufficient inventory, the product provider on the trading platform generally needs to know the actual specific inventory of the product, and in general, the corresponding inventory information needs to be disclosed on the trading platform. However, as the transaction is always in progress, especially for 618, twenty-one and the like concurrent transaction scenarios, the inventory information on the transaction platform is also changing continuously, and the inventory information change rate is generally in the order of seconds.
In the process of implementing the invention, the inventor finds that: when the related technology is adopted to update the original inventory information, resource competition can be generated with the response transaction operation, so that the processing capacity of the system cannot meet the high concurrency scene, and the inventory information can be changed in different time and effectively.
Disclosure of Invention
In view of the above, the present disclosure provides an inventory information processing method and system, a computer system, and a computer-readable storage medium.
One aspect of the present disclosure provides an inventory information processing method, including: obtaining an updating operation; in response to the updating operation, updating the original inventory information of the target product stored in the first type database to obtain the updated inventory information of the target product; and transmitting the updated inventory information of the target product to a second type database so as to update the inventory information of the target product stored in the second type database, wherein the second type database is used for responding to transaction operation when the target product is transacted.
According to an embodiment of the present disclosure, the first type database is a relational database, and the second type database is a memory database.
According to an embodiment of the present disclosure, the method further includes: acquiring a transaction operation for trading the target product; responding to the trading operation, generating a trading order and determining the trading quantity of the target product in the trading order; and subtracting the transaction amount from the stock amount of the target product stored in the second type database.
According to an embodiment of the present disclosure, after subtracting the transaction amount from the stock amount of the target product stored in the second type database, the method further includes: judging whether the transaction operation is successful or not; under the condition that the transaction is successful, transmitting the transaction amount to the first type database so as to update the current stock of the target product in the first type database; and under the condition that the transaction fails, restoring the current stock quantity of the target product in the second type database to the stock quantity before subtracting the transaction quantity.
According to an embodiment of the present disclosure, wherein: when the first type database is a relational database, the relational database stores the inventory information of the target product in a table field mode, wherein the table field at least comprises product identification information, inventory types and inventory quantities; and under the condition that the second type database is a memory database, the memory database stores the inventory information of the target product in a hash table form and/or an ordered set type, wherein the hash table at least comprises product identification information, order identification information and inventory quantity, and the ordered set type at least comprises the product identification information, the order identification information and time stamp information generated by the order.
Another aspect of the present disclosure provides an inventory information processing system, including: the first acquisition module is used for acquiring the updating operation; the first response module is used for responding to the updating operation, updating the original inventory information of the target product stored in the first type database, and obtaining the updated inventory information of the target product; and a first transmission module, configured to transmit the updated inventory information of the target product to a second type database, so as to update the inventory information of the target product stored in the second type database, where the second type database is used to respond to a transaction operation when the target product is transacted.
According to an embodiment of the present disclosure, the first type database is a relational database, and the second type database is a memory database.
According to an embodiment of the present disclosure, the above system further includes: the second acquisition module is used for acquiring transaction operation for trading the target product; the second response module is used for responding to the transaction operation, generating a transaction order and determining the transaction quantity of the target product in the transaction order; and a first calculation module for subtracting the transaction amount from the stock amount of the target product stored in the second type database.
According to an embodiment of the present disclosure, the above system further includes: the judging module is used for judging whether the transaction operation is successful after subtracting the transaction quantity from the stock quantity of the target product stored in the second type database; the second transmission module is used for transmitting the transaction quantity to the first type database under the condition that the transaction is successful so as to update the current stock of the target product in the first type database; and a second calculation module, configured to, in the case that the transaction fails, restore the current inventory level of the target product in the second type database to the inventory level before subtracting the transaction amount.
According to an embodiment of the present disclosure, wherein: when the first type database is a relational database, the relational database stores the inventory information of the target product in a table field mode, wherein the table field at least comprises product identification information, inventory types and inventory quantities; and under the condition that the second type database is a memory database, the memory database stores the inventory information of the target product in a hash table form and/or an ordered set type, wherein the hash table at least comprises product identification information, order identification information and inventory quantity, and the ordered set type at least comprises the product identification information, the order identification information and time stamp information generated by the order.
Another aspect of the present disclosure provides a computer system comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the inventory information processing method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the inventory information processing method as described above.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions for implementing the inventory information processing method as described above when executed.
According to the embodiment of the disclosure, the technical means that the inventory information of the product is respectively stored in two different types of databases, the first type of database is used for updating the original inventory information, the updated inventory information of the product is transmitted to the second type of database, and the second type of database is used for responding to the transaction operation during the transaction of the product are adopted, so that the updating of the original inventory information and the responding to the transaction operation are respectively carried out in different databases, and therefore, the condition of resource competition cannot be generated, the system processing capacity can meet high concurrency scenes, the technical problem that the inventory information cannot be timely and effectively changed due to the fact that the system processing capacity cannot meet the high concurrency scenes is at least partially solved, the purpose of timely changing the inventory information is further achieved, and the technical effect of the system concurrency processing capacity is improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture to which the inventory information processing method and system may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of an inventory information processing method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow diagram of an inventory information processing method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram of an inventory information processing method according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow diagram of an inventory information processing method according to another embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of an inventory information processing system, in accordance with an embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of an inventory information processing system according to another embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of an inventory information processing system, according to another embodiment of the present disclosure; and
FIG. 9 schematically shows a block diagram of a computer system suitable for implementing the above described method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides an inventory information processing method, which includes obtaining an updating operation; in response to the updating operation, updating the original inventory information of the target product stored in the first type database to obtain the updated inventory information of the target product; and transmitting the updated inventory information of the target product to a second type database so as to update the inventory information of the target product stored in the second type database, wherein the second type database is used for responding to the transaction operation when the target product is transacted. The present disclosure also provides an inventory information processing system, a computer system, and a computer-readable storage medium.
Fig. 1 schematically illustrates an exemplary system architecture to which the inventory information processing method and system may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include a first type database 101 and a second type database 102.
The first type database 101 may obtain the inventory information of different products through an external interface, and monitor whether the first type database obtains an operation of updating the inventory information, for example, an operation of adding new inventory for adding inventory or an operation of reducing inventory. The first-type database 101 may update the original inventory information of the target product stored in the first-type database 101 in response to the update operation.
The second-type database 102 is mainly used for responding to a trading operation when trading a target product, for example, after a user places an order, determining the number of products included in the order, and then subtracting the required number of products in the order from the stock amount stored in the second-type database 102.
According to an embodiment of the present invention, information may be transferred between the first type database 101 and the second type database 102. For example, the original inventory information in the first type database 101 is synchronized to the second type database 102 at the time of the product preparation transaction. When the first-type database 101 has an additional stock, it can be asynchronously updated to the second-type database 102 by a timing task. When the order transaction in the second type database 102 is successful, the order transaction can be asynchronously updated to the first type database 101 through the timing task.
According to the embodiment of the disclosure, the technical means that the inventory information of the product is respectively stored in two different types of databases, the first type of database is used for updating the original inventory information, the updated inventory information of the product is transmitted to the second type of database, and the second type of database is used for responding to the transaction operation during the transaction of the product are adopted, so that the updating of the original inventory information and the responding to the transaction operation are respectively carried out in different databases, and therefore, the condition of resource competition cannot be generated, the system processing capacity can meet high concurrency scenes, the technical problem that the inventory information cannot be timely and effectively changed due to the fact that the system processing capacity cannot meet the high concurrency scenes is at least partially solved, the purpose of timely changing the inventory information is further achieved, and the technical effect of the system concurrency processing capacity is improved.
It should be understood that the number of first type databases, second type databases, and networks in fig. 1 is merely illustrative. There may be any number, as desired for implementation.
Fig. 2 schematically shows a flow chart of an inventory information processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S230.
In operation S210, an update operation is acquired.
In operation S220, in response to the update operation, the original inventory information of the target product stored in the first type database is updated, so as to obtain updated inventory information of the target product.
According to an embodiment of the present disclosure, the update operation may be a new stock operation that adds the stock quantity, or may be a stock reduction operation for reducing the stock quantity. For example, the number of the vacuum cups stored in the first type database is increased from 100 to 200, or the number of the vacuum cups stored in the first type database is reduced from 500 to 250.
In operation S230, the updated inventory information of the target product is transmitted to a second-type database, so that the inventory information of the target product stored in the second-type database is updated, wherein the second-type database is used for responding to a transaction operation when the target product is transacted.
According to an embodiment of the present disclosure, after the first type database updates the original inventory information of the target product, the original inventory information may be asynchronously updated into the second type database by a timed task.
According to an embodiment of the present disclosure, the first type database is a relational database, and the second type database is an in-memory database.
According to the embodiment of the disclosure, the second type database adopts a memory database, such as a redis cache database, and since the transaction operation in the process of transacting the target product generally occurs in a high concurrency scenario, the performance of redis operation in the concurrency scenario is higher than that in a relational database, and the incremean operation of redis supports atomic transactions, the processing efficiency of operating the inventory information can be effectively improved on the premise of ensuring data security.
According to the embodiment of the disclosure, the technical means that the inventory information of the product is respectively stored in two different types of databases, the first type of database is used for updating the original inventory information, the updated inventory information of the product is transmitted to the second type of database, and the second type of database is used for responding to the transaction operation during the transaction of the product are adopted, so that the updating of the original inventory information and the responding to the transaction operation are respectively carried out in different databases, and therefore, the condition of resource competition cannot be generated, the system processing capacity can meet high concurrency scenes, the technical problem that the inventory information cannot be timely and effectively changed due to the fact that the system processing capacity cannot meet the high concurrency scenes is at least partially solved, the purpose of timely changing the inventory information is further achieved, and the technical effect of the system concurrency processing capacity is improved.
The method shown in fig. 2 is further described with reference to fig. 3-5 in conjunction with specific embodiments.
Fig. 3 schematically shows a flowchart of an inventory information processing method according to another embodiment of the present disclosure.
As shown in fig. 3, the method further includes operations S240 to S260.
In operation S240, a trading operation for trading a target product is acquired.
In operation S250, a trade order is generated in response to the trading operation, and a trading amount of the target product in the trade order is determined.
In operation S260, the inventory amount of the target product stored in the second type database is subtracted by the transaction amount.
According to the embodiment of the present disclosure, for example, when the user places an order, 5 pieces of clothes are traded in the order, and if the original inventory amount of clothes in the second type database is 10 pieces, the current inventory amount of clothes in the second type database is 5 pieces after subtracting the trading amount of 5 pieces.
According to the embodiment of the disclosure, taking the second type database as the redis cache database as an example, the operation performance of the redis cache database is much higher than that of the relational database in a concurrent scene, and the operation of the memory database supports atomic transactions, so that the efficiency of operating the inventory information is greatly improved on the premise of ensuring data security.
Fig. 4 schematically shows a flowchart of an inventory information processing method according to another embodiment of the present disclosure.
As shown in fig. 4, after subtracting the transaction amount from the stock amount of the target product stored in the second type database, the method includes operations S270 to S290.
In operation S270, it is determined whether the transaction operation is successful.
In operation S280, in case that the transaction is successful, the transaction amount is transmitted to the first type database to update the current inventory amount of the target product in the first type database.
According to the embodiment of the disclosure, the identification of the successful transaction can be that the user makes an order and completes the transaction, or that the user completes the online payment, and the like.
According to the embodiment of the disclosure, in the case of successful transaction, the number of the successfully transacted products can be transmitted to the first type database in a multithread processing manner, and the current inventory of the target products in the first type database is updated. Because the data is transmitted to the first type database in a multithread processing mode, the processing time is short, the data volume processed each time is much smaller, and the response efficiency of the database can be improved.
In operation S290, in case of a failure of the transaction, the current inventory amount of the target product in the second type database is restored to the inventory amount before subtracting the transaction amount.
According to the embodiment of the disclosure, the identification of the transaction failure may be that the user has not paid for the transaction due to time-out, or that the user has cancelled an order, the transaction amount is reduced, and the like.
According to the embodiment of the disclosure, in case of a failure of the transaction, the current inventory amount of the target product in the second type database may be directly restored to the inventory amount before subtracting the transaction amount, for example, when the user places an order, 2 trousers are traded in the order, and if the original inventory amount of the trousers in the second type database is 20, after subtracting the transaction amount by 2, the current inventory amount of the trousers in the second type database is 18. In the event of a transaction failure, such as a user not paying for a timeout, the current inventory of 18 pants in the second type of database is restored to 20. In this case, information on the change of the stock due to ordering does not need to be sent to the first type database, and the number of responses of the first type database is reduced.
According to an embodiment of the present disclosure, in a case where the first type database is a relational database, the relational database stores inventory information of the target product in a table field, wherein the table field includes at least product identification information, an inventory type, and an inventory amount.
In a relational database, according to embodiments of the present disclosure, the table structure design may be in the form of table 1 below.
TABLE 1
Figure BDA0001894527650000101
According to an embodiment of the present disclosure, the product identification information may be a product ID, and the inventory types include unsynchronized inventory and synchronized inventory, wherein unsynchronized inventory refers to not transferring updated inventory information to the second type database either synchronously or asynchronously.
According to the embodiment of the disclosure, under the condition that the second type database is a memory database, the memory database stores the inventory information of the target product in a hash table form and/or an ordered set type, wherein the hash table at least comprises product identification information, order identification information and inventory quantity, and the ordered set type at least comprises the product identification information, the order identification information and timestamp information generated by the order.
According to an embodiment of the present disclosure, the hash table form (hash type) may be the following form:
key: product ID + "_" + order number; value: the amount of inventory.
According to an embodiment of the present disclosure, the ordered collection type (sortedSet type) may be in the form of:
key: a product ID; value: order number, time stamp 1 of order generation, orderId1, time stamp 2, orderId2 … …
According to the embodiment of the disclosure, when the stock quantity is deleted, the stock quantity in the hash structure can be deleted according to the ware ID and the order number, the order number in the sortedSet structure is deleted, and the stock information in the hash structure is written into the sold stock information. When the inventory is recovered, all orders with score < the current timestamp-10 minutes in a polling sortedSet structure can be adopted and deleted; and deleting the stock information with the hash structure according to the order number deleted from the sortedSet, and recycling the stock information into the stock to be sold in the second type database.
Fig. 5 schematically shows a flowchart of an inventory information processing method according to another embodiment of the present disclosure.
As shown in fig. 5, the first type database is a relational database, and the second type database is an in-memory database. In a relational database, the raw inventory may be the total amount of all unsold inventory, including inventory that has been synchronized to and unsynchronized in the in-memory database.
According to embodiments of the present disclosure, the product inventory status may be divided into three states: available, locked, sold. Wherein, when the inventory is locked, the sold inventory can be divided into a plurality of shares, each share is associated with a corresponding order number, and the available inventory is associated with a certain type of goods (SKU) in the memory database. In the initial state, the locked inventory and sold inventory are empty.
According to the embodiment of the disclosure, when the relational database is monitored to have unsynchronized inventory information, the newly added inventory operation is executed, and the inventory information can be added to the available inventory. The inventory information is then deleted from the unsynchronized inventory and added to the synchronized inventory.
According to the embodiment of the disclosure, when placing an order, the inventory can be locked in the inventory database, and the inventory information bound by the order is deleted from the available inventory and added to the locked inventory.
According to embodiments of the present disclosure, in the event that the transaction is successful, e.g., after payment, the inventory bound to the order is removed from the locked inventory and added to the sold inventory (in-memory database).
According to embodiments of the present disclosure, in the event of a transaction failure, such as unpaid over time, inventory is reclaimed, inventory bound to the order over time is removed from locked inventory and added to available inventory, i.e., restored to the pre-transaction inventory information.
According to the embodiment of the present disclosure, sold inventory (memory type database) in the cache can be synchronized to the relational database at regular time, that is, sold inventory is deleted from the memory type database, and other two steps are performed at the same time: the corresponding sold inventory is added to the sold inventory (relational database) and subtracted from the synchronized inventory of the original inventory.
According to the embodiment of the disclosure, the technical means that the inventory information of the product is respectively stored in two different types of databases, the first type of database is used for updating the original inventory information, the updated inventory information of the product is transmitted to the second type of database, and the second type of database is used for responding to the transaction operation during the transaction of the product are adopted, so that the updating of the original inventory information and the responding to the transaction operation are respectively carried out in different databases, and therefore, the condition of resource competition cannot be generated, the system processing capacity can meet high concurrency scenes, the technical problem that the inventory information cannot be timely and effectively changed due to the fact that the system processing capacity cannot meet the high concurrency scenes is at least partially solved, the purpose of timely changing the inventory information is further achieved, and the technical effect of the system concurrency processing capacity is improved.
FIG. 6 schematically shows a block diagram of an inventory information processing system according to an embodiment of the disclosure.
As shown in fig. 6, the inventory information processing system 500 includes a first acquisition module 510, a first response module 520, and a first transmission module 530.
The first obtaining module 510 is used for obtaining an update operation.
The first response module 520 is configured to update the original inventory information of the target product stored in the first type database in response to the update operation, so as to obtain updated inventory information of the target product.
The first transmission module 530 is configured to transmit the updated inventory information of the target product to a second type database, so as to update the inventory information of the target product stored in the second type database, where the second type database is used for responding to a transaction operation when the target product is transacted.
According to the embodiment of the disclosure, the technical means that the inventory information of the product is respectively stored in two different types of databases, the first type of database is used for updating the original inventory information, the updated inventory information of the product is transmitted to the second type of database, and the second type of database is used for responding to the transaction operation during the transaction of the product are adopted, so that the updating of the original inventory information and the responding to the transaction operation are respectively carried out in different databases, and therefore, the condition of resource competition cannot be generated, the system processing capacity can meet high concurrency scenes, the technical problem that the inventory information cannot be timely and effectively changed due to the fact that the system processing capacity cannot meet the high concurrency scenes is at least partially solved, the purpose of timely changing the inventory information is further achieved, and the technical effect of the system concurrency processing capacity is improved.
According to an embodiment of the present disclosure, the first type database is a relational database, and the second type database is an in-memory database.
According to the embodiment of the disclosure, the second type database adopts a memory database, such as a redis cache database, and since the transaction operation in the process of transacting the target product generally occurs in a high concurrency scenario, the performance of redis operation in the concurrency scenario is higher than that in a relational database, and the incremean operation of redis supports atomic transactions, the processing efficiency of operating the inventory information can be effectively improved on the premise of ensuring data security.
FIG. 7 schematically illustrates a block diagram of an inventory information processing system according to another embodiment of the present disclosure.
As shown in FIG. 7, the inventory information processing system 500 further includes a second acquisition module 540, a second response module 550, and a first calculation module 560.
The second obtaining module 540 is used for obtaining the transaction operation for the transaction target product.
The second response module 550 is configured to generate a trade order in response to the trade operation and determine a trade amount of the target product in the trade order. And
the first calculation module 560 is used to subtract the transaction amount from the inventory amount of the target product stored in the second type database.
According to the embodiment of the disclosure, taking the second type database as the redis cache database as an example, the operation performance of the redis cache database is much higher than that of the relational database in a concurrent scene, and the operation of the memory database supports atomic transactions, so that the efficiency of operating the inventory information is greatly improved on the premise of ensuring data security.
FIG. 8 schematically illustrates a block diagram of an inventory information processing system, according to another embodiment of the present disclosure.
As shown in fig. 8, the inventory information processing system 500 further includes a determination module 570, a second transmission module 580, and a second calculation module 590.
The judging module 570 is used for judging whether the trading operation is successful after subtracting the trading amount from the stock quantity of the target product stored in the second type database.
The second transmitting module 580 is configured to transmit the transaction amount to the first type database in case of successful transaction, so as to update the current inventory amount of the target product in the first type database.
The second calculating module 590 is configured to, in case of a failure of the transaction, restore the current inventory of the target product in the second type database to the inventory before subtracting the transaction amount.
According to the embodiment of the disclosure, in the case of successful transaction, the number of the successfully transacted products can be transmitted to the first type database in a multithread processing manner, and the current inventory of the target products in the first type database is updated. Because the data is transmitted to the first type database in a multithread processing mode, the processing time is short, the data volume processed each time is much smaller, and the response efficiency of the database can be improved.
According to an embodiment of the present disclosure, in a case where the first type database is a relational database, the relational database stores inventory information of the target product in a table field, wherein the table field includes at least product identification information, an inventory type, and an inventory amount.
According to the embodiment of the disclosure, under the condition that the second type database is a memory database, the memory database stores the inventory information of the target product in a hash table form and/or an ordered set type, wherein the hash table at least comprises product identification information, order identification information and inventory quantity, and the ordered set type at least comprises the product identification information, the order identification information and timestamp information generated by the order.
According to the embodiment of the disclosure, when the stock quantity is deleted and recovered, the information in different data formats can be processed, and the stock can be deleted or recovered to the stock to be sold in the second type database, so that the information processing efficiency is improved.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the first obtaining module 510, the first responding module 520, the first transmitting module 530, the second obtaining module 540, the second responding module 550, the first calculating module 560, the judging module 570, the second transmitting module 580 and the second calculating module 590 may be combined into one module/unit/sub-unit to be implemented, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to the embodiment of the present disclosure, at least one of the first obtaining module 510, the first responding module 520, the first transmitting module 530, the second obtaining module 540, the second responding module 550, the first calculating module 560, the determining module 570, the second transmitting module 580, and the second calculating module 590 may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementation manners of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the first obtaining module 510, the first responding module 520, the first transmitting module 530, the second obtaining module 540, the second responding module 550, the first calculating module 560, the judging module 570, the second transmitting module 580 and the second calculating module 590 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
FIG. 9 schematically shows a block diagram of a computer system suitable for implementing the above described method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 9 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 9, a computer system 600 according to an embodiment of the present disclosure includes a processor 601, which 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. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the system 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 600 may also include an input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604. The system 600 may also include one or more of the following components 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.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure 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 computer readable storage medium, the computer program containing program code for performing the method illustrated by 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, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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), 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 disclosure, 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.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
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 disclosure. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (12)

1. An inventory information processing method, comprising:
obtaining an updating operation;
in response to the updating operation, updating original inventory information of the target product stored in the first type database to obtain updated inventory information of the target product; and
transmitting the updated inventory information of the target product to a second type database so as to update the inventory information of the target product stored in the second type database, wherein the second type database is used for responding to transaction operation when the target product is transacted.
2. The method of claim 1, wherein the first type of database is a relational database and the second type of database is an in-memory database.
3. The method of claim 2, wherein the method further comprises:
acquiring a transaction operation for trading the target product;
generating a trading order in response to the trading operation, and determining the trading quantity of the target product in the trading order; and
subtracting the transaction amount from the inventory amount of the target product stored in the second type database.
4. The method of claim 2, wherein after subtracting the transaction amount from the inventory amount of the target product stored in the second type of database, the method further comprises:
judging whether the transaction operation is successful or not;
transmitting the transaction amount to the first type database to update the current inventory amount of the target product in the first type database under the condition that the transaction is successful; and
and in the case of failure of the transaction, restoring the current inventory of the target product in the second type database to the inventory before subtracting the transaction quantity.
5. The method of claim 2, wherein:
under the condition that the first type database is a relational database, the relational database stores the inventory information of the target product in a table field mode, wherein the table field at least comprises product identification information, inventory types and inventory quantities;
and under the condition that the second type database is a memory database, the memory database stores the inventory information of the target product in a hash table form and/or an ordered set type, wherein the hash table at least comprises product identification information, order identification information and inventory quantity, and the ordered set type at least comprises the product identification information, the order identification information and timestamp information generated by the order.
6. An inventory information processing system, comprising:
the first acquisition module is used for acquiring the updating operation;
the first response module is used for responding to the updating operation, updating original inventory information of the target product stored in the first type database, and obtaining updated inventory information of the target product; and
the first transmission module is used for transmitting the updated inventory information of the target product to a second type database so as to update the inventory information of the target product stored in the second type database, wherein the second type database is used for responding to the transaction operation when the target product is transacted.
7. The system of claim 6, wherein the first type of database is a relational database and the second type of database is an in-memory database.
8. The system of claim 7, wherein the system further comprises:
the second acquisition module is used for acquiring transaction operation for trading the target product;
the second response module is used for responding to the trading operation, generating a trading order and determining the trading quantity of the target product in the trading order; and
a first calculation module for subtracting the transaction amount from the inventory amount of the target product stored in the second type database.
9. The system of claim 7, wherein the system further comprises:
the judging module is used for judging whether the transaction operation is successful after subtracting the transaction quantity from the inventory quantity of the target product stored in the second type database;
the second transmission module is used for transmitting the transaction amount to the first type database under the condition that the transaction is successful so as to update the current stock of the target product in the first type database; and
and the second calculation module is used for restoring the current stock of the target product in the second type database to the stock before subtracting the transaction quantity under the condition that the transaction fails.
10. The system of claim 7, wherein:
under the condition that the first type database is a relational database, the relational database stores the inventory information of the target product in a table field mode, wherein the table field at least comprises product identification information, inventory types and inventory quantities;
and under the condition that the second type database is a memory database, the memory database stores the inventory information of the target product in a hash table form and/or an ordered set type, wherein the hash table at least comprises product identification information, order identification information and inventory quantity, and the ordered set type at least comprises the product identification information, the order identification information and timestamp information generated by the order.
11. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the inventory information processing method of any of claims 1 to 5.
12. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the inventory information processing method of any one of claims 1 to 5.
CN201811490672.XA 2018-12-06 2018-12-06 Inventory information processing method and system, computer system and readable storage medium Pending CN111292028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811490672.XA CN111292028A (en) 2018-12-06 2018-12-06 Inventory information processing method and system, computer system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811490672.XA CN111292028A (en) 2018-12-06 2018-12-06 Inventory information processing method and system, computer system and readable storage medium

Publications (1)

Publication Number Publication Date
CN111292028A true CN111292028A (en) 2020-06-16

Family

ID=71023097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811490672.XA Pending CN111292028A (en) 2018-12-06 2018-12-06 Inventory information processing method and system, computer system and readable storage medium

Country Status (1)

Country Link
CN (1) CN111292028A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113159680A (en) * 2021-04-19 2021-07-23 北京京东振世信息技术有限公司 Inventory pre-occupation method, device, electronic equipment and computer readable medium
CN113626451A (en) * 2021-07-28 2021-11-09 山东浪潮通软信息科技有限公司 Self-adaptive data updating method and device
CN114386904A (en) * 2022-01-05 2022-04-22 北京京东振世信息技术有限公司 Stock preemption method, device, server and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662193B1 (en) * 2000-06-02 2003-12-09 Cg4 Solutions, Inc. Methods and systems for manipulating a database through portable data entry devices
CN104794132A (en) * 2014-01-21 2015-07-22 阿里巴巴集团控股有限公司 Inventory information processing method and system
CN106021597A (en) * 2016-06-07 2016-10-12 中国建设银行股份有限公司 Data sheet updating method and system for account transactions
CN106599018A (en) * 2016-10-20 2017-04-26 乐视控股(北京)有限公司 Inventory operation method and system
CN106708975A (en) * 2016-12-06 2017-05-24 上海艾融软件股份有限公司 Commodity inventory information processing method and system
CN107248052A (en) * 2017-05-16 2017-10-13 上海艾融软件股份有限公司 A kind of commodity stocks information determines method, apparatus and system
US20170372264A1 (en) * 2016-06-27 2017-12-28 Mastercard Asia/Pacific Pte. Ltd. Inventory management server
CN107992517A (en) * 2017-10-26 2018-05-04 深圳市金立通信设备有限公司 A kind of data processing method, server and computer-readable medium
CN108133399A (en) * 2016-11-30 2018-06-08 北京京东尚科信息技术有限公司 The second of high concurrent fast-response kills the method, apparatus and system that inventory precisely reduces

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662193B1 (en) * 2000-06-02 2003-12-09 Cg4 Solutions, Inc. Methods and systems for manipulating a database through portable data entry devices
CN104794132A (en) * 2014-01-21 2015-07-22 阿里巴巴集团控股有限公司 Inventory information processing method and system
CN106021597A (en) * 2016-06-07 2016-10-12 中国建设银行股份有限公司 Data sheet updating method and system for account transactions
US20170372264A1 (en) * 2016-06-27 2017-12-28 Mastercard Asia/Pacific Pte. Ltd. Inventory management server
CN106599018A (en) * 2016-10-20 2017-04-26 乐视控股(北京)有限公司 Inventory operation method and system
CN108133399A (en) * 2016-11-30 2018-06-08 北京京东尚科信息技术有限公司 The second of high concurrent fast-response kills the method, apparatus and system that inventory precisely reduces
CN106708975A (en) * 2016-12-06 2017-05-24 上海艾融软件股份有限公司 Commodity inventory information processing method and system
CN107248052A (en) * 2017-05-16 2017-10-13 上海艾融软件股份有限公司 A kind of commodity stocks information determines method, apparatus and system
CN107992517A (en) * 2017-10-26 2018-05-04 深圳市金立通信设备有限公司 A kind of data processing method, server and computer-readable medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113159680A (en) * 2021-04-19 2021-07-23 北京京东振世信息技术有限公司 Inventory pre-occupation method, device, electronic equipment and computer readable medium
CN113159680B (en) * 2021-04-19 2023-11-03 北京京东振世信息技术有限公司 Inventory preemption method, apparatus, electronic device, and computer-readable medium
CN113626451A (en) * 2021-07-28 2021-11-09 山东浪潮通软信息科技有限公司 Self-adaptive data updating method and device
CN114386904A (en) * 2022-01-05 2022-04-22 北京京东振世信息技术有限公司 Stock preemption method, device, server and storage medium

Similar Documents

Publication Publication Date Title
US10929393B2 (en) Replica database query routing for database environments
CN108090058B (en) High-concurrency activity interaction method
CN109791471A (en) Virtualize the non-volatile memory device at peripheral unit
CN111427971B (en) Business modeling method, device, system and medium for computer system
CN102971711A (en) An apparatus for processing a batched unit of work
CN111292028A (en) Inventory information processing method and system, computer system and readable storage medium
WO2014186759A1 (en) Configurable data accumulators
WO2020052614A1 (en) Asset matching method, asset matching system, device and storage medium
US8429120B1 (en) System and method for distributed back-off in a database-oriented environment
US10776428B2 (en) Systems and methods of retrospectively determining how submitted data transaction requests operate against a dynamic data structure
DE102022129468A1 (en) IMPLEMENTATION OF OBJECT VERSIONING AND CONSISTENCY AT SCALING
CN110795447A (en) Data processing method, data processing system, electronic device, and medium
US20150120613A1 (en) Real-time trade forecaster
CN109597697A (en) A kind of resource brings processing method and processing device together
CN109472680A (en) A kind of accounting processing method and system
US20220091878A1 (en) Transaction Replacing Method, Transaction Queuing Method, Device, and Storage Medium
CN111897822A (en) Account state information processing method and device, electronic equipment and storage medium
US11816020B2 (en) Online query execution using a big data framework
CN110855770A (en) Message processing method and device, electronic equipment and computer readable storage medium
US9652766B1 (en) Managing data stored in memory locations having size limitations
CN114169997A (en) Deduction method and device
CN110795445B (en) Concurrent task processing method and device, server equipment and medium
CN113112255A (en) Distributed message processing method, apparatus, device, medium, and program product
CN106878369B (en) Service processing method and device
CN113094168A (en) Distributed training method, device and system of model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination