為了使本技術領域的人員更好地理解本說明書一個或多個中的技術方案,下面將結合本說明書一個或多個實施例中的附圖,對本說明書一個或多個實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅僅是本說明書一個或多個一部分實施例,而不是全部的實施例。基於本說明書一個或多個中的實施例,本領域普通技術人員在沒有作出進步性勞動前提下所獲得的所有其他實施例,都應當屬本說明書一個或多個保護的範圍。
本說明書一個或多個實施例提供了一種圖形碼掃描方法、掃碼支付方法及掃碼設備,在利用掃碼設備掃描圖形碼時,自動確定該掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,基於該相對掃描角度控制影像採集模組進行旋轉,達到將該相對掃描角度縮小到預設範圍內,再利用旋轉後的影像採集模組對待識別圖形碼進行掃描,這樣能夠提高影像採集模組獲取到的圖形碼成像的可識別度,進而提高圖形碼掃描的效率和成功率。
圖1為本說明書一個或多個實施例提供的圖形碼掃描方法的第一種流程示意圖,圖1中的方法應用於掃碼設備執行,如圖1所示,該方法至少包括以下步驟:
S101,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,其中,該相對掃描角度為影像採集模組的掃描方向與待識別圖形碼的垂線方向的夾角;
具體的,待識別圖形碼可以是條碼、二維條碼或其他圖形碼,影像採集模組可以是可旋轉的攝影鏡頭,在使用掃碼設備對圖形碼進行掃描時,由掃碼設備中控制模組自動確定影像採集模組的相對掃描角度。
S102,根據確定出的相對掃描角度,旋轉影像採集模組,以使旋轉後的影像採集模組的相對掃描角度小於預設臨限值;
具體的,在確定出相對掃描角度後,由控制模組判斷該相對掃描角度是否大於預設臨限值,若判斷結果為是,則說明掃碼設備與待識別圖形碼之間形成的角度偏差比較大,可能導致多次掃碼失敗、支付耗時比較長,因此,需要透過旋轉影像採集模組來調節影像採集模組的掃描方向,從而減小相對掃描角度,將該相對掃描角度縮小到預設範圍內,使得掃碼設備以近似垂直角度掃描待識別圖形碼;
S103,利用旋轉後的影像採集模組,對待識別圖形碼進行掃描,具體的,透過旋轉影像採集模組使得影像採集模組的基準面(即影像採集平面)與待識別圖形碼所在平面近似平行後,由影像採集模組對待識別圖形碼進行掃描,並得到相應的掃描結果,將該掃描結果傳輸至掃碼設備中通信模組,由通信模組將該掃描結果傳輸至對應的終端設備,以觸發該終端設備進行相應的處理操作;
在一個具體實施例中,以掃碼支付的應用場景為例,終端設備在接收到掃碼設備傳輸的掃描結果後,根據該掃描結果執行支付處理操作,進而完成本次掃碼支付,這樣能夠縮短掃碼支付時間。
本說明書一個或多個實施例中,在利用掃碼設備掃描圖形碼時,自動確定該掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,基於該相對掃描角度控制影像採集模組進行旋轉,達到將該相對掃描角度縮小到預設範圍內,再利用旋轉後的影像採集模組對待識別圖形碼進行掃描,這樣能夠提高影像採集模組獲取到的圖形碼成像的可識別度,進而提高圖形碼掃描的效率和成功率。
進一步的,針對確定相對掃描角度的過程,結合三點確定一個平面的原理,可以透過在掃碼設備中設置至少三個發光光源,基於發光光源照射到待識別圖形碼上的至少三個光斑,來確定待識別圖形碼所在平面,進而確定相對掃描角度,基於此,如圖2所示,上述S101確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,具體包括:
S1011,確定照射到待識別圖形碼的至少三個光斑的座標資訊;
具體的,掃碼設備中設置的至少三個發光光源分別向待識別圖形碼發射預設方向的光束,得到照射到待識別圖形碼的至少三個光斑,針對每個發光光源而言,該發光光源發射的光束的方向保持不變,在具體實施時,為了提高確定出的圖形碼所在平面的準確度,各發光光源的預設方向各不相同,這樣能夠增加至少三個光斑的分佈離散度,進而適當增大至少三個光斑所構成的平面圖形的實際面積;
以發光光源的數量等於3為例,每個發光光源的發射光束落到圖形碼上將形成一個光斑,這樣在圖形碼上形成三個光斑,可以預先以掃碼設備中的影像採集模組為參考物件建立三維座標系,確定影像採集模組的基準面,且影像採集模組的掃描方向垂直於該基準面,對應的,三個光斑的座標分別為、、;
S1012,根據確定出的至少三個光斑的座標資訊,確定待識別圖形碼所在的目標平面;
具體的,在確定出照射到圖形碼上的至少三個光斑的座標資訊後,結合三點確定一個平面的原理,根據至少三個光斑的座標資訊,確定圖形碼所在的目標平面的函數表達式,仍以發光光源的數量等於3為例,根據三個光斑的座標、、,得到圖形碼所在的目標平面的函數表達式;
S1013,基於確定出的目標平面,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度;
具體的,在確定出圖形碼所在的目標平面的函數表達式後,確定該目標平面的參考垂線,即確定垂直於圖形碼所在平面的任一垂線,並且確定該參考垂線與目標平面的交點到影像採集模組的基準面的垂線,記為參考線段,將該參考垂線與該參考線段之間的夾角θ
確定為掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,其中,當時夾角θ
=0時,參考垂線與參考線段相平行,此時影像採集模組的基準面與圖形碼所在平面平行。
其中,針對至少三個光斑的座標資訊的確定過程,如圖3所示,上述S1011確定照射到待識別圖形碼的至少三個光斑的座標資訊,具體包括:
S10111,確定照射到待識別圖形碼的至少三個光斑的發光光源的發射角度;
具體的,在組裝得到掃碼設備時,記錄掃碼設備中設置的至少三個發光光源的發光光束的發射角度,並將各發光光源對應的發射角度存入控制模組,在預設參考座標系下,三個發光光源的發射角度分別為θ 1
、θ 2
、θ 3
;
S10112,確定至少三個光斑分別距影像採集模組的線段長度;
具體的,由於雷射具有很好方向性,並且需要獲取發光點到圖形碼之間的距離,因此,掃碼設備中設置的至少三個發光光源可以是雷射測距儀,透過該雷射測距儀可以得到自身發出的雷射發光點到圖形碼之間的距離,進而能夠得到影像採集模組到各發光光源落到圖形碼上的光斑的距離,發光光源將得到的各發光光源對應的距離資料傳輸至控制模組,控制模組即可獲取到至少三個光斑分別距影像採集模組的線段長度,仍以發光光源的數量等於3為例,三個發光光源的光斑對應的線段長度分別為l 1
、l 2
、l 3
;
S10113,根據確定出的各發光光源對應的發射角度和線段長度,確定至少三個光斑的座標資訊;
具體的,結合極座標系與三維座標系之間的轉換關係式,根據各發光光源對應的發射角度和線段長度,即可得到各發光光源對應的光斑的座標資訊,仍以發光光源的數量等於3為例,根據極座標系下的點(θ 1
,l 1
),確定第一光斑在三維座標系下的座標,根據極座標系下的點(θ 2
,l 2
),確定第二光斑在三維座標系下的座標,以及根據極座標系下的點(θ 3
,l 3
),確定第三光斑在三維座標系下的座標。
其中,針對基於目標平面確定相對掃描角度的過程,如圖4所示,上述S1013基於確定出的目標平面,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,具體包括:
S10131,確定目標平面的參考垂線的函數關係式;
具體的,在確定出圖形碼所在的目標平面的函數表達式後,確定該目標平面的參考垂線,並且根據目標平面的函數表達式,可以確定在同一三維座標系下的參考垂線的函數關係式;
S10132,確定參考垂線與目標平面的平面垂線交點的座標資訊;
具體的,在確定出參考垂線的函數關係式後,即可得到該參考垂線與目標平面的交點的座標資訊,即平面垂線交點O的座標為;
S10133,根據確定出的參考垂線的函數關係式和平面垂線交點的座標資訊,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度;
具體的,結合兩點之間線段長度的求解公式,由平面垂線交點O向影像採集模組的基準面做垂線段,該垂線段與基準面的交點為P,並計算基準面上的垂點P到平面垂線交點O之間形成的參考線段的長度為a
;以及,
結合點到直線的距離的求解公式,由影像採集模組的基準面上的垂點P向參考垂線做垂線段,該垂線段與參考垂線的交點為M,即由P點向參考垂線做垂線段,並求得該垂線段的長度為c
;
在確定出參考線段的長度a
和P點到參考垂線的垂線段的長度c
後,結合勾股定理,即可求得該參考垂線與該參考線段之間的夾角θ
,即,因此,可以確定出掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度;
其中,參考線段垂直於影像採集模組的基準面,參考垂線垂直於圖形碼所在平面(即目標平面),當時夾角θ
=0時,參考垂線與參考線段重合,此時影像採集模組的基準面與圖形碼所在平面平行。
具體的,針對參考垂線的函數關係式的確定過程,上述S10131確定目標平面的參考垂線的函數關係式,具體包括:
步驟一,在圖形碼所在的目標平面上,確定至少三個光斑所構成的平面圖形,其中,當發光光源的數量等於3時,所構成的平面圖形為三邊形,當發光光源的數量等於4時,所構成的平面圖形為四邊形,依次類推,仍以發光光源的數量等於3為例,若三個光斑分別為點S1、點S2、點S3,則三個光斑構成的平面圖形為S1、S2、S3三個座標點圍成的三邊形;
步驟二,將所構成的平面圖形的中垂線作為目標平面的參考垂線,並確定參考垂線的函數關係式;其中,較佳的,選取平面圖形的中垂線確定參考垂線,即該參考垂線為包含平面圖形的中心點且垂直於平面圖形的直線,對應的,參考垂線與目標平面的交點為平面圖形的中心點,即上述平面垂線交點O為平面圖形的中心點;
其中,選取出目標平面的參考垂線後,根據目標平面的函數表達式,可以確定在同一三維座標系下的參考垂線的函數關係式。
具體的,針對基於參考垂線的函數關係式和平面垂線交點確定相對掃描角度的過程,上述S10133根據確定出的參考垂線的函數關係式和平面垂線交點的座標資訊,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,具體包括:
步驟一,根據確定出的參考垂線的函數關係式,確定影像採集模組距參考垂線的第一線段長度,具體的,確定影像採集模組的基準面上的垂點距參考垂線的第一線段長度;
步驟二,根據確定出的平面垂線交點的座標資訊,確定影像採集模組距平面垂線交點的第二線段長度,具體的,確定影像採集模組的基準面上的垂點距平面垂線交點的第二線段長度;
步驟三,根據確定出的第一線段長度和第二線段長度,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度。
在具體實施時,如圖5所示,座標點P表示影像採集模組的基準面上的垂點的座標,即為,座標點O表示平面垂線交點的座標,即為,座標點M表示由座標點P向參考垂線做垂線段的交點的座標,即為,第一線段長度為座標點P到座標點M的距離,即線段PM的長度為c
,第二線段長度為座標點P到座標點O的距離,即線段PO的長度為a
,對應的,線段OP與線段OM之間的角度θ
為掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度。
具體的,如圖6a所示,給出了對影像採集模組進行旋轉之前,掃碼槍掃碼圖形碼時的側視圖,在圖6a中影像採集模組的掃描方向與待識別圖形碼的垂線方向(即平面法線方向)的夾角為θ
,以發光光源的數量等於3為例,掃碼設備中包含影像採集模組,掃碼設備中還設置有三個發光光源,其中,該三個發光光源的發光光束的發射角度各不相同,每個發光光源發射出的發光光束將落到圖形碼上的一個光斑,根據照射到圖形碼上的三個光斑即可確定圖形碼所在平面資訊,進而結合上述確定參考垂線與參考線段之間的夾角的過程,確定影像採集模組掃描待識別圖形碼的相對掃描角度。
如圖6b所示,給出了對影像採集模組進行旋轉之後,掃碼槍掃碼圖形碼時的側視圖,在確定出影像採集模組掃描待識別圖形碼的相對掃描角度後,由掃碼設備中的控制模組控制驅動模組對影像採集模組旋轉角度θ
,在圖6b中影像採集模組的掃描方向與待識別圖形碼的垂線方向(即平面法線方向)的夾角θ
=0,使得影像採集模組的基準面與待識別圖形碼所在平面平行。
本說明書一個或多個實施例中的圖形碼掃描方法,在利用掃碼設備掃描圖形碼時,自動確定該掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,基於該相對掃描角度控制影像採集模組進行旋轉,達到將該相對掃描角度縮小到預設範圍內,再利用旋轉後的影像採集模組對待識別圖形碼進行掃描,這樣能夠提高影像採集模組獲取到的圖形碼成像的可識別度,進而提高圖形碼掃描的效率和成功率。
對應上述圖1至圖4描述的圖形碼掃描方法,基於相同的技術構思,本說明書一個或多個實施例還提供了一種掃碼支付方法,圖7為本說明書一個或多個實施例提供的掃描支付方法的流程示意圖,圖7中的方法應用於掃碼設備,如圖7所示,該方法至少包括以下步驟:
S701,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,其中,該相對掃描角度為影像採集模組的掃描方向與待識別圖形碼的垂線方向的夾角,其中,步驟S701的具體實施方式參見步驟S101,這裡不再贅述;
S702,根據確定出的相對掃描角度,旋轉影像採集模組,以使旋轉後的影像採集模組的相對掃描角度小於預設臨限值,其中,步驟S702的具體實施方式參見步驟S102,這裡不再贅述;
S703,利用旋轉後的影像採集模組,對待識別圖形碼進行掃描,其中,步驟S703的具體實施方式參見步驟S103,這裡不再贅述;
S704,根據對待識別圖形碼進行掃描得到的掃描結果,觸發與掃碼設備連接的終端設備執行支付處理操作;
具體的,透過旋轉影像採集模組使得影像採集模組的基準面與待識別圖形碼所在平面近似平行後,由影像採集模組對待識別圖形碼進行掃描,並得到相應的掃描結果,將該掃描結果傳輸至掃碼設備中通信模組,由通信模組將該掃描結果傳輸至對應的終端設備,以觸發該終端設備進行相應的處理操作;在一個具體實施例中,以掃碼支付的應用場景為例,終端設備在接收到掃碼設備傳輸的掃描結果後,根據該掃描結果執行支付處理操作,進而完成本次掃碼支付,這樣能夠縮短掃碼支付時間。
其中,針對確定相對掃描角度的過程,結合三點確定一個平面的原理,可以透過在掃碼設備中設置至少三個發光光源,基於發光光源照射到待識別圖形碼上的至少三個光斑,來確定待識別圖形碼所在平面,進而確定相對掃描角度,基於此,上述S701確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,具體包括:
確定照射到待識別圖形碼的至少三個光斑的座標資訊;
根據確定出的至少三個光斑的座標資訊,確定待識別圖形碼所在的目標平面;
基於確定出的目標平面,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度。
其中,針對至少三個光斑的座標資訊的確定過程,上述確定照射到待識別圖形碼的至少三個光斑的座標資訊,具體包括:
確定照射到待識別圖形碼的至少三個光斑的發光光源的發射角度;以及,
確定至少三個光斑分別距影像採集模組的線段長度;
根據確定出的各發光光源對應的發射角度和線段長度,確定至少三個光斑的座標資訊。
其中,針對基於目標平面確定相對掃描角度的過程,上述基於目標平面,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,具體包括:
確定目標平面的參考垂線的函數關係式;以及,
確定參考垂線與目標平面的平面垂線交點的座標資訊;
根據確定出的參考垂線的函數關係式和平面垂線交點的座標資訊,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度。
其中,針對參考垂線的函數關係式的確定過程,上述確定目標平面的參考垂線的函數關係式,具體包括:
在圖形碼所在的目標平面上,確定至少三個光斑所構成的平面圖形;
將所構成的平面圖形的中垂線作為目標平面的參考垂線,並確定參考垂線的函數關係式。
其中,針對基於參考垂線的函數關係式和平面垂線交點確定相對掃描角度的過程,上述根據確定出的參考垂線的函數關係式和平面垂線交點的座標資訊,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,具體包括:
根據確定出的參考垂線的函數關係式,確定影像採集模組距參考垂線的第一線段長度;
根據確定出的平面垂線交點的座標資訊,確定影像採集模組距平面垂線交點的第二線段長度;
根據確定出的第一線段長度和第二線段長度,確定掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度。
本說明書一個或多個實施例中的圖形碼掃描方法,在利用掃碼設備掃描圖形碼時,自動確定該掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,基於該相對掃描角度控制影像採集模組進行旋轉,達到將該相對掃描角度縮小到預設範圍內,再利用旋轉後的影像採集模組對待識別圖形碼進行掃描,這樣能夠提高影像採集模組獲取到的圖形碼成像的可識別度,進而提高圖形碼掃描的效率和成功率,同時,根據對待識別圖形碼進行掃描得到的掃描結果,觸發相應的終端設備執行支付處理操作,進而完成本次掃碼支付,這樣能夠縮短掃碼支付時間。
需要說明的是,本說明書中該實施例與本說明書中上一實施例基於同一發明構思,因此該實施例的具體實施可以參見前述圖形碼掃描方法的實施,重複之處不再贅述。
對應上述圖1至圖4描述的圖形碼掃描方法,基於相同的技術構思,本說明書一個或多個實施例還提供了一種掃碼設備,圖8為本說明書一個或多個實施例提供的掃碼設備的第一種模組組成示意圖,該裝置用於執行圖1至圖4描述的圖形碼掃描方法,如圖8所示,該設備包括:控制模組801和與該控制模組801連接的影像採集模組802;
上述控制模組801,用於確定影像採集模組802掃描待識別圖形碼的相對掃描角度,其中,該相對掃描角度為影像採集模組802的掃描方向與待識別圖形碼的垂線方向的夾角;以及根據確定出的相對掃描角度,旋轉上述影像採集模組802,以使旋轉後的影像採集模組802的相對掃描角度小於預設臨限值;
上述影像採集模組802,用於對上述待識別圖形碼進行掃描。
本說明書一個或多個實施例中,在利用掃碼設備掃描圖形碼時,自動確定該掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,基於該相對掃描角度控制影像採集模組進行旋轉,達到將該相對掃描角度縮小到預設範圍內,再利用旋轉後的影像採集模組對待識別圖形碼進行掃描,這樣能夠提高影像採集模組獲取到的圖形碼成像的可識別度,進而提高圖形碼掃描的效率和成功率。
進一步的,如圖9所示,上述掃碼設備還包括:至少三個發光光源803;
上述發光光源803,用於向待識別圖形碼發射預設方向的光束,得到照射到待識別圖形碼的光斑,其中,各發光光源803的預設方向各不相同;
上述控制模組801,具體用於確定照射到待識別圖形碼的至少三個光斑的座標資訊;根據該至少三個光斑的座標資訊,確定待識別圖形碼所在的目標平面;以及基於確定出的目標平面,確定掃碼設備中影像採集模組802掃描待識別圖形碼的相對掃描角度。
其中,上述控制模組801,進一步具體用於:
確定至少三個發光光源803各自的預設方向對應的發射角度;以及,
確定照射到待識別圖形碼的至少三個光斑分別距上述影像採集模組802的線段長度;
根據確定出的各發光光源對應的發射角度和線段長度,確定至少三個光斑的座標資訊。
其中,上述控制模組801,還進一步具體用於:
確定上述目標平面的參考垂線的函數關係式;以及,
確定上述參考垂線與目標平面的平面垂線交點的座標資訊;
根據確定出的參考垂線的函數關係式和平面垂線交點的座標資訊,確定掃碼設備中影像採集模組802掃描待識別圖形碼的相對掃描角度。
本說明書一個或多個實施例中的圖形碼掃描裝置,在利用掃碼設備掃描圖形碼時,自動確定該掃碼設備中影像採集模組掃描待識別圖形碼的相對掃描角度,基於該相對掃描角度控制影像採集模組進行旋轉,達到將該相對掃描角度縮小到預設範圍內,再利用旋轉後的影像採集模組對待識別圖形碼進行掃描,這樣能夠提高影像採集模組獲取到的圖形碼成像的可識別度,進而提高圖形碼掃描的效率和成功率。
本領域內的技術人員應明白,本說明書一個或多個的實施例可提供為方法、系統、或電腦程式產品。因此,本說明書一個或多個可採用完全硬體實施例、完全軟體實施例、或結合軟體和硬體態樣的實施例的形式。
本說明書一個或多個是參照根據本說明書一個或多個實施例的方法、設備(系統)的流程圖和/或方塊圖來描述的。還需要說明的是,用語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個……”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。
本領域技術人員應明白,本說明書一個或多個的實施例可提供為方法、系統或電腦程式產品。因此,本說明書一個或多個可採用完全硬體實施例、完全軟體實施例或結合軟體和硬體態樣的實施例的形式。而且,本說明書一個或多個可採用在一個或多個其中包含有電腦可用程式代碼的電腦可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的電腦程式產品的形式。
本說明書中的各個實施例均採用循序的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於系統實施例而言,由於其基本相似於方法實施例,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。
以上所述僅為本說明書一個或多個的實施例而已,並不用於限制本說明書一個或多個。對於本領域技術人員來說,本說明書一個或多個可以有各種更改和變化。凡在本說明書一個或多個的精神和原理之內所作的任何修改、等同替換、改進等,均應包含在本說明書一個或多個的申請專利範圍之內。In order to enable those skilled in the art to better understand one or more of the technical solutions in this specification, the following will combine the drawings in one or more embodiments of this specification to compare the technical solutions in one or more embodiments of this specification. For a clear and complete description, it is obvious that the described embodiments are only a part of one or more embodiments in this specification, rather than all the embodiments. Based on one or more embodiments in this specification, all other embodiments obtained by a person of ordinary skill in the art without making progressive work shall fall within the scope of one or more protections of this specification. One or more embodiments of this specification provide a graphic code scanning method, a code scanning payment method, and a code scanning device. When the graphic code is scanned by the code scanning device, it is automatically determined that the image acquisition module in the scanning device scans the image to be recognized. The relative scanning angle of the code, based on the relative scanning angle, the image acquisition module is controlled to rotate, so as to reduce the relative scanning angle to a preset range, and then use the rotated image acquisition module to scan the pattern code to be identified. Improve the recognizability of the graphic code imaging obtained by the image acquisition module, thereby improving the efficiency and success rate of graphic code scanning. Fig. 1 is a schematic diagram of the first flow chart of a graphic code scanning method provided by one or more embodiments of this specification. The method in Fig. 1 is applied to a code scanning device. As shown in Fig. 1, the method includes at least the following steps: S101 , Determine the relative scan angle of the image capture module in the code scanning device to scan the graphic code to be recognized, where the relative scan angle is the angle between the scan direction of the image capture module and the vertical direction of the graphic code to be recognized; specifically, to be recognized The graphic code can be a bar code, a two-dimensional bar code or other graphic codes. The image capture module can be a rotatable camera lens. When the graphic code is scanned by a code scanning device, the control module in the code scanning device automatically determines the image capture The relative scanning angle of the module. S102: Rotate the image acquisition module according to the determined relative scan angle, so that the relative scan angle of the rotated image acquisition module is smaller than a preset threshold; specifically, after the relative scan angle is determined, the control module The group judges whether the relative scanning angle is greater than the preset threshold. If the judgment result is yes, it means that the angle deviation between the scanning device and the graphic code to be recognized is relatively large, which may cause multiple scanning failures and time-consuming payment It is relatively long, so it is necessary to adjust the scanning direction of the image acquisition module by rotating the image acquisition module, thereby reducing the relative scanning angle, and reducing the relative scanning angle to a preset range, so that the scanning device scans at an approximate vertical angle Graphic code to be recognized; S103, using the rotated image capture module to scan the graphic code to be recognized. Specifically, the reference plane (ie image capture plane) of the image capture module and the graphic to be recognized are made by rotating the image capture module After the plane of the code is approximately parallel, the image acquisition module scans the pattern code to be identified, and obtains the corresponding scan result. The scan result is transmitted to the communication module of the code scanning device, and the communication module transmits the scan result to The corresponding terminal device triggers the terminal device to perform the corresponding processing operation; In a specific embodiment, taking the application scenario of scanning code payment as an example, the terminal device receives the scanning result transmitted by the scanning device according to the scanning As a result, the payment processing operation is executed, and then this scan code payment is completed, which can shorten the scan code payment time. In one or more embodiments of this specification, when a code scanning device is used to scan a graphic code, the relative scanning angle of the image capture module in the scanning device to scan the graphic code to be recognized is automatically determined, and the image capture module is controlled based on the relative scanning angle. The group rotates to reduce the relative scanning angle to the preset range, and then use the rotated image acquisition module to scan the pattern code to be identified, which can improve the recognizability of the pattern code imaging obtained by the image acquisition module , Thereby improving the efficiency and success rate of graphic code scanning. Further, for the process of determining the relative scanning angle, combining the principle of determining a plane with three points, at least three light-emitting light sources can be arranged in the code scanning device, based on the light-emitting light source irradiating at least three light spots on the pattern code to be recognized, To determine the plane of the graphic code to be recognized, and then determine the relative scanning angle. Based on this, as shown in Figure 2, the above S101 determines the relative scanning angle of the image acquisition module in the code scanning device to scan the graphic code to be recognized, which specifically includes: S1011, Determine the coordinate information of at least three light spots irradiated to the pattern code to be identified; specifically, the at least three light-emitting light sources provided in the code scanning device respectively emit light beams in a preset direction to the pattern code to be identified to obtain the pattern code to be identified For each light-emitting light source, the direction of the light beam emitted by the light-emitting source remains unchanged. In specific implementation, in order to improve the accuracy of the plane where the determined graphic code is located, the preset The directions are different, which can increase the dispersion of at least three light spots, thereby appropriately increasing the actual area of the plane figure formed by the at least three light spots; Taking the number of light-emitting sources equal to 3 as an example, the emission of each light-emitting source When the light beam falls on the graphic code, a light spot will be formed. In this way, three light spots are formed on the graphic code. The image acquisition module in the code scanning device can be used as a reference object to establish a three-dimensional coordinate system to determine the reference plane of the image acquisition module. And the scanning direction of the image acquisition module is perpendicular to the reference plane. Correspondingly, the coordinates of the three light spots are , , S1012, according to the determined coordinate information of the at least three light spots, determine the target plane where the graphic code to be identified is located; specifically, after determining the coordinate information of the at least three light spots irradiated on the graphic code, combine the three points to determine The principle of a plane, according to the coordinate information of at least three light spots, determine the functional expression of the target plane where the graphic code is located, still taking the number of light sources equal to 3 as an example, according to the coordinates of the three light spots , , , Obtain the function expression of the target plane where the graphic code is located; S1013, based on the determined target plane, determine the relative scan angle of the image acquisition module in the code scanning device to scan the graphic code to be recognized; specifically, determine where the graphic code is located After the function expression of the target plane, determine the reference vertical line of the target plane, that is, determine any vertical line perpendicular to the plane where the graphic code is located, and determine the vertical line from the intersection point of the reference vertical line and the target plane to the reference plane of the image acquisition module , Marked as a reference line segment, and the included angle θ between the reference vertical line and the reference line segment is determined as the relative scanning angle of the image acquisition module in the code scanning device to scan the pattern code to be recognized, where, when the included angle θ = 0, the reference vertical line Parallel to the reference line segment. At this time, the reference plane of the image acquisition module is parallel to the plane where the graphic code is located. For the determination process of the coordinate information of at least three light spots, as shown in FIG. 3, the above S1011 determines the coordinate information of at least three light spots irradiated to the pattern code to be identified, specifically including: S10111, determining that the pattern code to be identified is irradiated Specifically, when the code scanning device is assembled, the emission angles of the luminous beams of the at least three luminous light sources set in the code scanning device are recorded, and each luminous light source is correspondingly emitted The angle is stored in the control module. Under the preset reference coordinate system, the emission angles of the three light-emitting light sources are respectively θ 1 , θ 2 , and θ 3 ; S10112, determine the line segment lengths of at least three light spots from the image acquisition module; Specifically, because the laser has good directivity and needs to obtain the distance between the light-emitting point and the graphic code, the at least three light-emitting light sources provided in the code scanning device may be laser rangefinders through which the laser The rangefinder can obtain the distance between the luminous point of the laser emitted by itself and the graphic code, and then the distance from the image acquisition module to the light spot of each luminous light source falling on the graphic code. The luminous light source corresponds to each luminous light source obtained The distance data is transmitted to the control module, and the control module can obtain the line segment lengths of at least three light spots from the image acquisition module. Taking the number of light-emitting light sources equal to 3 as an example, the line segments corresponding to the light spots of the three light-emitting light sources The lengths are l 1 , l 2 , and l 3 respectively ; S10113, determine the coordinate information of at least three light spots according to the determined emission angle and line segment length of each light-emitting source; specifically, combine the polar coordinate system and the three-dimensional coordinate system According to the corresponding emission angle and line length of each light-emitting light source, the coordinate information of the light spot corresponding to each light-emitting light source can be obtained. Still taking the number of light-emitting light sources equal to 3 as an example, according to the point ( θ 1 , l 1 ), determine the coordinates of the first spot in the three-dimensional coordinate system ,According to the point ( θ 2 , l 2 ) in the polar coordinate system, determine the coordinates of the second spot in the three-dimensional coordinate system , And according to the point in the polar coordinate system ( θ 3 , l 3 ), determine the coordinates of the third spot in the three-dimensional coordinate system . Among them, for the process of determining the relative scan angle based on the target plane, as shown in FIG. 4, the above S1013 determines the relative scan angle of the image capture module in the code scanning device to scan the graphic code to be recognized based on the determined target plane, which specifically includes: S10131: Determine the function relational expression of the reference perpendicular of the target plane; specifically, after the function expression of the target plane where the graphic code is located is determined, the reference perpendicular of the target plane is determined, and according to the function expression of the target plane, it can be determined The functional relationship of the reference perpendicular in the same three-dimensional coordinate system S10132, determine the coordinate information of the intersection of the reference perpendicular and the plane perpendicular of the target plane; specifically, after determining the function relation of the reference perpendicular, the coordinate information of the intersection of the reference perpendicular and the target plane can be obtained, that is, the intersection of the plane perpendicular The coordinates of O are S10133: Determine the relative scan angle of the image acquisition module in the code scanning device scanning the graphic code to be recognized according to the determined function relational expression of the reference vertical line and the coordinate information of the intersection of the plane vertical line; specifically, combine the length of the line segment between two points The solution formula is determined by the intersection point O of the plane perpendicular Make a vertical line segment to the reference plane of the image acquisition module, and the intersection point of the vertical line segment and the reference plane is P , And calculate the vertical point P on the datum plane To the intersection point O of the plane perpendicular The length of the reference line segment formed between the two is a ; and, combining the formula for solving the distance from the point to the straight line, the vertical point P on the datum plane of the image acquisition module is drawn to the reference vertical line as a vertical line segment. The intersection point is M , That is, point P Reference perpendicular Draw a vertical line segment, and find the length of the vertical line segment as c ; After determining the length a of the reference line segment and the length c of the vertical line segment from point P to the reference vertical line, combined with the Pythagorean theorem, the reference vertical line and The angle θ between the reference line segments, namely Therefore, it is possible to determine the relative scan angle of the image capture module in the code scanning device for scanning the graphic code to be recognized; where the reference line segment is perpendicular to the reference plane of the image capture module, and the reference vertical line is perpendicular to the plane where the graphic code is located (ie the target plane). ), when the included angle θ = 0, the reference vertical line coincides with the reference line segment, and the reference plane of the image acquisition module is parallel to the plane where the graphic code is located. Specifically, for the process of determining the function relational expression of the reference vertical line, the above S10131 determines the function relational expression of the reference vertical line of the target plane, which specifically includes: Step 1. On the target plane where the graphic code is located, determine at least three light spots. Plane graphics, where, when the number of light-emitting sources is equal to 3, the formed plane figure is a triangle; when the number of light-emitting sources is equal to 4, the formed plane figure is a quadrilateral, and so on, the number of light sources is still It is equal to 3 as an example, if the three light spots are point S1 , Point S2 , Point S3 , The plane figure formed by the three light spots is a triangle surrounded by the three coordinate points S1, S2, and S3; Step two, use the vertical line of the plane figure as the reference vertical line of the target plane, and determine the reference vertical line Function relation; among them, it is better to select the vertical line of the plane figure to determine the reference vertical line, that is, the reference vertical line is a straight line that includes the center point of the plane figure and is perpendicular to the plane figure. Correspondingly, the intersection point of the reference vertical line and the target plane is The center point of the plane figure, that is, the intersection point O of the above plane perpendiculars is the center point of the plane figure; among them, after the reference perpendicular of the target plane is selected, according to the function expression of the target plane, the reference perpendicular in the same three-dimensional coordinate system can be determined Functional relation . Specifically, for the process of determining the relative scan angle based on the functional relationship of the reference perpendicular and the intersection of the plane perpendicular, the above S10133 determines the image acquisition mode in the code scanning device according to the determined functional relationship of the reference perpendicular and the coordinate information of the intersection of the plane perpendicular. The relative scanning angles of the pattern code to be identified for group scanning include: Step 1. Determine the length of the first line segment between the image acquisition module and the reference perpendicular according to the determined function relationship of the reference vertical. Specifically, determine the image acquisition mode The length of the first line segment between the vertical point on the base plane of the group and the reference vertical; Step 2, according to the determined coordinate information of the intersection point of the plane vertical line, determine the second line segment length between the image acquisition module and the intersection point of the plane vertical line, specifically, Determine the length of the second line segment between the vertical point on the reference plane of the image capture module and the intersection of the vertical line of the plane; Step 3: Determine the scan of the image capture module in the code scanning device according to the determined length of the first line segment and the second line segment The relative scanning angle of the pattern code to be recognized. In specific implementation, as shown in Figure 5, the coordinate point P represents the coordinate of the vertical point on the reference plane of the image acquisition module, which is , The coordinate point O represents the coordinate of the intersection point of the plane perpendicular, which is , The coordinate point M represents the coordinate of the intersection point of the vertical line segment from the coordinate point P to the reference vertical line, which is , The length of the first line segment is the distance from the coordinate point P to the coordinate point M, that is, the length of the line segment PM is c , and the length of the second line segment is the distance from the coordinate point P to the coordinate point O, that is, the length of the line segment PO is a , corresponding , The angle θ between the line segment OP and the line segment OM is the relative scanning angle at which the image acquisition module in the code scanning device scans the graphic code to be recognized. Specifically, as shown in Fig. 6a, a side view of the code scanner when scanning the graphic code before rotating the image capture module is shown. In Fig. 6a, the scanning direction of the image capture module and the image code to be identified are shown. The angle between the vertical direction (that is, the plane normal direction) is θ . Taking the number of light-emitting light sources equal to 3 as an example, the code scanning device includes an image acquisition module, and the code scanning device is also provided with three light-emitting light sources. The emission angles of the luminous beams of the luminous light sources are different. The luminous beam emitted by each luminous source will fall on a spot on the pattern code, and the plane information of the pattern code can be determined according to the three spots irradiated on the pattern code. Furthermore, in combination with the above-mentioned process of determining the included angle between the reference vertical line and the reference line segment, the relative scanning angle of the image collection module scanning the graphic code to be recognized is determined. As shown in Figure 6b, after rotating the image acquisition module, the side view of the code scanner when scanning the graphic code is given. After determining the relative scanning angle of the image acquisition module scanning the graphic code to be recognized, the scanning The control module in the code device controls the rotation angle θ of the drive module to the image acquisition module. In Figure 6b, the angle between the scanning direction of the image acquisition module and the vertical direction of the pattern code to be identified (ie, the plane normal direction) is θ = 0, making the reference plane of the image acquisition module parallel to the plane where the graphic code to be identified is located. In the graphic code scanning method in one or more embodiments of this specification, when the graphic code is scanned by the code scanning device, the relative scanning angle at which the image acquisition module in the code scanning device scans the graphic code to be recognized is automatically determined, based on the relative scanning The angle controls the image acquisition module to rotate to reduce the relative scanning angle to a preset range, and then use the rotated image acquisition module to scan the pattern code to be identified, which can improve the pattern code obtained by the image acquisition module The recognizability of imaging improves the efficiency and success rate of graphic code scanning. Corresponding to the graphic code scanning method described in Figures 1 to 4, based on the same technical concept, one or more embodiments of this specification also provide a scanning code payment method. Figure 7 provides one or more embodiments of this specification. A schematic flow diagram of the scanning payment method. The method in Fig. 7 is applied to a code scanning device. As shown in Fig. 7, the method includes at least the following steps: S701, determining the relative scan of the image capture module in the scanning device to scan the graphic code to be recognized The relative scanning angle is the angle between the scanning direction of the image acquisition module and the vertical direction of the graphic code to be identified. For the specific implementation of step S701, refer to step S101, which will not be repeated here; S702, determined according to With respect to the scanning angle, rotate the image acquisition module so that the relative scanning angle of the rotated image acquisition module is smaller than the preset threshold. For the specific implementation of step S702, refer to step S102, which will not be repeated here; S703, using The rotated image acquisition module scans the graphic code to be recognized. For the specific implementation of step S703, refer to step S103, which will not be repeated here; S704, trigger and scan the code according to the scanning result obtained by scanning the graphic code to be recognized The terminal device connected to the device performs payment processing operations; specifically, after rotating the image capture module to make the reference plane of the image capture module approximately parallel to the plane where the graphic code to be recognized is located, the image capture module scans the graphic code to be recognized. And obtain the corresponding scan result, transmit the scan result to the communication module in the scanning device, and the communication module transmits the scan result to the corresponding terminal device to trigger the terminal device to perform the corresponding processing operation; In the embodiment, taking the application scenario of scan code payment as an example, after receiving the scan result transmitted by the scan code device, the terminal device executes the payment processing operation according to the scan result, and then completes the current scan code payment, which can shorten the scan code Payment time. Among them, for the process of determining the relative scan angle, combining the principle of determining a plane with three points, it is possible to set at least three light-emitting light sources in the code scanning device based on the light-emitting light source irradiating at least three light spots on the pattern code to be recognized. Determine the plane of the graphic code to be recognized, and then determine the relative scan angle. Based on this, the above S701 determines the relative scan angle of the image capture module in the code scanning device to scan the graphic code to be recognized, which specifically includes: The coordinate information of the three light spots; According to the determined coordinate information of the at least three light spots, determine the target plane where the graphic code to be recognized is located; Based on the determined target plane, determine the image acquisition module in the code scanning device to scan the graphic code to be recognized The relative scan angle. For the process of determining the coordinate information of the at least three light spots, the above determining the coordinate information of the at least three light spots irradiated to the pattern code to be identified specifically includes: determining the light-emitting light source that irradiates the at least three light spots of the pattern code to be identified Emission angle; and determining the line segment lengths of at least three light spots from the image acquisition module; and determining the coordinate information of the at least three light spots according to the determined emission angle and line segment length of each light-emitting light source. Among them, for the process of determining the relative scan angle based on the target plane, the determination of the relative scan angle of the image acquisition module in the code scanning device scanning the graphic code to be recognized based on the target plane as described above specifically includes: Determining the functional relational expression of the reference perpendicular of the target plane ; And, determine the coordinate information of the intersection of the reference perpendicular and the plane perpendicular of the target plane; According to the determined function relation of the reference perpendicular and the coordinate information of the intersection of the plane perpendicular, determine the image acquisition module in the scanning device to scan the graphic code to be recognized Relative scan angle. Among them, for the process of determining the functional relationship of the reference perpendicular, the above determining the functional relationship of the reference perpendicular of the target plane specifically includes: on the target plane where the graphic code is located, determining a plane figure composed of at least three light spots; The vertical line of the formed plane figure is used as the reference vertical line of the target plane, and the function relation formula of the reference vertical line is determined. Among them, for the process of determining the relative scanning angle based on the functional relationship of the reference perpendicular and the intersection of the plane perpendicular, the above-mentioned determination of the image acquisition module scanning in the code scanning device is based on the determined functional relationship of the reference perpendicular and the coordinate information of the intersection of the plane perpendicular The relative scanning angle of the graphic code to be identified includes: determining the length of the first line segment of the image acquisition module from the reference vertical according to the determined function relation of the reference vertical; determining the coordinate information of the determined intersection of the plane vertical The length of the second line segment between the image acquisition module and the intersection of the perpendicular to the plane; according to the determined first line segment length and the second line segment length, the relative scanning angle of the image acquisition module in the code scanning device for scanning the graphic code to be recognized is determined. In the graphic code scanning method in one or more embodiments of this specification, when the graphic code is scanned by the code scanning device, the relative scanning angle at which the image acquisition module in the code scanning device scans the graphic code to be recognized is automatically determined, based on the relative scanning The angle controls the image acquisition module to rotate to reduce the relative scanning angle to a preset range, and then use the rotated image acquisition module to scan the pattern code to be identified, which can improve the pattern code obtained by the image acquisition module The recognizability of imaging improves the efficiency and success rate of graphic code scanning. At the same time, according to the scanning result obtained by scanning the graphic code to be recognized, the corresponding terminal device is triggered to perform the payment processing operation, and then the scanning code payment is completed. It can shorten the time of scanning code payment. It should be noted that this embodiment in this specification is based on the same inventive concept as the previous embodiment in this specification. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned graphic code scanning method, and the repetition will not be repeated. Corresponding to the graphic code scanning method described in Figures 1 to 4, based on the same technical concept, one or more embodiments of this specification also provide a code scanning device. Figure 8 is a scanning device provided by one or more embodiments of this specification. A schematic diagram of the composition of the first module of the code device. The device is used to perform the graphic code scanning method described in Figures 1 to 4, as shown in Figure 8. The device includes: a control module 801 and connected to the control module 801 The image acquisition module 802; The above-mentioned control module 801 is used to determine the relative scanning angle of the image acquisition module 802 scanning the pattern code to be identified, where the relative scanning angle is the scanning direction of the image acquisition module 802 and the pattern to be identified The angle between the vertical direction of the code; and rotating the image acquisition module 802 according to the determined relative scanning angle, so that the relative scanning angle of the rotated image acquisition module 802 is less than a preset threshold; the image acquisition module 802, used to scan the above-mentioned graphic code to be recognized. In one or more embodiments of this specification, when a code scanning device is used to scan a graphic code, the relative scanning angle of the image capture module in the scanning device to scan the graphic code to be recognized is automatically determined, and the image capture module is controlled based on the relative scanning angle. The group rotates to reduce the relative scanning angle to the preset range, and then use the rotated image acquisition module to scan the pattern code to be identified, which can improve the recognizability of the pattern code imaging obtained by the image acquisition module , Thereby improving the efficiency and success rate of graphic code scanning. Further, as shown in FIG. 9, the above-mentioned code scanning device further includes: at least three light-emitting light sources 803; the above-mentioned light-emitting light source 803 is used to emit light beams in a preset direction to the pattern code to be identified, so as to obtain Light spots, wherein the preset directions of the light-emitting light sources 803 are different; the control module 801 is specifically used to determine the coordinate information of at least three light spots irradiated to the pattern code to be identified; according to the coordinate information of the at least three light spots , Determine the target plane where the graphic code to be recognized is located; and based on the determined target plane, determine the relative scanning angle of the image acquisition module 802 in the code scanning device to scan the graphic code to be recognized. Wherein, the control module 801 is further specifically configured to: determine the emission angles corresponding to the preset directions of the at least three light-emitting light sources 803; and determine that the at least three light spots irradiated to the pattern code to be identified are separated from the image acquisition module The length of the line segment of the group 802: Determine the coordinate information of at least three light spots according to the determined emission angle and the length of the line segment corresponding to each light-emitting source. Wherein, the control module 801 is further specifically configured to: determine the function relational expression of the reference perpendicular of the target plane; and determine the coordinate information of the intersection of the reference perpendicular and the plane perpendicular of the target plane; according to the determined reference perpendicular The function relational expression and the coordinate information of the intersection of the vertical line of the plane determine the relative scanning angle at which the image acquisition module 802 in the code scanning device scans the graphic code to be recognized. The graphic code scanning device in one or more embodiments of this specification automatically determines the relative scanning angle at which the image acquisition module in the code scanning device scans the graphic code to be recognized when the graphic code is scanned by the code scanning device, based on the relative scanning The angle controls the image acquisition module to rotate to reduce the relative scanning angle to a preset range, and then use the rotated image acquisition module to scan the pattern code to be identified, which can improve the pattern code obtained by the image acquisition module The recognizability of imaging improves the efficiency and success rate of graphic code scanning. Those skilled in the art should understand that one or more of the embodiments in this specification can be provided as a method, a system, or a computer program product. Therefore, one or more of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. One or more of this specification is described with reference to flowcharts and/or block diagrams of methods and devices (systems) according to one or more embodiments of this specification. It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, product or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or include elements inherent to this process, method, commodity, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity or equipment including the element. Those skilled in the art should understand that one or more of the embodiments in this specification can be provided as a method, a system, or a computer program product. Therefore, one or more of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more of this specification can be implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program codes. The form of the program product. The various embodiments in this specification are described in a sequential manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiment. The above descriptions are only one or more embodiments of this specification, and are not used to limit one or more of this specification. For those skilled in the art, one or more of this specification can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within one or more of the spirit and principles of this specification shall be included in the scope of one or more of the patent applications in this specification.