為了更好地理解上述技術方案,下面透過附圖以及具體實施例對本說明書實施例的技術方案做詳細的說明,應當理解本說明書實施例以及實施例中的具體特徵是對本說明書實施例技術方案的詳細的說明,而不是對本說明書技術方案的限定,在不衝突的情況下,本說明書實施例以及實施例中的技術特徵可以相互組合。
請參見圖1,為本說明書實施例的網際網路交易定位應用場景示意圖。交易終端100位於用戶側,與網路側的伺服器200進行通信。所述交易終端100中的交易處理客戶端101可以是基於網際網路實現業務的APP或網站,為用戶提供交易操作界面並將網際網路交易的交易資訊提供給網路側進行處理;所述伺服器200中的網際網路交易定位裝置201用於對所述交易處理客戶端101中涉及的網際網路交易進行定位。
所述交易終端100可以為智慧型手機、筆記型電腦、平板電腦以及一體機等智慧終端。對於在智慧型手機或者平板電腦等具有定位功能且定位功能開啟的交易終端上完成的網際網路交易,透過智慧型手機或者平板電腦等接收的衛星定位信號可以獲得網際網路交易的交易區域。本說明書實施例針對在筆記型、一體機等不具有定位功能的交易終端,或者在智慧型手機、平板電腦等具有定位功能但定位功能關閉的交易終端上完成的網際網路交易進行定位。
第一方面,本說明書實施例提供一種網際網路交易定位方法。圖2是所述網際網路交易定位方法的流程圖,所述網際網路交易定位方法包括步驟S201-步驟S203。
S201,從待定位交易的交易資訊中提取待定位終端的IP位址,所述待定位終端為進行所述待定位交易的交易終端。
對於每筆網際網路交易,進行網際網路交易的交易終端會產生相應的交易資訊,並將所述交易資訊提供給網路側進行處理,所述交易資訊包括但不限於進行交易的時間、進行交易的金額、進行交易的門店資訊、交易終端的IP位址、交易終端接收的衛星定位信號、交易終端的身份標識、交易終端連接的基地台資訊以及交易終端連接的WIFI資訊等。
需要說明的是,對於不同交易場景的網際網路交易,其對應的交易資訊也不相同。例如,對於前述在筆記型、一體機等不具有定位功能的交易終端,或者在智慧型手機、平板電腦等具有定位功能但定位功能關閉的交易終端上完成的網際網路交易,其對應的交易資訊中不包括交易終端接收的衛星定位信號;對於在小型商鋪進行的網際網路交易,其對應的交易資訊中不包括進行交易的門店資訊;對於採用GPRS方式聯網進行的網際網路交易,其對應的交易資訊中不包括交易終端連接的WIFI資訊;對於採用WIFI方式聯網進行的網際網路交易,其對應的交易資訊中不包括交易終端連接的基地台資訊。
但是,網際網路交易必須在聯網的狀態下進行,而進行網際網路交易的交易終端都具有唯一的身份標識,因而每筆網際網路交易的交易資訊均包括交易終端的IP位址和交易終端的身份標識。在本說明書實施例中,從所述待定位交易的交易資訊中提取進行所述待定位交易的交易終端的IP位址,根據所述待定位交易的交易終端的IP位址對所述待定位交易進行定位。為方便描述,將進行所述待定位交易的交易終端定義為待定位終端。
S202,判斷所述待定位終端的IP位址是否屬於一穩定IP位址段,所述穩定IP位址段為根據第一預設歷史時間段內的多筆第一網際網路交易確定的分佈在固定區域的IP位址段,且所述穩定IP位址段為所述多筆第一網際網路交易涉及的交易終端的IP位址前M位對應的位址段,M為正整數。
所有IP位址會按照省份、市級城市、縣級城市或者區等行政區域進行初始分配,各個省份、市級城市、縣級城市或者區作為每個IP位址分佈的區域。然而,在對所有IP位址進行初始分配後,由於各種原因導致分配方案可能不會被嚴格執行,某些IP位址分佈的區域存在動態變化的情況,因而現有透過GeoIP進行定位的結果準確性不高。
在進行所述待定位交易之前已有大量的網際網路交易發生,絕大部分已發生的網際網路交易的交易資訊包括交易的門店資訊、交易終端接收的衛星定位信號、交易終端連接的基地台資訊或者交易終端連接的WIFI資訊等可以準確定位的定位資訊,根據這些定位資訊獲得的IP位址分佈相對於透過GeoIP進行定位更加精準。因此,本說明書實施例根據所述多筆第一網際網路交易確定所述穩定IP位址段以及所述穩定IP位址段分佈的固定區域。
圖3是本說明書實施例確定所述穩定IP位址段分佈的固定區域的流程圖,所述確定所述穩定IP位址段分佈的固定區域包括步驟S301-步驟S305。
S301,從所述第一預設歷史時間段內的所有網際網路交易中提取所述多比第一網際網路交易,所述第一網際網路交易的交易資訊包括進行所述第一網際網路交易的交易終端的IP位址和進行所述第一網際網路交易的交易終端接收的衛星定位信號。
所述第一預設歷史時間段可以按照如下方式劃分:由於時間屬性為連續值,可以將時間離散化,即將時間進行分段,如按照自然天分段,所述第一預設歷史時間段為某一天或某幾天;如按照自然月分段,所述第一預設歷史時間段為某一個月或某幾個月。所述第一預設歷史時間段設置得越長,提取的所述第一網際網路交易總量越大,根據所述多筆第一網際網路交易確定的所述穩定IP位址段分佈的固定區域更加準確,但相應地資料處理速度變慢,所述第一預設歷史時間段的長度具體可根據實際需求進行設置。
在一種可選實現方式中,所述第一預設歷史時間段為從第一預設歷史時間至進行所述待定位交易的時間對應的歷史時間段,所述第一預設歷史時間為進行所述待定位交易的時間之前的任意時間。透過將所述第一預設歷史時間段設置為從所述第一預設歷史時間至進行所述待定位交易的時間對應的歷史時間段,獲得的所述多筆第一網際網路交易是最新的,即根據最新已發生的網際網路交易確定所述穩定IP位址段分佈的固定區域。相當於每次對網際網路交易進行定位時,都更新所述第一穩定IP位址段分佈的固定區域,因而可以較為實時地更新IP位址分佈,進一步提高對所述待定位交易進行定位的準確性。
所述第一網際網路交易的選取,可以是交易資訊包括交易的門店資訊、交易終端接收的衛星定位信號、交易終端連接的基地台資訊或者交易終端連接的WIFI資訊等可以進行準確定位的定位資訊的網際網路交易。考慮到所有網際網路交易的交易資訊中衛星定位信號最為豐富,本說明書實施例提取的所述第一網際網路交易的交易資訊包括進行所述第一網際網路交易的交易終端的IP位址和進行所述第一網際網路交易的交易終端接收的衛星定位信號。進一步,所述衛星定位信號可以為GPS信號、GLONASS信號、GALILEO信號或者北斗衛星信號等。
考慮到交易區域和衛星定位地點存在不一致的情況,所述第一網際網路交易的交易資訊還可以包括交易時間和定位時間,且所述交易時間與所述定位時間之差的絕對值小於預設時間差,所述交易時間為進行所述第一網際網路交易的時間,所述定位時間為進行所述第一網際網路交易的交易終端接收衛星定位信號的時間。透過將所述交易時間與所述定位時間之差的絕對值設置為小於所述預設時間差,可以過濾掉交易區域和衛星定位地點不一致的網際網路交易,進一步提高對所述待定位交易進行定位的準確性。所述預設時間差可根據實際經驗進行設置,本說明書實施例對此不進行限定。
S302,根據進行每筆第一網際網路交易的交易終端接收的衛星定位信號,獲得進行所述每筆第一網際網路交易的交易終端的IP位址分佈的唯一區域。
提取到所述多筆第一網際網路交易後,根據衛星定位原理和進行每筆第一網際網路交易的交易終端接收的衛星定位信號,獲得進行所述每筆第一網際網路交易的交易區域,將進行所述每筆第一網際網路交易的交易區域作為進行所述每筆第一網際網路交易的交易終端的IP位址分佈的唯一區域。
S303,根據進行所述每筆第一網際網路交易的交易終端的IP位址分佈的唯一區域,獲得每個待判斷IP位址段分佈的各個區域以及各個區域占比,所述待判斷IP位址段為進行所述每筆第一網際網路交易的交易終端的IP位址前M位對應的位址段。
所述M的取值可根據需要定位的區域行政級別、定位的準確率以及定位的覆蓋率等因素進行設置。本說明書實施例以定位所述待定位交易的市級城市為例,所述M的取值為24時,獲得的定位準確率以及覆蓋率都比較高。當然,在其他實施例中,若定位所述待定位交易的省份等更高級別的行政區域,則所述M的取值可以更小;若定位所述待定位交易的縣級城區等更低級別的行政區域,則所述M的取值可以更大。
所述M的取值確定後,獲得進行所述每筆第一網際網路交易的交易終端的IP位址前M位,相同前M位對應為一個待判斷IP位址段。根據進行所述每筆第一網際網路交易的交易終端的IP位址分佈的唯一區域,統計出每個待判斷IP位址段分佈的各個區域以及各個區域占比。
以M的取值為24、從所述第一預設歷史時間段內提取出五筆第一網際網路交易為例,若所述五筆第一網際網路交易對應的交易終端的IP位址分別為223.85.221.198、223.85.221.101、223.85.221.20、223.85.221.30以及182.132.23.97,前述五個IP位址分佈的唯一區域分別為成都市、成都市、成都市、綿陽市以及德陽市,則獲得待判斷IP位址段223.85.221和待判斷IP位址段182.132.23。所述待判斷IP位址段223.85.221分佈在成都市和綿陽市,且成都市占比為75%,綿陽市占比為25%;所述待判斷IP位址段182.132.23分佈在德陽市,且德陽市占比為100%。
S304,判斷所述待判斷IP位址段對應的各個區域占比中最高占比是否大於第一預設百分比。
獲得所述待判斷IP位址段對應的各個區域占比後,將所述各個區域占比中最高占比與所述第一預設百分比進行比較。若某個待判斷IP位址段在初始分配後未有變化,理想情況下其分佈的區域只有一個,其對應的最高占比為100%。考慮到資料採集誤差、進行所述第一網際網路交易的交易終端的IP位址可能為漫遊IP位址或者代理IP位址等因素,本說明書實施例在所述最高占比大於所述第一預設百分比時,將所述待判斷IP位址段確定為所述穩定IP位址段。所述第一預設百分比可根據資料採集誤差、漫遊IP位址或者代理IP位址等實際情況進行設置,本說明書實施例對此不進行限定。
若所述最高占比大於所述第一預設百分比,則執行步驟S305,確定所述待判斷IP位址段為所述穩定IP位址段,並將所述最高占比對應的區域確定為所述穩定IP位址段分佈的固定區域。
以所述第一預設百分比為70%為例,所述待判斷IP位址段223.85.221對應的最高占比75%大於所述第一預設百分比70%,因而所述待判斷IP位址段223.85.221為所述穩定IP位址段,所述最高占比75%對應的區域成都市為所述穩定IP位址段223.85.221分佈的固定區域;所述待判斷IP位址段182.132.23對應的最高占比100%大於所述第一預設百分比70%,因而所述待判斷IP位址段182.132.23為所述穩定IP位址段,所述最高占比100%對應的區域德陽市為所述穩定IP位址段182.132.23分佈的固定區域。
確定所述穩定IP位址段之後,將所述待定位終端的IP位址與各個穩定IP位址段進行比對,判斷所述待定位終端的IP位址是否屬於一穩定IP位址段,即判斷所述待定位終端的IP位址前M位與所述穩定IP位址段是否相同。仍以前述所述穩定IP位址段223.85.221和所述穩定IP位址段182.132.23為例,若所述待定位終端的IP位址為223.85.221.35,則所述待定位終端的IP位址223.85.221.35屬於所述穩定IP位址段223.85.221。
若所述待定位終端的IP位址屬於所述一穩定IP位址段,則執行步驟S203,將所述穩定IP位址段分佈的固定區域確定為進行所述待定位交易的交易區域。
所述穩定IP位址段分佈在所述固定區域,表明所述穩定IP位址段包括的所有IP位址都分佈在所述固定區域。因此,若所述待定位終端的IP位址屬於所述穩定IP位址段,則所述待定位終端的IP位址也分佈在所述固定區域,即所述固定區域為進行所述待定位交易的交易區域。
本說明書實施例中,由於所述穩定IP位址段為根據所述多筆第一網際網路交易確定的分佈在所述固定區域的IP位址段,進行所述第一網際網路交易的交易區域通常是根據衛星定位信號、交易的門店資訊或者交易終端連接的基地台資訊等獲得,當某個IP位址分佈的區域相對於初始分配發生了動態變化時,該動態變化透過衛星定位信號、交易的門店資訊或者交易終端連接的基地台資訊等可以在所述多筆第一網際網路交易中體現,因此根據所述多筆第一網際網路交易確定的IP位址分佈相對於初始分配更為準確,將所述穩定IP位址段分佈的固定區域確定為進行所述待定位交易的交易區域更為準確,提高了對所述待定位交易進行定位的準確性。
如前所述,網際網路交易的交易資訊包括但不限於進行交易的時間、進行交易的金額、進行交易的門店資訊、交易終端的IP位址、交易終端接收的衛星定位信號、交易終端的身份標識、交易終端連接的基地台資訊以及交易終端連接的WIFI資訊等,所述進行交易的門店資訊、所述交易終端的IP位址、所述交易終端接收的衛星定位信號、所述交易終端的身份標識、所述交易終端連接的基地台資訊以及所述交易終端連接的WIFI資訊都是可以進行定位的定位資訊。因此,除前述僅根據所述待定位交易的交易終端的IP位址對所述待定位交易進行定位外,還可以結合所述進行交易的門店資訊、所述交易終端接收的衛星定位信號、所述交易終端的身份標識、所述交易終端連接的基地台資訊以及所述交易終端連接的WIFI資訊對所述待定位交易進行定位。在一種可選實現方式中,本說明書實施例提供的網際網路交易定位方法還包括步驟S204和步驟S205。
S204,根據預先設置的各類定位資訊的優先級順序,判斷所述待定位交易的交易資訊中是否存在優先級高於所述待定位終端的IP位址的定位資訊。
所述定位資訊包括進行交易的門店資訊、交易終端的IP位址、交易終端接收的衛星定位信號、交易終端的身份標識、交易終端連接的基地台資訊以及交易終端連接的WIFI資訊中的至少一種。根據採用各類定位資訊進行定位的準確性高低,設置所述各類定位資訊的優先級順序。例如,若採用進行交易的門店資訊進行定位的準確性高於採用交易終端的IP位址進行定位的準確性,則將進行交易的門店資訊的優先級設置為高於交易終端的IP位址;若採用進行交易的門店資訊結合交易終端連接的基地台資訊進行定位的準確性高於採用進行交易的門店資訊進行定位的準確性,則將進行交易的門店資訊結合交易終端連接的基地台資訊的優先級設置為高於進行交易的門店資訊。
若所述待定位交易的交易資訊中不存在優先級高於所述待定位終端的IP位址的定位資訊,則執行步驟S201,從所述待定位交易的交易資訊中提取所述待定位終端的IP位址;否則則執行步驟S205,從所述待定位交易的交易資訊中提取優先級最高的定位資訊,並根據優先級最高的定位資訊確定進行所述待定位交易的交易區域。
根據所述待定位交易的交易終端的IP位址對所述待定位交易進行定位參考前述步驟S201-步驟S203,根據優先級最高的定位資訊確定進行所述待定位交易的交易區域具體視所述優先級最高的定位資訊而定。例如,若所述優先級最高的定位資訊為進行交易的門店資訊,則將所述進行所述待定位交易的門店位置確定為進行所述待定位交易的交易區域;若所述優先級最高的定位資訊為交易終端連接的基地台資訊,則將所述進行所述待定位交易的交易終端連接的基地台位置確定為進行所述待定位交易的交易區域;若所述優先級最高的定位資訊為交易終端連接的WIFI資訊,則將所述進行所述待定位交易的交易終端連接的WIFI位置確定為進行所述待定位交易的交易區域。
在本說明書前述實施例中,所述待定位終端的IP位址可能並不屬於任何一個穩定IP位址段。針對這種情況,本說明書實施例結合所述待定位終端的最後交易區域對所述待定位交易進行定位。在一種可選實現方式中,本說明書實施例提供的網際網路交易定位方法還包括步驟S206-步驟S208。
若所述待定位終端的IP位址不屬於所述一穩定IP位址段,則執行步驟S206,判斷所述待定位終端的IP位址是否屬於一不穩定IP位址段,所述不穩定IP位址段為根據所述多筆第一網際網路交易確定的分佈在兩個以上區域的IP位址段,且所述不穩定IP位址段為所述多筆第一網際網路交易涉及的交易終端的IP位址前M位對應的位址段。
所述不穩定IP位址段的具體確定方式參考圖3,若所述最高占比不大於所述第一預設百分比,則執行步驟S306,確定所述待判斷IP位址段為所述不穩定IP位址段,並將所述待判斷IP位址段分佈的各個區域中滿足預設條件的區域確定為所述不穩定IP位址段分佈的兩個以上區域。
所述預設條件包括占比高於第二預設百分比及/或與所述最高占比對應的區域屬於同一上級行政區域,所述第二預設百分比小於所述第一預設百分比。以所述第一預設百分比為90%為例,所述待判斷IP位址段223.85.221對應的最高占比75%小於所述第一預設百分比90%,因而所述待判斷IP位址段223.85.221為所述不穩定IP位址段。若所述預設條件包括占比高於所述第二預設百分比且與所述最高占比對應的區域屬於同一上級行政區域,所述第二預設百分比為20%,由於成都市占比為75%、綿陽市占比為25%,均高於所述第二預設百分比,且成都市和綿陽市同屬於四川省,因而將成都市和綿陽市確定為所述不穩定IP位址段223.85.221分佈的區域。
確定所述不穩定IP位址段之後,將所述待定位終端的IP位址與各個不穩定IP位址段進行比對,判斷所述待定位終端的IP位址是否屬於一不穩定IP位址段,即判斷所述待定位終端的IP位址前M位與所述不穩定IP位址段是否相同。仍以前述不穩定IP位址段223.85.221為例,若所述待定位終端的IP位址為223.85.221.35,則所述待定位終端的IP位址223.85.221.35屬於所述不穩定IP位址段223.85.221。
若所述待定位終端的IP位址屬於所述一不穩定IP位址段,則執行步驟S207,判斷所述不穩定IP位址段分佈的兩個以上區域是否包括所述待定位終端的最後交易區域。
圖4是本說明書實施例提供的獲得所述待定位終端的最後交易區域的流程圖,所述獲得所述待定位終端的最後交易區域包括步驟S401-步驟S404。
S401,從第二預設歷史時間段內的所有網際網路交易中提取多筆第二網際網路交易,所述第二預設歷史時間段為從第二預設歷史時間至進行所述待定位交易的時間對應的歷史時間段,所述第二網際網路交易的交易資訊包括進行所述第二網際網路交易的交易終端的身份標識、進行所述第二網際網路交易的交易終端接收的衛星定位信號以及進行所述第二網際網路交易的時間。
所述第二預設歷史時間為進行所述待定位交易的時間之前的任意時間,所述第二預設歷史時間段的長度可根據實際需求進行設置,只要保證能夠提取出足夠數量的所述第二網際網路交易。與所述第一網際網路交易的選取類似,所述第二網際網路交易也可以是交易資訊包括交易的門店資訊、交易終端接收的衛星定位信號、交易終端連接的基地台資訊或者交易終端連接的WIFI資訊等可以進行準確定位的定位資訊的網際網路交易。考慮到所有網際網路交易的交易資訊中衛星定位信號最為豐富,本說明書實施例提取的所述第二網際網路交易的交易資訊包括進行所述第二網際網路交易的交易終端的身份標識、進行所述第二網際網路交易的交易終端接收的衛星定位信號以及進行所述第二網際網路交易的時間。
S402,根據進行每筆第二網際網路交易的交易終端的身份標識、進行所述每筆第二網際網路交易的時間以及進行所述每筆第二網際網路交易的交易終端接收的衛星定位信號,確定每個身份標識對應的交易終端的最後交易區域。
提取到所述多筆第二網際網路交易後,根據衛星定位原理和進行每筆第二網際網路交易的交易終端接收的衛星定位信號,獲得進行所述每筆第二網際網路交易的交易區域,將進行所述每筆第二網際網路交易的交易區域作為進行所述每筆第二網際網路交易的交易終端的IP位址分佈的唯一區域。結合進行所述每筆第二網際網路交易的交易終端的身份標識和進行所述每筆第二網際網路交易的時間,獲得所述多筆第二網際網路交易涉及的每個交易終端的最後交易區域,亦即所述多筆第二網際網路交易涉及的每個身份標識對應的最後交易區域。
S403,從所述待定位交易的交易資訊中提取所述待定位終端的身份標識。
所述待定位終端的身份標識是能夠證明所述待定位終端身份的憑證,以所述待定位終端為智慧型手機為例,所述待定位終端的身份標識可以為智慧型手機的序列號。提取所述待定位終端的身份標識可以是在提取所述待定位終端的IP位址時進行,也可以是在提取所述待定位終端的IP位址之後進行,本說明書實施例對此不作限定。
S404,根據所述待定位終端的身份標識和所述每個身份標識對應的交易終端的最後交易區域,確定所述待定位終端的最後交易區域。
將所述待定位終端的身份標識與所述多筆第二網際網路交易涉及的所有身份標識進行比對,在所述多筆第二網際網路交易涉及的所有身份標識中找到所述待定位終端的身份標識,從而獲得所述待定位終端的最後交易區域。
以所述待定位終端的IP位址223.85.221.35屬於所述不穩定IP位址段223.85.221為例,則判斷所述不穩定IP位址段223.85.221分佈的區域是否包括所述待定位終端的最後交易區域,即將所述待定位終端的最後交易區域與所述不穩定IP位址段223.85.221分佈的區域進行比對。
若所述不穩定IP位址段分佈的兩個以上區域包括所述待定位終端的最後交易區域,則執行步驟S208,將所述待定位終端的最後交易區域確定為進行所述待定位交易的交易區域。
以所述待定位終端的IP位址223.85.221.35屬於所述不穩定IP位址段223.85.221為例,若所述待定位終端的最後交易區域為成都市,由於所述不穩定IP位址段223.85.221分佈的區域為成都市和綿陽市,包括所述待定位終端的最後交易區域成都市,因而將所述待定位終端的最後交易區域成都市確定為進行所述待定位交易的交易區域。
本說明書實施例的步驟S206-步驟S208,根據所述待定位終端的身份標識確定所述待定位終端的最後交易區域,在所述不穩定IP位址段分佈的兩個以上區域包括所述待定位終端的最後交易區域時,將所述待定位終端的最後交易區域確定為進行所述待定位交易的交易區域,對所述穩定IP位址段無法定位的情況進行補充,大幅度提高了對所述待定位交易進行定位的準確率和覆蓋率。
在一種可選實現方式中,本說明書實施例提供的網際網路交易定位方法還包括步驟S209。
若所述不穩定IP位址段分佈的兩個以上區域不包括所述待定位終端的最後交易區域,則執行步驟S209,將所述不穩定IP位址段分佈的兩個以上區域中占比最高的區域確定為進行所述待定位交易的交易區域。
以所述待定位終端的IP位址223.85.221.35屬於所述不穩定IP位址段223.85.221為例,若所述待定位終端的最後交易區域為南充市,由於所述不穩定IP位址段223.85.221分佈的區域為成都市和綿陽市,不包括所述待定位終端的最後交易區域南充市,因而將所述不穩定IP位址段223.85.221分佈的成都市和綿陽市中占比最高的成都市確定為進行所述待定位交易的交易區域。
第二方面,基於同一發明構思,本說明書實施例提供一種網際網路交易定位裝置,包括:
定位資訊提取模組,用於從待定位交易的交易資訊中提取待定位終端的IP位址,所述待定位終端為進行所述待定位交易的交易終端;
第一判斷模組,用於判斷所述待定位終端的IP位址是否屬於一穩定IP位址段,所述穩定IP位址段為根據第一預設歷史時間段內的多筆第一網際網路交易確定的分佈在固定區域的IP位址段,且所述穩定IP位址段為所述多筆第一網際網路交易涉及的交易終端的IP位址前M位對應的位址段,M為正整數;
第一確定模組,用於在所述待定位終端的IP位址屬於所述一穩定IP位址段時,將所述穩定IP位址段分佈的固定區域確定為進行所述待定位交易的交易區域。
在一種可選實現方式中,所述網際網路交易定位裝置還包括:
第二判斷模組,用於根據預先設置的各類定位資訊的優先級順序,判斷所述待定位交易的交易資訊中是否存在優先級高於所述待定位終端的IP位址的定位資訊;
所述定位資訊提取模組用於在所述待定位交易的交易資訊中不存在優先級高於所述待定位終端的IP位址的定位資訊時,從所述待定位交易的交易資訊中提取所述待定位終端的IP位址;否則從所述待定位交易的交易資訊中提取優先級最高的定位資訊,並根據優先級最高的定位資訊確定進行所述待定位交易的交易區域。
在一種可選實現方式中,所述網際網路交易定位裝置還包括:
第一交易提取模組,用於從所述第一預設歷史時間段內的所有網際網路交易中提取所述多比第一網際網路交易,所述第一網際網路交易的交易資訊包括進行所述第一網際網路交易的交易終端的IP位址和進行所述第一網際網路交易的交易終端接收的衛星定位信號;
位址分佈獲得模組,用於根據進行每筆第一網際網路交易的交易終端接收的衛星定位信號,獲得進行所述每筆第一網際網路交易的交易終端的IP位址分佈的唯一區域;
位址段分佈獲得模組,用於根據進行所述每筆第一網際網路交易的交易終端的IP位址分佈的唯一區域,獲得每個待判斷IP位址段分佈的各個區域以及各個區域占比,所述待判斷IP位址段為進行所述每筆第一網際網路交易的交易終端的IP位址前M位對應的位址段;
第三判斷模組,用於判斷所述待判斷IP位址段對應的各個區域占比中最高占比是否大於第一預設百分比;
第二確定模組,用於在所述最高占比大於所述第一預設百分比時,確定所述待判斷IP位址段為所述穩定IP位址段,並將所述最高占比對應的區域確定為所述穩定IP位址段分佈的固定區域。
在一種可選實現方式中,所述網際網路交易定位裝置還包括:
第四判斷模組,用於在所述待定位終端的IP位址不屬於所述一穩定IP位址段時,判斷所述待定位終端的IP位址是否屬於一不穩定IP位址段,所述不穩定IP位址段為根據所述多筆第一網際網路交易確定的分佈在兩個以上區域的IP位址段,且所述不穩定IP位址段為所述多筆第一網際網路交易涉及的交易終端的IP位址前M位對應的位址段;
第五判斷模組,用於在所述待定位終端的IP位址屬於所述一不穩定IP位址段時,判斷所述不穩定IP位址段分佈的兩個以上區域是否包括所述待定位終端的最後交易區域;
第三確定模組,用於在所述不穩定IP位址段分佈的兩個以上區域包括所述待定位終端的最後交易區域時,將所述待定位終端的最後交易區域確定為進行所述待定位交易的交易區域。
在一種可選實現方式中,所述網際網路交易定位裝置還包括:
第四確定模組,用於在所述最高占比不大於所述第一預設百分比時,確定所述待判斷IP位址段為所述不穩定IP位址段,並將所述待判斷IP位址段分佈的各個區域中滿足預設條件的區域確定為所述不穩定IP位址段分佈的兩個以上區域。
在一種可選實現方式中,所述定位資訊提取模組還用於從所述待定位交易的交易資訊中提取所述待定位終端的身份標識,所述網際網路交易定位裝置還包括:
第二交易提取模組,用於從第二預設歷史時間段內的所有網際網路交易中提取多筆第二網際網路交易,所述第二預設歷史時間段為從第二預設歷史時間至進行所述待定位交易的時間對應的歷史時間段,所述第二網際網路交易的交易資訊包括進行所述第二網際網路交易的交易終端的身份標識、進行所述第二網際網路交易的交易終端接收的衛星定位信號以及進行所述第二網際網路交易的時間;
第五確定模組,用於根據進行每筆第二網際網路交易的交易終端的身份標識、進行所述每筆第二網際網路交易的時間以及進行所述每筆第二網際網路交易的交易終端接收的衛星定位信號,確定每個身份標識對應的交易終端的最後交易區域;
第六確定模組,用於根據所述待定位終端的身份標識和所述每個身份標識對應的交易終端的最後交易區域,確定所述待定位終端的最後交易區域。
在一種可選實現方式中,所述網際網路交易定位裝置還包括:
第七確定模組,用於在所述不穩定IP位址段分佈的兩個以上區域不包括所述待定位終端的最後交易區域時,將所述不穩定IP位址段分佈的兩個以上區域中占比最高的區域確定為進行所述待定位交易的交易區域。
第三方面,基於與前述實施例中網際網路交易定位方法同樣的發明構思,本發明還提供一種伺服器,如圖5所示,包括記憶體504、處理器502及儲存在記憶體504上並可在處理器502上運行的計算機程式,所述處理器502執行所述程式時實現前述網際網路交易定位方法的步驟。
其中,在圖5中,匯流排架構(用匯流排500來代表),匯流排500可以包括任意數量的互聯的匯流排和橋,匯流排500將包括由處理器502代表的一個或多個處理器和記憶體504代表的記憶體的各種電路鏈接在一起。匯流排500還可以將諸如外圍設備、穩壓器和功率管理電路等之類的各種其他電路鏈接在一起,這些都是本領域所公知的,因此,本文不再對其進行進一步描述。匯流排介面505在匯流排500和接收器501和發送器503之間提供介面。接收器501和發送器503可以是同一個元件,即收發機,提供用於在傳輸媒體上與各種其他裝置通信的單元。處理器502負責管理匯流排500和通常的處理,而記憶體504可以被用於儲存處理器502在執行操作時所使用的資料。
第四方面,基於與前述實施例中網際網路交易定位的發明構思,本發明還提供一種計算機可讀儲存媒體,其上儲存有計算機程式,該程式被處理器執行時實現前文所述網際網路交易定位的步驟。
本說明書是參照根據本說明書實施例的方法、設備(系統)、和計算機程式產品的流程圖及/或方塊圖來描述的。應理解可由計算機程式指令實現流程圖及/或方塊圖中的每一流程及/或方塊、以及流程圖及/或方塊圖中的流程及/或方塊的結合。可提供這些計算機程式指令到通用計算機、專用計算機、嵌入式處理機或其他可編程資料處理設備的處理器以產生一個機器,使得透過計算機或其他可編程資料處理設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程及/或方塊圖一個方塊或多個方塊中指定的功能的設備。
這些計算機程式指令也可儲存在能引導計算機或其他可編程資料處理設備以特定方式工作的計算機可讀記憶體中,使得儲存在該計算機可讀記憶體中的指令產生包括指令設備的製造品,該指令設備實現在流程圖一個流程或多個流程及/或方塊圖一個方塊或多個方塊中指定的功能。
這些計算機程式指令也可裝載到計算機或其他可編程資料處理設備上,使得在計算機或其他可編程設備上執行一系列操作步驟以產生計算機實現的處理,從而在計算機或其他可編程設備上執行的指令提供用於實現在流程圖一個流程或多個流程及/或方塊圖一個方塊或多個方塊中指定的功能的步驟。
儘管已描述了本說明書的優選實施例,但本領域內的技術人員一旦得知了基本創造性概念,則可對這些實施例作出另外的變更和修改。所以,所附申請專利範圍意欲解釋為包括優選實施例以及落入本說明書範圍的所有變更和修改。
顯然,本領域的技術人員可以對本說明書進行各種改動和變型而不脫離本說明書的精神和範圍。這樣,倘若本說明書的這些修改和變型屬於本說明書申請專利範圍及其等同技術的範圍之內,則本說明書也意圖包含這些改動和變型在內。In order to better understand the above technical solutions, the technical solutions of the embodiments of this specification are described in detail below through the drawings and specific embodiments. It should be understood that the embodiments of this specification and the specific features in the embodiments are the same as those of the technical solutions of the embodiments of this specification. The detailed description is not a limitation on the technical solution of this specification. The embodiments of this specification and the technical features in the embodiments can be combined with each other if there is no conflict.
Please refer to FIG. 1, which is a schematic diagram of an application scenario of Internet transaction positioning according to an embodiment of this specification. The transaction terminal 100 is located on the user side and communicates with the server 200 on the network side. The transaction processing client 101 in the transaction terminal 100 may be an APP or website that implements services based on the Internet, which provides users with a transaction operation interface and provides transaction information of Internet transactions to the network side for processing; the server The Internet transaction locating device 201 in the processor 200 is used for locating the Internet transaction involved in the transaction processing client 101.
The transaction terminal 100 may be a smart terminal such as a smart phone, a notebook computer, a tablet computer, and an all-in-one machine. For Internet transactions that are completed on a transaction terminal with positioning function and positioning function enabled, such as a smart phone or tablet computer, the transaction area of the Internet transaction can be obtained through the satellite positioning signal received by the smart phone or tablet computer. The embodiments of this specification are aimed at positioning Internet transactions completed on transaction terminals that do not have positioning functions, such as notebooks and all-in-ones, or transaction terminals that have positioning functions but are turned off, such as smart phones and tablet computers.
In the first aspect, the embodiments of this specification provide a method for locating Internet transactions. Fig. 2 is a flowchart of the method for locating Internet transactions. The method for locating Internet transactions includes steps S201 to S203.
S201: Extract an IP address of a terminal to be located from transaction information of a transaction to be located, where the terminal to be located is a transaction terminal that performs the transaction to be located.
For each Internet transaction, the transaction terminal that conducts the Internet transaction will generate corresponding transaction information and provide the transaction information to the network side for processing. The transaction information includes but is not limited to the time of the transaction, The amount of the transaction, the information of the store where the transaction is conducted, the IP address of the transaction terminal, the satellite positioning signal received by the transaction terminal, the identity of the transaction terminal, the base station information connected to the transaction terminal, and the WIFI information connected to the transaction terminal, etc.
It should be noted that for Internet transactions in different transaction scenarios, the corresponding transaction information is also different. For example, for the aforementioned transaction terminals that do not have positioning functions such as notebooks and all-in-ones, or Internet transactions completed on transaction terminals with positioning functions such as smart phones and tablet computers but with positioning functions turned off, the corresponding transactions The information does not include the satellite positioning signal received by the transaction terminal; for Internet transactions conducted in small shops, the corresponding transaction information does not include the information of the store where the transaction is conducted; for Internet transactions conducted through the GPRS network, The corresponding transaction information does not include the WIFI information connected to the transaction terminal; for Internet transactions that use WIFI to connect to the Internet, the corresponding transaction information does not include the base station information connected to the transaction terminal.
However, Internet transactions must be conducted in a networked state, and transaction terminals that conduct Internet transactions have unique identifications. Therefore, the transaction information of each Internet transaction includes the IP address of the transaction terminal and the transaction. The identity of the terminal. In the embodiment of this specification, the IP address of the transaction terminal that performs the transaction to be located is extracted from the transaction information of the transaction to be located, and the transaction terminal to be located is determined according to the IP address of the transaction terminal for the transaction to be located. The transaction is positioned. For the convenience of description, the transaction terminal that performs the transaction to be located is defined as the terminal to be located.
S202: Determine whether the IP address of the terminal to be located belongs to a stable IP address segment, where the stable IP address segment is a distribution determined based on multiple first Internet transactions within a first preset historical time period An IP address segment in a fixed area, and the stable IP address segment is an address segment corresponding to the first M bits of the IP address of the transaction terminal involved in the multiple first Internet transactions, and M is a positive integer.
All IP addresses will be initially allocated according to administrative regions such as provinces, municipal cities, county-level cities or districts, and each province, municipal city, county-level city or district will be the area where each IP address is distributed. However, after the initial allocation of all IP addresses, the allocation plan may not be strictly implemented due to various reasons. There are dynamic changes in some areas of IP address distribution, so the accuracy of the existing positioning results through GeoIP not tall.
A large number of Internet transactions have occurred before the transaction to be located. The transaction information of the vast majority of Internet transactions that have occurred includes the information of the transaction store, the satellite positioning signal received by the transaction terminal, and the base to which the transaction terminal is connected. Positioning information that can be accurately positioned, such as station information or WIFI information connected to a trading terminal, and the distribution of IP addresses obtained based on these positioning information is more accurate than positioning through GeoIP. Therefore, the embodiment of this specification determines the stable IP address segment and the fixed area where the stable IP address segment is distributed based on the multiple first Internet transactions.
Fig. 3 is a flowchart of determining the fixed area of the stable IP address segment distribution according to the embodiment of the present specification. The determining of the fixed area of the stable IP address segment distribution includes step S301-step S305.
S301. Extract the multi-first Internet transaction from all Internet transactions in the first preset historical time period, and the transaction information of the first Internet transaction includes the transaction information of the first Internet transaction. The IP address of the transaction terminal of the online transaction and the satellite positioning signal received by the transaction terminal of the first Internet transaction.
The first preset historical time period can be divided as follows: Since the time attribute is a continuous value, time can be discretized, that is, time can be segmented, such as segmented according to natural days, the first preset historical time period It is a certain day or a certain few days; if it is segmented according to a natural month, the first preset historical time period is a certain month or a certain few months. The longer the first preset historical time period is set, the larger the total amount of the first Internet transactions extracted, and the stable IP address segment distribution determined according to the multiple first Internet transactions The fixed area of is more accurate, but correspondingly the data processing speed becomes slower. The length of the first preset historical time period can be specifically set according to actual needs.
In an optional implementation manner, the first preset historical time period is a historical time period corresponding to the time from the first preset historical time to the time when the transaction to be located is performed, and the first preset historical time is performed Any time before the time of the transaction to be located. By setting the first preset historical time period to the historical time period corresponding to the time from the first preset historical time to the time when the transaction to be located is performed, the plurality of first Internet transactions obtained are The latest, that is, the fixed area where the stable IP address segment is distributed is determined according to the latest Internet transaction that has occurred. It is equivalent to updating the fixed area of the first stable IP address segment distribution every time an Internet transaction is located, so that the IP address distribution can be updated in a relatively real-time manner, and the positioning of the transaction to be located is further improved. Accuracy.
The selection of the first Internet transaction may be that the transaction information includes the transaction store information, the satellite positioning signal received by the transaction terminal, the base station information connected to the transaction terminal, or the WIFI information connected to the transaction terminal, etc., which can be accurately positioned. Internet transactions of information. Considering that the satellite positioning signal is the richest among all the transaction information of Internet transactions, the transaction information of the first Internet transaction extracted in the embodiment of this specification includes the IP address of the transaction terminal that performs the first Internet transaction. Address and the satellite positioning signal received by the transaction terminal that conducts the first Internet transaction. Further, the satellite positioning signal may be a GPS signal, a GLONASS signal, a GALILEO signal, or a Beidou satellite signal.
Taking into account the inconsistency between the transaction area and the satellite positioning location, the transaction information of the first Internet transaction may also include transaction time and positioning time, and the absolute value of the difference between the transaction time and the positioning time is less than the expected value. Assuming a time difference, the transaction time is the time when the first Internet transaction is performed, and the positioning time is the time when the transaction terminal that performs the first Internet transaction receives a satellite positioning signal. By setting the absolute value of the difference between the transaction time and the positioning time to be less than the preset time difference, Internet transactions in which the transaction area and the satellite positioning location are inconsistent can be filtered out, and the processing of the transaction to be positioned is further improved. Accuracy of positioning. The preset time difference can be set according to actual experience, which is not limited in the embodiment of this specification.
S302: Obtain a unique area where the IP address of the transaction terminal that performs each first Internet transaction is distributed based on the satellite positioning signal received by the transaction terminal that performs each first Internet transaction.
After extracting the plurality of first Internet transactions, according to the principle of satellite positioning and the satellite positioning signals received by the transaction terminal that performs each first Internet transaction, the information for each first Internet transaction is obtained. In the transaction area, the transaction area for each first Internet transaction is taken as the only area where the IP address of the transaction terminal for each first Internet transaction is distributed.
S303: According to the unique area of the IP address distribution of the transaction terminal that performs each first Internet transaction, obtain each area of the IP address segment to be determined and the proportion of each area, and the IP address to be determined The address segment is an address segment corresponding to the first M bits of the IP address of the transaction terminal that performs each first Internet transaction.
The value of M can be set according to factors such as the administrative level of the area to be located, the accuracy of the positioning, and the coverage of the positioning. In the embodiment of this specification, locating the city-level city where the transaction is to be located is taken as an example. When the value of M is 24, the obtained positioning accuracy and coverage rate are relatively high. Of course, in other embodiments, if a higher-level administrative region such as the province where the transaction is to be located is located, the value of M may be smaller; if the county-level urban area, etc., where the transaction is to be located is located, it is lower For the administrative area of the level, the value of M can be larger.
After the value of M is determined, the first M bits of the IP address of the transaction terminal that performs each first Internet transaction are obtained, and the same first M bits correspond to an IP address segment to be determined. According to the unique area of the IP address distribution of the transaction terminal that performs each first Internet transaction, statistics are made for each area of the IP address segment to be determined and the proportion of each area.
Taking the value of M as 24 and extracting five first Internet transactions from the first preset historical time period as an example, if the IP addresses of the transaction terminals corresponding to the five first Internet transactions are respectively Are 223.85.221.198, 223.85.221.101, 223.85.221.20, 223.85.221.30, and 182.132.23.97. The only areas where the aforementioned five IP addresses are distributed are Chengdu, Chengdu, Chengdu, Mianyang, and Deyang. The to-be-judged IP address segment 223.85.221 and the to-be-judged IP address segment 182.132.23. The IP address segment 223.85.221 to be determined is distributed in Chengdu and Mianyang, and Chengdu accounts for 75% and Mianyang city accounts for 25%; the IP address segment to be determined 182.132.23 is distributed in Deyang City, and Deyang City accounts for 100%.
S304: Determine whether the highest proportion among the proportions of each area corresponding to the IP address segment to be judged is greater than a first preset percentage.
After obtaining the proportion of each area corresponding to the IP address segment to be determined, the highest proportion among the proportions of each area is compared with the first preset percentage. If a certain IP address segment to be judged has not changed after the initial allocation, it is ideally distributed in only one area, and its corresponding highest proportion is 100%. Taking into account the data collection error, the IP address of the transaction terminal performing the first Internet transaction may be a roaming IP address or a proxy IP address, etc., in the embodiment of this specification, the highest proportion is greater than the first Internet transaction. At a preset percentage, the IP address segment to be determined is determined as the stable IP address segment. The first preset percentage can be set according to actual conditions such as data collection error, roaming IP address, or proxy IP address, which is not limited in the embodiment of this specification.
If the highest percentage is greater than the first preset percentage, step S305 is executed to determine that the IP address segment to be determined is the stable IP address segment, and the area corresponding to the highest percentage is determined as The fixed area where the stable IP address segments are distributed.
Taking the first preset percentage of 70% as an example, the highest proportion of 75% corresponding to the IP address segment 223.85.221 to be determined is greater than the first preset percentage 70%, so the IP address to be determined The address segment 223.85.221 is the stable IP address segment, and the area corresponding to the highest proportion of 75%, Chengdu, is a fixed area where the stable IP address segment 223.85.221 is distributed; the IP address segment to be determined The highest percentage 100% corresponding to 182.132.23 is greater than the first preset percentage 70%, so the IP address segment to be determined 182.132.23 is the stable IP address segment, and the highest percentage 100% corresponds to Deyang City is a fixed area where the stable IP address segment 182.132.23 is distributed.
After determining the stable IP address segment, compare the IP address of the terminal to be located with each stable IP address segment to determine whether the IP address of the terminal to be located belongs to a stable IP address segment, That is, it is determined whether the first M bits of the IP address of the terminal to be located are the same as the stable IP address segment. Still taking the aforementioned stable IP address segment 223.85.221 and the stable IP address segment 182.132.23 as an example, if the IP address of the terminal to be located is 223.85.221.35, the IP of the terminal to be located The address 223.85.221.35 belongs to the stable IP address segment 223.85.221.
If the IP address of the terminal to be located belongs to the stable IP address segment, step S203 is executed to determine the fixed area where the stable IP address segment is distributed as the transaction area for the transaction to be located.
The stable IP address segment is distributed in the fixed area, indicating that all IP addresses included in the stable IP address segment are distributed in the fixed area. Therefore, if the IP address of the terminal to be located belongs to the stable IP address segment, the IP address of the terminal to be located is also distributed in the fixed area, that is, the fixed area is used for performing the to-be-positioned The trading area of the transaction.
In the embodiment of this specification, since the stable IP address segment is an IP address segment distributed in the fixed area determined according to the multiple first Internet transactions, the first Internet transaction is performed The transaction area is usually obtained based on satellite positioning signals, transaction store information, or base station information connected to the transaction terminal. When a certain IP address distribution area changes dynamically from the initial allocation, the dynamic change is through the satellite positioning signal , The transaction store information or the base station information connected to the transaction terminal can be reflected in the multiple first Internet transactions. Therefore, the IP address distribution determined according to the multiple first Internet transactions is relative to the initial The allocation is more accurate. It is more accurate to determine the fixed area of the stable IP address segment distribution as the transaction area for the transaction to be located, which improves the accuracy of locating the transaction to be located.
As mentioned earlier, the transaction information of Internet transactions includes, but is not limited to, the time of transaction, the amount of transaction, the information of the store where the transaction is performed, the IP address of the transaction terminal, the satellite positioning signal received by the transaction terminal, and the transaction terminal’s information Identity, information of the base station connected to the transaction terminal and WIFI information of the transaction terminal, etc., the information of the store where the transaction is conducted, the IP address of the transaction terminal, the satellite positioning signal received by the transaction terminal, and the transaction terminal The identification of, the base station information connected to the transaction terminal, and the WIFI information connected to the transaction terminal are all positioning information that can be located. Therefore, in addition to locating the transaction to be located based only on the IP address of the transaction terminal for the transaction to be located, it is also possible to combine the information of the store where the transaction is conducted, the satellite positioning signal received by the transaction terminal, and the location The identification of the transaction terminal, the base station information connected to the transaction terminal, and the WIFI information connected to the transaction terminal locate the transaction to be located. In an optional implementation manner, the Internet transaction location method provided in the embodiment of this specification further includes step S204 and step S205.
S204: According to the preset priority order of various types of positioning information, determine whether there is positioning information with a priority higher than the IP address of the terminal to be located in the transaction information of the transaction to be located.
The positioning information includes at least one of the store information for the transaction, the IP address of the transaction terminal, the satellite positioning signal received by the transaction terminal, the identity of the transaction terminal, the base station information connected to the transaction terminal, and the WIFI information connected to the transaction terminal . According to the accuracy of positioning using various types of positioning information, the priority order of the various types of positioning information is set. For example, if the accuracy of locating using the information of the transaction store is higher than the accuracy of using the IP address of the transaction terminal, the priority of the information of the transaction store is set higher than the IP address of the transaction terminal; If the accuracy of locating by using the information of the transaction store and the base station information connected to the transaction terminal is higher than the accuracy of locating using the information of the store where the transaction is performed, then combining the information of the transaction store with the information of the base station connected to the transaction terminal The priority is set higher than the store information where the transaction is made.
If there is no positioning information with a higher priority than the IP address of the terminal to be positioned in the transaction information of the transaction to be positioned, step S201 is executed to extract the terminal to be positioned from the transaction information of the transaction to be positioned Otherwise, perform step S205 to extract the positioning information with the highest priority from the transaction information of the transaction to be located, and determine the transaction area for the transaction to be located according to the positioning information with the highest priority.
To locate the transaction to be located according to the IP address of the transaction terminal of the transaction to be located, refer to the aforementioned steps S201 to S203, and determine the transaction area for performing the transaction to be located according to the positioning information with the highest priority. Depending on the positioning information with the highest priority. For example, if the location information with the highest priority is the store information for the transaction, the location of the store where the transaction to be located is performed is determined as the transaction area for the transaction to be located; if the location information with the highest priority is If the positioning information is the base station information connected to the transaction terminal, the location of the base station connected to the transaction terminal performing the transaction to be positioned is determined as the transaction area for the transaction to be positioned; if the positioning information with the highest priority Is the WIFI information connected to the transaction terminal, and the WIFI location connected to the transaction terminal performing the transaction to be located is determined as the transaction area for performing the transaction to be located.
In the foregoing embodiment of this specification, the IP address of the terminal to be located may not belong to any stable IP address segment. In view of this situation, the embodiment of this specification combines the last transaction area of the terminal to be located to locate the transaction to be located. In an optional implementation manner, the Internet transaction location method provided in the embodiment of this specification further includes step S206 to step S208.
If the IP address of the terminal to be located does not belong to the stable IP address segment, step S206 is executed to determine whether the IP address of the terminal to be located belongs to an unstable IP address segment. The IP address segment is an IP address segment that is distributed in two or more regions determined based on the multiple first Internet transactions, and the unstable IP address segment is the multiple first Internet transactions The address segment corresponding to the first M bits of the IP address of the transaction terminal involved.
For the specific determination method of the unstable IP address segment, refer to FIG. 3. If the highest proportion is not greater than the first preset percentage, step S306 is executed to determine that the IP address segment to be determined is the non-determined IP address segment. Stabilize the IP address segment, and determine the area satisfying a preset condition among the areas where the IP address segment to be determined is distributed as two or more areas where the unstable IP address segment is distributed.
The preset condition includes that the proportion is higher than a second preset percentage and/or the area corresponding to the highest proportion belongs to the same superior administrative area, and the second preset percentage is less than the first preset percentage. Taking the first preset percentage of 90% as an example, the highest proportion of 75% corresponding to the IP address segment 223.85.221 to be determined is less than the first preset percentage 90%, so the IP address to be determined The address segment 223.85.221 is the unstable IP address segment. If the preset condition includes that the proportion is higher than the second preset percentage and the area corresponding to the highest proportion belongs to the same superior administrative area, the second preset percentage is 20%, because the proportion of Chengdu is Is 75% and Mianyang’s share is 25%, both higher than the second preset percentage, and Chengdu and Mianyang belong to Sichuan Province, so Chengdu and Mianyang are determined as the unstable IP addresses Segment 223.85.221 distribution area.
After determining the unstable IP address segment, compare the IP address of the terminal to be located with each unstable IP address segment to determine whether the IP address of the terminal to be located belongs to an unstable IP address The address segment is to determine whether the first M bits of the IP address of the terminal to be located are the same as the unstable IP address segment. Still taking the aforementioned unstable IP address segment 223.85.221 as an example, if the IP address of the terminal to be located is 223.85.221.35, then the IP address of the terminal to be located 223.85.221.35 belongs to the unstable IP address. Address section 223.85.221.
If the IP address of the terminal to be located belongs to the one unstable IP address segment, step S207 is executed to determine whether two or more areas where the unstable IP address segment is distributed include the last of the terminal to be located Trading area.
Fig. 4 is a flowchart of obtaining the last transaction area of the terminal to be located according to an embodiment of the present specification. The obtaining of the last transaction area of the terminal to be located includes steps S401 to S404.
S401. Extract a plurality of second Internet transactions from all Internet transactions in a second preset historical time period, where the second preset historical time period is from the second preset historical time to the execution of the pending The historical time period corresponding to the time of the bit transaction, the transaction information of the second Internet transaction includes the identity of the transaction terminal that performs the second Internet transaction, and the transaction terminal that performs the second Internet transaction The received satellite positioning signal and the time when the second Internet transaction was performed.
The second preset historical time is any time before the time when the transaction to be located is performed, and the length of the second preset historical time period can be set according to actual needs, as long as it is ensured that a sufficient number of the The second Internet transaction. Similar to the selection of the first Internet transaction, the second Internet transaction may also be transaction information including transaction store information, satellite positioning signals received by the transaction terminal, base station information connected to the transaction terminal, or transaction terminal Internet transactions such as connected WIFI information can be accurately positioned and location information. Considering that the satellite positioning signal is the richest among all the transaction information of Internet transactions, the transaction information of the second Internet transaction extracted in the embodiment of this specification includes the identity of the transaction terminal that performs the second Internet transaction. , The satellite positioning signal received by the transaction terminal that performs the second Internet transaction and the time when the second Internet transaction is performed.
S402. According to the identity of the transaction terminal that performs each second Internet transaction, the time for each second Internet transaction, and the satellite received by the transaction terminal that performs each second Internet transaction The positioning signal determines the final transaction area of the transaction terminal corresponding to each identity.
After extracting the multiple second Internet transactions, according to the principle of satellite positioning and the satellite positioning signals received by the transaction terminal that conducts each second Internet transaction, obtain the information for each second Internet transaction. In the transaction area, the transaction area in which each second Internet transaction is performed is the only area where the IP address of the transaction terminal for each second Internet transaction is distributed. Combining the identity of the transaction terminal that performed each second Internet transaction and the time for each second Internet transaction to obtain each transaction terminal involved in the multiple second Internet transactions The last transaction area of, that is, the last transaction area corresponding to each identity identifier involved in the multiple second Internet transactions.
S403: Extract the identity of the terminal to be located from the transaction information of the transaction to be located.
The identity of the terminal to be located is a credential that can prove the identity of the terminal to be located. Taking the terminal to be located as a smartphone as an example, the identity of the terminal to be located may be the serial number of the smartphone. The identification of the terminal to be located may be extracted when the IP address of the terminal to be located is extracted, or after the IP address of the terminal to be located is extracted, which is not limited in the embodiment of this specification. .
S404: Determine the last transaction area of the terminal to be located according to the identity of the terminal to be located and the last transaction area of the transaction terminal corresponding to each identity.
The identity of the terminal to be located is compared with all the identities involved in the multiple second Internet transactions, and the pending identity is found among all the identities involved in the multiple second Internet transactions The identity of the terminal is located, so as to obtain the final transaction area of the terminal to be located.
Taking the IP address 223.85.221.35 of the terminal to be located belongs to the unstable IP address segment 223.85.221 as an example, it is determined whether the area distributed by the unstable IP address segment 223.85.221 includes the to be located The last transaction area of the terminal, that is, the last transaction area of the terminal to be located is compared with the area where the unstable IP address segment 223.85.221 is distributed.
If the two or more areas where the unstable IP address segment is distributed include the last transaction area of the terminal to be located, step S208 is executed to determine the last transaction area of the terminal to be located as the transaction area for the transaction to be located. Trading area.
Taking the IP address 223.85.221.35 of the terminal to be located belongs to the unstable IP address segment 223.85.221 as an example, if the last transaction area of the terminal to be located is Chengdu, the unstable IP address Segment 223.85.221 is distributed in Chengdu City and Mianyang City, including Chengdu City, the last transaction area of the terminal to be located. Therefore, Chengdu City, the last transaction area of the terminal to be located, is determined as the transaction for the transaction to be located. area.
Steps S206 to S208 of the embodiment of this specification are to determine the last transaction area of the terminal to be located according to the identity of the terminal to be located, and the two or more areas where the unstable IP address segment is distributed include the pending When positioning the last transaction area of the terminal, the last transaction area of the terminal to be located is determined as the transaction area for the transaction to be located, supplementing the situation that the stable IP address segment cannot be located, greatly improving the The accuracy and coverage of the positioning of the transaction to be located.
In an optional implementation manner, the Internet transaction location method provided in the embodiment of this specification further includes step S209.
If the two or more areas where the unstable IP address segments are distributed do not include the last transaction area of the terminal to be located, step S209 is executed to account for the two or more areas where the unstable IP address segments are distributed The highest area is determined as the transaction area for the transaction to be located.
Taking the IP address 223.85.221.35 of the terminal to be located belongs to the unstable IP address segment 223.85.221 as an example, if the last transaction area of the terminal to be located is Nanchong, the unstable IP address Segment 223.85.221 is distributed in Chengdu City and Mianyang City, excluding Nanchong City, the final transaction area of the terminal to be located, so Chengdu and Mianyang City, where the unstable IP address segment 223.85.221 is distributed, are accounted for Chengdu city with the highest ratio is determined as the transaction area for the transaction to be located.
In the second aspect, based on the same inventive concept, embodiments of this specification provide an Internet transaction positioning device, including:
The location information extraction module is used to extract the IP address of the terminal to be located from the transaction information of the transaction to be located, the terminal to be located is the transaction terminal that performs the transaction to be located;
The first judging module is used to judge whether the IP address of the terminal to be located belongs to a stable IP address segment, and the stable IP address segment is based on a plurality of first Internet transactions within a first preset historical time period. An IP address segment that is distributed in a fixed area determined by an Internet transaction, and the stable IP address segment is an address segment corresponding to the first M bits of the IP address of the transaction terminal involved in the multiple first Internet transactions , M is a positive integer;
The first determining module is configured to determine the fixed area where the stable IP address segment is distributed as the transaction to be located when the IP address of the terminal to be located belongs to the one stable IP address segment Trading area.
In an optional implementation manner, the Internet transaction positioning device further includes:
The second judgment module is used for judging whether there is positioning information with a priority higher than the IP address of the terminal to be located in the transaction information of the transaction to be located according to the pre-set priority order of various positioning information;
The location information extraction module is used for extracting the transaction information of the transaction to be located when there is no location information with a priority higher than the IP address of the terminal to be located in the transaction information of the transaction to be located The IP address of the terminal to be located; otherwise, the positioning information with the highest priority is extracted from the transaction information of the transaction to be located, and the transaction area for the transaction to be located is determined according to the positioning information with the highest priority.
In an optional implementation manner, the Internet transaction positioning device further includes:
The first transaction extraction module is configured to extract the Dobby first Internet transaction from all Internet transactions in the first preset historical time period, and the transaction information of the first Internet transaction Including the IP address of the transaction terminal performing the first Internet transaction and the satellite positioning signal received by the transaction terminal performing the first Internet transaction;
The address distribution obtaining module is used to obtain the unique IP address distribution of the transaction terminal for each first Internet transaction according to the satellite positioning signal received by the transaction terminal for each first Internet transaction area;
The address segment distribution obtaining module is used to obtain each area and each area of the IP address segment to be determined according to the unique area of the IP address distribution of the transaction terminal that performs each first Internet transaction In proportion, the IP address segment to be determined is the address segment corresponding to the first M bits of the IP address of the transaction terminal that performs each first Internet transaction;
The third judging module is used to judge whether the highest proportion among the proportions of each area corresponding to the IP address segment to be judged is greater than a first preset percentage;
The second determining module is configured to determine that the IP address segment to be determined is the stable IP address segment when the highest percentage is greater than the first preset percentage, and correspond to the highest percentage The area of is determined as a fixed area where the stable IP address segment is distributed.
In an optional implementation manner, the Internet transaction positioning device further includes:
The fourth determining module is used to determine whether the IP address of the terminal to be located belongs to an unstable IP address segment when the IP address of the terminal to be located does not belong to the stable IP address segment, The unstable IP address segment is an IP address segment distributed in two or more areas determined according to the multiple first Internet transactions, and the unstable IP address segment is the first multiple The address segment corresponding to the first M bits of the IP address of the transaction terminal involved in Internet transactions;
The fifth judgment module is used for judging whether two or more regions where the unstable IP address segment is distributed include the pending IP address when the IP address of the terminal to be located belongs to the one unstable IP address segment The last trading area of the bit terminal;
The third determining module is configured to determine the last transaction area of the terminal to be located as the last transaction area of the terminal to be located when the two or more areas where the unstable IP address segment is distributed include the last transaction area of the terminal to be located. The transaction area of the transaction to be located.
In an optional implementation manner, the Internet transaction positioning device further includes:
The fourth determining module is configured to determine that the IP address segment to be determined is the unstable IP address segment when the highest proportion is not greater than the first preset percentage, and to determine the IP address segment to be determined Among the areas where the IP address segments are distributed, areas that meet the preset conditions are determined to be more than two areas where the unstable IP address segments are distributed.
In an optional implementation manner, the positioning information extraction module is further configured to extract the identity of the terminal to be located from the transaction information of the transaction to be located, and the Internet transaction positioning device further includes:
The second transaction extraction module is used to extract multiple second Internet transactions from all Internet transactions in the second preset historical time period, where the second preset historical time period is from the second preset From the historical time to the historical time period corresponding to the time when the transaction to be located is performed, the transaction information of the second Internet transaction includes the identity of the transaction terminal performing the second Internet transaction, and the second Internet transaction is performed. The satellite positioning signal received by the transaction terminal of the Internet transaction and the time when the second Internet transaction is performed;
The fifth determining module is used to perform each second Internet transaction based on the identity of the transaction terminal that performs each second Internet transaction, the time for each second Internet transaction to be performed, and to perform each second Internet transaction The satellite positioning signal received by the transaction terminal of the transaction terminal determines the last transaction area of the transaction terminal corresponding to each identity;
The sixth determining module is configured to determine the last transaction area of the terminal to be located according to the identity of the terminal to be located and the last transaction area of the transaction terminal corresponding to each identity.
In an optional implementation manner, the Internet transaction positioning device further includes:
The seventh determining module is configured to distribute more than two unstable IP address segments when the two or more areas where the unstable IP address segments are distributed do not include the last transaction area of the terminal to be located The area with the highest proportion in the area is determined as the transaction area for the transaction to be located.
In the third aspect, based on the same inventive concept as the Internet transaction positioning method in the foregoing embodiment, the present invention also provides a server, as shown in FIG. 5, including a memory 504, a processor 502, and storage on the memory 504 A computer program that can be run on the processor 502, and the processor 502 implements the steps of the aforementioned Internet transaction location method when the processor 502 executes the program.
Wherein, in FIG. 5, the bus bar architecture (represented by bus bar 500), the bus bar 500 may include any number of interconnected bus bars and bridges, and the bus bar 500 will include one or more processes represented by the processor 502 The memory and various circuits of the memory represented by the memory 504 are linked together. The bus bar 500 can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are all known in the art, and therefore, will not be further described herein. The bus interface 505 provides an interface between the bus 500 and the receiver 501 and the transmitter 503. The receiver 501 and the transmitter 503 may be the same element, that is, a transceiver, which provides a unit for communicating with various other devices on the transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 can be used to store data used by the processor 502 when performing operations.
In the fourth aspect, based on the inventive concept of Internet transaction positioning in the foregoing embodiment, the present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the Internet The steps of road transaction positioning.
This specification is described with reference to flowcharts and/or block diagrams of methods, equipment (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment can be generated. It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product that includes the instruction device, The instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. Instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
Although the preferred embodiments of this specification have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the scope of the attached patent application is intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of this specification.
Obviously, those skilled in the art can make various changes and modifications to this specification without departing from the spirit and scope of the specification. In this way, if these modifications and variations of this specification fall within the scope of the patent application for this specification and its equivalent technology, this specification is also intended to include these modifications and variations.