TWI734730B - Method and device for updating inventory system data - Google Patents

Method and device for updating inventory system data Download PDF

Info

Publication number
TWI734730B
TWI734730B TW106101960A TW106101960A TWI734730B TW I734730 B TWI734730 B TW I734730B TW 106101960 A TW106101960 A TW 106101960A TW 106101960 A TW106101960 A TW 106101960A TW I734730 B TWI734730 B TW I734730B
Authority
TW
Taiwan
Prior art keywords
inventory
partition
database
deduction
area
Prior art date
Application number
TW106101960A
Other languages
Chinese (zh)
Other versions
TW201828112A (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

Images

Landscapes

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

Abstract

本發明實施例揭示了一種庫存系統資料更新方法及裝置。所述方案,在庫存表中設置與分區庫存資料庫對應的區域輸入欄位和區域扣減欄位,當分區庫存資料庫發生庫存增加或者庫存扣減時,只需更新與該分區庫存資料庫對應的區域輸入欄位或者區域扣減欄位,亦即使同時有多個分區庫存資料庫發生庫存變化,也只用分別更新與各個分區庫存資料庫對應的區域輸入欄位或區域扣減欄位,而不會出現同時更新同一個欄位的情況,從而能夠很好地避免資料同步衝突。而且每個分區庫存資料庫發生庫存變化時,可以在分區庫存資料庫本地更新對應的區域輸入欄位或者區域扣減欄位,再同步庫存表,因此資料更新回應時間短,有利於提高系統的處理量和可用性。 The embodiment of the present invention discloses a method and device for updating inventory system data. In the solution, the area input field and the area deduction field corresponding to the partition inventory database are set in the inventory table. When the inventory increase or inventory deduction occurs in the partition inventory database, only the partition inventory database needs to be updated. The corresponding area input field or area deduction field, even if there are inventory changes in multiple partition inventory databases at the same time, only the area input field or area deduction field corresponding to each partition inventory database is updated separately , And will not update the same field at the same time, which can avoid data synchronization conflicts. Moreover, when inventory changes occur in each partition inventory database, you can update the corresponding area input field or area deduction field locally in the partition inventory database, and then synchronize the inventory table, so the data update response time is short, which is beneficial to improve the system. Processing volume and availability.

Description

庫存系統資料更新方法及裝置 Method and device for updating inventory system data

本發明係有關資料庫技術領域,尤其有關一種庫存系統資料更新方法及裝置。 The present 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. Because website users come from different regions and the geographical differences are huge, in order to increase the speed of regional data processing and improve user experience, a distributed inventory system is usually used, that is, to establish partitioned inventory data in areas where users are concentrated. Database, each partition inventory database is connected, each partition inventory database is used to store and process inventory data, which is convenient for local users to quickly access. In the partitioned inventory database, the inventory data structure exists in the form of a table, called an inventory table. In order to facilitate synchronization, the partitioned inventory database shares the inventory table. The inventory data in the inventory table exists in the form of fields, including the inventory input The value input field, the deduction field indicating the inventory deduction value, and the inventory balance field. Inventory input means that the inventory provider enters a new inventory value, which is equivalent to inventory entry. Inventory deduction means that the inventory consumer deducts inventory. 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 synchronously. Specifically, when a transaction occurs in a certain place, the input field (occurring When inventory is entered) or the deduction field (when inventory deduction occurs) is modified, the modification will synchronize the same field in the inventory table of other partition inventory databases. However, transactions in various places often occur at the same time. The same column of the inventory table in each partition inventory database changes concurrently. This concurrency will cause data synchronization conflicts, cause data errors in the inventory table, and affect the real inventory. Data and transaction processing.

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

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

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

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

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

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

可選地,所述的庫存系統資料更新方法,使用環形同步來同步各個分區庫存資料庫的庫存表。 Optionally, the inventory system data update method uses ring synchronization to synchronize the inventory tables of each partitioned 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, and according to the second aspect of the embodiment of the present invention, an inventory system data update device is provided, including: a field setting unit for identifying the area of each partitioned inventory database, An area input field and an area deduction field corresponding to the area identifier are set in the inventory table. The area input field is used to record the increase in inventory in the partition inventory database, and the area deduction field is used for To record the value of the inventory deduction in the partition inventory database; the first update unit is used to update the area input field corresponding to the partition inventory database when the inventory increase occurs in the partition inventory database, and synchronize the inventory of each partition The inventory table of the database; the inventory judgment unit is used to determine whether the inventory balance is greater than or equal to the current inventory deduction value when the inventory deduction occurs in the partitioned inventory database, the inventory balance M=Σ(a1+a2+ ……+an)-Σ(b1+b2+……+bn), where a1 to an are the area input fields of each partition inventory database, and b1 to bn are the area deduction fields of each partition inventory database. Bit, n is the number of the partition inventory database; the second update unit is used to update the area deduction column corresponding to the partition inventory database when the inventory balance is greater than or equal to the current inventory deduction value And synchronize the inventory tables of each partition's inventory database.

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

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

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

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

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

應當理解的是,以上的一般描述和後文的細節描述僅是示例性和解釋性的,並不能限制本發明。 It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present invention.

U301‧‧‧欄位設置單元 U301‧‧‧Column Setting Unit

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

U303‧‧‧存餘判斷單元 U303‧‧‧Remaining Judgment Unit

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

U401‧‧‧欄位設置單元 U401‧‧‧Column Setting Unit

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

U403‧‧‧存餘判斷單元 U403‧‧‧Remaining Judgment Unit

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

U405‧‧‧提示單元 U405‧‧‧Prompt unit

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

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

圖2為本發明一示例性實施例示出的另一種庫存系統資料更新方法的流程示意圖。 Fig. 2 is a schematic flowchart 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 updating device according to an exemplary embodiment of the present invention.

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

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

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

圖1為本發明一示例性實施例示出的一種庫存系統資料更新方法的流程示意圖,如圖1所示,所述方法包括:步驟S101,在庫存表中設置與分區庫存資料庫對應的區域輸入欄位以及區域扣減欄位,所述區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,所述區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值。 Fig. 1 is a schematic flow chart of a method for updating 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 the partitioned inventory database in the inventory table The field and the area deduction field, 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。各分區庫存資料庫使用同一套表結構,也就是分區庫存資料庫的庫存表是一樣的,並且可以聯動而同步更新。 Wherein, the correspondence with the partition inventory database may be corresponding to the library identifier of the partition inventory database, or corresponding to the area identifier of the partition inventory database. Accordingly, in the inventory table, the number of area input fields and the area deduction The number of subtracted fields is the same as the number of the partition inventory database. For example, the inventory table is provided with area input fields a1, a2, a3...an and area deduction fields b1, b2, b3...bn corresponding to the partitioned inventory databases W1, W2, W3...Wn. Each partition inventory database uses the same table structure, that is, the inventory tables of the partition inventory database are the same, and can be linked and updated synchronously.

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

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

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

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

其中,較佳地,分區庫存資料庫發生庫存發生變化(增加或減少)時,更新與所述分區庫存資料庫對應的區 域輸入欄位或區域扣減欄位後,對各個分區庫存資料庫的庫存表的同步使用環形同步的方式,這是因為,將本發明中各個分區庫存資料庫在同步時作為多主庫,使用環形同步來處理多主庫資料庫中庫存表的同步,相比一般的將多個資料庫分為主從來同步的方法,具有更高的性能和可靠性。 Wherein, preferably, when the inventory of the partition inventory database changes (increases or decreases), after updating the area input field or the area deduction field corresponding to the partition inventory database, the data of each partition inventory database is updated. The synchronization of the inventory table uses the ring synchronization method. This is because each partitioned inventory database in the present invention is used as a multi-master database during synchronization, and the ring synchronization is used to process the synchronization of the inventory tables in the multi-master database. The method of dividing multiple databases into master and slave 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 sequential relationship between the occurrence of inventory input and the occurrence of inventory deduction. Therefore, in the technical solution provided by the present invention, step S102 and step S103 (and step S104) are not limited by the order of writing, that is, Step S102 may be executed first, and then steps S103 and S104 may be executed, or step S103 and step S104 may be executed first, and then step S102 may be executed, or step S102 and step S103 may be executed 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 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: The area input field and area deduction field corresponding to the partition inventory database are set in, and the inventory balance field is set in the inventory table. 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 inventory deduction in the partition inventory database, 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 area input fields of each partition inventory database, b1 to bn are the area deduction fields of each partition inventory database, and n is The number of the partition inventory database; step S202, when the partition inventory database has an inventory increase, when the partition inventory database has an inventory increase, update the area input field corresponding to the partition inventory database, and update the Inventory balance field, and synchronize the inventory tables of each partition inventory database; step S203, when inventory deduction occurs in the partition inventory database, determine whether the inventory balance field is greater than or equal to the current inventory deduction value; step S204: When the inventory balance is greater than or equal to the current inventory deduction value, update the area deduction field corresponding to the partition inventory database, update the inventory balance field at the same time, and synchronize the inventory data of each partition The inventory table of the library.

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

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

與圖中所述實施例相同,本實施例中,步驟S202與步驟S203(及步驟S204)之間並不受撰寫順序的限定, 也就是可以先執行步驟S202,再執行步驟S203與步驟S204,也可以先執行步驟S203和步驟S204,再執行步驟S202,或者步驟S202與步驟S203同時執行。 Similar to the embodiment described in the figure, in this embodiment, the writing sequence between step S202 and step S203 (and step S204) is not limited, that is, step S202 can be performed first, and then step S203 and step S204 can be performed. It is also possible to perform step S203 and step S204 first, and then perform step S202, or step S202 and step S203 can be performed simultaneously.

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

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

透過以上的方法實施例的描述,所屬領域的技術人員可以清楚地瞭解到本發明可借助軟體加必需的通用硬體平臺的方式來實現,當然也可以透過硬體,但很多情況下前者是更佳的實施模式。基於這樣的理解,本發明的技術方案本質上或者說對現有技術做出貢獻的部分可以以軟體產品的形式體現出來,並被儲存在一個儲存媒體中,包括若干指令用以使得一台智慧設備執行本發明各個實施例所述方法的全部或部分步驟。而前述的儲存媒體包括:唯讀記憶體(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 software plus the necessary universal hardware platform, of course, through hardware, but in many cases the former is better. The best implementation model. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and stored in a storage medium, including several instructions to make a smart device Perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage media include: read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks and other media that can store data and program codes.

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

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

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

圖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 device according to an exemplary embodiment of the present invention. As shown in FIG. 4, the device includes: a field setting unit U401, which is used to set an area input field and an area deduction field corresponding to the area identification in the inventory table according to the area identification of each partitioned inventory database In the inventory table, an inventory balance field is set. The area input field is used to record the increase in inventory in the partition inventory database, and the area 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 Enter the fields for the area of each partition inventory database, b1 to bn are the area deduction fields of each partition inventory database, n is the number of the partition inventory database; the first update unit U402 is used as the partition When inventory increases in the inventory database, update the area input field corresponding to the partition inventory database, update the inventory balance field at the same time, and synchronize the inventory tables of each partition inventory database; the inventory judgment unit U403 uses In order to determine whether the inventory balance field is greater than or equal to the value of the current inventory deduction when an inventory deduction occurs in the partitioned inventory database; the second update unit U404 is used for when an inventory deduction occurs in the partitioned inventory database, Update the area deduction field corresponding to the partition inventory database, update the inventory balance field at the same time, and synchronize the inventory tables of each partition inventory database; the prompt unit U405 is used for when the inventory balance is less than the current time When the value of inventory deduction, the message of insufficient inventory is displayed.

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

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

需要說明的是,在本文中,諸如“第一”和“第二”等之類的關係術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在有任何這種實際的關係或者逆序。而且,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、裝置或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、裝置或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括所述要素的過程、方法、裝置或者設備中還存在有另外的相同要素。 It should be noted that in this article, relational terms such as "first" and "second" are only used 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. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, device, or device that includes a series of elements includes not only those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, device, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, device, or equipment that includes the element.

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

Claims (12)

一種庫存系統資料更新方法,其特徵在於,包括:在庫存表中設置與分區庫存資料庫對應的區域輸入欄位以及區域扣減欄位,該區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,該區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值;當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值;以及當該庫存餘額大於或等於當次庫存扣減的數值時,則更新與該分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。 A method for updating inventory system data, which is characterized by comprising: setting an area input field and an area deduction field corresponding to the partition inventory database in the inventory table, and the area input field is used to record the inventory in the partition inventory database. Increased value, the area deduction field is used to record the value of inventory deduction in the partition inventory database; when the inventory increase occurs in the partition inventory database, update the area input field corresponding to the partition inventory database and synchronize The inventory table of each partition inventory database; when inventory deduction occurs in the partition inventory database, determine whether the inventory balance is greater than or equal to the current inventory deduction value; and when the inventory balance is greater than or equal to the current inventory deduction value At the time, update the area deduction field corresponding to the partition inventory database, and synchronize the inventory tables of each partition inventory database. 根據申請專利範圍第1項所述的庫存系統資料更新方法,其中,該庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數。 According to the inventory system data update method described in item 1 of the scope of patent application, the inventory balance M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn), where a1 to an Enter the fields for the area of each partition inventory database, b1 to bn are the area deduction fields of each partition inventory database, and n is the number of the partition inventory database. 根據申請專利範圍第1或2項所述的庫存系統資料更新方法,其中,還包括:在庫存表中設置庫存餘額欄位,該庫存餘額欄位用以記錄該庫存餘額; 當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,同時更新該庫存餘額欄位;以及,當分區庫存資料庫發生庫存扣減時,更新與該分區庫存資料庫對應的區域扣減欄位,同時更新該庫存餘額欄位。 The inventory system data update method according to item 1 or 2 of the scope of patent application, which further includes: setting an inventory balance field in the inventory table, and the inventory balance field is used to record the inventory balance; when the inventory database is partitioned When inventory increase occurs, update the area input field corresponding to the partition inventory database, and update the inventory balance field at the same time; and, when inventory deduction occurs in the partition inventory database, update the area corresponding to the partition inventory database Decrease the field and update the inventory balance field at the same time. 根據申請專利範圍第3項所述的庫存系統資料更新方法,其中,當分區庫存資料庫發生庫存扣減時,判斷該庫存餘額欄位是否大於或等於當次庫存扣減的數值。 According to the inventory system data update method described in item 3 of the scope of patent application, when inventory deduction occurs in the partitioned inventory database, it is determined whether the inventory balance field is greater than or equal to the current inventory deduction value. 根據申請專利範圍第1項所述的庫存系統資料更新方法,其中,還包括:當該庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。 The method for updating inventory system data according to item 1 of the scope of patent application, which further includes: when the inventory balance is less than the current inventory deduction value, displaying an inventory shortage message. 根據申請專利範圍第1項所述的庫存系統資料更新方法,其中,使用環形同步來同步各個分區庫存資料庫的庫存表。 According to the inventory system data update method described in item 1 of the scope of patent application, ring synchronization is used to synchronize the inventory tables of each partition inventory database. 一種庫存系統資料更新裝置,其特徵在於,包括:欄位設置單元,用以根據各個分區庫存資料庫的區域標識,在庫存表中設置與所述區域標識對應的區域輸入欄位以及區域扣減欄位,該區域輸入欄位用以記錄分區庫存資料庫中庫存增加的數值,該區域扣減欄位用以記錄分區庫存資料庫中庫存扣減的數值; 第一更新單元,用以當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,並同步各個分區庫存資料庫的庫存表;存餘判斷單元,用以當分區庫存資料庫發生庫存扣減時,判斷庫存餘額是否大於或等於當次庫存扣減的數值;以及第二更新單元,用以當該庫存餘額大於或等於當次庫存扣減的數值時,更新與該分區庫存資料庫對應的區域扣減欄位,並同步各個分區庫存資料庫的庫存表。 An inventory system data update device, which is characterized by comprising: a field setting unit for setting an area input field and area deduction corresponding to the area identification in the inventory table according to the area identification of each partitioned inventory database Field, the input field in this area is used to record the value of inventory increase in the partition inventory database, and the area deduction field is used to record the value of inventory deduction in the partition inventory database; the first update unit is used as the partition When inventory increases in the inventory database, update the input field corresponding to the partition inventory database, and synchronize the inventory tables of each partition inventory database; the inventory judgment unit is used when inventory deduction occurs in the partition inventory database To determine whether the inventory balance is greater than or equal to the current inventory deduction value; and the second update unit is used to update the area corresponding to the partition inventory database when the inventory balance is greater than or equal to the current inventory deduction value Deduct fields and synchronize the inventory tables of each partition's inventory database. 根據申請專利範圍第7項所述的庫存系統資料更新裝置,其中,該庫存餘額M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn),其中,a1至an分別為各個分區庫存資料庫的區域輸入欄位,b1至bn分別為各個分區庫存資料庫的區域扣減欄位,n為分區庫存資料庫的個數。 According to the inventory system data update device described in item 7 of the scope of patent application, the inventory balance M=Σ(a1+a2+……+an)-Σ(b1+b2+……+bn), where a1 to an Enter the fields for the area of each partition inventory database, b1 to bn are the area deduction fields of each partition inventory database, and n is the number of the partition inventory database. 根據申請專利範圍第7或8項所述的庫存系統資料更新裝置,其中,該欄位設置單元,還用以在庫存表中設置庫存餘額欄位,該庫存餘額欄位用以記錄該庫存餘額;該第一更新單元,用以當分區庫存資料庫發生庫存增加時,更新與該分區庫存資料庫對應的區域輸入欄位,同時更新該庫存餘額欄位;以及該第二更新單元,用以當分區庫存資料庫發生庫存扣減時,更新與該分區庫存資料庫對應的區域扣減欄位,同時更新該庫存餘額欄位。 The inventory system data update device according to item 7 or 8 of the scope of patent application, wherein the field setting unit is also used to set an inventory balance field in the inventory table, and the inventory balance field is used to record the inventory balance ; The first update unit is used to update the area input field corresponding to the partition inventory database when the inventory increase occurs in the partition inventory database, and update the inventory balance field at the same time; and the second update unit is used for When an inventory deduction occurs in a partition inventory database, update the area deduction field corresponding to the partition inventory database, and update the inventory balance field at the same time. 根據申請專利範圍第9項所述的庫存系統資料更新裝置,其中,該存餘判斷單元,用以當分區庫存資料庫發生庫存扣減時,判斷該庫存餘額欄位是否大於或等於當次庫存扣減的數值。 The inventory system data update device according to item 9 of the scope of patent application, wherein the inventory determination unit is used to determine whether the inventory balance field is greater than or equal to the current inventory when inventory deduction occurs in the partitioned inventory database The value of the deduction. 根據申請專利範圍第7項所述的庫存系統資料更新裝置,其中,還包括:提示單元,用以當該庫存餘額小於當次庫存扣減的數值時,顯示庫存不足訊息。 The inventory system data update device according to item 7 of the scope of patent application further includes: a prompting unit for displaying an insufficient inventory message when the inventory balance is less than the current inventory deduction value. 根據申請專利範圍第7項所述的庫存系統資料更新裝置,其中,該第一更新單元和該第二更新單元使用環形同步來同步各個分區庫存資料庫的庫存表。 The inventory system data update device according to item 7 of the scope of patent application, wherein the first update unit and the second update unit use ring synchronization to synchronize the inventory tables of each partitioned inventory database.
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 TW201828112A (en) 2018-08-01
TWI734730B true 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)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030004975A1 (en) * 2001-06-27 2003-01-02 Yukio Nakano Database management system with rebalance architectures
TW200602911A (en) * 2004-07-13 2006-01-16 Asiatek Inc Mixed decentralized file vault optimization system and related apparatus
US20070226269A1 (en) * 2006-03-24 2007-09-27 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
CN102708529A (en) * 2012-05-16 2012-10-03 北京航空航天大学 Drug storage information managing system for pharmacy
CN103853748A (en) * 2012-11-29 2014-06-11 天津书生投资有限公司 Database synchronizing method
CN104598610A (en) * 2015-01-29 2015-05-06 无锡江南计算技术研究所 Step-by-step database data distribution uploading and synchronizing method
CN104794132A (en) * 2014-01-21 2015-07-22 阿里巴巴集团控股有限公司 Inventory information processing method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030004975A1 (en) * 2001-06-27 2003-01-02 Yukio Nakano Database management system with rebalance architectures
TW200602911A (en) * 2004-07-13 2006-01-16 Asiatek Inc Mixed decentralized file vault optimization system and related apparatus
US20070226269A1 (en) * 2006-03-24 2007-09-27 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
CN102708529A (en) * 2012-05-16 2012-10-03 北京航空航天大学 Drug storage information managing system for pharmacy
CN103853748A (en) * 2012-11-29 2014-06-11 天津书生投资有限公司 Database synchronizing method
CN104794132A (en) * 2014-01-21 2015-07-22 阿里巴巴集团控股有限公司 Inventory information processing method and system
CN104598610A (en) * 2015-01-29 2015-05-06 无锡江南计算技术研究所 Step-by-step database data distribution uploading and synchronizing method

Also Published As

Publication number Publication date
TW201828112A (en) 2018-08-01

Similar Documents

Publication Publication Date Title
WO2017050179A1 (en) Method and device for updating inventory system data
CN108536752B (en) Data synchronization method, device and equipment
WO2017162113A1 (en) Method and device for outputting risk information and constructing risk information
CN110648138B (en) Transaction query and transaction data processing method, device and equipment based on block chain
CN107590207B (en) Data synchronization method and device and electronic equipment
CN112487083B (en) Data verification method and device
CN104714949A (en) Method for customizing report dynamically
CN111343241B (en) Graph data updating method, device and system
CN106484699B (en) Method and device for generating database query field
CN105989059A (en) Data record checking method and device
CN110532243A (en) Data processing method, device and electronic equipment
EP3502990A1 (en) Method and device for detecting fund transaction route in electronic payment process
CN107016016A (en) A kind of method and device of data processing
CN107015876A (en) A kind of service request processing method and device
CN104111957A (en) Method and system for synchronizing distributed transaction
CN110457321A (en) Date storage method and Related product based on block chain
CN104506636B (en) A kind of method of data synchronization and device
TWI734730B (en) Method and device for updating inventory system data
CN108563693A (en) A kind of processing method of affairs, device and equipment
WO2023202702A1 (en) Schedule information synchronization method and apparatus, and electronic device
CN103955854B (en) A kind of account management device and method
CN111161064A (en) Processing method and device for blockchain transaction records
CN106855821A (en) A kind of distributed transaction processing method and device
WO2022077916A1 (en) Data processing system, data processing method based on blockchain, and device
CN110569231B (en) Data migration method, device, equipment and medium