201142619 六、發明說明: 【發明所屬之技術領域】 本申請涉及網路技術,尤其涉及統計電子商務交易資 料的方法、應用伺服器和電子商務交易資料統計系統。 【先前技術】 伴隨著互聯網技術的快速發展,電子商務逐漸成爲人 們曰常生活的必需品,各類電子商務網站迅速崛起。對於 一個大型的電子商務網站,即時統計交易資料,並根據交 易資料進行業務分析顯得尤爲重要。 在對現有技術的硏究和實踐過程中,發明人發現現有 技術中存在以下問題:對於大型的電子商務網站,電子商 務交易系統一般會將交易資料保存到電子商務交易系統的 資料庫中,並且每天都會存在上千萬次的資料庫操作。由 於即時資料統計及更新,必須不停的對獲得的資料進行處 理,如果直接在電子商務交易系統的資料庫即時統計交易 資料,那麼就會極大的增加電子商務交易系統的資料庫的 負擔,影響正常的業務交易,嚴重時可能會導致電子商務 交易系統的資料庫當機,進而導致整個電子商務網站都不 可用。 【發明內容】 本申請實施例的目的是提供統計電子商務交易資料的 方法、應用伺服器和電子商務交易資料統計系統,以實現 201142619 即時的統計電子商務交易資料,並且不會增加 易系統的資料庫的負擔’從而不影響正常的業 爲解決上述技術問題’本申請實施例提供 電子商務交易資料的方法,適用於包括電子商 、資料倉庫系統及電子商務交易資料統計系統 系統’該電子商務交易系統包括第—應用伺服 料庫,該電子商務交易資料統計系統用於統計 務交易系統獲得的交易資料,該電子商務交易 統包括第一應用伺服器和第二資料庫,該方法 二應用伺服器即時獲得該第—應用伺服器發出 :在每次獲得交易資料後,該第二應用伺服器 資料’獲取該交易資料所屬類別的資訊;該第 器根據該交易資料所屬類別的資訊,從該第二 得該類別的歷史交易資料,其中,該第二資料 向該資料倉庫系統查詢並獲取符合預設條件的 將獲得的交易資料與之前對應的交易資料進行 不一致的交易資料;該第二應用伺服器結合該 該類別的歷史交易資料,得到該類別的當前交 爲解決上述技術問題’本申請實施例還提 用伺服器’適用於包括電子商務交易系統、資 及電子商務交易資料統計系統的電子商務系統 務交易系統包括第一應用伺服器和第一資料庫 務交易資料統計系統用於統計從該電子商務交 的父易資料’該電子商務交易資料統計系統包 電子商務交 務交易。 了一種統計 務交易系統 的電子商務 器和第一資 從該電子商 資料統計系 包括:該第 的交易資料 分析該交易 二應用伺服 資料庫中獲 庫非即時的 交易資料, 比較,更新 交易資料和 易資料。 供了 一種應 料倉庫系統 ,該電子商 ,該電子商 易系統獲得 括該應用伺 -6 - 201142619 服器和第二資料庫,該應用伺服器包括:交易資料處理單 元和交易資料統計單元;該交易資料處理單元用於即時獲 得該第一應用伺服器發出的交易資料,並在每次獲得交易 資料後,將該交易資料發給該交易資料統計單元;該交易 資料統計單元用於獲得並分析該交易資料,獲取該交易資 料所屬類別的資訊,根據該交易資料所屬類別的資訊,從 該第二資料庫中獲得該類別的歷史交易資料,並結合該交 易資料和該類別的歷史交易資料,得到該類別的當前交易 資料;其中,該第二資料庫非即時的向該資料倉庫系統查' 詢並獲取符合預設條件的交易資料,將獲得的交易資料與 之前對應的交易資料進行比較,更新不一致的交易資料。 爲解決上述技術問題,本申請實施例還提供了 一種電 子商務交易資料統計系統,適用於包括電子商務交易系統 、資料倉庫系統及電子商務交易資料統計系統的電子商務 系統,該電子商務交易系統包括第一應用伺服器和第一資 料庫,該電子商務交易資料統計系統用於統計從該電子商 務交易系統獲得的交易資料,該電子商務交易資料統計系 統包括:第二應用伺服器和第二資料庫;該第二應用伺服 器用於即時獲得該第一應用伺服器發出的交易資料,在每 次獲得交易資料後,分析該交易資料,獲取該交易資料所 屬類別的資訊,根據該交易資料所屬類別的資訊,從該第 二資料庫中獲得該類別的歷史交易資料,並結合該交易資 料和該類別的歷史交易資料,得到該類別的當前交易資料 ;該第二資料庫用於儲存交易資料,並非即時的向該資料 201142619 倉庫系統查詢並獲取符合預設條件的交易 交易資料與之前對應的交易資料進行比較 交易資料。 爲解決上述技術問題,本申請實施例 計電子商務交易資料的方法,適用於包括 統、資料倉庫系統及電子商務交易資料統 務系統,該電子商務交易系統包括第一應 資料庫,該電子商務交易資料統計系統用 商務交易系統獲得的交易資料,該電子商 系統包括第二應用伺服器和第二資料庫, 第二應用伺服器即時獲得該第一應用伺服 料;在每次獲得交易資料後,該第二應用 資料儲存到該第二資料庫中,並分析該交 交易資料所屬類別的資訊,其中,該第二 向該資料倉庫系統查詢並獲取符合預設條 將獲得的交易資料與之前對應的交易資料 不一致的交易資料;該第二應用伺服器根 屬類別的資訊,從該第二資料庫中獲得該 別的歷史交易資料;該第二應用伺服器結 該類別的歷史交易資料,得到該類別的當 爲解決上述技術問題,本申請實施例 用伺服器’其特徵在於,適用於包括電子 資料倉庫系統及電子商務交易資料統計系 統,該電子商務交易系統包括第一應用伺 資料,將獲得的 ,更新不一致的 還提供了 一種統 電子商務交易系 §十系統的電子商 用伺服器和第一 於統計從該電子 務交易資料統計 該方法包括:該 器發出的交易資 伺服器將該交易 易資料,獲取該 資料庫非即時的 件的交易資料, 進行比較,更新 據該交易資料所 交易資料和該類 合該交易資料和 前交易資料。 還提供了 一種應 商務交易系統、 統的電子商務系 服器和第一資料 -8 - 201142619 庫,該電子商務交易資料統計系統用於統計從該 交易系統獲得的交易資料,該電子商務交易資料 包括該應用伺服器和第二資料庫,該應用伺服器 易資料處理單元和交易資料統計單元;該交易資 元用於即時獲得該第一應用伺服器發出的交易資 次獲得交易資料後,將該交易資料儲存到該第二 ,並分析該交易資料,獲取該交易資料所屬類別 向該交易資料統計單元發出攜帶該交易資料所屬 訊的觸發消息,該觸發消息用於觸發該交易資料 統計交易資料;該交易資料統計單元用於根據該 所屬類別的資訊,從該第二資料庫中獲得該交易 類別的歷史交易資料,並結合該交易資料和該類 交易資料,得到該類別的當前交易資料;其中, 料庫非即時的向該資料倉庫系統查詢並獲取符合 的交易資料,將獲得的交易資料與之前對應的交 行比較,更新不一致的交易資料。 爲解決上述技術問題,本申請實施例還提供 子商務交易資料統計系統,適用於包括電子商務 、資料倉庫系統及電子商務交易資料統計系統的 系統,該電子商務交易系統包括第一應用伺服器 料庫,該電子商務交易資料統計系統用於統計從 務交易系統獲得的交易資料,該電子商務交易資 統包括:第二應用伺服器和第二資料庫;該第二 器用於即時獲得該第一應用伺服器發出的交易資 電子商務 統計系統 包括:交 料處理單 料,在每 資料庫中 的資訊, 類別的資 統計單元 交易資料 資料和該 別的歷史 該第二資 預設條件 易資料進 了 一種電 交易系統 電子商務 和第一資 該電子商 料統計系 應用伺服 料,在每 -9 - 201142619 次獲得交易資料後,該第二應用伺服器將該交易資料儲存 到該第二資料庫中,分析該交易資料,獲取該交易資料所 屬類別的資訊,根據該交易資料所屬類別的資訊,從該第 二資料庫中獲得該交易資料和該類別的歷史交易資料,該 第二應用伺服器結合該交易資料和該類別的歷史交易資料 ,得到該類別的當前交易資料;該第二資料庫用於儲存交 易資料,並非即時的向該資料倉庫系統查詢並獲取符合預 設條件的交易資料,將獲得的交易資料與之前對應的交易 資料進行比較,更新不一致的交易資料。 可見,本申請實施例中’電子商務交易資料統計系統 即時從電子商務交易系統的應用伺服器獲得交易資料,而 不是從電子商務交易系統的資料庫即時獲得交易資料,這 樣不會增加電子商務交易系統的資料庫的負擔,從而不會 影響正常的業務交易,更不會導致電子商務交易系統的資 料庫當機,由此可以避免整個電子商務網站都不可用。 式 方 施 本申請實施例提供統計電子商務交易資料的方法、應 用伺服器和電子商務交易資料統計系統。 在介紹統計電子商務交易資料的方法、應用伺服器和 電子商務交易資料統計系統之前,首先介紹本申請實施例 應用的網路環境和涉及的一些專業知識。 本申請實施例應用的網路環境如圖1所示,用戶端 103可以登錄到電子商務父易系統1〇1進行電子商務交易 -10- 201142619 操作,例如進行建立交易、付款等操作,電子商務交易系 統1 〇 1可以將交易資料和日誌記錄到資料倉庫系統i 〇2中 〇 電子商務交易系統丨0丨可以提供例如商品展示建立 交易、交易管理、支付等功能。 電子商務交易系統i 0 i可以包括應用伺服器和資料庫 ’應用伺服器也可以將交易資料等內容儲存到資料庫中。 在現有技術中,爲了統計交易資料,網路實體一般都要從 資料庫中獲取交易資料。 Μ料倉庫系統102是一個面向主題的、集成的、不可 更新的、隨時間不斷變化的資料集合的記錄載體,用於支 援企業或組織的決策分析處理。具體來說,資料倉庫系統 102會記錄父易資料的詳細變化歷史’用戶使用用戶端 1 〇 1在電子商務交易系統丨〇丨中的任何操作所產生的交易 資料變化都會記錄在資料倉庫系統1〇2中。 交易資料可以是指與交易相關的資料,例如用戶帳號 、操作類型、交易金額等資料,操作類型例如是指建立交 易、付款等事件。 需要說明的是’本申請實施例在圖1的基礎上增加了 一個電子商務交易資料統計系統,如圖2所示,電子商務 交易資料統計系統1 0 4既可以與電子商務交易系統1 〇丨交 互’也可以與資料倉庫系統102交互。本申請實施例將包 括電子商務交易系統、資料倉庫系統和電子商務交易資料 統計系統的網路系統稱爲電子商務系統,在電子商務系統 -11 - 201142619 中’電子商務交易系統、資料倉庫系統和電子商務交 料統計系統兩兩相連,當然,電子商務系統還可以包 他網路子系統和其他網路實體,其他網路實體例如是 «+0胃交易系統中進行電子商務交易的用戶端以及 電:子商務交易資料統計系統的管理員所使用的用戶端 前面提到過’電子商務交易系統101可以包括應用伺 和資料庫’爲便於下文描述方便,本申請實施例將電 務交易系統包括的應用伺服器稱爲第一應用伺服器, 子商務交易系統包括的資料庫稱爲第一資料庫。電子 交易資料統計系統1 〇4用於統計從電子商務交易系統 獲得的交易資料,電子商務交易資料統計系統i 04也 應用伺服器’爲便於下文描述方便,本申請實施例將 商務交易資料統計系統包括的應用伺服器稱爲第二應 服器’將電子商務交易資料統計系統包括的資料庫稱 二資料庫。本申請實施例的所有技術方案都適用於上 電子商務系統。 爲了使本技術領域的人員更好地理解本申請實施 的技術方案’並使本申請實施例的上述目的、特徵和 能夠更加明顯易懂,下面結合附圖對本申請實施例中 方案作進一步詳細的說明。 首先介紹本申請實施例的一種統計電子商務交易 的方法’前面提到過,這種方法適用於包括電子商務 系統、資料倉庫系統及電子商務交易資料統計系統的 商務系統’該電子商務交易系統包括第一應用伺服器 易資 括其 指在 管理 等。 服器 子商 將電 商務 101 包括 電子 用伺 爲第 述的 例中 優點 技術 資料 交易 電子 和第 -12- '201142619 一資料庫’該電子商務交易資料統計系統用於統計從該電 子商務交易系統獲得的交易資料,該電子商務交易資料統 計系統包括第二應用伺服器和第二資料庫。如圖3所示, 這種方法包括: S301 :第二應用伺服器即時獲得第一應用伺服器發出 的交易資料。 具體的,第一應用伺服器可以即時的向獨立於電子商 務交易系統和資料倉庫系統的電子商務交易資料統計系統 提供交易資料’具體的’第一應用伺服器即時的向第二應 用伺服器提供交易資料。 第一應用伺服器可以按照這樣的方式即時向第二應用 伺服器提供交易資料,即,第一應用伺服器可以發出非同 步消息,非同步消息中攜帶有交易資料。一個非同步消息 可以攜帶一個用戶進行一次操作所產生的資料。非同步消 息既可以是可靠的非同步消息’也可以是不可靠的非同步 消息。如果第一應用伺服器發出的是可靠的非同步消息, 那麼非同步消息可以不會丟失的到達第二應用伺服器;如 果第一應用伺服器發出的是不可靠的非同步消息,那麼可 能會發生非同步消息丟失的現象’或者說,第二應用伺服 器可能會接收不到非同步消息,這種情況下,第二應用伺 服器可能會無法獲得一些交易資料。 在實際應用中’使用可靠的非同步消息的成本會比較 局,而使用不可靠的非同步消息的成本會比較低。 另外’第一應用伺服器發出非同步消息的動作對於第 -13- 201142619 —應用伺服器來說,代價可以忽略不計,也就是說,第一 應用伺服器發出非同步消息的動作不會影響電子商務交易 系統提供的正常業務交易。 執行S 3 0 1後,執行S 3 02 :在每次獲得交易資料後, 該第二應用伺服器分析該交易資料,獲取該交易資料所屬 類別的資訊。 在本申請實施例中,可以將交易資料劃分爲多個類別 ’例如,按照用戶或者交易操作種類劃分。例如,某個交 易資料可以是一個用戶通過用戶端在電子商務交易系統中 進行電子商務操作所產生的資料,那麼這樣的交易資料可 以認爲是屬於這個用戶的交易資料。再例如,某個交易資 料可以是一個用戶通過用戶端在電子商務交易系統中進行 某種電子商務操作所產生的資料,某種電子商務操作例如 是向賣家付款(即交易成功)等操作,那麼這樣的交易資 料可以認爲是屬於這種電子商務操作的交易資料。當然, 交易資料還可以按照其他方式來劃分,這裏不再--舉例 說明。 第二應用伺服器獲得交易資料後,可以對交易資料進 行分析,確定父易資料所屬的類別,即,獲取交易資料所 屬類別的資訊。在具體實現時,第—應用伺服器發出的交 易資料不僅僅可以攜帶交易資料的資料內容,還可以攜帶 父易資料所屬類別的資訊’這種情況下,第二應用伺服器 可以直接從交易資料中獲取交易資料所屬類別的資訊。第 一應用伺服器也可以預先儲存記錄關鍵字與類別資訊映射 -14- 201142619 關係的映射表,一個類別資訊可以只對應一個關鍵字,一 個類別資訊也可以對應多個關鍵字,第二應用伺服器獲得 交易資料後,可以從交易資料中提取關鍵字,使用關鍵字 在該映射表中查找與關鍵字對應的類別資訊,這樣也可以 獲取交易資料所屬類別的資訊。當然,第二應用伺服器還 可以通過其他多種方式分析交易資料,獲取交易資料所屬 類別的資訊,這裏不再——舉例說明。 執行S3 02後,執行S3 03 :該第二應用伺服器根據該 交易資料所屬類別的資訊,從第二資料庫中獲得該類別的 歷史交易資料,其中,該第二資料庫非即時的向該資料倉 庫系統查詢並獲取符合預設條件的交易資料,將獲得的交 易資料與之前對應的交易資料進行比較,更新不一致的交 易資料。 第二應用伺服器獲取交易資料所屬類別的資訊後,可 以向第二資料庫發出請求消息,請求消息攜帶交易資料所 屬類別的資訊,請求消息用於表示請求提供交易資料所屬 類別的歷史交易資料。第二資料庫接收到請求消息後,可 以使用請求消息攜帶的交易資料所屬類別的資訊作爲關鍵 字,在本地查找交易資料所屬類別的歷史交易資料,並將 查找到的歷史交易資料返回給第二應用伺服器。特殊情況 下,由於第二資料庫可能未儲存過交易資料所屬類別的交 易資料等原因,第二資料庫在接收到請求消息後,可以向 第二應用伺服器返回一個回應消息,這個回應消息用於表 示沒有查找到交易資料所屬類別的歷史交易資料等內容。 -15- 201142619 前面提到過,如果第一應用伺服器發出的是不可靠的 非同步消息,那麼第二應用伺服器可能會無法接收到一些 非同步消息,進而導致第二應用伺服器可能會無法得到一 些交易資料。對此,第二資料庫可以非即時的向資料倉庫 系統查詢並獲取符合預設條件的交易資料,將獲得的交易 資料與之前對應的交易資料進行比較,更新不一致的交易 資料。 在實際應用中,第二資料庫可以每隔預先設置的週期 向資料倉庫系統查詢並獲取符合預設條件的交易資料。.預 先設置的週期可以由本領域技術人員根據實際需要而設置 ,例如1 〇分鐘。預設條件也可以由本領域技術人員根據 實際需要而設置,例如,在最近的一個週期內所有發生變 化的資料,所有發生變化的資料可以是指新增加的資料。 第二資料庫可以將獲得的符合預設條件的交易資料與 之前保存的符合預設條件的交易資料進行比較,如果一致 ’則可以不進行任何處理,如果存在不一致的資料,則更 新不一致的交易資料。 執行S 3 03後,執行S3 04 :該第二應用伺服器結合該 交易資料和該類別的歷史交易資料,得到該類別的當前交 易資料。 在具體實現時,第二應用伺服器可以按照統計規則對 交易資料進行即時統計。第二應用伺服器在按照統計規則 對交易資料進行即時統計處理之前,可以獲得用戶端所設 定的對交易資料進行統計處理的統計規則。例如,在第二 -16- 201142619 應用伺服器按照統計規則對交易資料進行統計處理之前, 管理電子商務交易資料統計系統的管理員在用戶端上設定 統計規則,用戶端將統計規則提供給第二應用伺服器,這 樣,第二應用伺服器就獲得了用戶端所設定的統計規則。 在實際應用中,上述統計規則例如包括對同一個類別 的交易資料進行疊加操作的規定,這種情況下,第二應用 伺服器可以將獲得的交易資料和同一個類別的歷史交易資 料進行疊加。 以交易資料所屬的類別是用戶爲例,第二資料庫可以 以一個用戶爲單位儲存這個用戶的交易記錄,或者說,每 個用戶資訊只對應一條交易記錄,每條交易記錄只對應一 個用戶資訊,交易記錄中記錄有這個用戶的交易資料。在 具體實現時,第二應用伺服器獲得一個用戶的交易資料和 這個用戶的歷史交易資料後,將這個用戶的交易資料和這 個用戶的歷史交易資料進行疊加,得到這個用戶的當前交 易資料,之後’將這個用戶的當前交易資料儲存到第二資 料庫中保存的這個用戶的交易記錄中。 例如’假設用戶1的交易記錄中記錄有用戶1的帳號 、建立交易次數、交易總金額等資訊,並假設用戶1通過 用戶端在電子商務交易系統中完成了一次交易,第一·應m 伺服器爲此產生的交易資料包括交易金額,第二應用伺服 器在獲得交易資料後’如果判斷出交易資料對應的是用戶 1 ’那麼弟一·應用何服益1要向弟—資料庫請求提供用戶1 的歷史交易資料’第二資料庫查找到用戶〗對應的交易記 -17- 201142619 錄後,向第二應用伺服器返回用戶1的歷史交易資料。之 後,第二應用伺服器將獲得的交易金額與用戶1對應的交 易記錄中原有的交易總金額相加(即結合獲得的用戶1的 交易資料和用戶1的歷史交易資料),得到新的交易總金 額(即用戶1的當前交易資料)。。第二應用伺服器得到 新的交易總金額後,可以將新的交易總金額提供給管理員 使用的用戶端,或者,根據新的交易總金額繪製用戶1的 交易總金額的顯示曲線,管理員通過顯示曲線可以直觀的 瞭解到用戶1的交易總金額的變化趨勢。 以交易資料所屬的類別是交易操作種類爲例。每個交 易資料對應至少一個交易資料類別,交易資料類別例如爲 在一段時間內的交易總金額、在一段時間內的建立交易的 總次數或在一段時間內的成功交易的總次數等。在具體實 現時,第二應用伺服器獲得一個交易操作種類的交易資料 和這個交易操作種類的歷史交易資料後,將這個交易操作 種類的交易資料和這個交易操作種類的歷史交易資料進行 疊加,得到這個交易操作種類的當前交易資料。 例如,假設第二應用伺服器需要統計在一段時間內的 交易總金額(交易操作種類爲付款和/或收款,可以不區 分用戶),並假設用戶1通過用戶端在電子商務交易系統 中完成了一次交易,第二應用伺服器爲此產生的交易資料 包括交易金額,第二應用伺服器在獲得交易資料後,如果 判斷出交易資料中的交易金額對應付款和/或收款這個類 別,那麼第二應用伺服器要向第二資料庫請求提供付款和 -18- 201142619 /或收款對應的歷史交易金額,第二資料庫查找到> 或收款對應的歷史交易金額後,向第二應用伺服器 款和/或收款對應的歷史交易金額。之後,第二應 器將獲得的交易金額與付款和/或收款對應的歷史 額相加,得到付款和/或收款對應的新的交易總金 二應用伺服器在得到付款和/或收款對應的新的交 額後,可以將新的交易總金額提供給管理員使用的 ,或者,根據新的交易總金額繪製在一段時間內的 金額的顯示曲線,管理員通過顯示曲線可以直觀的 在一段時間內的交易總金額的變化趨勢。 前面提到過,第二資料庫從資料倉庫系統獲得 預設條件的交易資料與之前保存的符合預設條件的 料可能不一致。如果第二資料庫從資料倉庫系統獲 合預設條件的交易資料與之前保存的符合預設條件 資料不一致,那麼第二應用伺服器可以以資料倉庫 供的資料爲準進行統計。也就是說,第二資料庫向 用伺服器提供的資料都是資料倉庫系統保存的完整 的資料,這樣,第二應用伺服器是以完整、準確的 準進行統計的。 例如,假設在10分鐘之內,用戶1通過用戶 子商務交易系統中完成了一次交易,第一應用伺服 了非同步消息,非同步消息攜帶了第一應用伺服器 交易產生的交易資料,交易資料包括交易金額,但 用伺服器沒有收到這個非同步消息。在1 〇分鐘結 寸款和/ 返回付 用伺服 交易金 額。第 易總金 用戶端 交易總 瞭解到 的符合 交易資 得的符 的交易 系統提 第二應 、準確 資料爲 端在電 器發出 爲此次 第二應 束時, 19- 201142619 第二資料庫向資料倉庫系統發出了查詢在10分鐘之內發 生變化的資料的請求,資料倉庫系統向第二資料庫返回了 在10分鐘之內發生變化的資料,發生變化的資料包括上 述的交易金額,第二資料庫將從資料倉庫系統獲得的在 10分鐘之內發生變化的資料和自己保存的在10分鐘之內 發生變化的資料相比較,確定自己沒有獲得用戶1在10 分鐘之內完成的一次交易而產生的交易資料,對此,第二 資料庫將用戶1在10分鐘之內完成的一次交易而產生的 交易資料保存到用戶1對應的交易記錄中,之後,第二應 用伺服器可以修改用戶1的交易金額對應的顯示曲線,並 將修改後的顯示曲線提供給管理員使用的用戶端。 可選的’在執行S 3 0 1後,第二應用伺服器可以將獲 得交易資料的日誌記錄在第二資料庫中的交易資料日誌表 中。交易資料曰誌表中可以以一個用戶發起的事件爲單位 構造一條記錄,或者說’以—個非同步消息爲單位構造一 條記錄。 另外’第二應用伺服器在每次獲得交易資料後,都可 以將交易資料儲存到第二資料庫中。第二資料庫也可以分 析交易資料’獲取交易資料所屬類別的資訊,將交易資料 與其所屬類別的資訊進行綁定。這樣,第二資料庫在後續 查找這個類別的交易資料時,就可以根據綁定關係,查找 到與這個類別綁定的所有交易資料。 此外’在實際應用中,管理電子商務系統的管理員可 能會需要查詢交易資料’這種情況下,管理員使用的用戶 -20- 201142619 端可以向第二應用伺服器發出查詢符合某個條件的交易資 料的請求消息,第二應用伺服器獲得請求消息後,可以向 第二資料庫發出查詢符合這個條件的交易資料,第二資料 庫查找到符合這個條件的交易資料後,向第二應用伺服器 返回符合這個條件的交易資料,第二應用伺服器再向管理 員使用的用戶端返回符合這個條件的交易資料。 與本申請監控事件的方法的實施例相對應,本申請還 提供了設置於電子商務交易資料統計系統中的應用伺服器 的實施例。這種應用伺服器適用於包括電子商務交易系統 、資料倉庫系統及電子商務交易資料統計系統的電子商務 系統,該電子商務交易系統包括第一應用伺服器和第一資 料庫,該電子商務交易資料統計系統用於統計從該電子商 務交易系統獲得的交易資料,該電子商務交易資料統計系 統包括該應用伺服器和第二資料庫。如圖4所示,該應用 伺服器包括:交易資料處理單元40 1和交易資料統計單元 402 ;交易資料處理單元40 1用於即時獲得該第一應用伺 服器發出的交易資料,並在每次獲得交易資料後,將該交 易資料發給交易資料統計單元402 ;交易資料統計單元 4 02用於獲得並分析該交易資料,獲取該交易資料所屬類 別的資訊,根據該交易資料所屬類別的資訊,從該第二資 料庫中獲得該類別的歷史交易資料,並結合該交易資料和 該類別的歷史交易資料,得到該類別的當前交易資料;其 中,該第二資料庫非即時的向該資料倉庫系統查詢並獲取 符合預設條件的交易資料,將獲得的交易資料與之前對應 -21 - 201142619 的交易資料進行比較’更新不一致的交易資料。 在實際應用中’交易資料處理單元4〇1在每次獲得交 易資料後,將該交易資料發給交易資料統計單元402,其 實質就是觸發交易資料統計單元402對交易資料進行統計 處理。在具體實現時,交易資料處理單元401可以向交易 資料統計單元4〇2發出用於觸發交易資料統計單元4〇2對 交易資料進行統計的觸發消息,這個觸發消息攜帶有交易 資料。 在實際應用中,交易資料統計單元4〇2獲得交易資料 後’可以對交易資料進行分析,確定交易資料所屬的類別 ,即,獲取交易資料所屬類別的資訊。在具體實現時,第 一應用伺服器發出的交易資料不僅僅可以攜帶交易資料的 資料內容,還可以攜帶交易資料所屬類別的資訊,這種情 況下,交易資料統計單元402可以直接從交易資料中獲取 交易資料所屬類別的資訊。交易資料統計單元402也可以 預先儲存記錄關鍵字與類別資訊映射關係的映射表,一個 類別資訊可以只對應一個關鍵字,一個類別資訊也可以對 應多個關鍵字,交易資料統計單元402獲得交易資料後, 可以從交易資料中提取關鍵字,使用關鍵字在該映射表中 查找與關鍵字對應的類別資訊,這樣也可以獲取交易資料 所屬類別的資訊。當然,交易資料統計單元402還可以通 過其他多種方式分析交易資料,獲取交易資料所屬類別的 資訊,這裏不再——舉例說明。 交易資料統計單元402獲取交易資料所屬類別的資訊 -22- 201142619 後’可以向第二資料庫發出請求消息,請求消息攜 資料所屬類別的資訊,請求消息用於表示請求提供 料所屬類別的歷史交易資料。第二資料庫接收到請 後,可以使用請求消息攜帶的交易資料所屬類別的 爲關鍵字’在本地查找交易資料所屬類別的歷史交 ,並將查找到的歷史交易資料返回給交易資料統 4 02。特殊情況下’由於第二資料庫可能未儲存過 料所屬類別的交易資料等原因,第二資料庫在接收 消息後’可以向交易資料統計單元402返回一個回 ’這個回應消息用於表示沒有查找到交易資料所屬 歷史交易資料等內容。 在實際應用中,交易資料統計單元402可以按 規則對交易資料進行即時統計。交易資料統計單元 按照統計規則對交易資料進行即時統計處理之前, 得用戶端所設定的對交易資料進行統計處理的統言十 例如,在交易資料統計單元4〇2按照統計規則對交 進行統計處理之前,管理電子商務交易資料統計系 理員在用戶端上設定統計規則,用戶端將統計規則 交易資料統計單元4〇2,這樣’交易資料統計單元 獲得了用戶端所設定的統計規則。 在實際應用中,上述統計規則例如包括對同一 的交易資料進行疊加操作的規定,這種情況下,交 統計單元4 0 2可以將獲得的交易資料和同一個類另IJ 交易資料進行疊加。 帶交易 交易資 求消息 資訊作 易資料 計單元 交易資 到請求 應消息 類別的 照統計 402在 可以獲 規則》 易資料 統的管 提供給 402就 個類別 易資料 的歷史 -23- 201142619 在實際應用中,如果第二資料庫從資料倉庫系統獲得 的符合預設條件的交易資料與之前保存的符合預設條件的 交易資料不一致,那麼交易資料統計單元402可以以資料 倉庫系統提供的資料爲準進行統計。也就是說,第二資料 庫向交易資料統計單元4〇2提供的資料都是資料倉庫系統 保存的完整、準確的資料,這樣,交易資料統計單元402 是以完整、準確的資料爲準進行統計的。 在實際應用中,交易資料處理單元40 1在每次獲得交 易資料後,可以將獲得交易資料的日誌記錄在第二資料庫 中的交易資料曰誌表中。 在實際應用中,交易資料處理單元40 1在每次獲得交 易資料後,可以將交易資料儲存到第二資料庫中。交易資 料統計單元402在獲得該交易資料後,也可以將該交易資 料儲存到該第二資料庫中。在實際應用中,交易資料處理 單元40 1和交易資料統計單元402兩者之一將交易資料儲 存到第二資料庫中即可。 在實際應用中,管理電子商務系統的管理員可能會需 要查詢交易資料,這種情況下,管理員使用的用戶端可以 向交易資料統計單元402發出查詢符合某個條件的交易資 料的請求消息,交易資料統計單元402獲得請求消息後, 可以向第二資料庫發出查詢符合這個條件的交易資料,第 二資料庫查找到符合這個條件的交易資料後,向交易資料 統計單元402返回符合這個條件的交易資料,交易資料統 計單元4 02再向管理員使用的用戶端返回符合這個條件的 -24- 201142619 交易資料。 由於圖4所示的應用伺服器實施例是與圖3所示的方 法實施例相對應的實施例,所以,圖4所示的應用伺服器 中的各個功能單元的功能及相互配合關係的詳細描述可以 參照圖3所示的方法實施例中的相關描述,這裏不再贅述 〇 由圖3所示的方法可知,圖3所示的方法中的很多步 驟都是以電子商務交易資料統計系統包括的應用伺服器爲 執行主體’另外,圖4所示的應用伺服器也是設置在電子 商務交易資料統計系統中的,所以,本申請實施例還提供 了一種電子商務交易資料統計系統。這種電子商務交易資 料統計系統適用於包括電子商務交易系統、資料倉庫系統 及電子商務交易資料統計系統的電子商務系統,該電子商 務交易系統包括第一應用伺服器和第一資料庫,該電子商 務交易資料統計系統用於統計從該電子商務交易系統獲得 的交易資料。 如圖5所示,這種電子商務交易資料統計系統包括第 二應用伺服器和第二資料庫5〇2 ;第二應用伺服器501用 於即時獲得該第一應用伺服器發出的交易資料,在每次獲 得交易資料後’分析該交易資料,獲取該交易資料所屬類 別的資訊’根據該交易資料所屬類別的資訊,從第二資料 庫5〇2中獲得該類別的歷史交易資料,並結合該交易資料 和該類別的歷史交易資料,得到該類別的當前交易資料; 苐一資料庫5〇2用於儲存父易資料,並非即時的向該資料 -25- 201142619 倉庫系統查詢並獲取符合預設條件的交易資料’將獲得的 交易資料與之前對應的交易資料進行比較’更新不一致的 交易資料。 可選的,第二資料庫502中可以設置有用於儲存交易 資料的日誌的交易資料日誌表和用於儲存交易資料的交易 資料基準表。在交易資料日誌表中,一條記錄可以以—個 用戶發起的事件爲單位,在交易資料基準表中,一條記錄 可以以一個用戶爲單位。第二應用伺服器5 0 1可以將獲得 交易資料的日誌記錄在交易資料日誌表中。 第二應用伺服器50 1和第二資料庫502的具體功能以 及相互配合關係的詳細描述可以參照圖3所示的方法實施 例和圖4所示的應用伺服器實施例中的相關描述,這裏不 再贅述。 除圖3所示的方法實施例外,本申請實施例還提供一 種統計電子商務交易資料的方法。這種方法適用於包括電 子商務交易系統、資料倉庫系統及電子商務交易資料統計 系統的電子商務系統,該電子商務交易系統包括第一應用 伺服器和第一資料庫’該電子商務交易資料統計系統用於 統計從該電子商務交易系統獲得的交易資料,該電子商務 交易資料統計系統包括第二應用伺服器和第二資料庫。如 圖6所示,方法包括: S601 ·第—應用伺服器即時獲得第—應用伺服器發出 的交易資料。 具體的,第一應用伺服器可以即時的向獨立於電子商 -26- 201142619 務交易系統和資料倉庫系統的電子商務交易資料統計系統 提供交易資料,具體的,第一應用伺服器即時的向第二應 用伺服器提供交易資料。 第一應用伺服器可以按照這樣的方式即時向第二應用 伺服器提供交易資料,即,第一應用伺服器可以發出非同 步消息’非同步消息中攜帶有交易資料。一個非同步消息 可以攜帶一個用戶進行一次操作所產生的資料。非同步消 息既可以是可靠的非同步消息,也可以是不可靠的非同步 消息。如果第一應用伺服器發出的是可靠的非同步消息, 那麼非同步消息可以不會丟失的到達第二應用伺服器;如 果第一應用伺服器發出的是不可靠的非同步消息,那麼可 能會發生非同步消息丟失的現象,或者說,第二應用伺服 器可能會接收不到非同步消息,這種情況下,第二應用伺 服器可能會無法獲得一些交易資料。 在實際應用中,使用可靠的非同步消息的成本會比較 高’而使用不可靠的非同步消息的成本會比較低。 另外’第一應用伺服器發出非同步消息的動作對於第 一應用伺服器來說,代價可以忽略不計,也就是說,第一 應用伺服器發出非同步消息的動作不會影響電子商務交易 系統提供的正常業務交易。 S 602 ·在每次獲得交易資料後,該第二應用伺服器將 該父易資料儲存到第二資料庫中,並分析該交易資料,獲 取^ 乂易貝料所屬類別的資訊,其中,該第二資料庫非即 時的向資料倉庫系統查詢並獲取符合預設條件的交易資料 -27- 201142619 ’將獲得的交易資料與之前對應的交易資料進行比較,更 新不一致的交易資料。 在本申請實施例中,可以將交易資料劃分爲多個類別 ’例如,按照用戶或者交易操作種類劃分。 第一應用伺服器獲得父易資料後’要將交易資料儲存 到第二資料庫中’並且還要分析交易資料,獲取交易資料 所屬類別的資訊。在實際應用中,將交易資料儲存到第一 資料庫中和分析交易資料可以同時進行,也可以先後進β ’如果先後進行’那麼也沒有必然的先後順序,或者說, 先進行哪個操作都可以。 在具體貫現時’第一應用伺服器發出的交易資料不僅 僅可以攜帶父易資料的資料內容’還可以攜帶交易資料所 屬類別的資訊’這種情況下’第二應用伺服器可以直接從 交易資料中獲取交易資料所屬類別的資訊。第二應用伺服 器也可以預先儲存記錄關鍵字與類別資訊映射關係的映射 表’一個類別資訊可以只對應一個關鍵字,一個類別資訊 也可以對應多個關鍵字,第二應用伺服器獲得交易資料後 ’可以從交易資料中提取關鍵字’使用關鍵字在該映射表 中查找與關鍵字對應的類別資訊,這樣也可以獲取交易資 料所屬類別的資訊。當然’第二應用伺服器還可以通過其 他多種方式分析交易資料,獲取交易資料所屬類別的資訊 ,這裏不再——舉例說明。 前面提到過,如果第一應用伺服器發出的是不可靠的 非同步消息,那麼第二應用伺服器可能會無法接收到一些 -28 - 201142619 非同步消息,進而導致第二應用伺服器可能會無法得到一 些交易資料。對此,第二資料庫可以非即時的向資料倉庫 系統查詢並獲取符合預設條件的交易資料,將獲得的交易 資料與之前對應的交易資料進行比較,更新不一致的交易 資料。 在實際應用中,第二資料庫可以每隔預先設置的週期 向資料倉庫系統查詢並獲取符合預設條件的交易資料。預 先設置的週期可以由本領域技術人員根據實際需要而設置 ,例如1 〇分鐘。預設條件也可以由本領域技術人員根據 實際需要而設置,例如,在最近的一個週期內所有發生變 化的資料,所有發生變化的資料可以是指新增加的資料。 第二資料庫可以將獲得的符合預設條件的交易資料與 之前保存的符合預設條件的交易資料進行比較,如果一致 ,則可以不進行任何處理,如果存在不一致的資料,則更 新不一致的交易資料。 S 6 03 :該第二應用伺服器根據該交易資料所屬類別的 資訊,從該第二資料庫中獲得該交易資料和該類別的歷史 交易資料。 第二應用伺服器獲取交易資料所屬類別的資訊後,可 以向第二資料庫發出請求消息,請求消息攜帶交易資料所 屬類別的資訊,請求消息用於表示請求提供交易資料所屬 類別的所有交易資料,包括獲得的交易資料和歷史交易資 料。第二資料庫接收到請求消息後,可以使用請求消息攜 帶的交易資料所屬類別的資訊作爲關鍵字,在本地查找交 -29- 201142619 易資料所屬類別的所有交易資料,並將查找到的所有交易 資料返回給第二應用伺服器。特殊情況下,可能由於某個 或某些原因’第—資料庫並沒有儲存過上述交易資料所屬 類別的歷史交易資料,這種情況下,第二資料庫只能向第 二應用伺服器返回第二應用伺服器獲得的上述交易資料所 屬類別的父易資料,而無法返回上述交易資料所屬類別的 歷史交易資料。 S604 .該第一應用伺服器結合該交易資料和該類別的 歷史交易資料’得到該類別的當前交易資料。 追裊需要說明的是’雖然第二應用伺服器之前已經將 獲得的交易資料儲存到第二資料庫中,但第二資料庫可以 只是將獲得的交易資料與對應的類別進行綁定,而不是與 相同類別的交易資料進行疊加等操作,這種情況下,第二 資料庫中儲存的這個類別的交易資料至少包括第二應用伺 服器獲得的交易資料和這個類別的歷史交易資料。所以, 第二應用伺服器從第二資料庫中得到的這個類別的交易資 料至少包括第二應用伺服器獲得的交易資料和這個類別的 歷史交易資料。因此’第二應用伺服器可以結合自己獲得 的交易資料和這個類別的歷史交易資料,得到這個類別的 當前交易資料。 在具體實現時,第二應用伺服器可以按照統計規則對 交易資料進行即時統計。第二應用伺服器在按照統計規則 對交易資料進行即時統計處理之前,可以獲得用戶端所設 定的對交易資料進行統計處理的統計規則。例如,在第二 -30- 201142619 應用伺服器按照統計規則對交易資料進行統計處理之前, 管理電子商務交易資料統計系統的管理員在用戶端上設定 統計規則,用戶端將統計規則提供給第二應用伺服器,這 樣,第二應用伺服器就獲得了用戶端所設定的統計規則。 在實際應用中,上述統計規則例如包括對同一個類別 的交易資料進行疊加操作的規定,這種情況下,第二應用 伺服器可以將獲得的交易資料和同一個類別的歷史交易資 料進行疊加。 前面提到過,第二資料庫從資料倉庫系統獲得的符合 預設條件的交易資料與之前保存的符合預設條件的交易資 料可能不一致。如果第二資料庫從資料倉庫系統獲得的符 合預設條件的交易資料與之前保存的符合預設條件的交易 資料不一致,那麼第二應用伺服器可以以資料倉庫系統提 供的資料爲準進行統計。也就是說,第二資料庫向第二應 用伺服器提供的資料都是資料倉庫系統保存的完整、準確 的資料,這樣,第二應用伺服器是以完整、準確的資料爲 準進行統計的。 可選的,在執行S60 1後,第二應用伺服器可以將獲 得交易資料的日誌記錄在第二資料庫中的交易資料日誌表 中。交易資料日誌表中可以以一個用戶發起的事件爲單位 構造一條記錄,或者說,以一個非同步消息爲單位構造一 條記錄。 另外,第二應用伺服器在將交易資料儲存到第二資料 庫中後,第二資料庫也可以分析交易資料,獲取交易資料 -31 - 201142619 所屬類別的資訊,將交易資料與其所屬類別的資 定。這樣,第二資料庫在後續查找這個類別的交 ,就可以根據綁定關係,查找到與這個類別綁定 易資料。 此外,在實際應用中,管理電子商務系統的 能會需要查詢交易資料,這種情況下,管理員使 端可以向第二應用伺服器發出査詢符合某個條件 料的請求消息,第二應用伺服器獲得請求消息後 第二資料庫發出查詢符合這個條件的交易資料, 庫查找到符合這個條件的交易資料後,向第二應 返回符合這個條件的交易資料,第二應用伺服器 員使用的用戶端返回符合這個條件的交易資料。 圖6所示的方法實施例與圖3所示的方法實 相同的技術特徵’對於這些相同技術特徵的具體 參照圖3所示的方法實施例中的相關描述,這裏 〇 與圖ό所示的方法實施例相對應,本申請還 置於電子商務交易資料統計系統中的應用伺服器 。追種應用伺服器適用於包括電子商務交易系統 庫系統及電子商務交易資料統計系統的電子商務 電子商務交易系統包括第一應用伺服器和第—資 電子商務交易資料統計系統用於統計從該電子商 統獲得的交易資料,該電子商務交易資料統計系 應用伺服器和第二資料庫。請再參見圖4,該應 訊進行綁 易資料時 的所有交 管理員可 用的用戶 的交易資 ,可以向 第二資料 用伺服器 再向管理 施例存在 描述可以 不再贅述 提供了設 的實施例 、資料倉 系統,該 料庫,該 務交易系 統包括該 用伺服器 -32- 201142619 包括:交易資料處理單元40 1和交易資料統計單元402 ; 交易資料處理單元40 1用於即時獲得該第一應用伺服器發 出的交易資料,在每次獲得交易資料後,將該交易資料儲 存到該第二資料庫中,並分析該交易資料,獲取該交易資 料所屬類別的資訊,向交易資料統計單元402發出攜帶該 交易資料所屬類別的資訊的觸發消息,該觸發消息用於觸 發交易資料統計單元402統計交易資料;交易資料統計單 元402用於根據該交易資料所屬類別的資訊,從該第二資 料庫中獲得該交易資料和該類別的歷史交易資料,並結合 該交易資料和該類別的歷史交易資料,得到該類別的當前 交易資料;其中,該第二資料庫非即時的向該資料倉庫系 統查詢並獲取符合預設條件的交易資料,將獲得的交易資 料與之前對應的交易資料進行比較,更新不一致的交易資 料。 這個應用伺服器實施例與前面描述的應用伺服器實施 例之間的一個明顯區別是,在這個應用伺服器實施例中, 交易資料處理單元40 1在獲取交易資料所屬類別的資訊後 ,向交易資料統計單元402發出不攜帶有交易資料、但攜 帶有交易資料所屬類別的資訊的觸發消息。交易資料統計 單元402從第二資料庫中獲得的是交易資料處理單元40 1 獲得的交易資料和這個類別的歷史交易資料。 這個應用伺服器實施例與前面描述的應用伺服器實施 例存在很多相同的技術特徵,例如,交易資料處理單元 40 1在每次獲得交易資料後,將獲得交易資料的日誌記錄 -33- 201142619 在第二資料庫中的交易資料日誌表中。對於 特徵的詳細描述,可以參照前面描述的應用 中的相關描述,這裏不再贅述。 另外,這個應用伺服器實施例是與圖6 施例相對應的,所以,這個應用伺服器中的 的功能及相互配合關係的描述可以參照圖6 施例中的相關描述,這裏不再贅述。 由圖6所示的方法可知,圖6所示的方 驟都是以電子商務交易資料統計系統包括的 執行主體’另外,對應的應用伺服器也是設 交易資料統計系統中的,所以,本申請實施 種電子商務交易資料統計系統。這種電子商 §十系統適用於包括電子商務交易系統、資料 子商務交易資料統計系統的電子商務系統, 易系統包括第一應用伺服器和第一資料庫, 易資料統計系統用於統計從該電子商務交易 易資料。請再參見圖5,該電子商務交易資 栝:第二應用伺服器501和第二資料庫5〇2 服器5 0 1用於即時獲得該第—應用伺服器發 ’在每次獲得交易資料後’第二應用伺服器 資料儲存到第二資料庫502中,分析該交易 交易資料所屬類別的資訊,根據該交易資料 訊’從第二資料庫502中獲得該交易資料和 交易資料,第二應用伺服器501結合該交易 這些相同技術 伺服器實施例 所示的方法實 各個功能單元 所示的方法實 法中的很多步 應用伺服器爲 置在電子商務 例還提供了一 務交易資料統 倉庫系統及電 該電子商務交 該電子商務交 系統獲得的交 料統計系統包 :第二應用伺 出的交易資料 501將該交易 資料,獲取該 屬類別的資 類別的歷史 資料和該類別 -34- 201142619 的歷史交易資料,得到該類別的當前交易資料;第二資料 庫5 02用於儲存交易資料,並非即時的向該資料倉庫系統 查詢並獲取符合預設條件的交易資料,將獲得的交易資料 與之前對應的交易資料進行比較,更新不一致的交易資料 〇 可選的,第二資料庫502中可以設置有用於儲存交易 資料的日誌的交易資料日誌表和用於儲存交易資料的交易 資料基準表。在交易資料日誌表中,一條記錄可以以一個 用戶發起的事件爲單位,在交易資料基準表中,一條記錄 可以以一個用戶爲單位。第二應用伺服器5 0 1可以將獲得 交易資料的日誌記錄在交易資料日誌表中。 第二應用伺服器5 0 1和第二資料庫5 02的具體功能以 及相互配合關係的詳細描述可以參照圖6所示的方法實施 例和對應的應用伺服器實施例中的相關描述,這裏不再贅 述。 通過以上的實施方式的描述可知,本申請實施例中, 電子商務交易資料統計系統的應用伺服器即時的從電子商 務交易系統的應用伺服器獲得交易資料,而不是從電子商 務交易系統的資料庫即時獲得交易資料,這樣不會增加電 子商務交易系統的資料庫的負擔,從而不會影響正常的業 務交易,更不會導致電子商務交易系統的資料庫當機,由 此可以避免整個電子商務網站都不可用。 另外,電子商務交易系統的應用伺服器可以通過發出 非同步不可靠的消息向電子商務交易資料統計系統提供交 -35- 201142619 易資料’既不會影響電子商務交易系統中的正常的業務交 易,還會降低實現成本。 此外’電子商務交易資料統計系統可以非即時的從資 料倉庫系統中獲得符合一定條件的資料,特別是最近的一 個週期內獲得發生變化的父易資料,這樣,即使電子商務 交易資料統計系統在一個週期內沒有接收到全部的非同步 消息,或者說,在一個週期內沒有接收到全部的交易資料 ,那麼也能保證電子商務交易資料統計系統在這個週期結 束之後能夠獲得全部的交易資料,從而可以爲統計處理提 供更加準確的資料基礎。 通過以上的實施方式的描述可知,本領域的技術人員 可以清楚地瞭解到本申請可借助軟體加必需的通用硬體平 臺的方式來實現。基於這樣的理解,本申請的技術方案本 質上或者說對現有技術做出貢獻的部分可以以軟體產品的 形式體現出來,該電腦軟體產品可以儲存在儲存媒體中, 如ROM/RAM、磁碟、光碟等,包括若干指令用以使得一 台電腦設備(可以是個人電腦,伺服器,或者網路設備等 )執行本申請各個實施例或者實施例的某些部分所述的方 法。 本說明書中的各個實施例均採用遞進的方式描述,各 個實施例之間相同相似的部分互相參見即可,每個實施例 重點說明的都是與其他實施例的不同之處。尤其,對於系 統實施例而言,由於其基本相似於方法實施例,所以描述 的比較簡單,相關之處參見方法實施例的部分說明即可》 -36- 201142619 本申請可用於眾多通用或專用的計算系統環境或配置 中。例如:個人電腦、伺服器電腦、手持設備或可攜式設 備、平板型設備、多處理器系統、基於微處理器的系統、 置頂盒、可編程的消費電子設備、網路PC、小型電腦、 大型電腦、包括以上任何系統或設備的分散式計算環境等 等。 本申請可以在由電腦執行的電腦可執行指令的一般上 下文中描述,例如程式模組。一般地,程式模組包括執行 特定任務或實現特定抽象資料類型的常式、程式、物件、 元件、資料結構等等。也可以在分散式計算環境中實踐本 申請,在這些分散式計算環境中,由通過通信網路而被連 接的遠端處理設備來執行任務。在分散式計算環境中,程 式模組可以位於包括儲存設備在內的本地和遠端電腦儲存 媒體中。 雖然通過實施例描繪了本申請,本領域普通技術人員 知道,本申請有許多變形和變化而不脫離本申請的精神, 希望所附的申請專利範圍包括這些變形和變化而不脫離本 申請的精神。 【圖式簡單說明】 爲了更清楚地說明本申請實施例或現有技術中的技術 方案,下面將對實施例或現有技術描述中所需要使用的附 圖作簡單地介紹,顯而易見地,下面描述中的附圖僅僅是 本申請中記載的一些實施例,對於本領域普通技術人員來 -37- 201142619 講,在不付出創造性勞動的前提下’還可以根據這些附圖 獲得其他的附圖。 圖1爲本申請實施例應用的網路環境示意圖; 圖2爲本申請實施例應用的包括電子商務交易資料統 計系統的網路環境示意圖: 圖3爲本申請實施例的一種統計電子商務交易資料的 方法的流程圖; 圖4爲本申請實施例的應用伺服器的邏輯結構示意_ t 圖5爲本申請實施例的電子商務交易資料統計系統@ 邏輯結構示意圖; 圖6爲本申請實施例的另一種統計電子商務交易資料 的方法的流程圖。 【主要元件符號說明】 101:電子商務交易系統 1〇2·資料倉庫系統 103 :用戶端 104 :電子商務交易資料統計系統 401 :交易資料處理單元 4〇2 :交易資料統計單元 5〇1 :第二應用伺服器 5〇2 :第二資料庫 -38-201142619 VI. Description of the Invention: [Technical Field] The present application relates to network technologies, and in particular, to a method for statistical e-commerce transaction data, an application server, and an e-commerce transaction data statistics system. [Prior Art] With the rapid development of Internet technology, e-commerce has gradually become a necessity for people's daily life, and various e-commerce websites have risen rapidly. For a large e-commerce website, it is especially important to analyze transaction data in real time and conduct business analysis based on transaction data. In the research and practice of the prior art, the inventors found that the following problems exist in the prior art: for a large e-commerce website, the e-commerce transaction system generally saves the transaction data to the database of the e-commerce transaction system, and There are tens of millions of database operations every day. Due to the real-time data statistics and updates, the acquired data must be processed continuously. If the transaction data is directly counted in the database of the e-commerce transaction system, the burden of the database of the e-commerce transaction system will be greatly increased, and the impact will be greatly affected. A normal business transaction may cause the database of the e-commerce transaction system to crash, which may result in the entire e-commerce website being unavailable. SUMMARY OF THE INVENTION The purpose of the embodiments of the present application is to provide a method for statistical e-commerce transaction data, an application server, and an e-commerce transaction data statistics system, so as to implement 201142619 real-time statistical e-commerce transaction data, and does not increase the data of the easy system. The burden of the library 'and thus does not affect the normal industry to solve the above technical problem'. The embodiment of the present application provides a method for e-commerce transaction data, which is applicable to an e-commerce transaction, a data warehouse system, and an e-commerce transaction data statistics system system. The system includes a first application servo database, and the e-commerce transaction data statistics system is used for the transaction data obtained by the statistical transaction system, the e-commerce transaction system includes a first application server and a second database, and the method 2 applies the server. Instantly obtaining the first application server to issue: after each transaction data is obtained, the second application server data 'acquires the information of the category to which the transaction data belongs; the first device according to the information of the category of the transaction data, from the first Second, the historical transaction data of this category, The second data is queried to the data warehouse system and obtains transaction data that is inconsistent with the previously corresponding transaction data according to the preset condition; the second application server combines the historical transaction data of the category, The current problem of obtaining the category is to solve the above technical problem. The embodiment of the present application also uses a server. The e-commerce system transaction system including the e-commerce transaction system, the capital and the e-commerce transaction data statistics system includes the first application server. And the first database transaction transaction data statistics system is used to count the e-commerce transaction data from the e-commerce transaction. A statistical transaction system e-commerce device and a first-party e-commerce data statistics department include: the first transaction data analysis of the transaction second application servo database obtained non-instant transaction data, comparison, update transaction data And easy information. Provided is an inventory warehouse system, the electronic merchant, the electronic merchant system obtains the application server and the second database, the application server comprises: a transaction data processing unit and a transaction data statistics unit; The transaction data processing unit is configured to obtain the transaction data sent by the first application server in real time, and send the transaction data to the transaction data statistics unit each time the transaction data is obtained; the transaction data statistics unit is used to obtain and Analyzing the transaction data, obtaining information of a category of the transaction data, obtaining historical transaction data of the category from the second database according to the information of the category of the transaction data, and combining the transaction data with historical transaction data of the category Obtaining current transaction data of the category; wherein the second database does not immediately query the data warehouse system and obtain transaction data that meets the preset conditions, and compares the obtained transaction data with the corresponding transaction data. , update inconsistent transaction data. To solve the above technical problem, the embodiment of the present application further provides an e-commerce transaction data statistics system, which is applicable to an e-commerce system including an e-commerce transaction system, a data warehouse system, and an e-commerce transaction data statistics system, and the e-commerce transaction system includes a first application server and a first database, the e-commerce transaction data statistics system is configured to collect transaction data obtained from the e-commerce transaction system, the e-commerce transaction data statistics system comprises: a second application server and a second data The second application server is configured to obtain the transaction data sent by the first application server in real time, analyze the transaction data after obtaining the transaction data, and obtain information about the category of the transaction data, according to the transaction data. The information of the category, the historical transaction data of the category is obtained from the second database, and the current transaction data of the category is obtained by combining the transaction data and the historical transaction data of the category; the second database is used for storing the transaction data. , not immediate to the data 201142619 warehouse department Query and obtain the transaction data that meets the preset conditions and compare the transaction data with the corresponding transaction data. To solve the above technical problem, the method for calculating e-commerce transaction data in the embodiment of the present application is applicable to a system including a system, a data warehouse system, and an e-commerce transaction data system, the e-commerce transaction system including a first application database, the e-commerce The transaction data statistics system uses the transaction data obtained by the business transaction system, the e-commerce system includes a second application server and a second database, and the second application server obtains the first application servo material in real time; after each transaction data is obtained The second application data is stored in the second database, and the information of the category to which the transaction data belongs is analyzed, wherein the second querying the data warehouse system and obtaining the transaction data that is obtained according to the preset bar is Corresponding transaction data inconsistent transaction data; the second application server root category information, the other historical transaction data is obtained from the second database; the second application server is associated with the historical transaction data of the category, When the above technical problem is solved, the embodiment of the present application uses a server Therefore, it is applicable to an electronic data warehouse system and an e-commerce transaction data statistics system, and the e-commerce transaction system includes the first application information, and the obtained and updated inconsistency also provides an electronic system of the e-commerce transaction system. The commercial server and the first statistics from the electronic transaction data statistics method include: the transaction server sent by the device uses the transaction information to obtain the transaction data of the non-instant piece of the database, compares and updates the data. The transaction data and the transaction data and the pre-transaction data. Also provided is a business transaction system, an e-commerce system and a first data - 201142619 library, the e-commerce transaction data statistics system is used to collect transaction data obtained from the transaction system, the e-commerce transaction data The application server and the second database are included, and the application server is convenient for the data processing unit and the transaction data statistics unit; the transaction element is used for obtaining the transaction information issued by the first application server in real time, and obtaining the transaction data, The transaction data is stored in the second, and the transaction data is analyzed, and the category of the transaction data is obtained, and a trigger message carrying the transaction information is sent to the transaction data statistics unit, and the trigger message is used to trigger the transaction data statistical transaction data. The transaction data statistics unit is configured to obtain historical transaction data of the transaction category from the second database according to the information of the category, and combine the transaction data and the transaction data to obtain current transaction data of the category; Wherein, the repository does not immediately query and obtain compliance with the data warehouse system. Transaction data, compare the obtained transaction data with the previous corresponding transaction, and update the inconsistent transaction data. To solve the above technical problem, the embodiment of the present application further provides a sub-commerce transaction data statistics system, which is applicable to a system including an e-commerce, a data warehouse system, and an e-commerce transaction data statistics system, where the e-commerce transaction system includes a first application server material. The e-commerce transaction data statistics system is configured to collect transaction data obtained from the transaction system, the e-commerce transaction system includes: a second application server and a second database; the second device is configured to obtain the first instant The transaction e-commerce statistical system issued by the application server includes: the materials for processing the materials, the information in each database, the information data of the statistical units of the category, and the history of the other resources. An electronic transaction system e-commerce and the first application of the electronic commerce statistics department application servo material, after obtaining the transaction data every -9 - 201142619 times, the second application server stores the transaction data to the second database In the analysis of the transaction data, obtaining information about the category of the transaction data, according to The information of the category to which the transaction data belongs, the transaction data and the historical transaction data of the category are obtained from the second database, and the second application server combines the transaction data and the historical transaction data of the category to obtain the current category of the category. Transaction data; the second database is used for storing transaction data, and is not an instant query to the data warehouse system and obtaining transaction data that meets the preset conditions, and compares the obtained transaction data with the corresponding transaction data, and updates the inconsistency. Transaction information. It can be seen that the e-commerce transaction data statistics system in the embodiment of the present application obtains the transaction data from the application server of the e-commerce transaction system in real time, instead of obtaining the transaction data from the database of the e-commerce transaction system, so that the e-commerce transaction is not increased. The burden of the system's database will not affect the normal business transactions, and will not cause the e-commerce transaction system's database to be down, thus avoiding the entire e-commerce website being unavailable. The embodiment of the present application provides a method for statistical e-commerce transaction data, an application server, and an e-commerce transaction data statistics system. Before introducing the method for calculating e-commerce transaction data, the application server, and the e-commerce transaction data statistics system, the network environment and some specialized knowledge involved in the application of the present application are first introduced. The network environment applied in the embodiment of the present application is as shown in FIG. 1. The client 103 can log in to the e-commerce parent-friendly system 1〇1 to perform an e-commerce transaction-10-201142619 operation, for example, to establish transactions, payment, etc., e-commerce. The trading system 1 〇1 can record transaction data and logs into the data warehouse system i 〇 2 〇 e-commerce transaction system 丨 0 丨 can provide functions such as commodity display establishment transaction, transaction management, payment, and the like. The e-commerce transaction system i 0 i can include an application server and a database. The application server can also store the transaction data and the like into the database. In the prior art, in order to count transaction data, a network entity generally obtains transaction data from a database. The warehouse system 102 is a subject-oriented, integrated, non-renewable, time-varying collection of data that supports the decision analysis process of a business or organization. Specifically, the data warehouse system 102 records the detailed change history of the parent data. The transaction data changes generated by the user using any operation of the client 1 在1 in the e-commerce transaction system are recorded in the data warehouse system 1 〇 2 in. Transaction data can refer to information related to the transaction, such as user account number, operation type, transaction amount, etc. The operation type is, for example, an event such as establishing a transaction or payment. It should be noted that the embodiment of the present application adds an e-commerce transaction data statistics system on the basis of FIG. 1, as shown in FIG. 2, the e-commerce transaction data statistics system 104 can be combined with the e-commerce transaction system. The interaction 'can also interact with the material repository system 102. The embodiment of the present application refers to a network system including an e-commerce transaction system, a data warehouse system, and an e-commerce transaction data statistics system as an e-commerce system. In the e-commerce system -11 - 201142619, an e-commerce transaction system, a data warehouse system, and The e-commerce delivery statistics system is connected in pairs. Of course, the e-commerce system can also include his network subsystem and other network entities. Other network entities are, for example, the user terminal for e-commerce transactions in the «+0 stomach trading system. : The user terminal used by the administrator of the sub-commerce transaction data statistics system has mentioned that the 'e-commerce transaction system 101 can include an application server and a database'. For convenience of the following description, the embodiment of the present application includes the electricity transaction system. The application server is called the first application server, and the database included in the sub-commerce transaction system is called the first database. The electronic transaction data statistics system 1 〇 4 is used to collect transaction data obtained from the e-commerce transaction system, and the e-commerce transaction data statistics system i 04 also applies the server 'for the convenience of the following description, the embodiment of the present application will be a business transaction data statistics system. The included application server is called the second server. The database included in the e-commerce transaction data statistics system is called the second database. All the technical solutions of the embodiments of the present application are applicable to the upper e-commerce system. In order to enable a person skilled in the art to better understand the technical solutions of the embodiments of the present application, and to make the above-mentioned objects, features and embodiments of the embodiments of the present application more obvious, the details of the embodiments of the present application are further described below with reference to the accompanying drawings. Description. First, a method for statistical e-commerce transaction in the embodiment of the present application is introduced. As mentioned above, the method is applicable to a business system including an e-commerce system, a data warehouse system, and an e-commerce transaction data statistics system. The first application server is easy to include in its management. The service provider will use the e-commerce transaction system to include statistics on the advantages of the technical information transaction electronic and the -12- '201142619 one database' for the e-commerce transaction system. The obtained transaction data, the e-commerce transaction data statistics system includes a second application server and a second database. As shown in FIG. 3, the method includes: S301: The second application server immediately obtains transaction data sent by the first application server. Specifically, the first application server can immediately provide the transaction data to the e-commerce transaction data statistics system independent of the e-commerce transaction system and the data warehouse system, and the first application server provides the second application server to the second application server. Transaction information. The first application server can immediately provide the transaction data to the second application server in such a manner that the first application server can issue a non-synchronization message, and the non-synchronization message carries the transaction data. An asynchronous message can carry the data generated by a user to perform an operation. The asynchronous message can be either a reliable asynchronous message or an unreliable asynchronous message. If the first application server sends a reliable asynchronous message, the asynchronous message may arrive at the second application server without being lost; if the first application server sends an unreliable asynchronous message, then the The phenomenon of loss of asynchronous messages occurs. Or the second application server may not receive asynchronous messages. In this case, the second application server may not be able to obtain some transaction data. In practice, the cost of using reliable asynchronous messages will be compared, and the cost of using unreliable asynchronous messages will be lower. In addition, the action of the first application server to issue an asynchronous message is negligible for the application server of the -13-201142619 - that is, the action of the first application server to send an asynchronous message does not affect the electronic Normal business transactions provided by the business transaction system. After executing S 3 0 1 , S 3 02 is executed: after each transaction data is obtained, the second application server analyzes the transaction data to obtain information of a category to which the transaction data belongs. In the embodiment of the present application, the transaction data may be divided into a plurality of categories ', for example, according to the user or the type of transaction operation. For example, a transaction data may be data generated by a user performing an e-commerce operation in an e-commerce transaction system by a client, and such transaction data may be considered as a transaction material belonging to the user. For another example, a transaction data may be data generated by a user performing an e-commerce operation in an e-commerce transaction system through a user terminal, and an e-commerce operation is, for example, an operation of paying a seller (ie, a transaction is successful), then Such transaction data can be considered as transaction materials belonging to such e-commerce operations. Of course, the transaction data can also be divided in other ways, no longer here - for example. After the second application server obtains the transaction data, the transaction data can be analyzed to determine the category to which the parent data belongs, that is, to obtain the information of the category to which the transaction data belongs. In the specific implementation, the transaction data sent by the first application server can not only carry the data content of the transaction data, but also carry the information of the category of the parental data. In this case, the second application server can directly access the transaction data. Get information about the category of the transaction data. The first application server may also pre-store a mapping table of the relationship between the record keyword and the category information map-14-201142619, one category information may correspond to only one keyword, one category information may also correspond to multiple keywords, and the second application server may After obtaining the transaction data, the device may extract the keyword from the transaction data, and use the keyword to find the category information corresponding to the keyword in the mapping table, so as to obtain the information of the category to which the transaction data belongs. Of course, the second application server can also analyze the transaction data in various other ways to obtain the information of the category to which the transaction data belongs. After executing S3 02, executing S3 03: the second application server obtains historical transaction data of the category from the second database according to the information of the category of the transaction data, wherein the second database is not instantaneously The data warehouse system queries and obtains transaction data that meets the preset conditions, compares the obtained transaction data with the corresponding transaction data, and updates the inconsistent transaction data. After obtaining the information of the category to which the transaction data belongs, the second application server may send a request message to the second database, the request message carries information of a category to which the transaction data belongs, and the request message is used to indicate the historical transaction data of the category to which the transaction data belongs. After receiving the request message, the second database may use the information of the category of the transaction data carried by the request message as a keyword to locally search the historical transaction data of the category to which the transaction data belongs, and return the found historical transaction data to the second. Application server. In a special case, because the second database may not store the transaction data of the category to which the transaction data belongs, the second database may return a response message to the second application server after receiving the request message, and the response message is used. It means that there is no history transaction data such as the category of the transaction data. -15- 201142619 As mentioned earlier, if the first application server sends an unreliable asynchronous message, the second application server may not receive some asynchronous messages, which may cause the second application server to Unable to get some transaction data. In this regard, the second database can query and obtain the transaction data that meets the preset conditions in a non-instant manner, compare the obtained transaction data with the corresponding transaction data, and update the inconsistent transaction data. In practical applications, the second database can query the data warehouse system and obtain transaction data that meets the preset conditions every preset period. . The preset period can be set by a person skilled in the art according to actual needs, for example, 1 minute. The preset conditions can also be set by a person skilled in the art according to actual needs, for example, all the changed data in the most recent cycle, and all the changed data can refer to the newly added data. The second database can compare the obtained transaction data that meets the preset conditions with the previously saved transaction data that meets the preset conditions. If the agreement is consistent, then no processing can be performed, and if there is inconsistent data, the inconsistent transaction is updated. data. After executing S 3 03, S3 04 is executed: the second application server combines the transaction data and the historical transaction data of the category to obtain the current transaction data of the category. In a specific implementation, the second application server can perform real-time statistics on the transaction data according to statistical rules. Before the second application server performs on-the-spot statistical processing on the transaction data according to the statistical rules, the statistical rule set by the client for statistical processing of the transaction data can be obtained. For example, before the second-16-201142619 application server performs statistical processing on the transaction data according to the statistical rules, the administrator managing the e-commerce transaction data statistics system sets the statistical rule on the user side, and the user side provides the statistical rule to the second. The application server is used, so that the second application server obtains the statistical rules set by the client. In practical applications, the above statistical rules include, for example, a provision for superimposing transaction data of the same category, in which case the second application server can superimpose the obtained transaction data with the historical transaction data of the same category. For example, the user belongs to the category in which the transaction data belongs. The second database can store the transaction record of the user in units of one user, or each user information only corresponds to one transaction record, and each transaction record only corresponds to one user information. The transaction data of this user is recorded in the transaction record. In a specific implementation, after obtaining the transaction data of the user and the historical transaction data of the user, the second application server superimposes the transaction data of the user and the historical transaction data of the user to obtain the current transaction data of the user, and then 'Save the current transaction data of this user to the transaction record of this user saved in the second database. For example, 'Assume that the transaction record of user 1 records the account number of user 1, the number of transactions established, the total amount of transactions, and the like, and assumes that user 1 completes a transaction in the e-commerce transaction system through the user terminal, the first · should be m servo The transaction data generated for this purpose includes the transaction amount, and the second application server obtains the transaction data. 'If it is judged that the transaction data corresponds to the user 1 'then, the younger one, the application, the service 1, the request to the younger brother, the database request user 1 The historical transaction data 'The second database is found to the user' corresponding transaction record -17- 201142619, after recording, the user 1's historical transaction data is returned to the second application server. After that, the second application server adds the transaction amount obtained to the original transaction total amount in the transaction record corresponding to the user 1 (ie, the acquired transaction data of the user 1 and the historical transaction data of the user 1) to obtain a new transaction. The total amount (ie the current transaction data of User 1). . After the second application server obtains the total amount of the new transaction, the total amount of the new transaction can be provided to the client used by the administrator, or the display curve of the total transaction amount of the user 1 is plotted according to the total amount of the new transaction, the administrator By displaying the curve, it is possible to intuitively understand the trend of the total amount of the transaction of the user 1. Take the category of the transaction data as an example of the type of transaction operation. Each transaction data corresponds to at least one transaction data category, such as the total amount of transactions over a period of time, the total number of transactions established over a period of time, or the total number of successful transactions over a period of time. In a specific implementation, after obtaining the transaction data of the transaction operation type and the historical transaction data of the transaction operation type, the second application server superimposes the transaction information of the transaction operation type and the historical transaction data of the transaction operation type to obtain The current transaction data for this transaction type. For example, suppose that the second application server needs to count the total amount of transactions over a period of time (the type of transaction operation is payment and/or collection, which may not distinguish users), and assume that user 1 completes in the e-commerce transaction system through the client. a transaction, the transaction data generated by the second application server for this includes the transaction amount, and after the second application server obtains the transaction data, if it is determined that the transaction amount in the transaction data corresponds to the payment and/or collection category, then The second application server requests the second database to provide payment and the historical transaction amount corresponding to the payment of -18-201142619, or the second database is found to be > or the historical transaction amount corresponding to the receipt, to the second The historical transaction amount corresponding to the application server and/or payment. After that, the second responder adds the transaction amount obtained and the historical amount corresponding to the payment and/or the receipt, and obtains the new transaction total payment corresponding to the payment and/or payment, and the application server receives the payment and/or receives the payment. After the new amount corresponding to the payment, the total amount of the new transaction can be provided to the administrator, or the display curve of the amount over a period of time based on the total amount of the new transaction can be intuitively displayed by the administrator by displaying the curve. The trend of the total amount of transactions over a period of time. As mentioned earlier, the second database may obtain the pre-conditional transaction data from the data warehouse system and may not be consistent with the previously saved material that meets the preset conditions. If the transaction data of the second database obtained from the data warehouse system and the preset conditions are inconsistent with the previously saved data that meets the preset conditions, the second application server may perform statistics based on the data provided by the data warehouse. That is to say, the data provided by the second database to the server is the complete data stored by the data warehouse system, so that the second application server is statistically complete and accurate. For example, suppose that within 10 minutes, user 1 completes a transaction through the user's sub-commerce transaction system, the first application serves an asynchronous message, and the non-synchronized message carries the transaction data generated by the first application server transaction, and the transaction data Including the transaction amount, but the server did not receive this asynchronous message. In 1 minute, the settlement amount and / return payment servo transaction amount. The trading system of the transaction account that is always known to the transaction account of the transaction is the second and accurate data. When the appliance is issued as the second bundle, 19-201142619 The warehouse system issues a request for information that changes within 10 minutes. The data warehouse system returns information that has changed within 10 minutes to the second database. The changed information includes the transaction amount and the second data. The library compares the data obtained by the data warehouse system that changed within 10 minutes with the data that has been saved within 10 minutes, and determines that it has not obtained a transaction completed by User 1 within 10 minutes. In the transaction data, the second database stores the transaction data generated by the user 1 in one transaction completed within 10 minutes into the transaction record corresponding to the user 1, and then the second application server can modify the user 1 The display curve corresponding to the transaction amount, and the modified display curve is provided to the client used by the administrator. Optional 'After executing S 3 0 1 , the second application server may record the log of the transaction data in the transaction data log table in the second database. The transaction data table can construct a record in units of a user-initiated event, or construct a record in units of one asynchronous message. In addition, the second application server can store the transaction data in the second database after obtaining the transaction data each time. The second database can also analyze the transaction data to obtain information about the category of the transaction data and bind the transaction data to the information of the category to which it belongs. In this way, when the second database searches for the transaction data of this category, it can find all the transaction materials bound to the category according to the binding relationship. In addition, in the actual application, the administrator who manages the e-commerce system may need to query the transaction data. In this case, the user -20-201142619 of the administrator can issue a query to the second application server to meet certain conditions. The request message of the transaction data, after the second application server obtains the request message, may send a transaction data that meets the condition to the second database, and the second database finds the transaction data that meets the condition, and then sends the service data to the second application. The device returns the transaction data that meets the condition, and the second application server returns the transaction data that meets the condition to the client used by the administrator. Corresponding to an embodiment of the method for monitoring an event of the present application, the present application also provides an embodiment of an application server disposed in an e-commerce transaction data statistics system. The application server is applicable to an e-commerce system including an e-commerce transaction system, a data warehouse system, and an e-commerce transaction data statistics system. The e-commerce transaction system includes a first application server and a first database, and the e-commerce transaction data The statistical system is configured to count transaction data obtained from the e-commerce transaction system, and the e-commerce transaction data statistics system includes the application server and the second database. As shown in FIG. 4, the application server includes: a transaction data processing unit 40 1 and a transaction data statistics unit 402; the transaction data processing unit 40 1 is configured to obtain the transaction data sent by the first application server in real time, and each time After obtaining the transaction data, the transaction data is sent to the transaction data statistics unit 402. The transaction data statistics unit 403 is used to obtain and analyze the transaction data, and obtain information about the category of the transaction data, according to the information of the category of the transaction data. Obtaining historical transaction data of the category from the second database, and combining the transaction data and the historical transaction data of the category to obtain current transaction data of the category; wherein the second database is not instantaneous to the data warehouse The system queries and obtains the transaction data that meets the preset conditions, and compares the obtained transaction data with the transaction data of the corresponding corresponding 21 - 201142619 to update the inconsistent transaction data. In the actual application, the transaction data processing unit 〇1 sends the transaction data to the transaction data statistic unit 402 each time the transaction data is obtained, and the essence is that the transaction data statistic unit 402 is triggered to perform statistical processing on the transaction data. In a specific implementation, the transaction data processing unit 401 may send a trigger message to the transaction data statistic unit 〇2 for triggering the transaction data statistic unit 〇2 to perform statistics on the transaction data, and the trigger message carries the transaction data. In the actual application, after the transaction data statistical unit 4〇2 obtains the transaction data, the transaction data can be analyzed to determine the category to which the transaction data belongs, that is, the information of the category to which the transaction data belongs. In a specific implementation, the transaction data sent by the first application server can not only carry the data content of the transaction data, but also carry the information of the category of the transaction data. In this case, the transaction data statistics unit 402 can directly from the transaction data. Get information about the category of the transaction data. The transaction data statistic unit 402 may also pre-store a mapping table of the mapping relationship between the record keyword and the category information. One category information may correspond to only one keyword, one category information may also correspond to multiple keywords, and the transaction data statistic unit 402 obtains transaction data. After that, keywords can be extracted from the transaction data, and the keyword information corresponding to the keyword can be searched in the mapping table by using the keyword, so that the information of the category to which the transaction data belongs can also be obtained. Of course, the transaction data statistic unit 402 can also analyze the transaction data in various other ways to obtain the information of the category to which the transaction data belongs. The transaction data statistic unit 402 obtains the information of the category to which the transaction data belongs - 201142619. After the request message can be sent to the second database, the request message carries the information of the category to which the data belongs, and the request message is used to indicate the historical transaction of the category to which the requested material belongs. data. After receiving the request, the second database may use the category of the transaction data carried by the request message as the keyword 'locally find the history of the category to which the transaction data belongs, and return the found historical transaction data to the transaction data system. . In special cases, because the second database may not store the transaction data of the category to which the material belongs, the second database may return a return to the transaction data statistics unit 402 after receiving the message. This response message is used to indicate that the response is not found. The transaction data belongs to the historical transaction data and other content. In an actual application, the transaction data statistics unit 402 can perform real-time statistics on the transaction data according to the rules. Before the transaction data statistics unit performs real-time statistical processing on the transaction data according to the statistical rules, the general information of the transaction data set by the user terminal is obtained. For example, in the transaction data statistical unit 4〇2, the statistical processing is performed according to the statistical rules. Previously, the management e-commerce transaction data statistics system set the statistical rules on the user side, and the user side will statistically calculate the transaction data statistics unit 4〇2, so that the 'transaction data statistics unit obtains the statistical rules set by the user side. In practical applications, the above statistical rules include, for example, a provision for superimposing the same transaction data. In this case, the transaction unit 410 can superimpose the obtained transaction data with the same class of other IJ transaction data. With the transaction transaction information message information for the easy data unit transaction funds to the request should be the message category of the statistics of the 402 in the rules can be obtained from the management of the data system to the history of a category of easy information -23- 201142619 in practical applications If the transaction data of the second database obtained from the data warehouse system meeting the preset condition is inconsistent with the previously saved transaction data that meets the preset condition, the transaction data statistics unit 402 may use the data provided by the data warehouse system. statistics. That is to say, the information provided by the second database to the transaction data statistical unit 4〇2 is complete and accurate data stored by the data warehouse system, so that the transaction data statistical unit 402 is based on complete and accurate data. of. In an actual application, the transaction data processing unit 40 1 may record the log of the transaction data in the transaction data table in the second database after each time the transaction data is obtained. In an actual application, the transaction data processing unit 40 1 may store the transaction data in the second database after each time the transaction data is obtained. After obtaining the transaction data, the transaction data statistics unit 402 may also store the transaction data in the second database. In an actual application, one of the transaction data processing unit 40 1 and the transaction data statistics unit 402 may store the transaction data in the second database. In an actual application, an administrator managing the e-commerce system may need to query the transaction data. In this case, the client used by the administrator may send a request message to the transaction data statistics unit 402 to query the transaction data that meets certain conditions. After obtaining the request message, the transaction data statistic unit 402 may issue a transaction data that meets the condition to the second database. After the second database finds the transaction data that meets the condition, the transaction data statistic unit 402 returns a condition that meets the condition. In the transaction data, the transaction data statistic unit 4 02 returns to the user side used by the administrator the transaction information of -24-201142619 that meets this condition. Since the application server embodiment shown in FIG. 4 is an embodiment corresponding to the method embodiment shown in FIG. 3, the functions and mutual cooperation relationships of the respective functional units in the application server shown in FIG. The description may refer to the related description in the method embodiment shown in FIG. 3, and details are not described herein. As can be seen from the method shown in FIG. 3, many steps in the method shown in FIG. 3 are included in the e-commerce transaction data statistics system. The application server is an execution entity. In addition, the application server shown in FIG. 4 is also disposed in the e-commerce transaction data statistics system. Therefore, the embodiment of the present application further provides an e-commerce transaction data statistics system. The e-commerce transaction data statistics system is applicable to an e-commerce system including an e-commerce transaction system, a data warehouse system, and an e-commerce transaction data statistics system, the e-commerce transaction system including a first application server and a first database, the electronic The business transaction data statistics system is used to count transaction data obtained from the e-commerce transaction system. As shown in FIG. 5, the e-commerce transaction data statistics system includes a second application server and a second database 5.2; the second application server 501 is configured to obtain the transaction data sent by the first application server in real time. After each transaction data is obtained, 'analyze the transaction data, obtain the information of the category to which the transaction data belongs', according to the information of the category of the transaction data, obtain the historical transaction data of the category from the second database 5〇2, and combine The transaction data and the historical transaction data of the category are used to obtain the current transaction data of the category; the first database is used to store the parental information, and it is not immediately available to the database - 201142619 Conditional transaction data 'Compare the transaction data obtained with the previous transaction data' to update the inconsistent transaction data. Optionally, the second database 502 may be provided with a transaction data log table for storing logs of transaction data and a transaction data reference table for storing transaction data. In the transaction data log table, one record can be in units of events initiated by the user. In the transaction data reference table, one record can be in units of one user. The second application server 5 0 1 can record the log of the transaction data in the transaction data log table. For a detailed description of the specific functions and the mutual cooperation relationship between the second application server 50 1 and the second database 502, reference may be made to the method embodiment shown in FIG. 3 and the related description in the application server embodiment shown in FIG. 4, where No longer. In addition to the method implementation shown in FIG. 3, the embodiment of the present application also provides a method for counting e-commerce transaction data. The method is applicable to an e-commerce system including an e-commerce transaction system, a data warehouse system, and an e-commerce transaction data statistics system, the e-commerce transaction system including a first application server and a first database 'the e-commerce transaction data statistics system For counting transaction data obtained from the e-commerce transaction system, the e-commerce transaction data statistics system includes a second application server and a second database. As shown in FIG. 6, the method includes: S601 · The first application server obtains the transaction data sent by the first application server. Specifically, the first application server can immediately provide transaction data to the e-commerce transaction data statistics system independent of the electronic business -26-201142619 transaction transaction system and the data warehouse system, specifically, the first application server is instant to the first Second, the application server provides transaction data. The first application server can immediately provide the transaction data to the second application server in such a manner that the first application server can issue a non-synchronization message. The non-synchronization message carries the transaction data. An asynchronous message can carry the data generated by a user to perform an operation. The asynchronous message can be either a reliable asynchronous message or an unreliable asynchronous message. If the first application server sends a reliable asynchronous message, the asynchronous message may arrive at the second application server without being lost; if the first application server sends an unreliable asynchronous message, then the The phenomenon that the asynchronous message is lost occurs, or the second application server may not receive the asynchronous message. In this case, the second application server may not be able to obtain some transaction data. In practical applications, the cost of using reliable asynchronous messages will be higher, and the cost of using unreliable asynchronous messages will be lower. In addition, the action of the first application server to issue an asynchronous message is negligible for the first application server, that is, the action of the first application server to issue an asynchronous message does not affect the e-commerce transaction system. Normal business transactions. S 602 · After obtaining the transaction data each time, the second application server stores the parent-easy data in the second database, and analyzes the transaction data to obtain information about the category of the 贝易贝料, wherein The second database does not immediately query the data warehouse system and obtain the transaction data that meets the preset conditions. -27- 201142619 'Compare the transaction data obtained with the corresponding transaction data to update the inconsistent transaction data. In the embodiment of the present application, the transaction data may be divided into a plurality of categories ', for example, according to the user or the type of transaction operation. After the first application server obtains the parent data, it is required to store the transaction data in the second database, and also analyzes the transaction data to obtain the information of the category to which the transaction data belongs. In practical applications, the transaction data can be stored in the first database and the analysis of the transaction data can be carried out at the same time, or it can be entered into β 'if it is performed sequentially' then there is no inevitable sequence, or which operation can be performed first. . In the specific case, the transaction data sent by the first application server can not only carry the data content of the parent data, but also can carry the information of the category of the transaction data. In this case, the second application server can directly access the transaction data. Get information about the category of the transaction data. The second application server may also pre-store a mapping table for mapping the relationship between the keyword and the category information. [One category information may correspond to only one keyword, one category information may also correspond to multiple keywords, and the second application server may obtain transaction data. After the 'can extract keywords from the transaction data', use the keyword to find the category information corresponding to the keyword in the mapping table, so that the information of the category to which the transaction data belongs can also be obtained. Of course, the second application server can also analyze the transaction data in various other ways to obtain the information of the category of the transaction data, which is no longer - for example. As mentioned earlier, if the first application server sends an unreliable asynchronous message, the second application server may not receive some -28 - 201142619 asynchronous messages, which may cause the second application server to Unable to get some transaction data. In this regard, the second database can query and obtain the transaction data that meets the preset conditions in a non-instant manner, compare the obtained transaction data with the corresponding transaction data, and update the inconsistent transaction data. In practical applications, the second database can query the data warehouse system and obtain transaction data that meets the preset conditions every preset period. The preset period can be set by a person skilled in the art according to actual needs, for example, 1 minute. The preset conditions can also be set by a person skilled in the art according to actual needs, for example, all the changed data in the most recent cycle, and all the changed data can refer to the newly added data. The second database can compare the obtained transaction data that meets the preset conditions with the previously saved transaction data that meets the preset conditions. If they are consistent, the transaction data may be left unprocessed, and if there is inconsistent data, the inconsistent transaction is updated. data. S 6 03: The second application server obtains the transaction data and the historical transaction data of the category from the second database according to the information of the category to which the transaction data belongs. After obtaining the information of the category to which the transaction data belongs, the second application server may send a request message to the second database, where the request message carries the information of the category to which the transaction data belongs, and the request message is used to indicate all the transaction materials requesting to provide the category of the transaction data. Includes acquired transaction data and historical transaction data. After receiving the request message, the second database may use the information of the category of the transaction data carried in the request message as a keyword to locally search all the transaction materials of the category to which the information belongs to -29-201142619, and will find all the transactions. The data is returned to the second application server. In special cases, the historical database of the category of the above transaction data may not be stored in the database for some or some reasons. In this case, the second database can only return to the second application server. 2. The parent transaction data of the category of the transaction data obtained by the application server cannot be returned, and the historical transaction data of the category of the transaction data cannot be returned. S604. The first application server combines the transaction data with the historical transaction data of the category to obtain current transaction data for the category. What needs to be explained is that although the second application server has previously stored the transaction data in the second database, the second database can simply bind the obtained transaction data to the corresponding category instead of The operation of superimposing the transaction data of the same category, in this case, the transaction data of this category stored in the second database includes at least the transaction data obtained by the second application server and the historical transaction data of this category. Therefore, the transaction information of the category obtained by the second application server from the second database includes at least the transaction data obtained by the second application server and the historical transaction data of the category. Therefore, the second application server can combine the transaction data obtained by itself with the historical transaction data of this category to obtain the current transaction data of this category. In a specific implementation, the second application server can perform real-time statistics on the transaction data according to statistical rules. Before the second application server performs on-the-spot statistical processing on the transaction data according to the statistical rules, the statistical rule set by the client for statistical processing of the transaction data can be obtained. For example, before the second -30-201142619 application server performs statistical processing on the transaction data according to the statistical rules, the administrator who manages the e-commerce transaction data statistics system sets the statistical rule on the user side, and the user side provides the statistical rule to the second. The application server is used, so that the second application server obtains the statistical rules set by the client. In practical applications, the above statistical rules include, for example, a provision for superimposing transaction data of the same category, in which case the second application server can superimpose the obtained transaction data with the historical transaction data of the same category. As mentioned earlier, the transaction data of the second database obtained from the data warehouse system that meets the pre-set conditions may not be consistent with the previously saved transaction data that meets the preset conditions. If the transaction data of the second database obtained from the data warehouse system that meets the preset conditions is inconsistent with the previously saved transaction data that meets the preset conditions, the second application server may perform statistics based on the data provided by the data warehouse system. That is to say, the data provided by the second database to the second application server is complete and accurate data stored by the data warehouse system, so that the second application server is based on complete and accurate data. Optionally, after executing S60 1, the second application server may record the log of the obtained transaction data in the transaction data log table in the second database. The transaction data log table can construct a record in units of a user-initiated event, or construct a record in units of an asynchronous message. In addition, after the second application server stores the transaction data in the second database, the second database can also analyze the transaction data, obtain the information of the category of the transaction data -31 - 201142619, and the transaction data and the category of the category. set. In this way, after the second database searches for the intersection of this category, it can find the binding data with this category according to the binding relationship. In addition, in practical applications, the management of the e-commerce system may need to query the transaction data. In this case, the administrator enables the terminal to issue a request message to the second application server that meets a certain condition, and the second application server After obtaining the request message, the second database issues a transaction data that meets the condition, and after the database finds the transaction data that meets the condition, the second data should return the transaction data that meets the condition, and the second application server user uses the transaction data. The transaction returns the transaction data that meets this condition. The technical features of the method embodiment shown in FIG. 6 are the same as those of the method shown in FIG. 3. For the specific description of these same technical features, reference is made to the related description in the method embodiment shown in FIG. 3, which is shown in FIG. Corresponding to the method embodiment, the application is also placed in an application server in the e-commerce transaction data statistics system. The tracking application server is applicable to an e-commerce e-commerce transaction system including an e-commerce transaction system library system and an e-commerce transaction data statistics system, including a first application server and a first-party e-commerce transaction data statistics system for counting statistics from the electronic The transaction data obtained by the business system, the e-commerce transaction data statistics application server and the second database. Please refer to FIG. 4 again, the transaction resources of all the users available to the administrator when the information is tied to the information can be described to the second data server to the management instance, and the implementation can be omitted. For example, the data warehouse system, the stock database, the transaction transaction system including the server-32-201142619 includes: a transaction data processing unit 40 1 and a transaction data statistics unit 402; the transaction data processing unit 40 1 is used to obtain the first Transaction data sent by the application server, after each transaction data is obtained, the transaction data is stored in the second database, and the transaction data is analyzed, and the information of the category of the transaction data is obtained, and the transaction data statistics unit is obtained. The triggering message is used to trigger the transaction data statistic unit 402 to collect the transaction data. The transaction data statistic unit 402 is configured to use the information according to the category of the transaction data from the second data. Obtaining the transaction data and historical transaction data of the category in the library, and combining the transaction data with the The historical transaction data of the category is obtained by the current transaction data of the category; wherein the second database is non-instantly querying the data warehouse system and obtaining the transaction data that meets the preset conditions, and the obtained transaction data is corresponding to the previous transaction. Compare the data and update the inconsistent transaction data. A significant difference between this application server embodiment and the previously described application server embodiment is that in this application server embodiment, the transaction data processing unit 40 1 proceeds to the transaction after obtaining the information of the category to which the transaction material belongs. The data statistic unit 402 issues a trigger message that does not carry the transaction data but carries the information of the category to which the transaction material belongs. The transaction data statistics unit 402 obtains from the second database the transaction data obtained by the transaction data processing unit 40 1 and the historical transaction data of this category. This application server embodiment has many of the same technical features as the application server embodiment described above. For example, the transaction data processing unit 40 1 will obtain a log record of the transaction data each time the transaction data is obtained -33-201142619 In the transaction data log table in the second database. For a detailed description of the features, reference may be made to the related description in the application described above, and details are not described herein again. In addition, the application server embodiment is corresponding to the embodiment of FIG. 6. Therefore, the description of the function and the mutual cooperation relationship in the application server can be referred to the related description in the embodiment of FIG. 6, and details are not described herein again. It can be seen from the method shown in FIG. 6 that the steps shown in FIG. 6 are all executed by the e-commerce transaction data statistics system. In addition, the corresponding application server is also set in the transaction data statistics system. Therefore, the present application Implement a kind of e-commerce transaction data statistics system. The e-commerce § ten system is applicable to an e-commerce system including an e-commerce transaction system and a data sub-commerce transaction data statistics system. The e-system includes a first application server and a first database, and the e-data system is used for statistics from the e-commerce system. E-commerce transaction information. Referring to FIG. 5 again, the e-commerce transaction resource: the second application server 501 and the second database 5〇2 server 5 0 1 are used to obtain the first application server to obtain the transaction data at each time. The second application server data is stored in the second database 502, and the information of the category of the transaction transaction data is analyzed, and the transaction data and the transaction data are obtained from the second database 502 according to the transaction information, and the second The application server 501 combines the transaction with the method shown in the same technical server embodiment. The method shown in each functional unit is implemented in many steps. The application server also provides a transaction data warehouse for the e-commerce example. System and electricity The e-commerce submitted to the e-commerce delivery system to obtain the delivery statistics system package: the second application served transaction data 501 to the transaction data, obtain the historical data of the category of the category and the category-34- 201142619 historical transaction data, get the current transaction data of the category; the second database 5 02 is used to store the transaction data, not immediately to the data warehouse The system queries and obtains the transaction data that meets the preset condition, compares the obtained transaction data with the corresponding transaction data, and updates the inconsistent transaction data. Optionally, the second database 502 can be configured with the transaction data. A log data table of the log and a transaction data reference table for storing the transaction data. In the transaction data log table, a record can be in units of a user-initiated event. In the transaction data reference table, a record can be in units of one user. The second application server 5 0 1 can record the log of the transaction data in the transaction data log table. For a detailed description of the specific functions and the mutual cooperation relationship between the second application server 510 and the second database 052, reference may be made to the method embodiment shown in FIG. 6 and the related description in the corresponding application server embodiment. Let me repeat. It can be seen from the description of the above embodiments that, in the embodiment of the present application, the application server of the e-commerce transaction data statistics system obtains the transaction data from the application server of the e-commerce transaction system in real time, instead of the database from the e-commerce transaction system. Instant access to transaction data, which will not increase the burden of the e-commerce transaction system database, so as not affecting normal business transactions, and will not cause the e-commerce transaction system database to crash, thereby avoiding the entire e-commerce website. Not available. In addition, the application server of the e-commerce transaction system can provide the e-commerce transaction data statistics system by issuing a non-synchronized unreliable message, which does not affect the normal business transactions in the e-commerce transaction system. It also reduces implementation costs. In addition, the 'e-commerce transaction data statistics system can obtain data that meets certain conditions from the data warehouse system in a non-instantaneous manner, especially the father-friendly data that has changed in the most recent cycle, so that even the e-commerce transaction data statistics system is in one If all the non-synchronized messages are not received within the period, or if all the transaction data are not received within one cycle, then the e-commerce transaction data statistics system can be guaranteed to obtain all the transaction data after the end of the period, so that Provide a more accurate data base for statistical processing. As will be apparent from the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of a software plus a necessary universal hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. A disc or the like includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments. The various embodiments in the specification are described in a progressive 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 the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. -36- 201142619 This application can be used for many general or special purposes. In the computing system environment or configuration. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, small computers, Large computers, decentralized computing environments including any of the above systems or devices, and more. The application can be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The present application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices that are connected through a communications network. In a distributed computing environment, the program modules can be located in local and remote computer storage media, including storage devices. While the present invention has been described by the embodiments of the present invention, it will be understood by those skilled in the art . BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, in the following description The drawings are merely some of the embodiments described in the present application, and those skilled in the art will be able to obtain other drawings based on these drawings without any inventive effort. 1 is a schematic diagram of a network environment according to an embodiment of the present application; FIG. 2 is a schematic diagram of a network environment including an e-commerce transaction data statistics system according to an embodiment of the present application: FIG. 3 is a statistical e-commerce transaction data according to an embodiment of the present application. FIG. 4 is a schematic diagram of a logical structure of an application server according to an embodiment of the present application. FIG. 5 is a schematic diagram of a logical structure of an e-commerce transaction data statistics system according to an embodiment of the present application. FIG. Another flow chart of a method for counting e-commerce transaction data. [Description of main component symbols] 101: E-commerce transaction system 1〇2. Data warehouse system 103: Client 104: E-commerce transaction data statistics system 401: Transaction data processing unit 4〇2: Transaction data statistical unit 5〇1: Second application server 5〇2: second database-38-