CN112416952B - Method, apparatus, readable storage medium for managing and synchronizing inventory data - Google Patents

Method, apparatus, readable storage medium for managing and synchronizing inventory data Download PDF

Info

Publication number
CN112416952B
CN112416952B CN202010776841.7A CN202010776841A CN112416952B CN 112416952 B CN112416952 B CN 112416952B CN 202010776841 A CN202010776841 A CN 202010776841A CN 112416952 B CN112416952 B CN 112416952B
Authority
CN
China
Prior art keywords
inventory
database
data
inventory data
server
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.)
Active
Application number
CN202010776841.7A
Other languages
Chinese (zh)
Other versions
CN112416952A (en
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202010776841.7A priority Critical patent/CN112416952B/en
Publication of CN112416952A publication Critical patent/CN112416952A/en
Application granted granted Critical
Publication of CN112416952B publication Critical patent/CN112416952B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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

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

Abstract

The application discloses a method, equipment and readable storage medium for managing and synchronizing inventory data, wherein the method for managing the inventory data comprises the following steps: after original inventory data in the commodity database are synchronized to the inventory database, when a first control instruction is received, a write switch and a read switch for the inventory database are turned on; updating inventory data in the inventory database according to the inventory update instructions when the inventory update instructions sent by the merchant server and/or the customer server are received; inquiring inventory data in the inventory database according to the inventory inquiry command when the inventory inquiry command sent by the merchant server and/or the client server is received; the method and the device can improve the efficiency of managing inventory data in a high concurrency scene.

Description

Method, apparatus, readable storage medium for managing and synchronizing inventory data
Technical Field
The present invention relates to the field of inventory management, and in particular, to a method, an apparatus, and a readable storage medium for managing and synchronizing inventory data.
Background
In the existing commodity inventory management system, commodity inventory data and other business data share the same commodity database, so that the commodity inventory data in the commodity database can be influenced by the other business data when a merchant server and/or a client server reads and writes the inventory data in the commodity database; in addition, in the existing commodity inventory management system, due to huge data volume, the read-write performance of the merchant server and/or the customer server on inventory data is also affected, especially during commodity sales promotion, the problems of abnormal system operation and low data read-write efficiency caused by that a plurality of servers read-write requests to the same database are caused under a high concurrency scene, and the situations of overstock and understock are caused.
Disclosure of Invention
The invention aims to provide a method, equipment and a readable storage medium for managing and synchronizing inventory data, which can improve the efficiency of managing inventory data in a high concurrency scene.
According to one aspect of the present application, there is provided a method of managing inventory data, applied to an inventory server in an inventory management system, the inventory management system further comprising: a merchant server, a customer server, a goods database, and an inventory database, the method comprising:
after original inventory data in the commodity database are synchronized to the inventory database, when a first control instruction is received, a write switch and a read switch for the inventory database are turned on;
updating inventory data in the inventory database according to the inventory update instructions when the inventory update instructions sent by the merchant server and/or the customer server are received;
and when receiving an inventory inquiry instruction sent by the merchant server and/or the client server, inquiring inventory data in the inventory database according to the inventory inquiry instruction.
Optionally, the raw inventory data includes: basic inventory data and incremental inventory data; wherein the basic inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in the process of synchronizing the basic inventory data.
Optionally, before the receiving the first control instruction, the method further includes:
after the basic inventory data in the commodity database are synchronized to the inventory database, when a second control instruction is received, a write switch for the commodity database and the inventory database is started, and a read switch for the commodity database is started;
when receiving an inventory update instruction sent by the client server, updating inventory data in the inventory database and the commodity database simultaneously according to the inventory update instruction;
and when receiving an inventory inquiry command sent by the client server, inquiring inventory data in the commodity database according to the inventory inquiry command.
Optionally, after the receiving the second control instruction and before the receiving the first control instruction, the method further includes:
after the incremental inventory data in the commodity database is synchronized to the inventory database, when a third control instruction is received, a write switch and a read switch for the commodity database are turned off.
In order to achieve the above object, the present application further provides a method for synchronizing inventory data, which is applied to an inventory management system, the inventory management system including: an inventory server, a commodity database and an inventory database, the method comprising:
receiving an inventory data synchronization instruction;
synchronizing the original inventory data in the commodity database to the inventory database;
and when the original inventory data is synchronous, sending a first control instruction to the inventory server so that the inventory server starts a write switch and a read switch for the inventory database.
Optionally, the raw inventory data includes: basic inventory data and incremental inventory data; wherein the basic inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in the process of synchronizing the basic inventory data.
Optionally, the synchronizing the original inventory data in the commodity database to the inventory database includes:
synchronizing base inventory data in the commodity database into the inventory database;
when the basic inventory data is finished synchronously, a second control instruction is sent to the inventory server, so that the inventory server starts a write switch for the commodity database and the inventory database and starts a read switch for the commodity database;
synchronizing incremental inventory data in the commodity database into the inventory database;
and when the incremental inventory data synchronization is completed, sending a third control instruction to the inventory server so that the inventory server closes a write switch and a read switch of the commodity database.
Optionally, before the sending the third control instruction to the inventory server, the method further includes:
judging whether inventory data in the commodity database and the inventory database are consistent;
if yes, a third control instruction is sent to the inventory server;
if not, correcting the inventory data in the inventory database according to the commodity database, and sending a third control instruction to the inventory server after the correction is completed.
In order to achieve the above object, the present application further provides a computer device, which specifically includes: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the method for managing inventory data and the method for synchronizing inventory data described above when executing the computer program.
To achieve the above object, the present application further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above-described method of managing inventory data and method of synchronizing inventory data.
The method, the device and the readable storage medium for managing and synchronizing inventory data provided by the application are characterized in that after the original inventory data in the commodity database are completely synchronized into the inventory database, a merchant server and/or a client server updates and/or inquires the inventory data in the inventory database through the inventory server. Because only the inventory data of the commodity is stored in the inventory database, and the inventory server is a server specially used for managing the inventory data, the separation of the business for managing the inventory data and other businesses can be realized, the problem of low efficiency in updating or inquiring the inventory data under a high concurrency scene is solved, the occurrence of the conditions of overstock and understock is avoided, and the stability of the inventory management system is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a schematic diagram showing the construction of an inventory management system according to a first embodiment;
FIG. 2 is a schematic diagram of a commodity database and an inventory database according to a first embodiment;
FIG. 3 is a schematic flow chart of an alternative method for managing inventory data according to the first embodiment;
FIG. 4 is a schematic diagram of data interaction during synchronizing incremental inventory data according to one embodiment;
FIG. 5 is a schematic diagram of data interaction after synchronization of original inventory data according to the first embodiment;
FIG. 6 is a schematic flow chart of an alternative method for synchronizing inventory data according to the second embodiment;
FIG. 7 is a schematic view showing an alternative constitution of an apparatus for managing inventory data according to the third embodiment;
FIG. 8 is a schematic diagram showing an alternative composition of an apparatus for synchronizing inventory data according to the fourth embodiment;
fig. 9 is a schematic diagram of an alternative hardware architecture of a computer device according to the fifth embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Example 1
The embodiment of the application provides a method for managing inventory data, which is applied to an inventory server 103 in an inventory management system 10 as shown in fig. 1, where the inventory management system 10 further includes: merchant server 101, customer server 102, merchandise database 104, and inventory database 105; the merchant server 101 is a server of the commodity provider, and the merchant may perform the following operations through the merchant server 101: purchasing and warehousing, delivery and delivery, residue-to-residue conversion, isolation of stock, isolation of return and allocation; the client server 102 is a server for a commodity purchaser, and the client can perform the following operations through the client server 102: inventory locking, payment completion, order cancellation, invoice creation, invoice callback, invoice cancellation, refund, return, and warehouse entry; the inventory server 103 is used for managing inventory data; the commodity database 104 is used for storing basic attribute data of commodities; the inventory database 105 is used for storing inventory data of the commodity; for example, as shown in fig. 2, the commodity database 104 stores SPU (Standard Product Unit, standardized product unit) base data, SKU (Stock Keeping Unit, stock quantity unit) base data, specification base data, and the like, and the inventory database 105 stores base inventory data, isolation inventory data, entity inventory data, commodity group inventory data, and the like. It should be noted that, in the existing inventory management system, only a merchant server, a customer server and a commodity database are provided, wherein the commodity database stores basic attribute data and inventory data of commodities, and the basic attribute data of the commodities and the inventory data of the commodities are redundant in the same data table; the merchant server and the client server directly update or query the inventory data in the commodity database; in this embodiment, an inventory server for managing inventory data only and an inventory database for storing inventory data only are added to the inventory management system, and the merchant server and the customer server update or query the inventory data in the inventory database through the inventory server.
As shown in fig. 3, the method for managing inventory data specifically includes the following steps:
step S301: after the original stock data in the commodity database is synchronized to the stock database, when a first control instruction is received, a write switch and a read switch for the stock database are turned on.
In this embodiment, it is necessary to synchronize the original inventory data stored in the commodity database to a newly set inventory database, and after the synchronization of the original inventory data is completed, establish a connection between the inventory server and the inventory database, and turn on a write switch and a read switch for the inventory database. The inventory server may modify and delete inventory data in the inventory database when the write switch is on, and may query and retrieve inventory data in the inventory database when the read switch is on.
Specifically, the raw inventory data includes: basic inventory data and incremental inventory data; wherein the basic inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in the process of synchronizing the basic inventory data.
In this embodiment, in order to ensure accuracy of the synchronized inventory data, the basic inventory data in the commodity database is synchronized to the inventory database, but in the process of synchronizing the basic inventory data, the merchant server and the customer server also update the inventory data in the commodity database, i.e., incremental inventory data is generated in the commodity database, so that the incremental inventory data is synchronized to the inventory database after the synchronization of the basic inventory data is completed.
Further, before the receiving the first control instruction, the method further includes:
step A1: after the basic inventory data in the commodity database are synchronized to the inventory database, when a second control instruction is received, a write switch for the commodity database and the inventory database is started, and a read switch for the commodity database is started;
step A2: when receiving an inventory update instruction sent by the client server, updating inventory data in the inventory database and the commodity database simultaneously according to the inventory update instruction;
step A3: and when receiving an inventory inquiry command sent by the client server, inquiring inventory data in the commodity database according to the inventory inquiry command.
In this embodiment, after the base stock data is synchronized to the stock database, the synchronization of the incremental stock data is started, but in order to ensure consistency of the commodity database and the stock data in the stock database in the process of synchronizing the incremental stock data, as shown in fig. 4, when the synchronization of the incremental stock data is started, a write switch of the stock server to the commodity database and the stock database is turned on, so that when the client server needs to update the stock data, the client server updates the commodity database and the stock data in the stock database simultaneously through the stock server; in addition, when the incremental inventory data starts to be synchronized, a read switch of the inventory server to the commodity database is started, so that the client server can only inquire the inventory data from the commodity database through the inventory server. In addition, when the synchronous increment inventory data is started, the writing switch of the merchant server to the commodity database is closed, and the reading switch of the merchant server to the commodity database is opened, namely, the merchant server cannot update the inventory data in the commodity database in the process of synchronizing the increment inventory data, but the merchant server can query the inventory data in the commodity database. It follows that in synchronizing the base inventory data, both the merchant server and the customer server may update the inventory data; however, in synchronizing the incremental inventory data, the merchant server cannot update the inventory data, and the customer server may update the inventory data through the inventory server.
Still further, after the receiving the second control instruction and before the receiving the first control instruction, the method further includes:
after the incremental inventory data in the commodity database is synchronized to the inventory database, when a third control instruction is received, a write switch and a read switch for the commodity database are turned off.
In this embodiment, when the incremental inventory data is synchronized to the inventory database, the original inventory data of the commodity database is successfully synchronized to the inventory database, and consistency of the inventory data in the commodity database and the inventory database can be ensured by the above-mentioned steps A1 to A3. At this time, the writing switch and the reading switch of the inventory server to the commodity database are closed, i.e. the inventory server does not update the inventory data in the commodity database.
Step S302: and when receiving an inventory updating instruction sent by the merchant server and/or the client server, updating inventory data in the inventory database according to the inventory updating instruction.
Step S303: and when receiving an inventory inquiry instruction sent by the merchant server and/or the client server, inquiring inventory data in the inventory database according to the inventory inquiry instruction.
Further, as shown in fig. 5, the method further includes:
and synchronizing the updated inventory data in the inventory database to the commodity database through the merchant server so as to backup the inventory data, thereby being used for rollback of the inventory data.
Preferably, when the inventory database has the inventory data updated, the inventory database sends the updated inventory data to a Binlog binary message queue, and the Binlog binary message queue forwards the updated inventory data to a DataBus in a merchant server so as to forward the updated inventory data to the commodity database through the DataBus; the merchant server asynchronously monitors whether the inventory data in the inventory database is updated through the message queue.
In this embodiment, after the original inventory data in the merchandise database is completely synchronized into the inventory database, the merchant server and/or customer server updates and/or queries the inventory data in the inventory database via the inventory server. Because only the inventory data of the commodity is stored in the inventory database, and the inventory server is a server specially used for managing the inventory data, the separation of the business for managing the inventory data and other businesses can be realized, the problem of low efficiency in updating or inquiring the inventory data under a high concurrency scene is solved, the occurrence of the conditions of overstock and understock is avoided, and the stability of the inventory management system is improved.
Example two
The embodiment of the application provides a method for synchronizing inventory data, which is applied to an inventory management system 10 as shown in fig. 1, wherein the inventory management system 10 specifically comprises: merchant server 101, customer server 102, inventory server 103, merchandise database 104, and inventory database 105; the merchant server 101 is a server of the commodity provider, and the merchant may perform the following operations through the merchant server 101: purchasing and warehousing, delivery and delivery, residue-to-residue conversion, isolation of stock, isolation of return and allocation; the client server 102 is a server for a commodity purchaser, and the client can perform the following operations through the client server 102: inventory locking, payment completion, order cancellation, invoice creation, invoice callback, invoice cancellation, refund, return, and warehouse entry; the inventory server 103 is used for managing inventory data; the commodity database 104 is used for storing basic attribute data of commodities; the inventory database 105 is used for storing inventory data of the commodity; for example, as shown in fig. 2, the commodity database 104 stores SPU (Standard Product Unit, standardized product unit) base data, SKU (Stock Keeping Unit, stock quantity unit) base data, specification base data, and the like, and the inventory database 105 stores base inventory data, isolation inventory data, entity inventory data, commodity group inventory data, and the like. It should be noted that, in the existing inventory management system, only a merchant server, a customer server and a commodity database are provided, wherein the commodity database stores basic attribute data and inventory data of commodities, and the basic attribute data of the commodities and the inventory data of the commodities are redundant in the same data table; the merchant server and the client server directly update or query the inventory data in the commodity database; in this embodiment, an inventory server for managing inventory data only and an inventory database for storing inventory data only are added to the inventory management system, and the merchant server and the customer server update or query the inventory data in the inventory database through the inventory server.
As shown in fig. 6, the method for synchronizing inventory data specifically includes the following steps:
step S601: and receiving an inventory data synchronization instruction.
Step S602: and synchronizing the original inventory data in the commodity database into the inventory database.
Specifically, the raw inventory data includes: basic inventory data and incremental inventory data; wherein the basic inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in the process of synchronizing the basic inventory data.
Further, step S602 includes:
step B1: and synchronizing the basic inventory data in the commodity database into the inventory database.
Step B2: and when the basic inventory data is finished synchronously, sending a second control instruction to the inventory server so that the inventory server starts a write switch for the commodity database and the inventory database and starts a read switch for the commodity database.
In this embodiment, after the base inventory data is synchronized, the incremental inventory data is started, but in order to ensure consistency of the inventory data in the commodity database and the inventory database in the process of synchronizing the incremental inventory data, as shown in fig. 4, when the incremental inventory data is started, a write switch of the inventory server to the commodity database and the inventory database is turned on, so that when the client server needs to update the inventory data, the client server updates the inventory data in the commodity database and the inventory database simultaneously through the inventory server; in addition, when the incremental inventory data starts to be synchronized, a read switch of the inventory server to the commodity database is started, so that the client server can only inquire the inventory data from the commodity database through the inventory server. In addition, when the synchronous increment inventory data is started, the writing switch of the merchant server to the commodity database is closed, and the reading switch of the merchant server to the commodity database is opened, namely, the merchant server cannot update the inventory data in the commodity database in the process of synchronizing the increment inventory data, but the merchant server can query the inventory data in the commodity database. It follows that in synchronizing the base inventory data, both the merchant server and the customer server may update the inventory data; however, in synchronizing the incremental inventory data, the merchant server cannot update the inventory data, and the customer server may update the inventory data through the inventory server.
Step B3: and synchronizing incremental inventory data in the commodity database into the inventory database.
Step B4: and when the incremental inventory data synchronization is completed, sending a third control instruction to the inventory server so that the inventory server closes a write switch and a read switch of the commodity database.
In this embodiment, when the incremental inventory data is synchronized to the inventory database, the original inventory data of the commodity database is successfully synchronized to the inventory database, and at this time, the write switch and the read switch of the inventory server to the commodity database are turned off, i.e. the inventory server does not update the inventory data in the commodity database.
Still further, before the sending the third control instruction to the inventory server, the method further includes:
judging whether inventory data in the commodity database and the inventory database are consistent;
if yes, a third control instruction is sent to the inventory server;
if not, correcting the inventory data in the inventory database according to the commodity database, and sending a third control instruction to the inventory server after the correction is completed.
Step S603: and when the original inventory data is synchronous, sending a first control instruction to the inventory server so that the inventory server starts a write switch and a read switch for the inventory database.
In this embodiment, it is necessary to synchronize the original inventory data stored in the commodity database to a newly set inventory database, and after the synchronization of the original inventory data is completed, establish a connection between the inventory server and the inventory database, and turn on a write switch and a read switch for the inventory database. The inventory server may modify and delete inventory data in the inventory database when the write switch is on, and may query and retrieve inventory data in the inventory database when the read switch is on.
In this embodiment, after the original inventory data in the merchandise database is completely synchronized into the inventory database, the merchant server and/or customer server updates and/or queries the inventory data in the inventory database via the inventory server. Because only the inventory data of the commodity is stored in the inventory database, and the inventory server is a server specially used for managing the inventory data, the separation of the business for managing the inventory data and other businesses can be realized, the problem of low efficiency in updating or inquiring the inventory data under a high concurrency scene is solved, the occurrence of the conditions of overstock and understock is avoided, and the stability of the inventory management system is improved.
Further, as shown in fig. 5, the method further includes:
and synchronizing the updated inventory data in the inventory database to the commodity database through the merchant server so as to backup the inventory data, thereby being used for rollback of the inventory data.
Preferably, when the inventory database has the inventory data updated, the inventory database sends the updated inventory data to a Binlog binary message queue, and the Binlog binary message queue forwards the updated inventory data to a DataBus in a merchant server so as to forward the updated inventory data to the commodity database through the DataBus; the merchant server asynchronously monitors whether the inventory data in the inventory database is updated through the message queue.
In this embodiment, in order to ensure accuracy of the synchronized inventory data, the basic inventory data in the commodity database is synchronized to the inventory database, but in the process of synchronizing the basic inventory data, the merchant server and the customer server also update the inventory data in the commodity database, i.e., incremental inventory data is generated in the commodity database, so that the incremental inventory data is synchronized to the inventory database after the synchronization of the basic inventory data is completed. In addition, in order to ensure consistency of the commodity database and the inventory data in the inventory database in the process of synchronizing the incremental inventory data, the write-on switch of the inventory server to the commodity database and the inventory server is turned on at the same time, and the write-on switch of the inventory server to the commodity database is turned off when the incremental inventory data is synchronized, and only the write-on switch of the inventory server to the inventory database is reserved.
Example III
The embodiment of the application provides a device for managing inventory data, which is applied to an inventory server in an inventory management system, wherein the inventory management system further comprises: the merchant server, the client server, the commodity database and the inventory database, as shown in fig. 7, the device specifically comprises the following components:
an opening module 701, configured to, after original inventory data in the commodity database is synchronized to the inventory database, open a write switch and a read switch for the inventory database when a first control instruction is received;
an updating module 702, configured to, when receiving an inventory update instruction sent by the merchant server and/or the customer server, update inventory data in the inventory database according to the inventory update instruction;
and a query module 703, configured to query the inventory database for inventory data according to the inventory query instruction when receiving the inventory query instruction sent by the merchant server and/or the customer server.
Specifically, the raw inventory data includes: basic inventory data and incremental inventory data; wherein the basic inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in the process of synchronizing the basic inventory data.
Further, the device further comprises:
the processing module is used for starting a write switch for the commodity database and the inventory database and starting a read switch for the commodity database when a second control instruction is received after the basic inventory data in the commodity database are synchronized to the inventory database; when receiving an inventory update instruction sent by the client server, updating inventory data in the inventory database and the commodity database simultaneously according to the inventory update instruction; and when receiving an inventory inquiry command sent by the client server, inquiring inventory data in the commodity database according to the inventory inquiry command.
Still further, the apparatus further comprises:
and the closing module is used for closing a writing switch and a reading switch of the commodity database when receiving a third control instruction after the incremental inventory data in the commodity database are synchronized to the inventory database.
Example IV
The embodiment of the application provides a device for synchronizing inventory data, which is applied to an inventory management system, wherein the inventory management system comprises: the device comprises an inventory server, a commodity database and an inventory database, as shown in fig. 8, and specifically comprises the following components:
a receiving module 801, configured to receive an inventory data synchronization instruction;
a synchronizing module 802, configured to synchronize the original inventory data in the commodity database to the inventory database;
and the sending module 803 is configured to send a first control instruction to the inventory server when the original inventory data is completed in synchronization, so that the inventory server turns on a write switch and a read switch for the inventory database.
Specifically, the raw inventory data includes: basic inventory data and incremental inventory data; wherein the basic inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in the process of synchronizing the basic inventory data.
Further, the synchronization module 802 is specifically configured to:
synchronizing base inventory data in the commodity database into the inventory database;
when the basic inventory data is finished synchronously, a second control instruction is sent to the inventory server, so that the inventory server starts a write switch for the commodity database and the inventory database and starts a read switch for the commodity database;
synchronizing incremental inventory data in the commodity database into the inventory database;
and when the incremental inventory data synchronization is completed, sending a third control instruction to the inventory server so that the inventory server closes a write switch and a read switch of the commodity database.
Still further, the apparatus further comprises:
the correction module is used for judging whether the inventory data in the commodity database and the inventory database are consistent; if yes, a third control instruction is sent to the inventory server; if not, correcting the inventory data in the inventory database according to the commodity database, and sending a third control instruction to the inventory server after the correction is completed.
Example five
The present embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack-mounted server, a blade server, a tower server, or a rack-mounted server (including an independent server or a server cluster formed by a plurality of servers) that can execute a program. As shown in fig. 9, the computer device 90 of the present embodiment includes at least, but is not limited to: a memory 901 and a processor 902 which are communicably connected to each other via a system bus. It should be noted that FIG. 9 only shows a computer device 90 having components 901-902, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
In this embodiment, the memory 901 (i.e., readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 901 may be an internal storage unit of the computer device 90, such as a hard disk or memory of the computer device 90. In other embodiments, the memory 901 may also be an external storage device of the computer device 90, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the computer device 90. Of course, memory 901 may also include both internal storage units of computer device 90 and external storage devices. In the present embodiment, the memory 901 is typically used to store an operating system and various types of application software installed on the computer device 90. Further, the memory 901 can also be used to temporarily store various types of data that have been output or are to be output.
The processor 902 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 902 is generally operative to control the overall operation of the computer device 90.
Specifically, in the present embodiment, the processor 902 is configured to execute a program of a method for managing inventory data stored in the processor 902, where the program of the method for managing inventory data is executed to implement the following steps:
after original inventory data in the commodity database are synchronized to the inventory database, when a first control instruction is received, a write switch and a read switch for the inventory database are turned on;
updating inventory data in the inventory database according to the inventory update instructions when the inventory update instructions sent by the merchant server and/or the customer server are received;
and when receiving an inventory inquiry instruction sent by the merchant server and/or the client server, inquiring inventory data in the inventory database according to the inventory inquiry instruction.
The specific embodiment of the above method steps may refer to the first embodiment, and this embodiment is not repeated here.
In addition, in the present embodiment, the processor 902 is further configured to execute a program for synchronizing inventory data stored in the processor 902, where the program for synchronizing inventory data is executed to further implement the following steps:
receiving an inventory data synchronization instruction;
synchronizing the original inventory data in the commodity database to the inventory database;
and when the original inventory data is synchronous, sending a first control instruction to the inventory server so that the inventory server starts a write switch and a read switch for the inventory database.
The specific embodiment of the above method steps may refer to the second embodiment, and the description of this embodiment is not repeated here.
Example six
The present embodiment also provides a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., having stored thereon a computer program that when executed by a processor performs the following method steps:
after original inventory data in the commodity database are synchronized to the inventory database, when a first control instruction is received, a write switch and a read switch for the inventory database are turned on;
updating inventory data in the inventory database according to the inventory update instructions when the inventory update instructions sent by the merchant server and/or the customer server are received;
and when receiving an inventory inquiry instruction sent by the merchant server and/or the client server, inquiring inventory data in the inventory database according to the inventory inquiry instruction.
The specific embodiment of the above method steps may refer to the first embodiment, and this embodiment is not repeated here.
Furthermore, the computer program when executed by a processor also realizes the following method steps:
receiving an inventory data synchronization instruction;
synchronizing the original inventory data in the commodity database to the inventory database;
and when the original inventory data is synchronous, sending a first control instruction to the inventory server so that the inventory server starts a write switch and a read switch for the inventory database.
The specific embodiment of the above method steps may refer to the second embodiment, and the description of this embodiment is not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (8)

1. A method of managing inventory data, characterized by being applied to an inventory server in an inventory management system, the inventory management system further comprising: a merchant server, a customer server, a goods database, and an inventory database, the method comprising:
after original inventory data in the commodity database are synchronized to the inventory database, when a first control instruction is received, a write switch and a read switch for the inventory database are turned on; wherein the raw inventory data includes: basic inventory data and incremental inventory data;
updating inventory data in the inventory database according to the inventory update instructions when the inventory update instructions sent by the merchant server and/or the customer server are received;
inquiring inventory data in the inventory database according to the inventory inquiry command when the inventory inquiry command sent by the merchant server and/or the client server is received;
before the receiving the first control instruction, the method further includes:
after the basic inventory data in the commodity database are synchronized to the inventory database, when a second control instruction is received, a write switch for the commodity database and the inventory database is started, and a read switch for the commodity database is started;
after the incremental inventory data in the commodity database is synchronized to the inventory database, when a third control instruction is received, a write switch and a read switch for the commodity database are turned off.
2. The method of managing inventory data according to claim 1, wherein the base inventory data is inventory data before a synchronization start time in the commodity database, and the incremental inventory data is inventory data newly added in the commodity database in synchronizing the base inventory data.
3. The method of managing inventory data according to claim 2, characterized in that before the receiving a first control instruction, the method further comprises:
when receiving an inventory update instruction sent by the client server, updating inventory data in the inventory database and the commodity database simultaneously according to the inventory update instruction;
and when receiving an inventory inquiry command sent by the client server, inquiring inventory data in the commodity database according to the inventory inquiry command.
4. A method of synchronizing inventory data, characterized by being applied to an inventory management system, the inventory management system comprising: an inventory server, a commodity database and an inventory database, the method comprising:
receiving an inventory data synchronization instruction;
synchronizing the original inventory data in the commodity database to the inventory database; wherein the raw inventory data includes: basic inventory data and incremental inventory data;
when the original inventory data is finished in synchronization, a first control instruction is sent to the inventory server, so that the inventory server starts a write switch and a read switch for the inventory database;
before sending the first control instruction to the inventory server, the method further includes:
after the basic inventory data in the commodity database are synchronized into the inventory database, a second control instruction is sent to the inventory server, so that the inventory server starts a write switch on the commodity database and the inventory database and starts a read switch on the commodity database;
after synchronizing the incremental inventory data in the inventory database into the inventory database, a third control instruction is sent to the inventory server to cause the inventory server to close a write switch and a read switch to the inventory database.
5. The method of synchronizing inventory data according to claim 4, wherein the base inventory data is inventory data prior to a synchronization start time in the commodity database and the incremental inventory data is inventory data that was added to the commodity database during synchronization of the base inventory data.
6. The method of synchronizing inventory data according to claim 5, wherein prior to said sending a third control instruction to the inventory server, the method further comprises:
judging whether inventory data in the commodity database and the inventory database are consistent;
if yes, a third control instruction is sent to the inventory server;
if not, correcting the inventory data in the inventory database according to the commodity database, and sending a third control instruction to the inventory server after the correction is completed.
7. A computer device, the computer device comprising: memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 6 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
CN202010776841.7A 2020-08-05 2020-08-05 Method, apparatus, readable storage medium for managing and synchronizing inventory data Active CN112416952B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010776841.7A CN112416952B (en) 2020-08-05 2020-08-05 Method, apparatus, readable storage medium for managing and synchronizing inventory data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010776841.7A CN112416952B (en) 2020-08-05 2020-08-05 Method, apparatus, readable storage medium for managing and synchronizing inventory data

Publications (2)

Publication Number Publication Date
CN112416952A CN112416952A (en) 2021-02-26
CN112416952B true CN112416952B (en) 2023-07-04

Family

ID=74844166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010776841.7A Active CN112416952B (en) 2020-08-05 2020-08-05 Method, apparatus, readable storage medium for managing and synchronizing inventory data

Country Status (1)

Country Link
CN (1) CN112416952B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116167699B (en) * 2023-01-16 2023-11-14 广州辰创科技发展有限公司 Equipment guarantee resource management method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013161398A (en) * 2012-02-08 2013-08-19 Nippon Telegr & Teleph Corp <Ntt> Database system, method for database management, and database management program
CN105868343A (en) * 2016-03-28 2016-08-17 上海携程商务有限公司 Database migration method and system
CN107248052A (en) * 2017-05-16 2017-10-13 上海艾融软件股份有限公司 A kind of commodity stocks information determines method, apparatus and system
CN107767104A (en) * 2017-11-10 2018-03-06 小草数语(北京)科技有限公司 Commodity inventory control information system, method and e-commerce platform
CN109377120A (en) * 2018-08-21 2019-02-22 中国平安人寿保险股份有限公司 Inventory management method, device and electronic equipment based on cloud service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013161398A (en) * 2012-02-08 2013-08-19 Nippon Telegr & Teleph Corp <Ntt> Database system, method for database management, and database management program
CN105868343A (en) * 2016-03-28 2016-08-17 上海携程商务有限公司 Database migration method and system
CN107248052A (en) * 2017-05-16 2017-10-13 上海艾融软件股份有限公司 A kind of commodity stocks information determines method, apparatus and system
CN107767104A (en) * 2017-11-10 2018-03-06 小草数语(北京)科技有限公司 Commodity inventory control information system, method and e-commerce platform
CN109377120A (en) * 2018-08-21 2019-02-22 中国平安人寿保险股份有限公司 Inventory management method, device and electronic equipment based on cloud service

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种高并发电商秒杀系统的设计与实现;刘磊;《现代计算机》;20190131(第08期);第[95]-[100]页 *

Also Published As

Publication number Publication date
CN112416952A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
EP3428811B1 (en) Database interface agent for a tenant-based upgrade system
CN104699712B (en) The method and device being updated to the inventory record information in database
US7277900B1 (en) Method and mechanism for rolling back a transaction on a row of data
US9170999B2 (en) Method, system, and program product for transferring document attributes
CA2831381C (en) Recovery of tenant data across tenant moves
US8494888B2 (en) Offline modification of business data
CN102043838A (en) Primary database system, replication database system and method for replicating data of a primary database system
US8280917B1 (en) Batching content management operations to facilitate efficient database interactions
US8051054B2 (en) Method and system for data processing with database update for the same
CN103634144A (en) Method, system and equipment for managing multi-IDC (internet data center) cluster configuration file
CN111090663A (en) Transaction concurrency control method, device, terminal equipment and medium
CA3157820A1 (en) Method of and device for archiving stale data
CN113760922A (en) Service data processing system, method, server and storage medium
US20120066180A1 (en) File-backed in-memory structured storage for service synchronization
US8650169B1 (en) Method and mechanism for identifying transaction on a row of data
CN112416952B (en) Method, apparatus, readable storage medium for managing and synchronizing inventory data
US20110246250A1 (en) Simulation of supply chain plans using data model
CN115599807A (en) Data access method, device, application server and storage medium
CN114444478A (en) Voucher visualization method and device, electronic equipment and storage medium
CN102024010A (en) Data processing system and data processing method
CN111581227A (en) Event pushing method and device, computer equipment and storage medium
US20170329830A1 (en) Read-optimized database changes
CN107038617B (en) Pre-creation method and device of payment order
CN112163002A (en) Cross-border e-commerce customs data processing method and system
US9785894B2 (en) Simulation of supply chain plans using web service

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
GR01 Patent grant
GR01 Patent grant