下面結合圖式,對本說明書提供的方案進行描述。
本說明書的一個實施例提供的交易量的預測方法可以應用於如圖1所示的預測系統中,圖1中,預測系統可以包括:爬蟲模組101、即時資料同步模組102、業務資料同步模組103、資料預處理模組104以及預測模組105。
爬蟲模組101用於高頻率地(如,每隔一分鐘)從網頁上爬取與交易相關的輿情資料。該輿情資料可以包括:商戶的即時活動資訊(如,促銷活動等)、匯率波動資訊以及極端天氣資訊(如,極寒天氣或者極熱天氣等)等。
需要說明的是,因為在商戶搞促銷活動的時候,通常會大大增加用戶的交易次數,從而會影響一天的交易量,所以本說明書在預測當天的總交易量時,將商戶的即時活動資訊作為交易量(也稱交易金額)的一個影響特徵。此外,由於匯率波動情況以及極端天氣均會影響一天的交易量,所以將該兩者也作為交易量的影響特徵。
通過爬蟲模組101,可以提前獲知商戶活動資訊。
即時資料同步模組102用於高頻率地(如,每隔一分鐘)獲取從當天開始時刻(如,零點)起所發生的每筆交易的交易資料。其中,一筆交易的交易資料可以包括:交易時間、交易金額、商戶資訊以及用戶資訊等等。
業務資料同步模組103用於同步資料庫中記錄的、可以對交易量產生影響的非交易資料(以下稱為影響資料)。上述影響資料可以包括:1)商戶的畫像資料:商戶的國別資訊、商戶的類型(如,實體商戶或者虛擬商戶等)、商戶的經營範圍以及商戶所在地的市場資訊(如,節假日資訊)等。2)交易筆數。3)用戶的畫像資料(如,學生、教師以及民工等)等。
需要說明的是,上述影響資料可以是人為預先收集的。
資料預處理模組104用於對上述輿情資料(爬蟲模組101獲取)、交易資料(即時資料同步模組102獲取)以及影響資料(業務資料同步模組103獲取)進行資料層融合。此處的資料層融合可以理解為將上述資料從低維度抽象化到高維度。如,將上述資料中商戶維度、用戶維度以及資金維度的資料轉化為交易量緯度表徵。資料預處理模組104還用於將融合後的資料進行資料格式轉化,如轉化為符合預測模型輸入參數標準的資料格式,該轉化過程可以包括資料歸一化等。
預測模組105,用於根據預處理後的資料,預測某一天的交易量。該預測模組105可以包括預測模型。該預測模型可以是根據經典時間序列預測演算法(或者機器學習演算法等)和歷史資料獲得的。其中,經典時間序列預測演算法是一種用於利用過去及現在的資料來預測未來發生變化趨勢的演算法。其例如可以為holt-winters演算法(一種資料平滑演算法)、自回歸積分滑動平均(Autoregressive Integrated Moving Average,ARIMA)演算法以及長短期記憶網路(Long Short-Term Memory,LSTM)演算法等。而歷史資料可以包括當天之前的交易資料(也稱歷史交易資料)、當天之前的交輿情資料(也稱歷史輿情資料)以及上述影響資料等。
需要說明的是,上述預測模型可以為單獨的一個模型,也可以包括多個子模型。當包括多個子模型時,可以結合輿情資料,來選擇相應的子模型。以輿情資料為商戶的即時活動資訊,預測模型包括兩個子模型:第一子模型和第二子模型為例來說。假設第一子模型可以是根據經典時間序列預測演算法(或者機器學習演算法等)和包含商戶的即時活動資訊的樣本獲得的;第二子模型可以是根據經典時間序列預測演算法(或者機器學習演算法等)和不包含商戶的即時活動資訊的樣本獲得的。那麼在預測某一天的交易量時,若當天有商戶活動,則可以通過第一子模型來預測當天的總交易量。若當天沒有商戶活動,則可以通過第二子模型來預測當天的總交易量。當然,在實際應用中,也可以同時通過兩個子模型來預測當天的總交易量。如,分別為兩個子模型設置不同的權重值,之後,根據各個子模型的輸出值以及對應的權重值,來預測當天的總交易量。
由此可以看出,上述預測系統在預測當天的總交易量時,綜合考慮了當天交易資料、與當天的交易相關的輿情資料以及預先估計的可能會對交易量產生影響的資料,從而可以提高預測的交易量的準確性。
可選地,圖1的預測系統還可以包括商家交易即時監控模組106,用於高頻率地對當天交易資料進行監控,以確定是否有對應的商戶活動。在一種實現方式中,上述監控過程可以為:高頻率地根據當天交易資料,統計如下資料:實際交易量、實際交易筆數以及實際交易客單價等。同理,根據歷史交易資料,統計如下資料:歷史同期交易量、歷史交易筆數以及歷史客單價等。然後可以分別將實際交易量與歷史同期交易量、實際交易筆數與歷史交易筆數、實際交易客單價與歷史客單價進行比對。當任意兩者差異較大(如,大於預設臨限值或者小於預設臨限值)時,發出對應的商戶活動警報資訊。如,在大於預設臨限值時,發出商戶活動驟升警報資訊。在小於預設臨限值時,發出商戶活動驟減警報資訊。
通過商家交易即時監控模組106,可以準確地識別出商戶活動資訊。從而可以使得預測系統在預測交易量時,綜合考慮商戶活動資訊,由此來進一步提高預測的交易量的準確性。
可選地,圖1的預測系統還可以包括異常檢測模組107。當還包括異常檢測模組107時,商家交易即時監控模組106識別出的商戶活動警報資訊可以輸入到異常檢測模組107中。
異常檢測模組107可以用於對當天的總交易量進行異常檢測,並用於在檢測到異常時,對當天的總交易量進行調節。在一種實現方式中,上述異常檢測以及調節過程可以為:根據歷史交易資料,統計如下資料:上周同期交易量、本周平均交易量以及昨日交易量等。然後分別將當天的總交易量與上周同期交易量、本周平均交易量以及昨日交易量進行一一比較。若當天的總交易量高於上述任一指定倍數(如,1.5倍),且沒有對應的商戶活動驟升警報資訊,則確定當天的總交易量存在異常。或者,若當天的總交易量低於上述任一指定倍數(如,0.5倍),且沒有對應的商戶活動驟減警報資訊,則確定當天的總交易量存在異常。在存在異常時,可以將存在異常的當天的總交易量乘以調節係數(可以根據上述指定倍數確定,如,1.5和0.5),從而保證預測的當天的總交易量在可靠範圍內,也即可以保障預測的當天的總交易量的穩健性。
可選地,圖1的預測系統還可以包括外部策略決策模組108,用於收集與交易相關的策略。以當天的總交易量用於確定外匯的需求量的場景為例來說,與交易相關的策略可以為外匯交易策略。該外匯交易策略可以為:本次購買的外匯只覆蓋60%倉位或者整體交易量低於真實交易量等等。
可選地,圖1的預測系統還可以包括輔助決策模組109。當還包括輔助決策模組109時,外部策略決策模組108收集的與交易相關的策略可以輸入到輔助決策模組109中。
輔助決策模組109,可以用於結合上述與交易相關的策略、當前交易趨勢、歷史交易趨勢以及業務關鍵績效指標(Key Performance Indicator,KPI)等資訊,對當天的總交易量進行調節。如前述例子,假設與交易相關的策略為:整體交易量低於真實交易量,則可以將當天的總交易量乘以懲罰函數,從而來保證得到最優的交易量。
需要說明的是,上述當前交易趨勢可以是根據從當天開始時刻(如,0點)起所發生的每筆交易的交易資料所確定的。上述歷史交易趨勢以及業務KPI可以是根據歷史交易資料所確定的。以根據當前交易趨勢對當天的總交易量進行調節為例來說,如果當前交易趨勢是上升趨勢,那麼當天的總交易量會按照預設比例放大,反之同理。上述預設比例可以根據目前交易量(根據當天過去時刻的交易資料確定)與日常交易量的比例確定。
當然,在實際應用中,上述預測系統還可以包括其它模組,如,輸出模組和展示模組,本說明書對此不作限定。
圖2為本說明書的一個實施例提供的交易量的預測方法流程圖。如圖2所示,所述方法具體可以包括:
步驟210,獲取當天過去時刻的第一交易資料以及與當天的交易相關的第一輿情資料。
此處,當天過去時刻的第一交易資料可以是指從當天開始時刻至目前時刻所產生的每筆交易的交易資料,其也可以稱為當天交易資料。假設一天的開始時刻為零點,而目前時刻為上午11點,則當天過去時刻的第一交易資料是指當天00:00-11:00之間所產生的每筆交易的交易資料。該交易資料可以包括:交易時間、交易金額、商戶資訊以及用戶資訊等等。具體地,可以是由即時資料同步模組102來獲取當天交易資料。
此外,上述與當天的交易相關的第一輿情資料(也稱當天輿情資料)可以包括:商戶即時活動資訊、匯率波動資訊以及極端天氣等,其可以是通過爬蟲模組101從網頁上獲取的。需要說明的是,由於商家通常會提前通知活動資訊,所以上述商戶即時活動資訊可以是根據當天之前的第二輿情資料(也稱歷史輿情資料)獲得的。總之,本說明書的實施例可以提前獲知商戶活動資訊。
步驟220,對第一交易資料、第一輿情資料以及預設的影響資料進行預處理,得到預處理後的資料。
此處的預設的影響資料可以是指上述記錄在數倉表的、預先估計的可能會對交易量產生影響的非交易資料,即由業務資料同步模組103獲取。上述預處理可以包括資料融合以及資料格式轉化等。
具體地,可以是由資料預處理模型104對第一交易資料、第一輿情資料以及預設的影響資料進行資料層融合。此處的資料層融合可以理解為將上述資料從低維度抽象化到高維度。如,將上述資料中商戶維度、用戶維度以及資金維度的資料轉化為交易量緯度表徵。之後,將融合後的資料進行資料格式轉化,如轉化為符合預測模型輸入參數標準的資料格式,該轉化過程可以包括資料歸一化等。
步驟230,將預處理後的資料輸入預測模型,以預測當天的總交易量。
此處的預測模型可以包含在預測模組105中,也即由預測模組105預測當天的總交易量。預測模型可以是根據當天之前的第二交易資料(歷史交易資料)、歷史輿情資料以及上述預設的影響資料獲得的,其可以用於根據歷史資料來預測未來發展變化趨勢。
具體地,可以將預先收集的歷史交易資料、歷史輿情資料以及上述預設的影響資料作為訓練樣本來訓練經典時間序列預測演算法或者機器學習演算法等。可以理解的是,在將經典時間序列預測演算法或者機器學習演算法訓練好之後,就可以得到上述預測模型。需要說明的是,訓練好的預測模型可以為單獨的一個模型,也可以包括多個子模型。
當為單獨的一個模型時,將預處理後的資料輸入該一個模型,就可以得到當天的總交易量。當包括多個子模型時,可以結合第一輿情資料,來選擇相應的子模型。之後將預處理後的資料輸入選擇的子模型,得到當天的總交易量。或者,將預處理後的資料分別輸入到多個子模型中,得到多個預測交易量。將多個預測交易量進行融合,得到當天的總交易量。
以第一輿情資料為商戶的即時活動資訊,預測模型包括兩個子模型:第一子模型和第二子模型為例來說。假設第一子模型可以是根據經典時間序列預測演算法(或者機器學習演算法等)和包含商戶的即時活動資訊的樣本獲得的;第二子模型可以是根據經典時間序列預測演算法(或者機器學習演算法等)和不包含商戶的即時活動資訊的樣本獲得的。那麼在預測某一天的交易量時,若當天有商戶活動,則可以通過第一子模型來預測當天的總交易量。若當天沒有商戶活動,則可以通過第二子模型來預測當天的總交易量。當然,在實際應用中,也可以同時通過兩個子模型來預測當天的總交易量。如,分別為兩個子模型設置不同的權重值,之後,根據各個子模型的輸出值以及對應的權重值,來預測當天的總交易量。
由此可以看出,本說明書的實施例在預測當天的總交易量時,綜合考慮了當天交易資料、與當天的交易相關的輿情資料以及預先估計的可能會對交易量產生影響的資料,從而可以提高預測的交易量的準確性。
可選地,在執行上述步驟210-步驟230的過程中,還可以同時執行如下過程:商家交易即時監控模組106高頻率地對當天交易資料進行監控,以確定是否有對應的商戶活動。在一種實現方式中,上述監控過程可以為:高頻率地根據當天交易資料,統計如下資料:實際交易量、實際交易筆數以及實際交易客單價等。同理,根據歷史交易資料,統計如下資料:歷史同期交易量、歷史交易筆數以及歷史客單價等。然後可以分別將實際交易量與歷史同期交易量、實際交易筆數與歷史交易筆數、實際交易客單價與歷史客單價進行比對。當任意兩者差異較大(如,大於預設臨限值或者小於預設臨限值)時,發出對應的商戶活動警報資訊。如,在大於預設臨限值時,發出商戶活動驟升警報資訊。在小於預設臨限值時,發出商戶活動驟減警報資訊。
通過對當天交易資料進行監控,可以準確地識別出商戶活動資訊。從而可以在預測交易量時,綜合考慮商戶活動資訊,由此來進一步提高預測的交易量的準確性。
在得到當天的交易量之後,商家交易即時監控模組106可以將識別出的商戶活動警報資訊輸入到異常檢測模組107中。從而由異常檢測模組107結合上述商戶活動警報資訊,來對當天的總交易量進行異常檢測,並在檢測到異常時,對當天的總交易量進行調節。在一種實現方式中,上述異常檢測以及調節過程可以為:根據歷史交易資料,統計如下資料:上周同期交易量、本周平均交易量以及昨日交易量等。然後分別將當天的總交易量與上周同期交易量、本周平均交易量以及昨日交易量進行一一比較。若當天的總交易量高於上述任一指定倍數(如,1.5倍),且沒有對應的商戶活動驟升警報資訊,則確定當天的總交易量存在異常。或者,若當天的總交易量低於上述任一指定倍數(如,0.5倍),且沒有對應的商戶活動驟減警報資訊,則確定當天的總交易量存在異常。在存在異常時,可以將存在異常的當天的總交易量乘以調節係數(可以根據上述指定倍數確定,如,1.5和0.5),從而保證預測的當天的總交易量在可靠範圍內。
當然,在實際應用中,也可以通過其它方式來對當天的總交易量進行異常檢測,如,可以通過箱線法來進行異常檢測,本說明書對此不作限定。
在另一種實現方式中,還可以由外部策略決策模組108收集與交易相關的策略。以當天的總交易量用於確定外匯的需求量的場景為例來說,與交易相關的策略可以為外匯交易策略。該外匯交易策略可以為:本次購買的外匯只覆蓋60%倉位或者整體交易量低於真實交易量等等。
之後,外部策略決策模組108可以將收集的與交易相關的策略輸入到輔助決策模組109中。輔助決策模組109可以結合與交易相關的策略,對當天的總交易量進行調節。如前述例子,假設與交易相關的策略為:整體交易量低於真實交易量,則可以將當天的總交易量乘以懲罰函數。從而來保證得到最優的交易量。
在再一種實現方式中,輔助決策模組109還可以結合前交易趨勢、歷史交易趨勢以及業務關鍵績效指標(Key Performance Indicator,KPI)等資訊,對當天的總交易量進行調節。當前交易趨勢可以是根據當天交易資料所確定的。上述歷史交易趨勢以及業務KPI可以是根據歷史交易資料所確定的。以根據當前交易趨勢對當天的總交易量進行調節為例來說,如果當前交易趨勢是上升趨勢,那麼當天的總交易量會按照預設比例放大,反之同理。上述預設比例可以根據目前交易量(根據當天過去時刻的交易資料確定)與日常交易量的比例確定。
需要說明的是,由於線上海外購,線下當面付業務的迅猛發展,支付寶支撐商戶,買家之間不同貨幣的支付與收款。支付寶每個工作日都購買相應的外匯以應對業務需求,因此,在預測的交易量的準確性提高的情況下,可以減少業務風險以及提高資金利用率。
綜上,本說明書的上述實施例可以實現在有商戶活動干擾的情況下,準確地對當天的總交易量進行預測。
與上述交易量的預測方法對應地,本說明書的一個實施例還提供的一種交易量的預測裝置,如圖3所示,該裝置包括:
獲取單元301,用於獲取當天過去時刻的第一交易資料以及與當天的交易相關的第一輿情資料。
預處理單元302,用於對獲取單元301獲取的第一交易資料、第一輿情資料以及預設的影響資料進行預處理,得到預處理後的資料。預設的影響資料是指預先估計的會對交易量產生影響的資料。
預測單元303,用於將預處理單元302預處理後的資料輸入預測模型,以預測當天的總交易量。預測模型是根據經典時間序列預測演算法或者機器學習演算法、當天之前的第二交易資料、第二輿情資料以及預設的影響資料獲得的。預測模型用於根據歷史資料來預測未來發展變化趨勢。
預測單元303具體可以用於:
根據預處理後的第一輿情資料,選擇對應的子模型。
將預處理後的資料輸入選擇的子模型,得到當天的總交易量。
或者,將預處理後的資料分別輸入到多個子模型中,得到多個預測交易量。
將多個預測交易量進行融合,得到當天的總交易量。
需要說明的是,上述獲取單元301可以由圖1中的爬蟲模組101和即時資料同步模組102來實現。預處理單元302可以由圖1中的資料預處理模組104來實現,預測單元303可以由圖1中的預測模組105來實現。
可選地,該裝置還可以包括:比較單元304和發送單元305。
獲取單元301,還用於週期性根據第二交易資料,獲取第一交易資料的歷史同期交易資料。
比較單元304,用於將第一交易資料與獲取單元301獲取的歷史同期交易資料進行比較。
發送單元305,用於當比較單元304比較第一交易資料與歷史同期交易資料的差異較大時,發出相應的商戶活動警報資訊。
需要說明的是,上述比較單元304和發送單元305可以由圖1中的商家交易即時監控模組106來實現。
可選地,該裝置還可以包括:
檢測單元306,用於對當天的總交易量進行異常檢測。
調節單元307,用於當檢測單元306檢測到當天的總交易量存在異常時,對當天的總交易量進行調節。
可選地,檢測單元306具體可以用於:
根據第二交易資料,統計當天的總交易量的歷史同期交易量。
將歷史同期交易量與當天的總交易量進行比較。
當歷史同期交易量與當天的總交易量的相差倍數大於臨限值且沒有相應的商戶活動警報資訊時,確定當天的總交易量存在異常。
調節單元307具體可以用於:
根據相差倍數,確定相應的調節係數。
根據調節係數,調節當天的總交易量。
可選地,該裝置還可以包括:
需要說明的是,上述檢測單元306和調節單元307可以由異常檢測模組107來實現。
確定單元308,用於根據第一交易資料,確定當前交易趨勢。
調節單元307,用於根據確定單元308確定的當前交易趨勢,調節當天的總交易量。
和/或,
確定單元308,用於根據第二交易資料,確定歷史交易趨勢。
調節單元307,用於根據確定單元308確定的歷史交易趨勢,調節當天的總交易量。
和/或,
獲取單元301,還用於獲取外部交易策略.
調節單元307,用於根據獲取單元301獲取的外部交易策略,調節當天的總交易量。
需要說明的是,上述確定單元308可以由圖1中的輔助決策模組109來實現。
本說明書的上述實施例裝置的各功能模組的功能,可以通過上述方法實施例的各步驟來實現,因此,本說明書的一個實施例提供的裝置的具體工作過程,在此不復贅述。
本說明書的一個實施例提供的交易量的預測裝置,獲取單元301獲取當天過去時刻的第一交易資料以及與當天的交易相關的第一輿情資料。預處理單元302對第一交易資料、第一輿情資料以及預設的影響資料進行預處理,得到預處理後的資料。預測單元303將預處理後的資料輸入預測模型,以預測當天的總交易量。由此,可以預測的交易量的準確性。
本領域技術人員應該可以意識到,在上述一個或多個示例中,本說明書所描述的功能可以用硬體、軟體、韌體或它們的任意組合來實現。當使用軟體實現時,可以將這些功能儲存在電腦可讀媒體中或者作為電腦可讀媒體上的一個或多個指令或程式碼進行傳輸。
以上所述的具體實施方式,對本說明書的目的、技術方案和有益效果進行了進一步詳細說明,所應理解的是,以上所述僅為本說明書的具體實施方式而已,並不用於限定本說明書的保護範圍,凡在本說明書的技術方案的基礎之上,所做的任何修改、等同替換、改進等,均應包括在本說明書的保護範圍之內。The scheme provided in this specification will be described below in conjunction with the drawings.
The transaction volume prediction method provided by an embodiment of the present specification can be applied to the prediction system shown in FIG. 1. In FIG. 1, the prediction system can include: a crawler module 101, a real-time data synchronization module 102, and business data synchronization Module 103, data preprocessing module 104, and prediction module 105.
The crawler module 101 is used to crawl public opinion data related to transactions from web pages with high frequency (for example, every one minute). The public opinion data may include: real-time activity information of merchants (eg, promotional activities, etc.), exchange rate fluctuation information, and extreme weather information (eg, extremely cold weather or extremely hot weather, etc.).
It should be noted that because when merchants engage in promotional activities, they usually greatly increase the number of user transactions, which will affect the transaction volume of the day. Therefore, in this manual, when predicting the total transaction volume of the day, the merchant’s real-time activity information is used as An influential feature of transaction volume (also called transaction amount). In addition, since exchange rate fluctuations and extreme weather will affect the trading volume of a day, these two are also used as the characteristics of the trading volume.
Through the crawler module 101, merchant activity information can be obtained in advance.
The real-time data synchronization module 102 is used to acquire transaction data of each transaction that occurs from the start time of the day (for example, zero point) at a high frequency (for example, every minute). Among them, the transaction data of a transaction can include: transaction time, transaction amount, merchant information, user information and so on.
The business data synchronization module 103 is used to synchronize the non-transaction data (hereinafter referred to as impact data) recorded in the database and that can affect the transaction volume. The above-mentioned impact data may include: 1) Merchant profile data: merchant's country information, merchant type (eg, physical merchant or virtual merchant, etc.), merchant's business scope, and merchant's market information (eg, holiday information), etc. . 2) The number of transactions. 3) User's portrait data (for example, students, teachers, migrant workers, etc.), etc.
It should be noted that the above-mentioned impact data may be collected in advance artificially.
The data preprocessing module 104 is used for data layer fusion of the above public opinion data (acquired by the crawler module 101), transaction data (obtained by the real-time data synchronization module 102), and impact data (obtained by the business data synchronization module 103). The data layer fusion here can be understood as abstracting the above data from a low dimension to a high dimension. For example, the data of merchant dimension, user dimension and fund dimension in the above data are converted into latitude characterization of transaction volume. The data preprocessing module 104 is also used to convert the fused data into a data format. For example, if it is converted into a data format that meets the input parameter standard of the prediction model, the conversion process may include data normalization.
The prediction module 105 is used to predict the transaction volume of a certain day based on the preprocessed data. The prediction module 105 may include a prediction model. The prediction model can be obtained based on classical time series prediction algorithms (or machine learning algorithms, etc.) and historical data. Among them, the classic time series forecasting algorithm is an algorithm for using the past and present data to predict future trends. For example, it can be a Holt-winters algorithm (a data smoothing algorithm), an Autoregressive Integrated Moving Average (ARIMA) algorithm, and a Long Short-Term Memory (LSTM) algorithm, etc. . The historical data may include transaction data before the day (also known as historical transaction data), public opinion data before the day (also known as historical public opinion data), and the above-mentioned impact data.
It should be noted that the above prediction model may be a single model, or may include multiple sub-models. When multiple sub-models are included, the public opinion data can be combined to select the corresponding sub-model. Taking public opinion data as the real-time activity information of merchants, the prediction model includes two sub-models: the first sub-model and the second sub-model as an example. It is assumed that the first sub-model can be obtained according to the classic time series prediction algorithm (or machine learning algorithm, etc.) and samples containing real-time activity information of the merchant; the second sub-model can be based on the classic time series prediction algorithm (or machine Learning algorithms, etc.) and samples that do not contain real-time activity information of merchants. Then when predicting the trading volume of a certain day, if there are merchant activities on that day, you can use the first sub-model to predict the total trading volume of that day. If there is no merchant activity on the day, the second sub-model can be used to predict the total transaction volume on the day. Of course, in practical applications, two sub-models can also be used to predict the total transaction volume of the day. For example, different weight values are set for the two sub-models respectively, and then, based on the output value of each sub-model and the corresponding weight value, the total transaction volume of the day is predicted.
It can be seen that when the above forecast system predicts the total transaction volume of the day, it comprehensively considers the transaction data of the day, the public opinion data related to the transaction of the day, and the pre-estimated data that may affect the transaction volume, which can improve The accuracy of the predicted transaction volume.
Optionally, the prediction system of FIG. 1 may further include a merchant transaction real-time monitoring module 106 for monitoring the transaction data of the day at a high frequency to determine whether there is a corresponding merchant activity. In an implementation manner, the above monitoring process may be: based on the transaction data of the day at high frequency, the following data is counted: actual transaction volume, actual transaction number, and actual transaction customer unit price, etc. Similarly, according to historical transaction data, statistics are as follows: historical transaction volume, historical transaction number, and historical customer unit price. Then you can compare the actual transaction volume with the historical period transaction volume, the actual transaction number and the historical transaction number, the actual transaction customer unit price and the historical customer unit price. When there is a big difference between any two (eg, greater than the preset threshold or less than the preset threshold), the corresponding merchant activity alert information is issued. For example, when it is greater than the preset threshold, the merchant activity swell warning information is issued. When it is less than the preset threshold, it will issue a sudden decrease in merchant activity information.
The merchant transaction real-time monitoring module 106 can accurately identify merchant activity information. Therefore, the forecasting system can comprehensively consider the merchant activity information when forecasting the transaction volume, thereby further improving the accuracy of the predicted transaction volume.
Optionally, the prediction system of FIG. 1 may further include an anomaly detection module 107. When the anomaly detection module 107 is also included, the merchant activity alarm information identified by the merchant transaction real-time monitoring module 106 can be input into the anomaly detection module 107.
The anomaly detection module 107 may be used to perform anomaly detection on the total transaction volume of the day, and to adjust the total transaction volume of the day when an abnormality is detected. In an implementation manner, the above-mentioned abnormality detection and adjustment process may be: according to historical transaction data, statistics are as follows: the transaction volume of the same period last week, the average transaction volume of this week, and the transaction volume of yesterday. Then compare the total trading volume of the day with the trading volume of the same period last week, the average trading volume of this week and the trading volume of yesterday. If the total transaction volume on the day is higher than any of the above specified multiples (eg, 1.5 times), and there is no corresponding alarm information for the sudden rise of the merchant activity, it is determined that the total transaction volume on the day is abnormal. Or, if the total transaction volume of the day is lower than any of the specified multiples (for example, 0.5 times), and there is no corresponding business activity sudden decrease alert information, it is determined that the total transaction volume of the day is abnormal. When there is an anomaly, you can multiply the total trading volume on the day of the abnormality by the adjustment factor (which can be determined according to the specified multiples above, such as 1.5 and 0.5), so as to ensure that the predicted total trading volume on the day is within a reliable range, that is, It can guarantee the robustness of the predicted total transaction volume of the day.
Optionally, the prediction system of FIG. 1 may further include an external strategy decision module 108 for collecting strategies related to the transaction. Taking the scenario where the total trading volume of the day is used to determine the demand for foreign exchange as an example, the strategy related to trading can be a foreign exchange trading strategy. The foreign exchange trading strategy can be: the foreign exchange purchased only covers 60% of the positions or the overall trading volume is lower than the real trading volume, etc.
Optionally, the prediction system of FIG. 1 may further include an auxiliary decision module 109. When the auxiliary decision-making module 109 is also included, the strategy related to the transaction collected by the external strategic decision-making module 108 can be input into the auxiliary decision-making module 109.
The auxiliary decision-making module 109 can be used to adjust the total transaction volume of the day by combining the above-mentioned transaction-related strategies, current transaction trends, historical transaction trends, and business key performance indicators (Key Performance Indicator, KPI). As in the previous example, assuming that the strategy related to the transaction is: the overall transaction volume is lower than the real transaction volume, the total transaction volume of the day can be multiplied by the penalty function to ensure that the optimal transaction volume is obtained.
It should be noted that the above current transaction trend may be determined based on transaction data of each transaction that has occurred since the start time of the day (for example, 0 o'clock). The above historical transaction trends and business KPIs can be determined based on historical transaction data. Taking the adjustment of the total trading volume of the day according to the current trading trend as an example, if the current trading trend is an upward trend, then the total trading volume of the day will be enlarged according to a preset ratio, and vice versa. The above-mentioned preset ratio can be determined according to the ratio of the current transaction volume (determined according to the transaction data of the past moment of the day) and the daily transaction volume.
Of course, in practical applications, the above prediction system may also include other modules, such as output modules and display modules, which are not limited in this specification.
FIG. 2 is a flowchart of a transaction volume prediction method provided by an embodiment of the present specification. As shown in FIG. 2, the method may specifically include:
Step 210: Obtain the first transaction data of the past moment of the day and the first public opinion data related to the transaction of the day.
Here, the first transaction data of the past time of the day may refer to the transaction data of each transaction generated from the start time of the day to the current time, and it may also be referred to as the transaction data of the day. Assuming that the start time of the day is zero and the current time is 11 am, the first transaction data of the past time of the day refers to the transaction data of each transaction generated between 00:00 and 11:00 of the day. The transaction data may include: transaction time, transaction amount, merchant information, user information, etc. Specifically, the real-time data synchronization module 102 may obtain the transaction data of the day.
In addition, the above-mentioned first public opinion data related to the transaction of the day (also known as the public opinion data of the day) may include: real-time activity information of the merchant, exchange rate fluctuation information, and extreme weather, etc., which may be obtained from the webpage through the crawler module 101. It should be noted that since the merchant usually informs the event information in advance, the above-mentioned merchant's real-time event information may be obtained based on the second public opinion data (also known as historical public opinion data) before the day. In short, the embodiments of this specification can be informed of merchant activity information in advance.
Step 220: Preprocess the first transaction data, the first public opinion data, and the preset influence data to obtain preprocessed data.
The preset impact data here may refer to the non-transaction data recorded in the data warehouse table and estimated in advance that may have an impact on the transaction volume, that is, obtained by the business data synchronization module 103. The above preprocessing may include data fusion and data format conversion.
Specifically, the data pre-processing model 104 may perform data layer fusion on the first transaction data, the first public opinion data, and the preset influence data. The data layer fusion here can be understood as abstracting the above data from a low dimension to a high dimension. For example, the data of merchant dimension, user dimension and fund dimension in the above data are converted into latitude characterization of transaction volume. Afterwards, the fused data is converted into a data format, for example, into a data format that conforms to the input parameter standard of the prediction model, the conversion process may include data normalization and the like.
Step 230: Input the pre-processed data into the prediction model to predict the total transaction volume of the day.
The prediction model here may be included in the prediction module 105, that is, the prediction module 105 predicts the total transaction volume of the day. The prediction model can be obtained based on the second transaction data (historical transaction data) before the day, historical public opinion data, and the above-mentioned preset impact data, which can be used to predict future development and change trends based on historical data.
Specifically, the historical transaction data, historical public opinion data collected in advance, and the aforementioned preset impact data can be used as training samples to train a classic time series prediction algorithm or a machine learning algorithm. It is understandable that the above prediction model can be obtained after training the classic time series prediction algorithm or machine learning algorithm. It should be noted that the trained prediction model may be a single model, or may include multiple sub-models.
When it is a single model, input the pre-processed data into the one model, you can get the total transaction volume of the day. When multiple sub-models are included, the first public opinion data can be combined to select the corresponding sub-model. Then input the pre-processed data into the selected sub-model to get the total transaction volume of the day. Or, input the preprocessed data into multiple sub-models respectively to obtain multiple predicted transaction volumes. Combine multiple predicted transaction volumes to get the total transaction volume for the day.
Taking the first public opinion data as the real-time activity information of the merchant, the prediction model includes two sub-models: the first sub-model and the second sub-model as an example. It is assumed that the first sub-model can be obtained according to the classic time series prediction algorithm (or machine learning algorithm, etc.) and samples containing real-time activity information of the merchant; the second sub-model can be based on the classic time series prediction algorithm (or machine Learning algorithms, etc.) and samples that do not contain real-time activity information of merchants. Then when predicting the trading volume of a certain day, if there are merchant activities on that day, you can use the first sub-model to predict the total trading volume of that day. If there is no merchant activity on the day, the second sub-model can be used to predict the total transaction volume on the day. Of course, in practical applications, two sub-models can also be used to predict the total transaction volume of the day. For example, different weight values are set for the two sub-models respectively, and then, based on the output value of each sub-model and the corresponding weight value, the total transaction volume of the day is predicted.
It can be seen from this that the embodiments of the present specification comprehensively consider the transaction data of the day, the public opinion data related to the transaction of the day, and the pre-estimated data that may affect the transaction volume when predicting the total transaction volume of the day, thus Can improve the accuracy of the predicted transaction volume.
Optionally, during the execution of the above steps 210-230, the following process may also be performed simultaneously: the merchant transaction real-time monitoring module 106 monitors the transaction data of the day at a high frequency to determine whether there is a corresponding merchant activity. In an implementation manner, the above monitoring process may be: based on the transaction data of the day at high frequency, the following data is counted: actual transaction volume, actual transaction number, and actual transaction customer unit price, etc. Similarly, according to historical transaction data, statistics are as follows: historical transaction volume, historical transaction number, and historical customer unit price. Then you can compare the actual transaction volume with the historical period transaction volume, the actual transaction number and the historical transaction number, the actual transaction customer unit price and the historical customer unit price. When there is a big difference between any two (eg, greater than the preset threshold or less than the preset threshold), the corresponding merchant activity alert information is issued. For example, when it is greater than the preset threshold, the merchant activity swell warning information is issued. When it is less than the preset threshold, it will issue a sudden decrease in merchant activity information.
By monitoring the transaction data on the day, you can accurately identify merchant activity information. Therefore, when predicting the transaction volume, the merchant activity information can be comprehensively considered, thereby further improving the accuracy of the predicted transaction volume.
After obtaining the transaction volume of the day, the merchant transaction real-time monitoring module 106 can input the identified merchant activity alarm information into the anomaly detection module 107. Therefore, the abnormality detection module 107 combines the aforementioned merchant activity alarm information to perform abnormality detection on the total transaction volume of the day, and adjusts the total transaction volume of the day when an abnormality is detected. In an implementation manner, the above-mentioned abnormality detection and adjustment process may be: according to historical transaction data, statistics are as follows: the transaction volume of the same period last week, the average transaction volume of this week, and the transaction volume of yesterday. Then compare the total trading volume of the day with the trading volume of the same period last week, the average trading volume of this week and the trading volume of yesterday. If the total transaction volume on the day is higher than any of the above specified multiples (eg, 1.5 times), and there is no corresponding alarm information for the sudden rise of the merchant activity, it is determined that the total transaction volume on the day is abnormal. Or, if the total transaction volume of the day is lower than any of the specified multiples (for example, 0.5 times), and there is no corresponding business activity sudden decrease alert information, it is determined that the total transaction volume of the day is abnormal. When there is an anomaly, the total transaction volume on the day that the anomaly exists can be multiplied by the adjustment factor (which can be determined according to the specified multiple above, such as 1.5 and 0.5), so as to ensure that the predicted total transaction volume on the day is within a reliable range.
Of course, in practical applications, anomaly detection can also be performed on the total transaction volume of the day by other methods, for example, the anomaly detection can be performed by the box-line method, which is not limited in this specification.
In another implementation, the strategy related to the transaction may also be collected by the external strategy decision module 108. Taking the scenario where the total trading volume of the day is used to determine the demand for foreign exchange as an example, the strategy related to trading can be a foreign exchange trading strategy. The foreign exchange trading strategy can be: the foreign exchange purchased only covers 60% of the positions or the overall trading volume is lower than the real trading volume, etc.
Thereafter, the external strategic decision module 108 may input the collected strategy related to the transaction into the auxiliary decision module 109. The auxiliary decision-making module 109 can combine the strategies related to the transaction to adjust the total transaction volume of the day. As in the previous example, assuming that the strategy related to the transaction is that the overall transaction volume is lower than the real transaction volume, the total transaction volume of the day can be multiplied by the penalty function. In order to ensure the best transaction volume.
In yet another implementation manner, the auxiliary decision-making module 109 may also combine information such as pre-trade trends, historical transaction trends, and business key performance indicators (Key Performance Indicators, KPIs) to adjust the total transaction volume of the day. The current trading trend can be determined based on the trading data of the day. The above historical transaction trends and business KPIs can be determined based on historical transaction data. Taking the adjustment of the total trading volume of the day according to the current trading trend as an example, if the current trading trend is an upward trend, then the total trading volume of the day will be enlarged according to a preset ratio, and vice versa. The above-mentioned preset ratio can be determined according to the ratio of the current transaction volume (determined according to the transaction data of the past moment of the day) and the daily transaction volume.
It should be noted that due to the rapid development of offline face-to-face payment business due to online overseas purchases, Alipay supports merchants and buyers in different currencies for payment and collection. Alipay purchases the corresponding foreign exchange every business day to meet business needs. Therefore, in the case of improved accuracy of the predicted transaction volume, it can reduce business risks and increase capital utilization.
In summary, the above embodiments of the present specification can achieve accurate prediction of the total transaction volume of the day when there is interference from merchant activities.
Corresponding to the above transaction volume prediction method, an embodiment of this specification further provides a transaction volume prediction device, as shown in FIG. 3, the device includes:
The obtaining unit 301 is configured to obtain the first transaction data of the past time of the day and the first public opinion data related to the transaction of the day.
The pre-processing unit 302 is configured to pre-process the first transaction data, the first public opinion data, and the preset influence data obtained by the obtaining unit 301 to obtain pre-processed data. The preset impact data refers to the data estimated in advance that will affect the transaction volume.
The prediction unit 303 is used to input the data preprocessed by the preprocessing unit 302 into the prediction model to predict the total transaction volume of the day. The prediction model is obtained based on the classic time series prediction algorithm or machine learning algorithm, the second transaction data before the day, the second public opinion data, and the preset influence data. The prediction model is used to predict future development and change trends based on historical data.
The prediction unit 303 may be specifically used for:
According to the pre-processed first public opinion data, select the corresponding sub-model.
Enter the preprocessed data into the selected sub-model to get the total transaction volume of the day.
Or, input the preprocessed data into multiple sub-models respectively to obtain multiple predicted transaction volumes.
Combine multiple predicted transaction volumes to get the total transaction volume for the day.
It should be noted that the above acquisition unit 301 may be implemented by the crawler module 101 and the real-time data synchronization module 102 in FIG. 1. The preprocessing unit 302 may be implemented by the data preprocessing module 104 in FIG. 1, and the prediction unit 303 may be implemented by the prediction module 105 in FIG. 1.
Optionally, the device may further include: a comparing unit 304 and a sending unit 305.
The obtaining unit 301 is also used to periodically obtain historical synchronization transaction data of the first transaction data according to the second transaction data.
The comparison unit 304 is used to compare the first transaction data with the historical synchronization transaction data acquired by the acquisition unit 301.
The sending unit 305 is configured to send out corresponding merchant activity alert information when the comparing unit 304 compares the first transaction data with the historical transaction data over the same period.
It should be noted that the above comparison unit 304 and sending unit 305 may be implemented by the merchant transaction real-time monitoring module 106 in FIG. 1.
Optionally, the device may further include:
The detection unit 306 is used for abnormal detection of the total transaction volume of the day.
The adjustment unit 307 is configured to adjust the total transaction volume of the day when the detection unit 306 detects that the total transaction volume of the day is abnormal.
Optionally, the detection unit 306 may be specifically used for:
According to the second transaction data, the historical total transaction volume of the same day is counted.
Compare the historical trading volume with the total trading volume of the day.
When the difference between the historical transaction volume of the same period and the total transaction volume of the day is greater than the threshold and there is no corresponding business activity alert information, it is determined that the total transaction volume of the day is abnormal.
The adjustment unit 307 may be specifically used for:
According to the phase difference multiple, determine the corresponding adjustment coefficient.
According to the adjustment factor, adjust the total transaction volume of the day.
Optionally, the device may further include:
It should be noted that the above detection unit 306 and adjustment unit 307 may be implemented by the abnormality detection module 107.
The determining unit 308 is configured to determine the current transaction trend based on the first transaction data.
The adjustment unit 307 is configured to adjust the total transaction volume of the day according to the current transaction trend determined by the determination unit 308.
and / or,
The determining unit 308 is used to determine the historical transaction trend according to the second transaction data.
The adjustment unit 307 is configured to adjust the total transaction volume of the day according to the historical transaction trend determined by the determination unit 308.
and / or,
The obtaining unit 301 is also used to obtain external trading strategies.
The adjustment unit 307 is configured to adjust the total transaction volume of the day according to the external transaction strategy acquired by the acquisition unit 301.
It should be noted that the above determination unit 308 may be implemented by the auxiliary decision module 109 in FIG. 1.
The functions of the functional modules of the device in the above embodiments of the present specification can be implemented through the steps of the above method embodiments. Therefore, the specific working process of the device provided in an embodiment of the present description will not be repeated here.
According to an embodiment of the present specification, a transaction volume prediction apparatus, the obtaining unit 301 obtains first transaction data of the past time of the day and first public opinion data related to the transaction of the day. The pre-processing unit 302 pre-processes the first transaction data, the first public opinion data and the preset influence data to obtain the pre-processed data. The prediction unit 303 inputs the pre-processed data into the prediction model to predict the total transaction volume of the day. Thus, the accuracy of the transaction volume can be predicted.
Those skilled in the art should be aware that in the above one or more examples, the functions described in this specification can be implemented by hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on the computer-readable medium.
The specific embodiments described above further describe the purpose, technical solutions, and beneficial effects of this specification in detail. It should be understood that the above are only specific implementations of this specification and are not intended to limit the scope of this specification. The scope of protection, any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this specification, shall be included in the scope of protection of this specification.