TW201828112A - Method and device for updating inventory system data capable of shortening data update response time - Google Patents

Method and device for updating inventory system data capable of shortening data update response time Download PDF

Info

Publication number
TW201828112A
TW201828112A TW106101960A TW106101960A TW201828112A TW 201828112 A TW201828112 A TW 201828112A TW 106101960 A TW106101960 A TW 106101960A TW 106101960 A TW106101960 A TW 106101960A TW 201828112 A TW201828112 A TW 201828112A
Authority
TW
Taiwan
Prior art keywords
inventory
partition
deduction
database
area
Prior art date
Application number
TW106101960A
Other languages
Chinese (zh)
Other versions
TWI734730B (en
Inventor
嚴煥
Original Assignee
阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集團服務有限公司 filed Critical 阿里巴巴集團服務有限公司
Priority to TW106101960A priority Critical patent/TWI734730B/en
Publication of TW201828112A publication Critical patent/TW201828112A/en
Application granted granted Critical
Publication of TWI734730B publication Critical patent/TWI734730B/en

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the present invention discloses a method and a device for updating inventory system data, wherein an area input field and an area deduction field corresponding to an area inventory database are arranged in an inventory table. When the number of items in the area inventory database increases or decreases, only the area input field or the area deduction filed corresponding to the area inventory database is required to be updated, that is, even when inventory changes are made to a plurality of area inventory databases, only the area input fields or area deduction fields corresponding to each area inventory database are updated respectively. The situation of updating the same field at the same time is thus avoided from conflicts caused by data synchronization. Moreover, when inventory changes occur to each area inventory database, the corresponding area input field or area deduction field can be locally updated in the area inventory database, and then the inventory table is synchronized. As a result, the data update response time is short, which is beneficial to improve the processing volume and availability of the system.

Description

庫存系統資料更新方法及裝置  Inventory system data updating method and device  

本發明係有關資料庫技術領域,尤其有關一種庫存系統資料更新方法及裝置。 The invention relates to the technical field of database, in particular to a method and device for updating inventory system data.

存在有跨區域交易的網站,由於網站用戶來自不同區域,地理位置差異巨大,為了提高區域資料處理速度和提高用戶體驗,通常採用分散式庫存系統,也就是在各個用戶集中的地區建立分區庫存資料庫,各個分區庫存資料庫相連接,各個分區庫存資料庫用來儲存和處理庫存資料,方便當地用戶的快速訪問。在分區庫存資料庫中,庫存資料結構則以表的形式存在,稱為庫存表,為了方便同步,分區庫存資料庫共用庫存表,庫存表中庫存資料以欄位的形式存在,包括表示庫存輸入數值的輸入欄位、表示庫存扣減數值的扣減欄位和庫存餘額欄位,庫存輸入指庫存提供方輸入新的庫存值,相當於庫存輸入,庫存扣減指庫存消費方扣減庫存,相當於庫存輸出。 There are websites with cross-regional transactions. Since the users of the website come from different regions, the geographical location is very different. In order to improve the speed of regional data processing and improve the user experience, a decentralized inventory system is usually adopted, that is, the partition inventory data is established in the areas where each user is concentrated. The library, each partition inventory database is connected, and each partition inventory database is used to store and process inventory data, which is convenient for local users to access quickly. In the partition inventory database, the inventory data structure exists in the form of a table, which is called an inventory table. In order to facilitate synchronization, the partition inventory database shares the inventory table, and the inventory data in the inventory table exists in the form of a field, including indicating inventory input. The input field of the value, the deduction field and the inventory balance field indicating the deduction value of the inventory, the inventory input means that the inventory provider inputs a new inventory value, which is equivalent to the inventory input, and the deduction of the inventory refers to the deduction of the inventory by the inventory consumer. Equivalent to inventory output.

當庫存系統發生庫存輸入或者扣減時,各個分區庫存資料庫的庫存資料需要同步進行更新,具體上,當某地發 生交易時,該地分區庫存資料庫的庫存表中,輸入欄位(發生庫存輸入時)或扣減欄位(發生庫存扣減時)被修改,該修改會同步其他分區庫存資料庫的庫存表的相同欄位。但各地的交易常常是同時發生的,各個分區庫存資料庫中庫存表的同一個欄位併發地發生變化,這種併發情況會導致資料同步的衝突,造成庫存表發生資料錯誤,影響真實的庫存資料和交易處理。 When inventory input or deduction occurs in the inventory system, the inventory data of each partition inventory database needs to be updated simultaneously. Specifically, when a transaction occurs in a place, the input field of the inventory table of the local inventory database is generated (occurrence occurs) When the inventory is entered) or the deduction field (when inventory deduction occurs) is modified, the modification will synchronize the same field of the inventory table of the other partition inventory database. However, transactions in various places often occur at the same time. The same field of the inventory table in each partition inventory database changes concurrently. This concurrency will lead to conflicts in data synchronization, resulting in data errors in the inventory table, affecting real inventory. Data and transaction processing.

為了避免資料同步的衝突,通常採用單點修改的方式,也就是只使用一個庫存資料庫來修改庫存表,再將修改後的庫存表同步到各個分區庫存資料庫。但這種方式下,各地交易資訊要先跨地域遠距離地發送給用來修改庫存表的庫存資料庫,然後修改庫存表的庫存資料庫按優先順序排序或者時間排序修改庫存表,這種方式資料修改和同步的回應時間長,降低系統的處理量、可用性以及用戶體驗。 In order to avoid the conflict of data synchronization, a single point modification method is usually adopted, that is, only one inventory database is used to modify the inventory table, and then the modified inventory table is synchronized to each partition inventory database. However, in this way, the transaction information of each place must be sent to the inventory database used to modify the inventory table, and then the inventory database of the inventory table is modified in order of priority or time order to modify the inventory table. Data modification and synchronization have a long response time, reducing system throughput, availability, and user experience.

為了克服相關技術中庫存系統資料更新存在資料同步的問題,本發明提供一種庫存系統資料更新方法及裝置。 In order to overcome the problem of data synchronization in the inventory system data update in the related art, the present invention provides a method and device for updating inventory system data.

根據本發明實施例的第一態樣,提供一種庫存系統資料更新方法,包括:在庫存表中設置與分區庫存資料庫對應的區域輸入欄位以及區域扣減欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄 分區庫存資料庫中庫存扣減的數值;當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值,所述庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數;當所述庫存餘額大於或等於當次庫存扣減的數值時,則更新與所述分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。 According to a first aspect of the present invention, a method for updating an inventory system data is provided, including: setting an area input field corresponding to a partition inventory database and an area deduction field in an inventory table, the area input field The value used to record the inventory increase in the partition inventory database, the regional deduction field is used to record the value of the inventory deduction in the partition inventory database; when the inventory inventory database increases, the partition inventory is updated The area corresponding to the database input field, and synchronize the inventory table of each partition inventory database; when the inventory inventory of the partition inventory database occurs, determine whether the inventory balance is greater than or equal to the value of the current inventory deduction, the inventory balance M=Σ(a1+a2+...+an)-Σ(b1+b2+...+bn), where a1 to an are the regional input fields of the respective partition inventory databases, and b1 to bn are the respective partition stocks respectively. The area deduction field of the database, where n is the number of the partition inventory database; when the inventory balance is greater than or equal to the value of the current inventory deduction, the pair is updated with the partition inventory database The region deductions fields, and synchronizing the various partitions inventory database inventory table.

可選地,所述的庫存系統資料更新方法,還包括:在庫存表中設置庫存餘額欄位,所述庫存餘額欄位用以記錄所述庫存餘額;當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,同時更新所述庫存餘額欄位;以及,當分區庫存資料庫發生庫存扣減時,更新與所述分區庫存資料庫對應的區域扣減欄位,同時更新所述庫存餘額欄位。 Optionally, the method for updating the inventory system data further includes: setting an inventory balance field in the inventory table, wherein the inventory balance field is used to record the inventory balance; when the inventory of the partition inventory database increases, Updating an area input field corresponding to the partition inventory database, and updating the inventory balance field; and updating an area deduction corresponding to the partition inventory database when an inventory deduction occurs in the partition inventory database Field, and update the inventory balance field at the same time.

可選地,當分區庫存資料庫發生庫存扣減時,判斷所述庫存餘額欄位是否大於或等於當次庫存扣減的數值。 Optionally, when the inventory deduction occurs in the partition inventory database, it is determined whether the inventory balance field is greater than or equal to the value of the current inventory deduction.

可選地,所述的庫存系統資料更新方法,還包括:當所述庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。 Optionally, the method for updating the inventory system data further includes: displaying an insufficient inventory message when the inventory balance is less than the value of the current inventory deduction.

可選地,所述的庫存系統資料更新方法,使用環形同步來同步各個分區庫存資料庫的庫存表。 Optionally, the inventory system data update method uses a ring synchronization to synchronize an inventory table of each partition inventory database.

相應於本發明實施例的第一態樣,根據本發明實施例的第二態樣,提供一種庫存系統資料更新裝置,包括:欄位設置單元,用以根據各個分區庫存資料庫的區域標識,在庫存表中設置與所述區域標識對應的區域輸入欄位以及區域扣減欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值;第一更新單元,用以當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;存餘判斷單元,用以當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值,所述庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數;第二更新單元,用以當所述庫存餘額大於或等於當次庫存扣減的數值時,更新與所述分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。 Corresponding to the first aspect of the embodiment of the present invention, according to the second aspect of the embodiment of the present invention, an inventory system data updating apparatus is provided, including: a field setting unit, configured to use the area identifier of each partition inventory database. An area input field corresponding to the area identifier and an area deduction field are set in the inventory table, where the area input field is used to record the value of the inventory increase in the partition inventory database, and the area deduction field is used. The value of the deduction of the inventory in the partition inventory database; the first update unit is configured to update the regional input field corresponding to the partition inventory database when the inventory inventory database increases, and synchronize the inventory of each partition. The inventory table of the database; the remaining judgment unit is configured to determine whether the inventory balance is greater than or equal to the value of the current inventory deduction when the inventory deduction occurs in the partition inventory database, the inventory balance M=Σ(a1+a2+ ......+an)-Σ(b1+b2+...+bn), where a1 to an are the regional input fields for each partition inventory database, and b1 to bn are the respective partition inventory databases. The area deduction field, n is the number of the partition inventory database; the second update unit is configured to update and correspond to the partition inventory database when the inventory balance is greater than or equal to the value of the current inventory deduction The area deducts the field and synchronizes the inventory table of each partition inventory database.

可選地,所述欄位設置單元,還用以在庫存表中設置庫存餘額欄位,所述庫存餘額欄位用以記錄所述庫存餘額;所述第一更新單元,用以當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,同時更新所述庫存餘額欄位;以及,所述第二更新單元,用以當分區庫存資料庫發生庫存扣減時,更新與所述分區庫存資料庫對應的區域扣減欄位,同時更新所述庫存餘額欄位。 Optionally, the field setting unit is further configured to set an inventory balance field in the inventory table, the inventory balance field is used to record the inventory balance; and the first update unit is configured to use the partition inventory Updating the inventory input field corresponding to the partitioned inventory database and updating the inventory balance field; and the second update unit is configured to generate an inventory deduction when the inventory is generated in the partition inventory database. When the time is reduced, the area deduction field corresponding to the partition inventory database is updated, and the inventory balance field is updated.

可選地,所述存餘判斷單元,用以當分區庫存資料庫發生庫存扣減時,判斷所述庫存餘額欄位是否大於或等於當次庫存扣減的數值。 Optionally, the remaining judgment unit is configured to determine, when the inventory deduction of the partition inventory database occurs, whether the inventory balance field is greater than or equal to a value of the current inventory deduction.

可選地,所述的庫存系統資料更新裝置,還包括:提示單元,用以當所述庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。 Optionally, the inventory system data updating device further includes: a prompting unit, configured to display an insufficient inventory message when the inventory balance is less than a value of the current inventory deduction.

可選地,所述第一更新單元和所述第二更新單元使用環形同步來同步各個分區庫存資料庫的庫存表。 Optionally, the first update unit and the second update unit use ring synchronization to synchronize the inventory tables of the respective partition inventory databases.

本發明實施例提供的技術方案,在庫存表中設置與分區庫存資料庫對應的區域輸入欄位和區域扣減欄位,當某個分區庫存資料庫發生庫存增加時,只需更新與該分區庫存資料庫對應的區域輸入欄位,當某個分區庫存資料庫發生庫存扣減時,只需更新與該分區庫存資料庫對應的區域扣減欄位,這樣即使同時有多個分區庫存資料庫發生庫存變化,也只需同時分別更新與各個分區庫存資料庫對應的 區域輸入欄位或區域扣減欄位,而不會出現同時更新同一個欄位的情況,從而很好地避免了資料同步衝突。而且每個分區庫存資料庫發生庫存變化時,可以在本地更新對應的區域輸入欄位或者區域扣減欄位,然後同步庫存表,而不需其他分區庫存資料庫發起遠距離庫存修改訪問,因此資料更新回應時間短,有利於提高系統的處理量、可用性以及用戶體驗。 According to the technical solution provided by the embodiment of the present invention, an area input field and an area deduction field corresponding to the partition inventory database are set in the inventory table, and when the inventory of a certain partition inventory database increases, only the partition is updated. The area input field corresponding to the inventory database, when an inventory deduction for a partition inventory database occurs, only the regional deduction field corresponding to the partition inventory database is updated, so that even if there are multiple partition inventory databases at the same time In the event of inventory changes, it is only necessary to update the regional input fields or regional deduction fields corresponding to each partition inventory database at the same time, without the situation that the same field is updated at the same time, thus avoiding data synchronization. conflict. Moreover, when inventory changes occur in each partition inventory database, the corresponding regional input field or regional deduction field can be locally updated, and then the inventory table is synchronized, without requiring other partition inventory database to initiate remote inventory modification access, The short response time of the data update is beneficial to improve the processing capacity, availability and user experience of the system.

應當理解的是,以上的一般描述和後文的細節描述僅是示例性和解釋性的,並不能限制本發明。 The above general description and the following detailed description are intended to be illustrative and not restrictive.

U301‧‧‧欄位設置單元 U301‧‧‧Field setting unit

U302‧‧‧第一更新單元 U302‧‧‧First update unit

U303‧‧‧存餘判斷單元 U303‧‧‧Residual judgment unit

U304‧‧‧第二更新單元 U304‧‧‧Second update unit

U401‧‧‧欄位設置單元 U401‧‧‧Field setting unit

U402‧‧‧第一更新單元 U402‧‧‧First update unit

U403‧‧‧存餘判斷單元 U403‧‧‧Residual judgment unit

U404‧‧‧第二更新單元 U404‧‧‧Second update unit

U405‧‧‧提示單元 U405‧‧‧Cue unit

為了更清楚地說明本發明實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,對於本領域普通技術人員而言,在不付出創造性勞動性的前提下,還可以根據這些附圖而獲得其他的附圖。 In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, for those skilled in the art, Other drawings may also be obtained from these drawings without paying for inventive labor.

圖1為本發明一示例性實施例示出的一種庫存系統資料更新方法的流程示意圖。 FIG. 1 is a schematic flowchart of a method for updating an inventory system data according to an exemplary embodiment of the present invention.

圖2為本發明一示例性實施例示出的另一種庫存系統資料更新方法的流程示意圖。 FIG. 2 is a schematic flowchart diagram of another method for updating inventory system data according to an exemplary embodiment of the present invention.

圖3為本發明一示例性實施例示出的一種庫存系統資料更新裝置的方塊圖。 FIG. 3 is a block diagram of an inventory system data update apparatus according to an exemplary embodiment of the present invention.

圖4為本發明一示例性實施例示出的另一種庫存系統資料更新裝置的方塊圖。 FIG. 4 is a block diagram of another inventory system data updating apparatus according to an exemplary embodiment of the present invention.

這裏將詳細地對示例性實施例進行說明,其示例表示在附圖中。下面的描述相關附圖時,除非另有表示,不同附圖中的相同數字表示相同或相似的要素。以下示例性實施例中所描述的實施模式並不代表與本發明相一致的所有實施模式。相反地,它們僅是與如所附申請專利範圍中所詳述的、本發明的一些態樣相一致的裝置和方法的例子。 Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. The same numbers in the different figures represent the same or similar elements, unless otherwise indicated. The mode of implementation described in the following exemplary embodiments does not represent all implementation modes consistent with the present invention. On the contrary, they are merely examples of devices and methods consistent with aspects of the invention as detailed in the appended claims.

為了全面理解本發明,在以下詳細描述中提到了許多具體的細節,但是本領域技術人員應該理解,本發明可以無需這些具體細節而實現。在其他實施例中,不詳細描述公知的方法、過程、元件和電路,以免不必要地導致實施例模糊。 In order to fully understand the present invention, many specific details are described in the following detailed description, but those skilled in the art will understand that the invention may be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits are not described in detail to avoid unnecessarily obscuring the embodiments.

圖1為本發明一示例性實施例示出的一種庫存系統資料更新方法的流程示意圖,如圖1所示,所述方法包括:步驟S101,在庫存表中設置與分區庫存資料庫對應的區域輸入欄位以及區域扣減欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值。 FIG. 1 is a schematic flowchart of a method for updating an inventory system data according to an exemplary embodiment of the present invention. As shown in FIG. 1 , the method includes: Step S101: setting an area input corresponding to a partition inventory database in an inventory table. A field and an area deduction field, wherein the area input field is used to record the value of the inventory increase in the partition inventory database, and the area deduction field is used to record the value of the inventory deduction in the partition inventory database.

其中,所述與分區庫存資料庫對應可以為與分區庫存資料庫的庫標識對應,或者與分區庫存資料庫的區域標識對應,相應地,庫存表中,區域輸入欄位的個數和區域扣減欄位的個數分別與分區庫存資料庫的個數相同。例如,庫存表中設置有對應於分區庫存資料庫W1、W2、 W3……Wn的區域輸入欄位a1、a2、a3……an和區域扣減欄位b1、b2、b3……bn。各分區庫存資料庫使用同一套表結構,也就是分區庫存資料庫的庫存表是一樣的,並且可以聯動而同步更新。 The corresponding to the partition inventory database may correspond to the library identifier of the partition inventory database, or correspond to the region identifier of the partition inventory database, and correspondingly, the number of the region input fields and the region buckle in the inventory table The number of reduction fields is the same as the number of partition inventory databases. For example, the inventory table is provided with area input fields a1, a2, a3, ..., and area deduction fields b1, b2, b3, ... bn corresponding to the partition stock databases W1, W2, W3, ... Wn. Each partition inventory database uses the same set of table structure, that is, the inventory table of the partition inventory database is the same, and can be synchronized and updated simultaneously.

步驟S102,當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;步驟S103,當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值;步驟S104,當所述庫存餘額大於或等於當次庫存扣減的數值時,則更新與所述分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。 Step S102, when an inventory increase occurs in the partition inventory database, update an area input field corresponding to the partition inventory database, and synchronize an inventory table of each partition inventory database; in step S103, when the partition inventory database generates an inventory deduction If the time is reduced, it is determined whether the inventory balance is greater than or equal to the value of the current inventory deduction; and in step S104, when the inventory balance is greater than or equal to the value of the current deduction, the area corresponding to the partitioned inventory database is updated. Deduct the fields and synchronize the inventory table of each partition inventory database.

在一種應用環境下,當分區庫存資料庫發生庫存增加或庫存扣減時,由用戶修改對應的區域輸入欄位或區域扣減欄位來完成區域輸入欄位或區域扣減欄位的更新;在另一種應用環境下,當分區庫存資料庫所在區域發生交易後,根據所述交易資訊自動更新區域輸入欄位或區域扣減欄位,例如交易為賣出,庫存扣減,則根據賣出額來更新區域扣減欄位,如果交易為買入,庫存增加,則根據買入額來更新區域輸入欄位。 In an application environment, when an inventory increase or inventory deduction occurs in the partition inventory database, the user inputs the corresponding region input field or the regional deduction field to complete the update of the region input field or the regional deduction field; In another application environment, when a transaction occurs in the area where the partition inventory database is located, the regional input field or the regional deduction field is automatically updated according to the transaction information, for example, the transaction is sold, the inventory is deducted, and then the sale is based on To update the regional deduction field, if the transaction is buy and the inventory is increased, the regional input field is updated according to the purchase amount.

當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,也就是在區域輸入欄位原來的值上上加上庫存增加的數值,這時分區庫存資料庫中的庫存表發生變化,根據該變化來同步各個分區庫存資 料庫的庫存表,由此各個分區庫存資料庫的庫存表中與發生庫存增加的分區庫存資料庫對應的區域輸入欄位都發生相同的變化,完成同步更新。 When the inventory of the partition inventory database increases, the area input field corresponding to the partition inventory database is updated, that is, the value of the inventory increase is added to the original value of the area input field, and then the partition inventory database is The inventory table changes, and the inventory table of each partition inventory database is synchronized according to the change, so that the regional input fields corresponding to the partition inventory database in which the inventory increase occurs in the inventory table of each partition inventory database are the same. Change to complete the sync update.

當分區庫存資料庫發生庫存扣減時,更新與所述分區庫存資料庫對應的區域扣減欄位,也就是在區域輸入欄位原來的值上上減去庫存增加的數值。但如果此時庫存餘額不足,則無法完成庫存扣減。因此當分區庫存資料庫發生庫存扣減時,先判斷庫存餘額是否大於或等於當次庫存扣減的數值,所述庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數。如果庫存餘額大於或等於當次庫存扣減的數值,則可以進行庫存扣減,更新與所述分區庫存資料庫對應的區域扣減欄位,這時分區庫存資料庫中的庫存表發生變化,根據該變化同步各個分區庫存資料庫的庫存表,由此各個分區庫存資料庫的庫存表中與發生庫存扣減的分區庫存資料庫對應的區域扣減欄位都發生相同的變化,完成同步更新。如果庫存餘額小於當次庫存扣減的數值,則不能進行庫存扣減,也就不更新與所述分區庫存資料庫對應的區域扣減欄位,這種情況下可以顯示庫存不足訊息,以提醒用戶此時庫存不足,無法完成庫存扣減。 When the inventory deduction of the partition inventory database occurs, the regional deduction field corresponding to the partition inventory database is updated, that is, the value of the inventory increase is subtracted from the original value of the regional input field. However, if the inventory balance is insufficient at this time, the inventory deduction cannot be completed. Therefore, when the inventory deduction of the partition inventory database occurs, it is first determined whether the inventory balance is greater than or equal to the value of the current inventory deduction, the inventory balance M=Σ(a1+a2+...+an)-Σ(b1+b2+ ......+bn), where a1 to an are the regional input fields of each partition inventory database, b1 to bn are the regional deduction fields of each partition inventory database, and n is the number of partition inventory databases. . If the inventory balance is greater than or equal to the value of the current inventory deduction, the inventory deduction may be performed, and the regional deduction field corresponding to the partition inventory database is updated, and the inventory table in the partition inventory database changes, according to The change synchronizes the inventory table of each partition inventory database, so that the regional deduction field corresponding to the partition inventory database in which the inventory deduction occurs in the inventory table of each partition inventory database changes the same, and the synchronization update is completed. If the inventory balance is less than the value of the current inventory deduction, the inventory deduction cannot be performed, and the regional deduction field corresponding to the partitioned inventory database is not updated. In this case, an insufficient inventory message can be displayed to remind The user is not in stock at this time and cannot complete the inventory deduction.

其中,較佳地,分區庫存資料庫發生庫存發生變化(增加或減少)時,更新與所述分區庫存資料庫對應的區 域輸入欄位或區域扣減欄位後,對各個分區庫存資料庫的庫存表的同步使用環形同步的方式,這是因為,將本發明中各個分區庫存資料庫在同步時作為多主庫,使用環形同步來處理多主庫資料庫中庫存表的同步,相比一般的將多個資料庫分為主從來同步的方法,具有更高的性能和可靠性。 Preferably, when the inventory inventory database changes (increase or decrease), the regional input field or the regional deduction field corresponding to the partition inventory database is updated, and the inventory database of each partition is The synchronization of the inventory table uses the ring synchronization method, because the partition inventory database in the present invention is used as a multi-master library in synchronization, and the ring synchronization is used to process the synchronization of the inventory table in the multi-master database database, compared to the general The method of dividing multiple databases into primary and secondary synchronization has higher performance and reliability.

需要說明的是,發生庫存輸入和發生庫存扣減之間並無先後關係,因此本發明提供的技術方案中步驟S102與步驟S103(及步驟S104)之間並不受撰寫順序的限定,也就是可以先執行步驟S102,再執行步驟S103與步驟S104,也可以先執行步驟S103和步驟S104,再執行步驟S102,或者步驟S102與步驟S103同時執行。 It should be noted that there is no relationship between the occurrence of the inventory input and the occurrence of the inventory deduction. Therefore, the technical solution provided by the present invention is not limited by the writing order between step S102 and step S103 (and step S104), that is, Step S102 and step S104 may be performed first, or step S103 and step S104 may be performed first, then step S102 may be performed, or step S102 and step S103 may be performed simultaneously.

圖2為本發明一示例性實施例示出的另一種庫存系統資料更新方法的流程示意圖,該方法基於圖1所示的方法,如圖2所示,所述方法包括:步驟S201,在庫存表中設置與分區庫存資料庫對應的區域輸入欄位以及區域扣減欄位,以及在庫存表中設置庫存餘額欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值,所述庫存餘額欄位用於記錄所述庫存餘額,所述庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫 存資料庫的個數;步驟S202,當分區庫存資料庫發生庫存增加時,當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,同時更新所述庫存餘額欄位,並同步各個分區庫存資料庫的庫存表;步驟S203,當分區庫存資料庫發生庫存扣減時,判斷所述庫存餘額欄位是否大於或等於當次庫存扣減的數值;步驟S204,當所述庫存餘額大於或等於當次庫存扣減的數值時,更新與所述分區庫存資料庫對應的區域扣減欄位,同時更新所述庫存餘額欄位,並同步各個分區庫存資料庫的庫存表。 FIG. 2 is a schematic flowchart diagram of another method for updating inventory system data according to an exemplary embodiment of the present invention. The method is based on the method shown in FIG. 1. As shown in FIG. 2, the method includes: step S201, in an inventory table. Setting an area input field corresponding to the partition inventory database and an area deduction field, and setting an inventory balance field in the inventory table, wherein the area input field is used to record the value of the inventory increase in the partition inventory database. The area deduction field is used to record the value of the deduction of the inventory in the partition inventory database, and the inventory balance field is used to record the inventory balance, and the inventory balance M=Σ(a1+a2+...+an )-Σ(b1+b2+...+bn), where a1 to an are the regional input fields of each partition inventory database, and b1 to bn are the regional deduction fields of each partition inventory database, respectively, n is The number of the partition inventory database; in step S202, when the inventory of the partition inventory database increases, when the inventory of the partition inventory database increases, the area input field corresponding to the partition inventory database is updated, and the location is updated. Inventory balance field, and synchronize the inventory table of each partition inventory database; step S203, when the inventory inventory deduction occurs in the partition inventory database, determine whether the inventory balance field is greater than or equal to the value of the current inventory deduction; S204. When the inventory balance is greater than or equal to the value of the current inventory deduction, update the regional deduction field corresponding to the partition inventory database, update the inventory balance field, and synchronize the inventory information of each partition. Library inventory table.

步驟S205,當所述庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。 In step S205, when the inventory balance is less than the value of the current inventory deduction, an insufficient inventory message is displayed.

當分區庫存資料庫發生庫存扣減時,上述實施方式,在判斷庫存餘額是否大於或等於當次庫存扣減的數值,要計算庫存餘額值,而分區庫存資料庫發生庫存增加時,並未計算庫存餘額值和對庫存餘額進行更新,這種情況可能會因為對庫存增加情況下庫存餘額的更新空白而導致在庫存扣減情況下計算庫存餘額值時發生錯誤,使得得到的庫存餘額值與實際存在有誤差,如果庫存餘額值計算錯誤,很可能導致系統因為錯誤的庫存扣減而發生崩潰。 When the inventory deduction of the zoning inventory database occurs, the above embodiment determines whether the inventory balance is greater than or equal to the value of the current inventory deduction, and the inventory balance value is calculated, and when the inventory inventory of the zoning inventory database increases, it is not calculated. The inventory balance value and the inventory balance are updated. This situation may result in an error in calculating the inventory balance value in the case of inventory deduction due to the update blank of the inventory balance, so that the obtained inventory balance value and the actual value There is an error, and if the inventory balance value is incorrectly calculated, it is likely to cause the system to crash due to a wrong inventory deduction.

與圖中所述實施例相同,本實施例中,步驟S202與步驟S203(及步驟S204)之間並不受撰寫順序的限定, 也就是可以先執行步驟S202,再執行步驟S203與步驟S204,也可以先執行步驟S203和步驟S204,再執行步驟S202,或者步驟S202與步驟S203同時執行。 In the embodiment, the step S202 and the step S203 (and the step S204) are not limited by the writing order, that is, the step S202 may be performed first, and then the steps S203 and S204 are performed. Step S203 and step S204 may be performed first, then step S202 may be performed, or step S202 and step S203 may be performed simultaneously.

因此在本實施例中,除了在庫存表中設置區域輸入欄位和區域扣減欄位,還在庫存表中設置庫存餘額欄位,所述庫存餘額欄位用以記錄所述庫存餘額。當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,同時更新所述庫存餘額欄位,也就是計算庫存增加後的庫存餘額,將庫存餘額欄位更新到計算結果;以及當分區庫存資料庫發生庫存扣減時,更新與所述分區庫存資料庫對應的區域扣減欄位,同時更新所述庫存餘額欄位,也就是計算庫存扣減後新的庫存餘額值,並庫存餘額欄位更新到計算結果。這樣,由於庫存餘額欄位是即時更新的,在發生庫存扣減時,可以不需再計算庫存餘額,而直接讀取庫存餘額欄位,判斷所述庫存餘額欄位是否大於或等於目前的扣減值。 Therefore, in the present embodiment, in addition to setting the area input field and the area deduction field in the stock table, an inventory balance field is also set in the stock table, and the stock balance field is used to record the stock balance. When the inventory of the partition inventory database increases, the area input field corresponding to the partition inventory database is updated, and the inventory balance field is updated, that is, the inventory balance after the inventory increase is calculated, and the inventory balance field is updated. To the calculation result; and when the inventory deduction of the partition inventory database occurs, updating the regional deduction field corresponding to the partition inventory database, and updating the inventory balance field, that is, calculating the new inventory deduction The inventory balance value and the inventory balance field are updated to the calculation result. In this way, since the inventory balance field is updated in real time, when the inventory deduction occurs, the inventory balance can be read without directly calculating the inventory balance field, and it is determined whether the inventory balance field is greater than or equal to the current deduction. Impairment.

本發明實施例提供的技術方案,在庫存表中設置與分區庫存資料庫對應的區域輸入欄位和區域扣減欄位,當分區庫存資料庫發生庫存增加或者庫存扣減時,只需更新與該分區庫存資料庫對應的區域輸入欄位或者區域扣減欄位,因而即使同時有多個分區庫存資料庫發生庫存變化,也只用分別更新與各個分區庫存資料庫對應的區域輸入欄位或區域扣減欄位,而不會出現同時更新同一個欄位的情況,從而能夠很好地避免資料同步衝突。而且每個分區庫 存資料庫發生庫存變化時,可以在分區庫存資料庫本地更新對應的區域輸入欄位或者區域扣減欄位,再同步庫存表,而不需對其他分區庫存資料庫發起遠距離訪問來進行更新修改,因此資料更新回應時間短,有利於提高系統的處理量、可用性以及用戶體驗。 According to the technical solution provided by the embodiment of the present invention, an area input field and an area deduction field corresponding to the partition inventory database are set in the inventory table, and when the inventory inventory of the partition inventory database increases or the inventory deduction occurs, only the update and the The area input field or the area deduction field corresponding to the partition inventory database, so that even if there are multiple partition inventory database inventory changes at the same time, only the regional input fields corresponding to each partition inventory database are updated separately or The area deducts the field without the simultaneous update of the same field, which can avoid data synchronization conflicts. Moreover, when inventory changes occur in each partition inventory database, the corresponding regional input field or regional deduction field can be locally updated in the partition inventory database, and the inventory table can be synchronized, without having to initiate long distance to other partition inventory databases. Access to update and modify, so the data update response time is short, which helps to improve the system's processing capacity, availability and user experience.

透過以上的方法實施例的描述,所屬領域的技術人員可以清楚地瞭解到本發明可借助軟體加必需的通用硬體平臺的方式來實現,當然也可以透過硬體,但很多情況下前者是更佳的實施模式。基於這樣的理解,本發明的技術方案本質上或者說對現有技術做出貢獻的部分可以以軟體產品的形式體現出來,並被儲存在一個儲存媒體中,包括若干指令用以使得一台智慧設備執行本發明各個實施例所述方法的全部或部分步驟。而前述的儲存媒體包括:唯讀記憶體(ROM)、隨機存取記憶體(RAM)、磁碟或者光碟等各種可以儲存資料和程式碼的媒體。 Through the description of the above method embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of a software plus a necessary universal hardware platform, and of course, can also be through hardware, but in many cases, the former is more Good implementation mode. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product and stored in a storage medium, including a number of instructions for making a smart device. All or part of the steps of the method of the various embodiments of the invention are performed. The foregoing storage medium includes: a medium that can store data and a code, such as a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

圖3為本發明一示例性實施例示出的一種庫存系統資料更新裝置的方塊圖。如圖3所示,所述裝置包括:欄位設置單元U301,用以根據各個分區庫存資料庫的區域標識,在庫存表中設置與所述區域標識對應的區域輸入欄位以及區域扣減欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值;第一更新單元U302,用以當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄 位,並同步各個分區庫存資料庫的庫存表;存餘判斷單元U303,用以當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值;第二更新單元U304,用以當所述庫存餘額大於或等於當次庫存扣減的數值時,更新與所述分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。 FIG. 3 is a block diagram of an inventory system data update apparatus according to an exemplary embodiment of the present invention. As shown in FIG. 3, the device includes: a field setting unit U301, configured to set an area input field corresponding to the area identifier and an area deduction column in the inventory table according to the area identifier of each partition inventory database. Bit, the area input field is used to record the value of the inventory increase in the partition inventory database, and the area deduction field is used to record the value of the inventory deduction in the partition inventory database; the first update unit U302 is used to When the inventory of the partition inventory database increases, the regional input field corresponding to the partition inventory database is updated, and the inventory table of each partition inventory database is synchronized; the deposit judging unit U303 is used to generate the partition inventory database. When the inventory is deducted, it is determined whether the inventory balance is greater than or equal to the value of the current inventory deduction; the second update unit U304 is configured to update the partition when the inventory balance is greater than or equal to the value of the current inventory deduction The area corresponding to the inventory database deducts the field and synchronizes the inventory table of each partition inventory database.

其中,所述庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數。 Wherein, the inventory balance M=Σ(a1+a2+...+an)-Σ(b1+b2+...++bn), wherein a1 to an are the regional input fields of the respective partition inventory databases, b1 to Bn is the regional deduction field for each partition inventory database, and n is the number of partition inventory databases.

其中,較佳的是,所述第一更新單元和所述第二更新單元使用環形同步來同步各個分區庫存資料庫的庫存表。 Preferably, the first update unit and the second update unit use ring synchronization to synchronize the inventory tables of the respective partition inventory databases.

圖4為本發明一示例性實施例示出的另一種庫存系統資料更新裝置的方塊圖。如圖4所示,所述裝置包括:欄位設置單元U401,用以根據各個分區庫存資料庫的區域標識,在庫存表中設置與所述區域標識對應的區域輸入欄位以及區域扣減欄位,以及在庫存表中設置庫存餘額欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值,所述庫存餘額欄位用以記錄所述庫存餘額,所述庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存 資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數;第一更新單元U402,用以當分區庫存資料庫發生庫存增加時,更新與所述分區庫存資料庫對應的區域輸入欄位,同時更新所述庫存餘額欄位,並同步各個分區庫存資料庫的庫存表;存餘判斷單元U403,用以當分區庫存資料庫發生庫存扣減時,判斷所述庫存餘額欄位是否大於或等於當次庫存扣減的數值;第二更新單元U404,用以當分區庫存資料庫發生庫存扣減時,更新與所述分區庫存資料庫對應的區域扣減欄位,同時更新所述庫存餘額欄位,並同步各個分區庫存資料庫的庫存表;提示單元U405,用以當所述庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。 FIG. 4 is a block diagram of another inventory system data updating apparatus according to an exemplary embodiment of the present invention. As shown in FIG. 4, the device includes: a field setting unit U401, configured to set an area input field corresponding to the area identifier and an area deduction column in the inventory table according to the area identifier of each partition inventory database. Bit, and set the inventory balance field in the inventory table, the area input field is used to record the value of the inventory increase in the partition inventory database, and the regional deduction field is used to record the inventory deduction in the partition inventory database. The inventory balance field is used to record the inventory balance, the inventory balance M=Σ(a1+a2+...+an)-Σ(b1+b2+...++bn), where a1 to an Field input fields for each partition inventory database, b1 to bn are the regional deduction fields of each partition inventory database, n is the number of partition inventory database; first update unit U402 is used to partition When the inventory database increases, the area input field corresponding to the partition inventory database is updated, the inventory balance field is updated, and the inventory table of each partition inventory database is synchronized; the remaining judgment unit U403 is used. Take When the inventory deduction of the partition inventory database occurs, it is determined whether the inventory balance field is greater than or equal to the value of the current inventory deduction; the second update unit U404 is used to update the inventory deduction when the partition inventory database occurs. The area corresponding to the partition inventory database deducts the field, simultaneously updates the inventory balance field, and synchronizes the inventory table of each partition inventory database; the prompt unit U405 is used when the inventory balance is less than the current inventory deduction When the value is subtracted, the insufficient stock message is displayed.

為了描述的方便,描述以上裝置時以功能區分而為各種單元分別描述。當然,在實施本發明時可以把各單元的功能在同一個或多個軟體和/或硬體中予以實現。 For convenience of description, the above devices are described separately in terms of functions and are described separately for various units. Of course, the functions of the various units may be implemented in the same or multiple software and/or hardware in the practice of the invention.

本說明書中的各個實施例均採用漸進的方式來描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於裝置或系統實施例而言,由於其基本上相似於方法實施例,所以描述得比較簡單,相關之處參見方法實施例的部分說明即可。以上所描述的裝置及系統實施例僅僅是示意 性的,其中所述作為分離部件說明的單元可以是或者也可以不是物理上分開的,作為單元顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分佈到多個網路單元上。可以根據實際的需要而選擇其中的部分或者全部模組來實現本實施例方案的目的。本領域普通技術人員在不付出創造性勞動的情況下,即可以理解並實施。 The various embodiments in the present specification are described in a gradual manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for a device or system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant portions can be referred to the description of the method embodiments. The apparatus and system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie It can be located in one place or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.

需要說明的是,在本文中,諸如“第一”和“第二”等之類的關係術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在有任何這種實際的關係或者逆序。而且,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、裝置或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、裝置或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括所述要素的過程、方法、裝置或者設備中還存在有另外的相同要素。 It should be noted that, in this context, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these There is any such actual relationship or reverse order between entities or operations. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, apparatus, or device that includes a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, device, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of the same element in the process, method, apparatus, or device.

以上所述僅是本發明的具體實施例,使本領域技術人員能夠理解或實現本發明。對這些實施例的多種修改對本領域的技術人員來說將是顯而易見的,本文中所定義的一般原理可以在不脫離本發明的精神或範圍的情況下,在其他實施例中實現。因此,本發明將不會被限制於本文所示 的這些實施例,而是要符合與本文所揭示的原理和新穎特徵相一致的最寬的範圍。 The above description is only illustrative of specific embodiments of the invention, which will enable those skilled in the art to understand or implement the invention. Various modifications to these embodiments are obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but the scope of the invention.

Claims (12)

一種庫存系統資料更新方法,其特徵在於,包括:在庫存表中設置與分區庫存資料庫對應的區域輸入欄位以及區域扣減欄位,該區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,該區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值;當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值;以及當該庫存餘額大於或等於當次庫存扣減的數值時,則更新與該分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。  An inventory system data updating method, comprising: setting an area input field corresponding to a partition inventory database and an area deduction field in an inventory table, wherein the input field of the area is used to record the inventory in the partition inventory database The added value, the area deduction field is used to record the value of the deduction of the inventory in the partition inventory database; when the inventory of the partition inventory database increases, the regional input field corresponding to the partition inventory database is updated and synchronized. The inventory table of each partition inventory database; when the inventory deduction of the partition inventory database occurs, it is judged whether the inventory balance is greater than or equal to the value of the current inventory deduction; and when the inventory balance is greater than or equal to the value of the current inventory deduction At the same time, the regional deduction field corresponding to the partition inventory database is updated, and the inventory table of each partition inventory database is synchronized.   根據申請專利範圍第1項所述的庫存系統資料更新方法,其中,該庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數。  According to the inventory system data updating method described in claim 1, wherein the stock balance M=Σ(a1+a2+...+an)-Σ(b1+b2+......+bn), wherein a1 to an The fields are respectively input into the area of each partition inventory database, and b1 to bn are the regional deduction fields of each partition inventory database, and n is the number of the partition inventory database.   根據申請專利範圍第1或2項所述的庫存系統資料更新方法,其中,還包括:在庫存表中設置庫存餘額欄位,該庫存餘額欄位用以記錄該庫存餘額; 當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,同時更新該庫存餘額欄位;以及,當分區庫存資料庫發生庫存扣減時,更新與該分區庫存資料庫對應的區域扣減欄位,同時更新該庫存餘額欄位。  The inventory system data updating method according to claim 1 or 2, further comprising: setting an inventory balance field in the inventory table, the inventory balance field is used to record the inventory balance; and when the partition inventory database When the inventory increase occurs, the area input field corresponding to the partition inventory database is updated, and the inventory balance field is updated; and when the inventory deduction of the partition inventory database occurs, the area corresponding to the partition inventory database is updated. Deduct the field and update the inventory balance field.   根據申請專利範圍第3項所述的庫存系統資料更新方法,其中,當分區庫存資料庫發生庫存扣減時,判斷該庫存餘額欄位是否大於或等於當次庫存扣減的數值。  According to the inventory system data updating method described in claim 3, when the inventory deduction of the partition inventory database occurs, it is determined whether the inventory balance field is greater than or equal to the value of the current inventory deduction.   根據申請專利範圍第1項所述的庫存系統資料更新方法,其中,還包括:當該庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。  The method for updating inventory system data according to claim 1, wherein the method further comprises: displaying an insufficient inventory message when the inventory balance is less than the value of the current inventory deduction.   根據申請專利範圍第1項所述的庫存系統資料更新方法,其中,使用環形同步來同步各個分區庫存資料庫的庫存表。  The inventory system data update method according to claim 1, wherein the ring synchronization is used to synchronize the inventory tables of the respective partition inventory databases.   一種庫存系統資料更新裝置,其特徵在於,包括:欄位設置單元,用以根據各個分區庫存資料庫的區域標識,在庫存表中設置與所述區域標識對應的區域輸入欄位以及區域扣減欄位,該區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,該區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值; 第一更新單元,用以當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;存餘判斷單元,用以當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值;以及第二更新單元,用以當該庫存餘額大於或等於當次庫存扣減的數值時,更新與該分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。  An inventory system data updating device, comprising: a field setting unit, configured to set an area input field corresponding to the area identifier and an area deduction in the inventory table according to the area identifier of each partition inventory database; Field, the input field of the area is used to record the value of the inventory increase in the partition inventory database, and the deduction field of the area is used to record the value of the deduction of the inventory in the partition inventory database; the first update unit is used to be the partition When the inventory database increases, the area input field corresponding to the partition inventory database is updated, and the inventory table of each partition inventory database is synchronized; the remaining judgment unit is used when the inventory deduction of the partition inventory database occurs. And determining, by the second update unit, the area corresponding to the partition inventory database when the inventory balance is greater than or equal to the value of the current inventory deduction; Deduct the fields and synchronize the inventory table of each partition inventory database.   根據申請專利範圍第7項所述的庫存系統資料更新裝置,其中,該庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數。  The inventory system data updating device according to item 7 of the patent application scope, wherein the inventory balance M=Σ(a1+a2+...+an)-Σ(b1+b2+...++bn), wherein a1 to an The fields are respectively input into the area of each partition inventory database, and b1 to bn are the regional deduction fields of each partition inventory database, and n is the number of the partition inventory database.   根據申請專利範圍第7或8項所述的庫存系統資料更新裝置,其中,該欄位設置單元,還用以在庫存表中設置庫存餘額欄位,該庫存餘額欄位用以記錄該庫存餘額;該第一更新單元,用以當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,同時更新該庫存餘額欄位;以及該第二更新單元,用以當分區庫存資料庫發生庫存扣減時,更新與該分區庫存資料庫對應的區域扣減欄位,同時更新該庫存餘額欄位。  The inventory system data updating device according to claim 7 or 8, wherein the field setting unit is further configured to set an inventory balance field in the inventory table, wherein the inventory balance field is used to record the inventory balance The first update unit is configured to update an area input field corresponding to the partition inventory database when the inventory inventory database increases, and update the inventory balance field; and the second update unit is configured to: When the inventory deduction occurs in the partition inventory database, the regional deduction field corresponding to the partition inventory database is updated, and the inventory balance field is updated.   根據申請專利範圍第9項所述的庫存系統資料更新裝置,其中,該存餘判斷單元,用以當分區庫存資料庫發生庫存扣減時,判斷該庫存餘額欄位是否大於或等於當次庫存扣減的數值。  The inventory system data updating device according to claim 9, wherein the deposit determining unit is configured to determine whether the inventory balance field is greater than or equal to the current inventory when the inventory deduction occurs in the partition inventory database. The deduction value.   根據申請專利範圍第7項所述的庫存系統資料更新裝置,其中,還包括:提示單元,用以當該庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。  The inventory system data updating device according to the seventh aspect of the invention, further comprising: a prompting unit, configured to display an insufficient stock message when the stock balance is less than a value of the current stock deduction.   根據申請專利範圍第7項所述的庫存系統資料更新裝置,其中,該第一更新單元和該第二更新單元使用環形同步來同步各個分區庫存資料庫的庫存表。  The inventory system data updating apparatus according to claim 7, wherein the first update unit and the second update unit synchronize the inventory table of each of the partition stock databases using ring synchronization.  
TW106101960A 2017-01-19 2017-01-19 Method and device for updating inventory system data TWI734730B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106101960A TWI734730B (en) 2017-01-19 2017-01-19 Method and device for updating inventory system data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106101960A TWI734730B (en) 2017-01-19 2017-01-19 Method and device for updating inventory system data

Publications (2)

Publication Number Publication Date
TW201828112A true TW201828112A (en) 2018-08-01
TWI734730B TWI734730B (en) 2021-08-01

Family

ID=63960272

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106101960A TWI734730B (en) 2017-01-19 2017-01-19 Method and device for updating inventory system data

Country Status (1)

Country Link
TW (1) TWI734730B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4183400B2 (en) * 2001-06-27 2008-11-19 株式会社日立製作所 Database system, database management method and program
TW200602911A (en) * 2004-07-13 2006-01-16 Asiatek Inc Mixed decentralized file vault optimization system and related apparatus
US7870226B2 (en) * 2006-03-24 2011-01-11 International Business Machines Corporation Method and system for an update synchronization of a domain information file
CN101441738A (en) * 2007-12-24 2009-05-27 北京奥腾讯达科技有限公司 Sectorization storage management system
CN102708529B (en) * 2012-05-16 2015-01-14 北京航空航天大学 Drug storage information managing system for pharmacy
CN103853748A (en) * 2012-11-29 2014-06-11 天津书生投资有限公司 Database synchronizing method
CN104794132B (en) * 2014-01-21 2018-08-24 阿里巴巴集团控股有限公司 Inventory information processing method and system
CN104598610B (en) * 2015-01-29 2017-12-12 无锡江南计算技术研究所 A kind of distributed data base data distribution uploads synchronous method

Also Published As

Publication number Publication date
TWI734730B (en) 2021-08-01

Similar Documents

Publication Publication Date Title
WO2017050179A1 (en) Method and device for updating inventory system data
US10671968B2 (en) Method and system of processing commodity object information
US20210049601A1 (en) Dual transaction method and system based on centralization and decentralization
CN104699712B (en) The method and device being updated to the inventory record information in database
CN106960295B (en) Allocation method and device and pre-sale system
US20190180252A1 (en) Method and device for detecting fund transaction route in electronic payment process
US20150371207A1 (en) Method and system for variability of aggregated payments based on account trustworthiness
US20200234383A1 (en) Blockchain-based service source tracing method, apparatus, and electronic device
CN107092491B (en) Configuration loading method and system
EP3905172A1 (en) Blockchain-based invoice voiding method and apparatus, and electronic device
CN107590207A (en) Method of data synchronization and device, electronic equipment
TWI686703B (en) Method and device for data storage and business processing
CN110147686A (en) A kind of storage method, system, device and the equipment of personal asset change record
CN104111957A (en) Method and system for synchronizing distributed transaction
CN111292049A (en) Task generation method and device
CN107015876A (en) A kind of service request processing method and device
TW201828112A (en) Method and device for updating inventory system data capable of shortening data update response time
WO2023202702A1 (en) Schedule information synchronization method and apparatus, and electronic device
CN106296209B (en) Address input control method and device
CN113806143B (en) Remote disaster recovery method, system and electronic equipment
CN109408792B (en) Customer information complement method and device
CN105574020B (en) Database operation method and device
US20230334095A1 (en) Storage method for graph data and distributed computing method for graph data
US8706619B1 (en) Employing spillover tables for data updates
TW201531982A (en) Data cache method having high transmissivity and accuracy