201030658 六、發明說明: 【發明所屬之技術領域】 本發明涉及資料處理技術,特別是涉及一種緩衝記帳 方法及裝置。 【先前技術】 在帳務處理中,資金從一方帳戶支出並轉入另一方帳 Φ 戶,對雙方帳戶而言,都有一個記帳處理的過程。記帳處 理過程主要包括兩部分,一部分是記錄記帳憑證,另一部 分是更新帳戶餘額。 參照圖1,是標準的記帳處理流程圖。以交易過程中 的記帳處理爲例,針對一筆記帳請求事件:首先,對交易 相關帳戶(包括買方對應的支出帳戶和賣方對應的入帳帳 戶)進行資源的加鎖,以保證不被其他請求影響資料的準 確性;其次,執行支出帳戶的記帳操作,包括記錄記帳憑 φ 證及更新餘額,然後執行入帳帳戶的記帳操作,也包括記 錄記帳憑證及更新餘額;待記帳請求事件處理完畢後,統 一釋放資源的鎖。 通常,每一次記帳都需要對相關帳號進行鎖操作,從 而避免其他操作對正在處理的帳號進行再次操作造成資料 不一致,因此鎖是實現倂發方法。隨著業務量的不斷增大 ,某些帳號會在瞬間產生多個倂發操作,但所有倂發線程 中只有一個線程能夠持有當時的資源鎖,其他線程必須等 待鎖被釋放後再逐一進行記帳處理。這種情況下,其他的 -5- 201030658 線程都在等待,嚴重影響了帳務系統的性能。 例如,同時有10 00名彩民向彩券帳號付款,此時, 對該彩券帳號一共約有1000筆請求佇列,而要逐一等待 取得鎖許可權再進行操作,將嚴重影響系統其他業務的處 理。 目前,一種解決方法是採用緩衝機制。所述緩衝機制 對入帳帳戶的記帳操作僅做記帳流水的記錄,即臨時記錄 記帳憑證,而將更新帳戶餘額的操作延後處理,即將帳號 的相關記帳請求進行過渡處理,不進行真正的記帳操作。 這種過渡處理不需要對帳號進行鎖資源,從而解決了單一 資源的高倂發需求,以保證其他相關業務可以正常進行。 關於帳戶餘額的更新,每日進行一次小結(稱爲曰切 ),一個會計日過後,系統會根據該類帳戶前一會計曰的 記帳流水記錄,小結出帳戶的餘額,即該類帳戶的餘額是 每個會計曰更新—次的。其中,所述會計日以規定的時間 點爲界線,如21 : 00 ’即21 : 00~次曰20 : 59 (約)爲一 個會計曰。 這種技術相當於將高併發的請求臨時緩衝,再將緩衝 區中的請求串列的處理,即滿足了不影響其他業務正常進 行的需求’又平緩了系統的處理壓力(將峰値較高的區間 資料分散到較多時間段上平緩的處理)。但是,存在的問 題是:雖然可以滿足用戶即時查看帳務明細的需求,但該 明細與餘額是沒有關聯的’因爲餘額要下一個會計曰才可 以反映出來,因此不能滿足用戶對帳的平衡規則(即當前 -6- 201030658 餘額=帳務明細的累加):而且,對用戶的入帳資金要下 —個會計日才可以看到並可用,例如某帳號當天收到10 筆交易資金’但該帳號要等到第二天才能真正收到這筆資 金0 【發明內容】 本發明所要解決的技術問題是提供一種緩衝記帳方法 Φ 及裝置’以解決現有的緩衝記帳機制不能滿足用戶對帳需 求、在下一個會計曰才可以看到到帳資金的問題。 爲解決上述技術問題,根據本發明提供的具體實施例 ’本發明公開了以下技術方案: 一種緩衝記帳方法,包括: 對高倂發帳戶,記錄每一個請求事件,並產生緩衝記 錄; 提取緩衝記錄,並對應高倂發帳戶進行記帳處理,所 帳處理包括記錄記帳資訊和更新帳戶的操作。 其中’所述提取緩衝記錄包括定時提取和循環提取。 其中,對應高倂發帳戶’對所述緩衝記錄逐條進行記 帳處理,具體包括:對高倂發帳戶的資源加鎖;記錄記帳 資訊;更新帳戶餘額;釋放該資源鎖。 所述方法還包括:刪除相應的緩衝記錄。 所述方法還包括:每日對前一個會計日的記帳資訊進 行對帳驗證’如果存在前一個會計日的緩衝記錄,則對該 緩衝記錄進行記帳處理後,再進行對帳驗證。 201030658 一種緩衝記帳裝置,包括: 緩衝儲存單元,用於對高倂發帳戶,記錄每一個請求 事件,並產生緩衝記錄; 記帳處理單元,用於提取緩衝記錄,並對應高倂發帳 戶進行記帳處理,所述記帳處理包括記錄記帳資訊和更新 帳戶的操作。 所述裝置還包括:對帳驗證單元,用於每日對前一個 會計日的記帳資訊進行對帳驗證,如果緩衝儲存單元中存 在前一個會計日的緩衝記錄,則等待記帳處理單元對該緩 衝記錄進行記帳處理後,再進行對帳驗證。 其中,所述記帳處理單元定時或循環從緩衝儲存單元 中提取緩衝記錄。 其中,如果爲定時提取,則所述裝置還包括:定時單 元’用於設定預置時間,定時觸發記帳處理單元從緩衝儲 存單元中提取緩衝記錄。 其中’所述記帳處理單元對緩衝記錄逐條進行記帳處 理。 其中’所述記帳處理單元處理完緩衝記錄後,從緩衝 儲存單元中刪除該緩衝記錄。 根據本發明提供的具體實施例,本發明具有以下技術 效果: 首先’本發明提出了一種新的緩衝記帳方法,該方法 針對參與帳戶爲高倂發帳戶的情況,利用儲存區域臨時記 錄每一個請求事件,然後在後期進行記錄記帳資訊和更新 -8- 201030658 帳戶的操作,從而補充原記帳請求未完成的內容。 與現有技術的不同之處在於,本發明緩存的是請求事 件,即沒有將記帳處理過程中記錄記帳資訊和更新帳戶的 操作相分離,而是在後期同步進行;而且,所述後期處理 也會在短時間內完成,不會等到下一個會計日才進行曰結 處理。這樣可以保證帳務明細與帳戶餘額同步更新,滿足 用戶的對帳需求。而且,帳務資金在較短的時間範圍內可 Φ 查詢並可用,該時間可以根據帳戶的倂發量設置。 其次,在後期處理中,本發明提供了兩種緩衝記錄的 提取方式:一種是定時提取,即指定時間點處理,此方式 適用於業務量較大、對延遲時間沒有太高要求的帳戶;另 一種是循環提取,即處理完一批,再取下一批,此方式適 用於業務量很大、且對延遲時間要求較短的帳戶。 【實施方式】 φ 爲使本發明的上述目的、特徵和優點能夠更加明顯易 懂,下面結合附圖和具體實施方式對本發明作進一步詳細 的說明。 針對高倂發帳務請求,本發明提出了一種新的緩衝記 帳方法,該方法針對參與帳戶爲高倂發帳戶的情況,利用 儲存區域臨時記錄每一個請求事件,然後在後期進行記錄 記帳資訊和更新帳戶的操作,從而補充原記帳請求未完成 的內容。 本發明適用於多個領域的帳務處理,如網上購物、車 -9- 201030658 票、演唱會門票的購買等場景。而且,本發明尤其適用於 處理倂發付款請求,即由多個帳號同時向一個帳號付款的 情況。下面通過具體實施例進行詳細說明。 以交易處理爲例,買方從賣方購買商品,應向賣方帳 戶付款。其中,賣方帳戶可稱爲入帳帳戶,買方帳戶可稱 爲支出帳戶,即支付金額從支出帳戶轉入入帳帳戶。 在這個過程中,涉及到兩類角色的利益:一類是持有 帳戶的用戶(包括買方和賣方),下文簡稱爲用戶;另一 類是提供帳務服務的系統,下文簡稱爲系統。 從用戶角度: 1 )希望即時看到記帳流水資訊,即帳務明細,便於 確認交易款項的進度; 2)希望帳戶的餘額能夠即時更新,並可用。 從系統角度: 希望在高倂發情況下即時處理,從而平緩系統的處理 壓力,並保證其他相關業務可以正常進行。 爲同時滿足上述用戶和系統的要求,本發明實施例提 供了一種緩衝記帳方法,以多個帳號同時向一個帳號付款 的倂發情況爲例。參照圖2,是實施例所述一種緩衝記帳 方法流程圖,具體如下: S 201,在高倂發情況下,當買方向賣方付款時,向帳 務系統發起付款請求; S 2 02 ’帳務系統針對每一筆付款請求,首先對買方帳 戶進行記帳處理,包括如下操作: 201030658 η對買方帳戶的資源加鎖; 2)記錄記帳憑證,即做記帳流水的記錄; ' 3)更新帳戶餘額,即從買方帳戶扣除付款金額; S203,帳務系統再對賣方帳戶進行緩衝處理,等待後 期處理;緩衝處理過程是僅記錄該請求事件,而不作實質 性的記帳操作(包括記錄記帳憑證和更新帳戶餘額); 帳務系統可以將每一個請求事件以流水帳形式記錄到 φ 一個緩衝區域,產生緩衝記錄,然後在一定時間段之後, 再依次進入原來的帳務系統進行記帳操作。所述緩衝區域 可以是資料庫,伺服器或硬碟、記憶體等實體儲存裝置。 S 204,經過上述步驟,一個請求事件已處理完畢,可 以釋放買方帳戶的資源鎖; S20 5,對於等待後期處理的緩衝記錄,帳務系統會單 獨進行緩衝記錄的還原處理。 參照圖3,是所述緩衝記錄的還原流程圖。 φ S301,從緩衝區域提取緩衝記錄; 本實施例提供了兩種提取方式:一種是定時提取,即 指定時間點處理,此方式適用於業務量較大、對延遲時間 沒有太高要求的帳戶:另一種是循環提取,即處理完一批 ,再取下一批,此方式適用於業務量很大、且對延遲時間 要求較短的帳戶》 緩衝記錄提取後,根據帳戶拆分,每個帳戶分配一個 處理線程在後臺處理,從而縮短處理時間。 S3 02,逐條進行處理,針對每一條緩衝記錄,先對賣 -11 - 201030658 方帳戶的資源加鎖; S3 03,記錄記帳憑證,即做記帳流水的記錄; S3 04,更新帳戶餘額,即將付款金額轉入賣方帳戶; S 3 0 5,較佳的,從緩衝區域刪除相應的緩衝記錄’以 便於後續的日切處理; S3 06,經過上述步驟,一條緩衝記錄已處理完畢’可 以釋放賣方帳戶的資源鎖;然後,返回S3 02循環處理提 取出的下一條記錄;當提取出的所有緩衝記錄都處理完後 ,再返回S301提取新的緩衝記錄進行還原操作。 上述說明可參見圖4.1和4.2的示意圖,其中,圖4.2 是定時提取緩衝記錄的示意圖。圖4.1和4.2中,帳務系 統是由第三方支付平台實現,帳務系統中設有用戶虛擬帳 戶,包括買方虛擬帳戶和賣方虛擬帳戶。買方先將交易資 金從銀行帳戶轉入買方虛擬帳戶,在交易過程中再由買方 虛擬帳戶轉到賣方虛擬帳戶中,此時交易資金控制在第三 方支付平台(如帳務系統),賣方無法提現。當買方確認 收貨之後,交易資金再由賣方虛擬帳戶轉入賣方銀行帳戶 。本發明即是處理帳務系統中由多個虛擬帳戶同時向一個 虛擬帳戶發送請求的倂發情況。 圖4.1和4.2中,交易系統是買賣雙方通過網路進行 交易的平台,主要用於完成交易,並記錄交易相關資訊。 交易過程中,交易資金的轉帳操作由帳務系統完成。每當 有一筆交易,交易系統會向帳務系統發請求,帳務系統完 成交易資金的處理後向交易系統返回處理結果,以便交易 -12- 201030658 系統繼續完成交易過程。在實際 帳務系統共同作爲第三方支付平 易系統也可以與第三方支付平台 圖4.2是定時提取緩衝記錄 過定時系統的控制,定時地從緩 處理。其中,定時系統用於完成 以根據應用需要自行設置。 φ 綜上所述,本發明由於將帳 新,對於高倂發用戶,雖然是一 用戶的業務影響非常小,能夠滿 ,帳務資金在較短的時間範圍內 可以根據帳戶的倂發量設置。而 解了資源的長時間鎖定現象。因 機制具有明顯的優勢。 對於帳務系統,每天要進行 φ 傳統的日切操作不同,本發明由 導致在日切時還存在目標日未處 在日切操作前加一個處理,即檢 料,如果存在,要先對這些資料 切;否則’該日切任務停止,待 針對上述緩衝記帳方法,本 帳的裝置實施例。參照圖5,是 。所述裝置主要包括緩衝儲存單 U502。 應用中,交易系統可以和 台:但在某些應用中,交 (如帳務系統)分離。 的示意圖,即帳務系統通 衝區域提取緩衝記錄進行 定時時間間隔的控制,可 務明細與帳戶餘額同步更 個延遲入帳的處理,但對 足用戶的對帳需求;而且 即可査詢並可用,該時間 從系統角度,較大程度緩 此,本發明比現有的緩衝 一次日切操作。本發明與 於緩衝記帳的處理,可能 理的緩衝資料。因此,要 査目標曰是否存在緩衝資 進行還原,才可以繼續日 恢復後繼續。 發明還提供了一種緩衝記 實施例一所述裝置結構圖 元U501和記帳處理單元 -13- 201030658 緩衝儲存單元U5 01用於對高倂發帳戶,記錄每一個 請求事件,並產生緩衝記錄。緩衝儲存單元U501可以是 資料庫,伺服器或硬碟、記億體等實體儲存裝置。 記帳處理單元U502用於從緩衝儲存單元U501提取 緩衝記錄,並對應高倂發帳戶進行記帳處理,所述記帳處 理包括記錄記帳資訊和更新帳戶的操作。記帳處理單元 U5 02可以通過定時或循環提取的方式,從緩衝儲存單元 U501獲取緩衝記錄。 較佳的,如果是定時提取,則所述裝置還包括定時單 元U5 03,用於設定預置時間,定時觸發記帳處理單元 U502從緩衝儲存單元U501中提取緩衝記錄;該時間可以 根據帳戶的倂發量設置。 在記帳處理過程中,記帳處理單元U502對緩衝記錄 逐條進行處理,在處理每一條緩衝記錄時,都對相應的高 倂發帳戶進行鎖操作,並在處理完之後釋放該鎖。較佳的 ,記帳處理單元U502在處理完緩衝記錄後,還從緩衝儲 存單元中刪除該緩衝記錄,以便於後續的日切處理。 較佳的,所述裝置還包括對帳驗證單元U504,用於 每曰對前一個會計日的記帳資訊進行對帳驗證,如果緩衝 儲存單元U501中存在前一個會計日的緩衝記錄,則等待 記帳處理單元U5 02對該緩衝記錄進行記帳處理後,再進 行對帳驗證。 下面通過實施例二具體說明上述裝置在電子交易中的 應用。參照圖6,是實施例二提供的一種緩衝記帳系統結 -14- 201030658 構圖。所述系統主要包括交易系統U601、帳務5 和緩衝儲存區域U603,以及買方用戶終端、賣 端。 其中,所述交易系統U601用於處理買方用 賣方用戶終端之間的網路交易,並記錄相關的交 所述帳務系統U602用於處理交易過程中的帳務 要包括的操作有記錄記帳憑證和更新帳戶餘額。 φ 發請求,帳務系統U602進行緩衝處理,將請求 衝儲存區域U603,然後再從緩衝儲存區域U603 記錄進行逐條處理。 本實施例中,帳務系統U602由第三方支付 ;或者,交易系統U601和帳務系統U602都由 付平台實現,具體實現方式比較靈活。帳務系統 爲買方用戶終端和賣方用戶終端分別設置了虛擬 方和賣方之間的交易轉帳通過所述第三方虛擬帳. φ 所述緩衝記帳系統的處理如下: 買方用戶終端和賣方用戶終端通過交易系統 交易流程,當買方付款給賣方時,交易系統向帳 送帳務請求,帳務系統針對該請求,需要將買方 中的交易資金轉入賣方虛擬帳戶中。 對於多個帳戶同時向一個帳戶付款的倂發處 系統首先對買方虛擬帳戶進行鎖操作,然後對該 記帳憑證,並更新該帳戶的餘額;然後,帳務系 虛擬帳戶進行緩衝記帳處理,即將該請求事件記 ;統 U602 方用戶終 戶終端和 易資訊。 請求,主 對於高倂 記錄到緩 提取緩衝 平台實現 第三方支 U602 中 帳戶,買 3實現。 實現整個 務系統發 虛擬帳戶 理,帳務 帳戶記錄 統對賣方 錄到緩衝 -15- 201030658 儲存區域,完成後釋放買方虛擬帳戶的鎖資源。 針對緩衝儲存區域中的緩衝記錄,帳務系統通過定時 或循環提取的方式,逐條進行記帳處理。帳務系統首先提 取出緩衝記錄,然後對賣方虛擬帳戶進行鎖操作,記錄記 帳憑證並更新該帳戶的餘額,然後從緩衝儲存區域中刪除 本條記錄’最後釋放賣方虛擬帳戶的鎖資源,從而完成一 條緩衝記錄的處理。帳務系統最後把每條記錄的處理結果 返回給交易系統,交易系統繼續完成交易流程。 緩衝記帳系統通過以上處理,能夠緩解資源的長時間 鎖定現象,提高倂發處理的效率,並實現帳務明細與帳戶 餘額同步更新,滿足買賣雙方的對帳需求。 圖5所示裝置、圖6所示系統中未詳述的部分可以參 見圖2-圖4所示方法的相關部分,爲了篇幅考慮,在此不 再詳述。 以上對本發明所提供的一種緩衝記帳方法及裝置,進 行了詳細介紹,本文中應用了具體個例對本發明的原理及 實施方式進行了闡述,以上實施例的說明只是用於幫助理 解本發明的方法及其核心思想;同時,對於本領域的一般 技術人員,依據本發明的思想,在具體實施方式及應用範 圍上均會有改變之處。綜上所述,本說明書內容不應理解 爲對本發明的限制。 【圖式簡單說明】 圖1是現有技術中標準的記帳處理流程示意圖; 201030658 圖2是本發明實施例提供的一種緩衝記帳方法流程圖 » 圖3是圖2實施例中緩衝記錄的還原流程圖; 圖4.1是本發明實施例所述緩衝記帳的示意圖,圖 4.2是緩衝記錄還原的示意圖; 圖5是本發明實施例一提供的一種緩衝記帳裝置結構 圖, 圖6是本發明實施例二提供的一種緩衝記帳系統結構 圖。 【主要元件符號說明】 U501 :緩衝儲存單元 U502 :記帳處理單元 U503 :定時單元 U504 :對帳驗證單元 U601 :交易系統 U602 :帳務系統 U603 :緩衝儲存區域 -17-201030658 VI. Description of the Invention: [Technical Field] The present invention relates to data processing technology, and in particular to a buffer accounting method and apparatus. [Prior Art] In the accounting process, funds are paid from one account and transferred to the other account. For both accounts, there is a billing process. The billing process consists of two main parts, one is to record the billing document, and the other is to update the account balance. Referring to Figure 1, it is a standard billing process flow chart. Taking the billing process in the transaction process as an example, the request event for a note-taking account: First, the transaction-related account (including the corresponding account of the buyer and the account corresponding to the seller) is locked to ensure that it is not affected by other requests. The accuracy of the data; secondly, the billing operation of the execution expense account, including recording the billing certificate and updating the balance, and then performing the billing operation of the billing account, including recording the billing document and updating the balance; after the billing request event is processed, Unlock the release of resources. Usually, each account needs to lock the related account, so that other operations can prevent the data from being inconsistent when the other operations are operated again. Therefore, the lock implements the burst method. As the volume of business continues to increase, some accounts will generate multiple burst operations in an instant, but only one thread of all burst threads can hold the resource lock at that time. Other threads must wait for the lock to be released and then proceed one by one. Billing processing. In this case, the other -5-201030658 threads are waiting, which seriously affects the performance of the accounting system. For example, at the same time, 100,000 lottery people pay for the lottery account. At this time, there are about 1000 requests for the lottery account, and waiting for the lock permission to be operated one by one will seriously affect the processing of other services of the system. Currently, one solution is to use a buffering mechanism. The buffering mechanism only records the accounting flow for the accounting operation of the accounting account, that is, temporarily records the accounting vouchers, and delays the operation of updating the account balance, that is, the related accounting request of the account is processed for transition, and no real accounting is performed. operating. This kind of transition processing does not need to lock resources for the account, thus solving the high burst demand of a single resource, so as to ensure that other related services can be performed normally. Regarding the update of the account balance, a daily summary (called cut-off), after an accounting day, the system will summarize the balance of the account according to the accounting record of the previous account of the account, that is, the balance of the account. It is every accounting update - times. Wherein, the accounting day is defined by a predetermined time point, such as 21:00 ‘21:00~20:59 (about) is an accounting 曰. This technique is equivalent to temporarily buffering high-concurrency requests, and then processing the requests in the buffer, that is, satisfying the requirements that do not affect the normal operation of other services, and smoothing the processing pressure of the system (higher peaks) The interval data is spread over a relatively long period of time to deal with it gently). However, the problem is that although the user can meet the demand for the account details in real time, the details are not related to the balance' because the balance can be reflected by the next accounting, so the balance rules of the user reconciliation cannot be satisfied. (ie the current -6- 201030658 balance = the accumulation of the account details): Moreover, the user's accounting funds will be visible and available for the next accounting day, for example, an account receives 10 transaction funds on the same day' The account number has to wait until the next day to actually receive the funds. [Invention] The technical problem to be solved by the present invention is to provide a buffer accounting method Φ and device 'to solve the existing buffer accounting mechanism that cannot meet the user's reconciliation demand, under An accountant can see the problem of receiving funds. In order to solve the above technical problem, the present invention discloses the following technical solution according to the specific embodiment provided by the present invention: A buffer accounting method includes: recording a request event for a high-issue account, and generating a buffer record; extracting a buffer record, and The billing process is performed corresponding to the high-issuance account, and the account processing includes an operation of recording billing information and updating the account. Wherein the extraction buffer record includes timing extraction and loop extraction. The billing record is processed one by one according to the high-issuance account, which specifically includes: locking the resource of the high-issuing account; recording the billing information; updating the account balance; and releasing the resource lock. The method also includes deleting the corresponding buffer record. The method further includes: performing daily reconciliation of the accounting information of the previous accounting day. If there is a buffer record of the previous accounting day, the buffered record is billed, and then the reconciliation verification is performed. 201030658 A buffer accounting device, comprising: a buffer storage unit for recording a high-issuance account, recording each request event, and generating a buffer record; a billing processing unit for extracting a buffer record, and performing billing processing corresponding to the high-issue account, the billing Processing includes the operation of recording billing information and updating the account. The device further includes: a reconciliation verification unit, configured to perform daily reconciliation of the accounting information of the previous accounting day, and if there is a buffer record of the previous accounting day in the buffer storage unit, wait for the accounting processing unit to buffer the buffer After the record is processed, the reconciliation verification is performed. Wherein the billing processing unit periodically or cyclically extracts the buffered record from the buffer storage unit. Wherein, if it is timing extraction, the apparatus further comprises: a timing unit 'for setting a preset time, and the timing trigger billing processing unit extracts the buffer record from the buffer storage unit. Wherein the billing processing unit performs billing processing on the buffer records one by one. Wherein the billing processing unit deletes the buffer record from the buffer storage unit after processing the buffer record. According to the specific embodiment provided by the present invention, the present invention has the following technical effects: Firstly, the present invention proposes a new buffer accounting method, which temporarily records each request event by using a storage area in the case where the participating account is a high-issue account. Then, in the later stage, the accounting information is updated and the operation of the account is updated -8- 201030658 to supplement the content of the original billing request. The difference from the prior art is that the present invention caches the request event, that is, does not separate the operation of recording the accounting information and the account of updating the account during the billing process, but performs the synchronization at a later stage; In a short period of time, it will not wait until the next accounting day to carry out the settlement process. This ensures that the account details are updated in sync with the account balance to meet the user's reconciliation needs. Moreover, the account funds can be queried and available in a short time frame, which can be set according to the amount of bursts in the account. Secondly, in the post-processing, the present invention provides two methods for extracting buffer records: one is timing extraction, that is, processing at a specified time point, and the method is applicable to an account with a large amount of traffic and having no high requirement for delay time; One is loop extraction, that is, processing one batch and then taking one batch. This method is suitable for accounts with large business volume and short delay time requirements. The present invention will be further described in detail with reference to the drawings and specific embodiments. The present invention proposes a new buffer accounting method for the high-sending billing request, which temporarily records each request event by using the storage area for the case where the participating account is a high-issuing account, and then records the accounting information and updates the account at a later stage. , thereby replenishing the content of the original billing request that is not completed. The invention is applicable to accounting processing in various fields, such as online shopping, car -9-201030658 ticket, purchase of concert tickets, and the like. Moreover, the present invention is particularly suitable for processing burst payment requests, i.e., when multiple accounts are simultaneously paying for an account. The details will be described below by way of specific examples. In the case of transaction processing, the buyer should pay the seller account by purchasing the goods from the seller. Among them, the seller account can be called the account account, and the buyer account can be called the expense account, that is, the payment amount is transferred from the expense account to the account. In this process, the interests of two types of roles are involved: one is the user holding the account (including the buyer and the seller), hereinafter referred to as the user; the other is the system providing the accounting service, hereinafter referred to as the system. From the user's point of view: 1) I want to see the billing information, that is, the account details, to confirm the progress of the transaction; 2) I want the account balance to be updated and available. From a system perspective: I want to deal with it in a high-speed situation, so as to smooth the processing pressure of the system and ensure that other related services can be carried out normally. In order to satisfy the requirements of the above-mentioned users and systems, the embodiment of the present invention provides a buffer accounting method, which is an example of a burst situation in which a plurality of accounts simultaneously pay to an account. Referring to FIG. 2, it is a flowchart of a buffer accounting method according to an embodiment, which is specifically as follows: S 201. In the case of a high burst, when a buyer pays to the seller, a payment request is initiated to the accounting system; S 2 02 'the accounting system targets For each payment request, the buyer account is first billed, including the following operations: 201030658 η locks the resources of the buyer account; 2) records the accounting vouchers, that is, records the accounting flow; '3) updates the account balance, that is, from the buyer The account deducts the payment amount; S203, the accounting system buffers the seller account and waits for post-processing; the buffering process records only the request event without substantive billing operations (including recording billing vouchers and updating account balances); The accounting system can record each request event in the form of a running account to a buffer area, generate a buffer record, and then enter the original accounting system for billing operations after a certain period of time. The buffer area may be a physical storage device such as a database, a server or a hard disk, or a memory. S204. After the above steps, a request event has been processed, and the resource lock of the buyer account can be released; S20 5. For the buffer record waiting for post-processing, the accounting system separately performs the restoration processing of the buffer record. Referring to Figure 3, there is a flow chart of the restoration of the buffer record. φ S301, extracting the buffer record from the buffer area; the embodiment provides two extraction methods: one is timing extraction, that is, the specified time point processing, and the method is applicable to an account with a large amount of traffic and no high requirement for delay time: The other is loop extraction, that is, processing a batch, and then taking the next batch. This method is suitable for accounts with large business volume and short delay time requirements. After the buffer record is extracted, each account is split according to the account. Allocating a processing thread to process in the background reduces processing time. S3 02, processing one by one, for each buffer record, first lock the resources of the -11 - 201030658 party account; S3 03, record the accounting vouchers, that is, record the accounting flow; S3 04, update the account balance, The payment amount is transferred to the seller account; S 3 0 5, preferably, the corresponding buffer record is deleted from the buffer area for subsequent subsequent cut processing; S3 06, after the above steps, a buffer record has been processed 'can release the seller The resource lock of the account; then, return to S3 02 to process the extracted next record; when all the extracted buffer records are processed, return to S301 to extract a new buffer record for the restore operation. The above description can be seen in the schematic diagrams of Figures 4.1 and 4.2, wherein Figure 4.2 is a schematic diagram of timing extraction buffer records. In Figures 4.1 and 4.2, the accounting system is implemented by a third-party payment platform with user virtual accounts, including buyer virtual accounts and seller virtual accounts. The buyer first transfers the transaction funds from the bank account to the buyer's virtual account, and then transfers the buyer's virtual account to the seller's virtual account during the transaction. At this time, the transaction funds are controlled by the third-party payment platform (such as the accounting system), and the seller cannot withdraw the cash. . After the buyer confirms the receipt, the transaction funds are transferred from the seller's virtual account to the seller's bank account. The present invention is a processing situation in which a request is sent from a plurality of virtual accounts to a virtual account simultaneously in a billing system. In Figures 4.1 and 4.2, the trading system is a platform for buyers and sellers to conduct transactions over the Internet, mainly for completing transactions and recording transaction-related information. During the transaction, the transfer of the trading funds is completed by the accounting system. Whenever there is a transaction, the trading system will send a request to the accounting system, and the accounting system will return the processing result to the trading system after the transaction funds are processed, so that the transaction can continue to complete the transaction process. In the actual accounting system, the third-party payment system can also be used as a third-party payment platform. Figure 4.2 is the timing extraction buffer record. The control of the over-time system is periodically delayed. Among them, the timing system is used to complete to set according to the needs of the application. φ In summary, the present invention is based on the account, and for the high-sending user, although the business impact of a user is very small, the account capital can be set in a shorter time range according to the burst amount of the account. It solves the long-term locking phenomenon of resources. Because the mechanism has obvious advantages. For the accounting system, the φ conventional day-cutting operation is performed every day. The present invention causes the target date to be added during the day-cutting process to be added before the day-cutting operation, that is, the inspection, if any, the first The data is cut; otherwise, the day-cut task is stopped, and the device embodiment of the account is to be applied to the above buffer accounting method. Referring to Figure 5, it is. The device primarily includes a buffer storage unit U502. In an application, the trading system can be combined with: but in some applications, the transaction (such as the accounting system) is separated. The schematic diagram, that is, the accounting system extracts the buffer record to control the time interval, and the transaction details are synchronized with the account balance to delay the processing of the account, but the reconciliation requirement for the user; and can be queried and available. This time, from a system perspective, to a lesser extent, the present invention is more than a conventional one-time cut operation. The present invention is related to the processing of buffered billing, which may be a buffered material. Therefore, it is necessary to check whether the target has buffer resources for restoration, and then continue to resume after the day. The invention also provides a buffering device. The device structure element U501 and the accounting processing unit -13-201030658 are used to buffer the account, record each request event, and generate a buffer record. The buffer storage unit U501 can be a physical storage device such as a database, a server or a hard disk, and a tablet. The billing processing unit U502 is for extracting the buffered record from the buffer storage unit U501, and performs billing processing corresponding to the high burst account, the billing processing including the operation of recording the billing information and updating the account. The billing processing unit U5 02 can acquire the buffered record from the buffer storage unit U501 by means of timing or loop extraction. Preferably, if it is timing extraction, the device further includes a timing unit U5 03 for setting a preset time, and the timing trigger billing processing unit U502 extracts the buffer record from the buffer storage unit U501; the time may be based on the account. The volume setting. In the billing process, the billing processing unit U502 processes the buffered records one by one, and when processing each of the buffered records, locks the corresponding high-issued accounts, and releases the locks after processing. Preferably, the billing processing unit U502 deletes the buffer record from the buffer storage unit after processing the buffer record to facilitate subsequent day-cut processing. Preferably, the device further includes a reconciliation verification unit U504, configured to perform reconciliation verification on the accounting information of the previous accounting day, and if there is a buffer record of the previous accounting day in the buffer storage unit U501, wait for the accounting The processing unit U5 02 performs billing processing on the buffer record, and then performs reconciliation verification. The application of the above device in electronic transaction will be specifically described below through the second embodiment. Referring to FIG. 6, it is a buffer accounting system junction-14-201030658 composition provided in the second embodiment. The system mainly includes a transaction system U601, a ledger 5 and a buffer storage area U603, and a buyer user terminal and a seller. The transaction system U601 is configured to process a network transaction between the buyer and the seller user terminal, and record the related transaction accounting system U602 for processing the transaction in the transaction process. And update your account balance. φ sends a request, and the accounting system U602 performs buffer processing, flushes the request to the storage area U603, and then records the processing one by one from the buffer storage area U603. In this embodiment, the accounting system U602 is paid by a third party; or the transaction system U601 and the accounting system U602 are implemented by the payment platform, and the specific implementation manner is relatively flexible. The accounting system sets a transaction transfer between the virtual party and the seller for the buyer user terminal and the seller user terminal respectively through the third party virtual account. φ The processing of the buffer accounting system is as follows: the buyer user terminal and the seller user terminal pass the transaction In the system transaction process, when the buyer pays the seller, the transaction system sends a billing request to the account, and the billing system needs to transfer the transaction funds in the buyer to the seller virtual account for the request. The issuing system that pays for one account simultaneously to one account first locks the buyer virtual account, then the accounting voucher, and updates the balance of the account; then, the accounting system virtual account performs buffer accounting processing, that is, Request event record; U602 side user terminal terminal and easy information. Request, the main for the high-level record to the slow extraction buffer platform to achieve the third-party U602 account, buy 3 to achieve. Realize the virtual account management of the whole system, the account account record is recorded to the seller in the buffer -15- 201030658 storage area, and the lock resource of the buyer virtual account is released after completion. For the buffer records in the buffer storage area, the accounting system performs billing processing one by one by means of timing or loop extraction. The accounting system first extracts the buffered record, then locks the seller's virtual account, records the accounting voucher and updates the balance of the account, and then deletes the record from the buffer storage area, and finally releases the lock resource of the seller's virtual account, thus completing a The processing of buffered records. The accounting system finally returns the processing result of each record to the trading system, and the trading system continues to complete the trading process. Through the above processing, the buffer accounting system can alleviate the long-term locking phenomenon of resources, improve the efficiency of burst processing, and realize the simultaneous update of account details and account balance to meet the reconciliation requirements of buyers and sellers. The apparatus shown in Fig. 5 and the parts not detailed in the system shown in Fig. 6 can be referred to the relevant parts of the method shown in Figs. 2 to 4, and will not be described in detail herein for the sake of space. The method and apparatus for buffering accounting provided by the present invention are described in detail. The principles and embodiments of the present invention are described in detail herein. The description of the above embodiments is only for helping to understand the method of the present invention. And its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific embodiments and application scope. In summary, the content of the specification should not be construed as limiting the invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic diagram of a standard billing processing flow in the prior art; 201030658 FIG. 2 is a flow chart of a buffer billing method according to an embodiment of the present invention. FIG. 3 is a flow chart of restoring a buffer record in the embodiment of FIG. Figure 4 is a schematic diagram of buffered accounting according to an embodiment of the present invention, and Figure 4.2 is a schematic diagram of buffered recording and restoration; Figure 5 is a structural diagram of a buffering and accounting apparatus according to Embodiment 1 of the present invention, and Figure 6 is a second embodiment of the present invention. A buffered billing system structure diagram. [Main component symbol description] U501 : Buffer storage unit U502 : Accounting processing unit U503 : Timing unit U504 : Reconciliation verification unit U601 : Trading system U602 : Accounting system U603 : Buffer storage area -17-