TW202001667A - Method for decoding graphic code and client - Google Patents

Method for decoding graphic code and client Download PDF

Info

Publication number
TW202001667A
TW202001667A TW108106636A TW108106636A TW202001667A TW 202001667 A TW202001667 A TW 202001667A TW 108106636 A TW108106636 A TW 108106636A TW 108106636 A TW108106636 A TW 108106636A TW 202001667 A TW202001667 A TW 202001667A
Authority
TW
Taiwan
Prior art keywords
decoding
current frame
information
frame image
interval
Prior art date
Application number
TW108106636A
Other languages
Chinese (zh)
Other versions
TWI759583B (en
Inventor
鄒啟晨
屠寅海
方剛
Original Assignee
香港商阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW202001667A publication Critical patent/TW202001667A/en
Application granted granted Critical
Publication of TWI759583B publication Critical patent/TWI759583B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A method for decoding a graphic code and a client. The method comprises providing decoding information, wherein the decoding information comprises decoding manners and interval information associated with the decoding manners, and the interval information is used for defining the use frequency of the associated decoding manners in the process of decoding. The method comprises: obtaining a current frame image and determining current frame information corresponding to the current frame image; determining, according to the interval information and the current frame information, a target decoding manner adapted with the current frame image from the decoding manners of the decoding information; and decoding the graphic code contained in the current frame image according to the target decoding manner. By means of the method, the decoding speed of the graphic code can be improved.

Description

圖形碼的解碼方法及用戶端Graphic code decoding method and user terminal

本申請關於互聯網技術領域,特別關於一種圖形碼的解碼方法及用戶端。This application relates to the field of Internet technology, in particular to a graphics code decoding method and a user terminal.

隨著編碼技術的不斷發展,目前已經能夠將豐富的資訊轉換為圖形碼。該圖形碼例如可以包括條碼、一維碼、二維碼等。用戶透過具備掃碼功能的終端設備或者軟體,可以對圖形碼進行解碼,從而識別出圖形碼中包含的資訊。 圖形碼的編碼方式多種多樣。以二維碼為例,可以具備PDF417、QR Code、Code 49、Code 16K、Data Matrix等多種編碼方式。那麼在對圖形碼進行解碼時,也需要使用對應的解碼方式才能成功解析出圖形碼中的資訊。目前,在對圖形碼解碼的過程中,通常會預先確定多個可能會使用到的解碼方式,然後針對同一幀圖像,會依次使用這些解碼方式嘗試解碼,一旦解碼成功,便可以得到解碼資訊。然而,如果當前幀圖像中不存在圖形碼,或者圖形碼不夠清晰,會在當前幀圖像中耗費較多的時間去逐一嘗試各種解碼方式,從而導致掃碼過程比較緩慢。With the continuous development of coding technology, it has been able to convert rich information into graphic codes. The graphic code may include, for example, a bar code, a one-dimensional code, a two-dimensional code, or the like. The user can decode the graphic code through a terminal device or software with a code scanning function, thereby recognizing the information contained in the graphic code. The coding methods of graphic codes are various. Taking a two-dimensional code as an example, it can have PDF417, QR Code, Code 49, Code 16K, Data Matrix and other encoding methods. Then, when decoding the graphic code, the corresponding decoding method is also needed to successfully parse the information in the graphic code. At present, in the process of decoding graphics codes, usually multiple decoding methods that may be used are determined in advance, and then for the same frame image, these decoding methods will be used in turn to try to decode. Once the decoding is successful, the decoding information can be obtained . However, if there is no graphic code in the current frame image, or the graphic code is not clear enough, it will spend more time in the current frame image to try various decoding methods one by one, resulting in a slower scanning process.

本申請實施方式的目的是提供一種圖形碼的解碼方式,能夠提高圖形碼的解碼速度。 為實現上述目的,本申請實施方式提供一種圖形碼的解碼方法,提供有解碼資訊,所述解碼資訊中包括解碼方式以及所述解碼方式關聯的間隔資訊,所述間隔資訊用於限定關聯的解碼方式在解碼過程中使用的頻率;所述方法包括:獲取當前幀圖像,並確定所述當前幀圖像對應的當前幀資訊;根據所述間隔資訊和所述當前幀資訊,在所述解碼資訊的解碼方式中確定所述當前幀圖像適配的目標解碼方式;按照所述目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼。 為實現上述目的,本申請實施方式還提供一種用戶端,所述用戶端包括:儲存單元,用於儲存解碼資訊,所述解碼資訊中包括解碼方式以及所述解碼方式關聯的間隔資訊,所述間隔資訊用於限定關聯的解碼方式在解碼過程中使用的頻率;當前幀資訊確定單元,用於獲取當前幀圖像,並確定所述當前幀圖像的當前幀資訊;目標解碼方式確定單元,用於根據所述間隔資訊和所述當前幀資訊,在所述解碼資訊的解碼方式中確定所述當前幀圖像適配的目標解碼方式;解碼單元,用於按照所述目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼。 為實現上述目的,本申請實施方式還提供一種用戶端,所述用戶端包括處理器和記憶體,所述記憶體用於儲存電腦程式,所述電腦程式被所述處理器執行時,實現上述的方法。 由上可見,本申請提供的技術方案,可以預先在解碼資訊中為各個解碼方式設置關聯的間隔資訊。該間隔資訊例如可以是間隔幀數或者間隔時間。其中,間隔幀數可以用於限定某個解碼方式僅針對連續的多幀圖像中的一幀圖像嘗試解碼。間隔時間可以用於限定某個解碼方式僅在一段時間內的一個時間節點嘗試解碼。這樣,當獲取到當前幀圖像之後,可以確定該圖像對應的當前幀資訊。該當前幀資訊可以是當前幀圖像的當前幀數,或者是獲取該當前幀圖像時的當前時間節點。這樣,透過比對當前幀資訊表徵的幀數/時間節點和解碼資訊中的間隔資訊表徵的間隔幀數/間隔時間節點,從而確定適配於當前幀圖像的一個或者多個目標解碼方式。然後,可以透過確定的目標解碼方式嘗試對當前幀圖像進行解碼。由上可見,在本申請提供的技術方案中,並不會針對每一幀圖像均嘗試各種解碼方式,而是按照間隔資訊,有選擇地選用一部分解碼方式嘗試解碼,從而可以減少嘗試解碼的時間,進而提高掃碼的速度。The purpose of the embodiments of the present application is to provide a graphics code decoding method, which can improve the decoding speed of the graphics code. To achieve the above object, the embodiments of the present application provide a decoding method of a graphic code, which provides decoding information, the decoding information includes a decoding method and interval information associated with the decoding method, and the interval information is used to limit associated decoding The frequency used in the decoding process; the method includes: acquiring the current frame image and determining the current frame information corresponding to the current frame image; based on the interval information and the current frame information, in the decoding In the decoding method of the information, a target decoding method adapted to the current frame image is determined; according to the target decoding method, the graphic code included in the current frame image is decoded. To achieve the above purpose, the embodiments of the present application further provide a user terminal, the user terminal includes: a storage unit for storing decoding information, the decoding information includes a decoding method and interval information associated with the decoding method, the The interval information is used to define the frequency of the associated decoding method used in the decoding process; the current frame information determination unit is used to obtain the current frame image and determine the current frame information of the current frame image; the target decoding mode determination unit, It is used to determine the target decoding mode of the current frame image adaptation in the decoding mode of the decoding information according to the interval information and the current frame information; the decoding unit is used to perform Decode the graphics code contained in the current frame image. To achieve the above object, the embodiments of the present application further provide a user terminal, the user terminal includes a processor and a memory, the memory is used to store a computer program, and the computer program is executed by the processor to implement the above Methods. As can be seen from the above, the technical solution provided by this application can set the associated interval information for each decoding method in the decoding information in advance. The interval information may be, for example, the number of interval frames or the interval time. Among them, the interval frame number can be used to limit a certain decoding method to try to decode only one frame image in consecutive multiple frame images. The interval time can be used to define that a certain decoding method only attempts to decode at a time node within a period of time. In this way, after the current frame image is acquired, the current frame information corresponding to the image can be determined. The current frame information may be the current frame number of the current frame image, or the current time node when acquiring the current frame image. In this way, by comparing the frame number/time node represented by the current frame information and the interval frame number/interval time node represented by the interval information in the decoded information, one or more target decoding modes suitable for the current frame image are determined. Then, you can try to decode the current frame image through the determined target decoding method. It can be seen from the above that in the technical solution provided by the present application, various decoding methods are not tried for each frame of image, but a part of the decoding methods are selectively selected to try to decode according to the interval information, thereby reducing the number of attempts to decode Time, which in turn increases the scanning speed.

為了使本技術領域的人員更好地理解本申請中的技術方案,下面將結合本申請實施方式中的附圖,對本申請實施方式中的技術方案進行清楚、完整地描述,顯然,所描述的實施方式僅僅是本申請一部分實施方式,而不是全部的實施方式。基於本申請中的實施方式,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施方式,都應當屬於本申請保護的範圍。 本申請提供一種圖形碼的解碼方法,所述方法可以應用於具備掃碼功能的終端設備或者軟體中。上述的終端設備例如可以是智慧手機、平板電腦、個人數位助理、智慧可穿戴設備等電子設備。 在本實施方式中,可以針對掃碼過程預先設置解碼資訊,所述解碼資訊中可以包括解碼方式以及所述解碼方式關聯的間隔資訊。其中,所述解碼方式可以與圖形碼的編碼方式相對應。例如,常用的圖形碼的編碼方式為PDF417、QR Code、Code 49、Code 16K以及Data Matrix,那麼上述例舉的各個編碼方式對應的解碼方式便可以是解碼資訊中包含的解碼方式。 由於在實際應用時,不同的解碼方式使用的頻率往往不同。例如,對於二維碼而言,應用比較廣泛的解碼方式可以為QR Code對應的解碼方式,而Data Matrix對應的解碼方式應用的範圍可能較小。鑒於此,在本實施方式中,可以針對解碼方式在實際應用中出現的頻率,來設置各個解碼方式關聯的間隔資訊。與解碼方式關聯的間隔資訊,可以用於限定該解碼方式在解碼過程中被使用的頻率。在實際應用中,該間隔資訊可以是間隔幀數或者間隔時間。其中,間隔幀數可以用於限定解碼方式僅針對連續的多幀圖像中的一幀圖像嘗試解碼。間隔時間可以用於限定解碼方式僅在一段時間內的一個時間節點嘗試解碼。舉例來說,若所述間隔幀數為5,則表示與該間隔幀數關聯的解碼方式會針對每5幀圖像中的一幀圖像嘗試解碼。又例如,若所述間隔時間為25毫秒,則表示與該間隔時間關聯的解碼方式在掃碼過程中每隔25毫秒會嘗試一次解碼。由此可見,若所述間隔資訊表徵的數值越大,則表示關聯的解碼方式被使用的頻率越低;反之,若所述間隔資訊表徵的數值越小,則表示關聯的解碼方式被使用的頻率越高。 在本實施方式中,當設置了解碼方式以及關聯的間隔資訊之後,從而可以生成解碼過程中所需的解碼資訊。該解碼資訊可以儲存於伺服器中。該伺服器可以是提供掃碼服務的軟體對應的業務伺服器。這樣,終端設備可以從伺服器中獲取該解碼資訊,後續可以按照該解碼資訊中設置的解碼方式以及間隔資訊進行解碼。此外,該解碼資訊還可以直接集成於提供掃碼服務的軟體中。例如,該解碼資訊可以作為軟體的一部分,壓縮於軟體的安裝包中。當終端設備安裝該軟體時,便可以從安裝包中解壓出解碼資訊。這樣,終端設備便可以將解碼資訊儲存於安裝包指定的路徑下,後續可以按照該解碼資訊中設置的解碼方式以及間隔資訊進行解碼。 請參閱圖1,所述圖形碼的解碼方法可以包括以下步驟。 S1:獲取當前幀圖像,並確定所述當前幀圖像對應的當前幀資訊。 在本實施方式中,當需要進行掃碼操作時,可以開啟終端設備上的攝像頭,然後透過該攝像頭拍攝包含圖形碼的圖像。在實際應用中,攝像頭在開啟過程中,可以按照固定的時間間隔,持續採集各幀圖像。例如,攝像頭可以每秒鐘採集25幀圖像。 在本實施方式中,針對攝像頭採集的當前幀圖像,可以識別其中包含的圖形碼,並將圖形碼攜帶的資訊解碼出來。具體地,在獲取到當前幀圖像之後,可以確定該當前幀圖像對應的當前幀資訊。 在實際應用中,該當前幀信息的類型可以與解碼資訊中間隔資訊的類型保持一致。例如,解碼資訊中的間隔資訊為間隔幀數。那麼,在確定所述當前幀圖像對應的當前幀資訊時,可以記錄所述當前幀圖像的當前幀數,並將記錄的所述當前幀數作為所述當前幀資訊。其中,所述當前幀數可以是針對本次掃碼過程統計的。在本次掃碼中,攝像頭採集到的第一幀圖像的幀數可以為1,後續圖像的幀數可以逐個遞加。此外,如果解碼資訊中的間隔資訊為間隔時間,那麼在確定所述當前幀圖像對應的當前幀資訊時,可以記錄獲取所述當前幀圖像時的當前時間節點,並將所述當前時間節點作為所述當前幀資訊。其中,所述當前時間節點可以是按照本次掃碼的時間來記錄。具體地,本次掃碼剛開始時,時間可以從0開始統計,隨著掃碼過程的不斷推進,統計的時間也可以逐漸累加。例如,所述當前幀圖像是在本次掃碼過程的第50毫秒獲取的,那麼所述當前時間節點便可以是50毫秒。此外,所述當前時間節點還可以按照終端設備實際的系統時間來記錄。例如,獲取所述當前幀圖像時,終端設備的系統時間為17點25分20秒,那麼所述當前時間節點便可以是17點25分20秒。當然,在實際應用中,系統時間的精度可以精確到毫秒級別,從而可以區分相鄰的多幀圖像的時間節點。 S3:根據所述間隔資訊和所述當前幀資訊,在所述解碼資訊的解碼方式中確定所述當前幀圖像適配的目標解碼方式。 在本實施方式中,在獲取到所述當前幀資訊之後,可以將所述當前幀資訊與所述間隔資訊進行匹配,以確定目前應該採用哪些解碼方式對當前幀圖像嘗試解碼。具體地,若所述間隔資訊為間隔幀數,那麼可以確定所述間隔幀數對應的幀數序列,所述幀數序列中包括至少一個幀數。該幀數序列中包含的幀數,可以是所述間隔幀數的倍數。例如,所述間隔幀數為5,那麼幀數序列中包含的幀數可以是5、10、15等等。當然,在實際應用中,由間隔幀數確定幀數序列可以有多種方式,而且幀數序列中的幀數也可以不是所述間隔幀數的倍數。例如,可以是所述間隔幀數的倍數加上一個固定數值。本申請對基於間隔幀數構建幀數序列的方式並不做限定。 在本實施方式中,當終端設備獲取到與所述幀數序列中包含的幀數相符的圖像時,便可以調用與該間隔幀數關聯的解碼方式對獲取的圖像嘗試解碼。那麼,在基於所述間隔幀數確定出幀數序列之後,可以判斷所述當前幀數是否存在於所述幀數序列中,若存在,則可以將所述間隔幀數關聯的解碼方式確定為所述當前幀圖像適配的目標解碼方式。後續可以利用該目標解碼方式嘗試對當前幀圖像進行解碼。 在實際應用中,針對不同的解碼方式,均可以關聯對應的間隔幀數。請參閱圖2,在一個應用示例中,假設當前有三種解碼方式,這三種解碼方式關聯的間隔幀數分別為1、2以及4。圖2中的矩形框為各幀圖像,填充陰影的矩形框則可以表示需要調用對應的解碼方式嘗試解碼的圖像。如圖2所示,針對第一種解碼方式,每一幀圖像均需要調用該解碼方式嘗試解碼;針對第二種解碼方式,每2幀圖像中,需要有一幀圖像調用該解碼方式嘗試解碼;針對第三種解碼方式,每4幀圖像中,需要有一幀圖像調用該解碼方式嘗試解碼。這樣,在獲取的各幀圖像中,有些圖像可能需要利用多種解碼方式嘗試解碼,而有些圖像則可能只需要採用一種解碼方式嘗試解碼。 在本實施方式中,若所述間隔資訊為間隔時間,那麼也可以確定所述間隔時間對應的時間序列,所述時間序列中包括至少一個時間節點。例如,所述間隔時間為25毫秒,那麼所述時間序列中的時間節點可以是25毫秒、50毫秒、75毫秒等等。其中,若在所述時間序列中的時間節點處獲取了圖像,則可以調用所述間隔時間關聯的解碼方式對獲取的圖像嘗試解碼。這樣,在確定所述間隔時間對應的時間序列後,可以判斷所述當前時間節點是否存在於所述時間序列中,若存在,則可以將所述間隔時間關聯的解碼方式確定為所述當前幀圖像適配的目標解碼方式。 S5:按照所述目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼。 在本實施方式中,當確定出所述當前幀圖像適配的目標解碼方式後,便可以按照所述目標解碼方式嘗試對當前幀圖像中包含的圖形碼進行解碼。若解碼成功,則可以得到圖形碼中包含的資訊,從而可以結束本次的掃碼過程。若解碼失敗,則可以停止對所述當前幀圖像中包含的圖形碼進行解碼,並獲取下一幀圖像。針對下一幀圖像,同樣可以按照步驟S1和S3中的描述,確定與該下一幀圖像適配的解碼方式,從而利用適配的解碼方式嘗試對下一幀圖像進行解碼。如果針對下一幀圖像依然解碼失敗,則可以繼續獲取後續的圖像,直至解碼成功或者解碼超時為止。 在一個實施方式中,所述當前幀圖像可能會與至少兩個目標解碼方式相適配。例如,在圖2中,第2幀圖像與第一種解碼方式以及第二種解碼方式相適配,第4幀圖像則與三種解碼方式均適配。在這種情況下,在按照所述目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼時,可以在所述至少兩個目標解碼方式中確定當前的目標解碼方式。具體地,可以隨機在所述至少兩個目標解碼方式中確定當前的目標解碼方式,也可以將間隔資訊限定的被使用頻率最高的目標解碼方式作為當前的目標解碼方式。然後,可以按照所述當前的目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼。若解碼成功,則可以得到圖形碼中包含的資訊,從而可以直接停止本次的解碼過程。如果當前的目標解碼方式解碼失敗,則可以在所述至少兩個目標解碼方式中確定與所述當前的目標解碼方式不同的目標解碼方式,並按照確定的所述目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼。當然,在實際應用中,為了不重複使用同一種解碼方式對當前幀多次嘗試解碼,在當前的目標解碼方式解碼失敗後,在後續選擇新的目標解碼方式時,可以不再選取已經解碼失敗的目標解碼方式。由此可見,當存在多個適配的目標解碼方式時,可以利用這多個目標解碼方式依次嘗試解碼,一旦解碼成功,便可以停止本次的解碼過程;若當前的目標解碼方式解碼失敗,則可以換另一個目標解碼方式嘗試解碼。若適配的多個目標解碼方式均解碼失敗,則可以放棄對當前幀圖像進行解碼的過程,進而獲取下一幀圖像,並針對下一幀圖像利用步驟S1至S5中描述的方式重新解碼。 在一個實施方式中,應用於掃碼過程中的各個解碼方式可以預先設定優先順序。其中,該優先順序可以按照解碼方式的使用率來設定。使用率越高,解碼方式的優先順序便可以越高。具體地,可以統計指定數量的圖形碼中,各個解碼方式出現的次數,然後按照統計的次數來設置各個解碼方式的優先順序。此外,還可以根據設定的間隔資訊來設定解碼方式的優先順序。間隔資訊限定的數值越小,對應的優先順序可以越高。 在本實施方式中,當所述當前幀圖像與至少兩個目標解碼方式相適配時,可以按照預設優先順序對所述至少兩個目標解碼方式排序。在實際應用中,為了儘快完成解碼過程,可以按照優先順序從高到低的順序對多個目標解碼方式進行排序。然後,可以按照排序結果依次對所述當前幀圖像中包含的圖形碼進行解碼。具體地,可以優先採用優先順序較高的目標解碼方式嘗試解碼。若解碼成功,則可以得到圖形碼中包含的資訊,便可以停止本次的解碼過程。若當前選用的目標解碼方式解碼失敗,則可以選用優先順序低一些的目標解碼方式嘗試解碼。若按照排序結果均解碼失敗,則可以停止針對所述當前幀圖像的解碼過程,進而獲取下一幀圖像,並針對下一幀圖像利用步驟S1至S5中描述的方式重新解碼。 由上可見,按照本申請提供的技術方案,並非針對每一幀圖像都需要利用全部的解碼方式嘗試解碼,而是根據解碼方式的使用率,為解碼方式設定間隔資訊。其中,使用率越高的解碼方式,間隔資訊限定的數值可以越小。例如,針對QR Code的解碼方式,可以在每一幀圖像中均嘗試解碼。而針對Data Matrix的解碼方式,可以在每10幀圖像中的一幀圖像上嘗試解碼。這樣處理的目的在於,如果當前幀圖像中不包含圖形碼,或者由於拍攝角度問題,所有的解碼方式都不能成功解碼,那麼由於當前幀圖像適配的目標解碼方式可能只有一種或者少量的幾種,那麼會很快停止針對當前幀圖像的解碼過程,並且可以進入下一幀圖像的解碼過程,從而可以避免在一幀圖像中浪費較多時間,進而提高了整個掃碼過程的速度。 請參閱圖3,本申請還提供一種用戶端,所述用戶端包括: 儲存單元,用於儲存解碼資訊,所述解碼資訊中包括解碼方式以及所述解碼方式關聯的間隔資訊,所述間隔資訊用於限定關聯的解碼方式在解碼過程中使用的頻率; 當前幀資訊確定單元,用於獲取當前幀圖像,並確定所述當前幀圖像的當前幀資訊; 目標解碼方式確定單元,用於根據所述間隔資訊和所述當前幀資訊,在所述解碼資訊的解碼方式中確定所述當前幀圖像適配的目標解碼方式; 解碼單元,用於按照所述目標解碼方式對所述當前幀圖像中包含的圖形碼進行解碼。 在一個實施方式中,所述間隔資訊包含間隔幀數;相應地,所述當前幀資訊確定單元包括: 幀數記錄模組,用於記錄所述當前幀圖像的當前幀數,並將記錄的所述當前幀數作為所述當前幀資訊。 在一個實施方式中,所述目標解碼方式確定單元包括: 幀數序列確定模組,用於確定所述間隔幀數對應的幀數序列,所述幀數序列中包括至少一個幀數; 幀數匹配模組,用於判斷所述當前幀數是否存在於所述幀數序列中,若存在,將所述間隔幀數關聯的解碼方式確定為所述當前幀圖像適配的目標解碼方式。 在一個實施方式中,所述間隔資訊包含間隔時間;相應地,所述當前幀資訊確定單元包括: 時間節點記錄模組,用於記錄獲取所述當前幀圖像時的當前時間節點,並將所述當前時間節點作為所述當前幀資訊。 在一個實施方式中,所述目標解碼方式確定單元包括: 時間序列確定模組,用於確定所述間隔時間對應的時間序列,所述時間序列中包括至少一個時間節點; 時間節點匹配模組,用於判斷所述當前時間節點是否存在於所述時間序列中,若存在,將所述間隔時間關聯的解碼方式確定為所述當前幀圖像適配的目標解碼方式。 在一個實施方式中,所述當前幀圖像與至少兩個目標解碼方式相適配,並且所述目標解碼方式具備預設優先順序;相應地,所述解碼單元包括: 排序模組,用於按照預設優先順序對所述至少兩個目標解碼方式排序,並按照排序結果依次對所述當前幀圖像中包含的圖形碼進行解碼; 解碼判定模組,用於在解碼成功的情況下,停止本次的解碼過程;在按照排序結果均解碼失敗的情況下,停止針對所述當前幀圖像的解碼過程,並獲取下一幀圖像。 請參閱圖4,本申請還提供一種用戶端,所述用戶端包括處理器和記憶體,所述記憶體用於儲存電腦程式,所述電腦程式被所述處理器執行時,可以實現上述的圖形碼的解碼方法。 在本實施方式中,所述記憶體可以包括用於儲存資訊的物理裝置,通常是將資訊數位化後再以利用電、磁或者光學等方法的媒體加以儲存。本實施方式所述的記憶體又可以包括:利用電能方式儲存資訊的裝置,如RAM、ROM等;利用磁能方式儲存資訊的裝置,如硬碟、軟碟、磁帶、磁芯記憶體、磁泡記憶體、USB隨身碟;利用光學方式儲存資訊的裝置,如CD或DVD。當然,還有其他方式的記憶體,例如量子記憶體、石墨烯記憶體等等。 在本實施方式中,所述處理器可以按任何適當的方式實現。例如,所述處理器可以採取例如微處理器或處理器以及儲存可由該(微)處理器執行的電腦可讀程式碼(例如軟體或硬體)的電腦可讀媒體、邏輯閘、開關、專用積體電路(Application Specific Integrated Circuit,ASIC)、可程式設計邏輯控制器和嵌入微控制器的形式等等。 本說明書實施方式提供的用戶端,其記憶體和處理器實現的具體功能,可以與本說明書中的前述實施方式相對照解釋,並能夠達到前述實施方式的技術效果,這裡便不再贅述。 由上可見,本申請提供的技術方案,可以預先在解碼資訊中為各個解碼方式設置關聯的間隔資訊。該間隔資訊例如可以是間隔幀數或者間隔時間。其中,間隔幀數可以用於限定某個解碼方式僅針對連續的多幀圖像中的一幀圖像嘗試解碼。間隔時間可以用於限定某個解碼方式僅在一段時間內的一個時間節點嘗試解碼。這樣,當獲取到當前幀圖像之後,可以確定該圖像對應的當前幀資訊。該當前幀資訊可以是當前幀圖像的當前幀數,或者是獲取該當前幀圖像時的當前時間節點。這樣,透過比對當前幀資訊表徵的幀數/時間節點和解碼資訊中的間隔資訊表徵的間隔幀數/間隔時間節點,從而確定適配於當前幀圖像的一個或者多個目標解碼方式。然後,可以透過確定的目標解碼方式嘗試對當前幀圖像進行解碼。由上可見,在本申請提供的技術方案中,並不會針對每一幀圖像均嘗試各種解碼方式,而是按照間隔資訊,有選擇地選用一部分解碼方式嘗試解碼,從而可以減少嘗試解碼的時間,進而提高掃碼的速度。 在20世紀90年代,對於一個技術的改進可以很明顯地區分是硬體上的改進(例如,對二極體、電晶體、開關等電路結構的改進)還是軟體上的改進(對於方法流程的改進)。然而,隨著技術的發展,當今的很多方法流程的改進已經可以視為硬體電路結構的直接改進。設計人員幾乎都透過將改進的方法流程程式設計到硬體電路中來得到相應的硬體電路結構。因此,不能說一個方法流程的改進就不能用硬體實體模組來實現。例如,可程式設計邏輯器件(Programmable Logic Device, PLD)(例如現場可程式設計閘陣列(Field Programmable Gate Array,FPGA))就是這樣一種積體電路,其邏輯功能由用戶對元件程式設計來確定。由設計人員自行程式設計來把一個數位系統“集成”在一片PLD上,而不需要請晶片製造廠商來設計和製作專用的積體電路晶片。而且,如今,取代手工地製作積體電路晶片,這種程式設計也多半改用“邏輯編譯器(logic compiler)”軟體來實現,它與程式開發撰寫時所用的軟體編譯器相類似,而要編譯之前的原始代碼也得用特定的程式設計語言來撰寫,此稱之為硬體描述語言(Hardware Description Language,HDL),而HDL也並非僅有一種,而是有許多種,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL (Very-High-Speed Integrated Circuit Hardware Description Language)與Verilog2。本領域技術人員也應該清楚,只需要將方法流程用上述幾種硬體描述語言稍作邏輯程式設計並程式設計到積體電路中,就可以很容易得到實現該邏輯方法流程的硬體電路。 本領域技術人員也知道,除了以純電腦可讀程式碼方式實現用戶端以外,完全可以透過將方法步驟進行邏輯程式設計來使得用戶端以邏輯閘、開關、專用積體電路、可程式設計邏輯控制器和嵌入微控制器等的形式來實現相同功能。因此這種用戶端可以被認為是一種硬體部件,而對其內包括的用於實現各種功能的裝置也可以視為硬體部件內的結構。或者甚至,可以將用於實現各種功能的裝置視為既可以是實現方法的軟體模組又可以是硬體部件內的結構。 透過以上的實施方式的描述可知,本領域的技術人員可以清楚地瞭解到本申請可借助軟體加必需的通用硬體平臺的方式來實現。基於這樣的理解,本申請的技術方案本質上或者說對現有技術做出貢獻的部分可以以軟體產品的形式體現出來,該電腦軟體產品可以儲存在儲存媒體中,如ROM/RAM、磁碟、光碟等,包括若干指令用以使得一台電腦設備(可以是個人電腦,伺服器,或者網路設備等)執行本申請各個實施方式或者實施方式的某些部分所述的方法。 本說明書中的各個實施方式均採用遞進的方式描述,各個實施方式之間相同相似的部分互相參見即可,每個實施方式重點說明的都是與其他實施方式的不同之處。尤其,針對用戶端的實施方式來說,均可以參照前述方法的實施方式的介紹對照解釋。 本申請可以在由電腦執行的電腦可執行指令的一般上下文中描述,例如程式模組。一般地,程式模組包括執行特定任務或實現特定抽象資料類型的常式、程式、物件、元件、資料結構等等。也可以在分散式運算環境中實踐本申請,在這些分散式運算環境中,由透過通信網路而被連接的遠端處理設備來執行任務。在分散式運算環境中,程式模組可以位於包括存放裝置在內的本地和遠端電腦儲存媒體中。 雖然透過實施方式描繪了本申請,本領域普通技術人員知道,本申請有許多變形和變化而不脫離本申請的精神,希望所附的申請專利範圍包括這些變形和變化而不脫離本申請的精神。In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described The embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of this application. The present application provides a decoding method of a graphic code, and the method can be applied to a terminal device or software having a code scanning function. The above terminal device may be, for example, an electronic device such as a smart phone, a tablet computer, a personal digital assistant, a smart wearable device, and the like. In this embodiment, decoding information may be preset for the scanning process. The decoding information may include a decoding method and interval information associated with the decoding method. Wherein, the decoding method may correspond to the encoding method of the graphic code. For example, the commonly used encoding methods of graphic codes are PDF417, QR Code, Code 49, Code 16K and Data Matrix, then the decoding methods corresponding to the encoding methods exemplified above may be the decoding methods included in the decoding information. In practical applications, the frequency used by different decoding methods is often different. For example, for a two-dimensional code, the more widely used decoding method may be the decoding method corresponding to QR Code, and the application range of the decoding method corresponding to Data Matrix may be smaller. In view of this, in this embodiment, the interval information associated with each decoding method can be set for the frequency at which the decoding method appears in practical applications. The interval information associated with the decoding method can be used to define the frequency with which the decoding method is used in the decoding process. In practical applications, the interval information may be an interval frame number or an interval time. Among them, the number of spaced frames can be used to limit the decoding method to try to decode only one frame of consecutive multi-frame images. The interval time can be used to limit the decoding mode to try to decode only at a time node within a period of time. For example, if the number of interval frames is 5, it means that the decoding method associated with the number of interval frames will try to decode one frame out of every five frames. For another example, if the interval time is 25 milliseconds, it indicates that the decoding method associated with the interval time will try to decode every 25 milliseconds during the scanning process. It can be seen that, if the value represented by the interval information is larger, the frequency of the associated decoding method is used lower; on the contrary, if the value represented by the interval information is smaller, the associated decoding method is used. The higher the frequency. In this embodiment, after the decoding method and associated interval information are set, the decoding information required in the decoding process can be generated. The decoded information can be stored in the server. The server may be a business server corresponding to software that provides a scanning service. In this way, the terminal device can obtain the decoding information from the server, and can subsequently decode according to the decoding method and interval information set in the decoding information. In addition, the decoding information can also be directly integrated into the software that provides the scanning service. For example, the decoding information can be compressed as part of the software in the software installation package. When the terminal device installs the software, the decoding information can be extracted from the installation package. In this way, the terminal device can store the decoding information in the path specified by the installation package, and can subsequently decode according to the decoding method and interval information set in the decoding information. Please refer to FIG. 1, the decoding method of the graphic code may include the following steps. S1: Obtain the current frame image, and determine the current frame information corresponding to the current frame image. In this embodiment, when a code scanning operation is required, a camera on the terminal device can be turned on, and then an image containing a graphic code is taken through the camera. In practical applications, the camera can continuously collect images of each frame at a fixed time interval when the camera is turned on. For example, the camera can collect 25 frames per second. In this embodiment, for the current frame image collected by the camera, the graphic code contained therein can be identified, and the information carried by the graphic code can be decoded. Specifically, after acquiring the current frame image, the current frame information corresponding to the current frame image may be determined. In practical applications, the type of the current frame information can be consistent with the type of interval information in the decoding information. For example, the interval information in the decoding information is the number of interval frames. Then, when determining the current frame information corresponding to the current frame image, the current frame number of the current frame image may be recorded, and the recorded current frame number may be used as the current frame information. Wherein, the current number of frames may be counted for this scanning process. In this scan code, the number of frames of the first frame of images collected by the camera may be 1, and the number of frames of subsequent images may be increased one by one. In addition, if the interval information in the decoding information is the interval time, when determining the current frame information corresponding to the current frame image, the current time node at the time of acquiring the current frame image may be recorded, and the current time The node serves as the current frame information. Wherein, the current time node may be recorded according to the time of the current code scanning. Specifically, at the beginning of the current code scanning, the time can be counted from 0, and as the code scanning process continues to progress, the statistical time can also be gradually accumulated. For example, the current frame image is acquired at the 50th millisecond of the current scanning process, then the current time node may be 50 milliseconds. In addition, the current time node may also be recorded according to the actual system time of the terminal device. For example, when acquiring the current frame image, the system time of the terminal device is 17:25:20, then the current time node may be 17:25:20. Of course, in practical applications, the accuracy of the system time can be accurate to the millisecond level, so that the time nodes of adjacent multi-frame images can be distinguished. S3: Determine, according to the interval information and the current frame information, a target decoding method adapted to the current frame image in the decoding method of the decoding information. In this embodiment, after the current frame information is acquired, the current frame information and the interval information may be matched to determine which decoding methods should be used to try to decode the current frame image. Specifically, if the interval information is an interval frame number, a frame number sequence corresponding to the interval frame number may be determined, and the frame number sequence includes at least one frame number. The number of frames included in the frame number sequence may be a multiple of the number of frames in the interval. For example, if the interval frame number is 5, then the number of frames included in the frame number sequence may be 5, 10, 15, and so on. Of course, in practical applications, there may be many ways to determine the frame number sequence from the number of interval frames, and the number of frames in the frame number sequence may not be a multiple of the number of interval frames. For example, it may be a multiple of the number of spaced frames plus a fixed value. This application does not limit the manner of constructing the frame number sequence based on the number of spaced frames. In this embodiment, when the terminal device acquires an image that matches the number of frames included in the frame number sequence, it can call a decoding method associated with the interval frame number to try to decode the acquired image. Then, after determining the frame number sequence based on the interval frame number, it can be determined whether the current frame number exists in the frame number sequence, and if it exists, the decoding method associated with the interval frame number can be determined as The target decoding mode adapted to the current frame image. Later, the target decoding mode can be used to try to decode the current frame image. In practical applications, for different decoding methods, the corresponding number of interval frames can be associated. Referring to FIG. 2, in an application example, it is assumed that there are currently three decoding methods, and the number of interval frames associated with these three decoding methods is 1, 2, and 4, respectively. The rectangular frame in FIG. 2 is each frame of image, and the rectangular frame filled with shadow can indicate the image to be decoded by calling the corresponding decoding method. As shown in Figure 2, for the first decoding method, every frame of image needs to call this decoding method to try to decode; for the second decoding method, every 2 frames of image, there needs to be one frame of image to call this decoding method Try decoding; for the third decoding method, every 4 frames of images, there needs to be a frame of images to call this decoding method to try to decode. In this way, among the acquired frames, some images may need to use multiple decoding methods to try to decode, while some images may only need to use one decoding method to try to decode. In this embodiment, if the interval information is an interval time, a time sequence corresponding to the interval time may also be determined, and the time sequence includes at least one time node. For example, the interval time is 25 milliseconds, then the time nodes in the time series may be 25 milliseconds, 50 milliseconds, 75 milliseconds, and so on. Wherein, if an image is acquired at a time node in the time series, the decoding method associated with the interval time may be called to try to decode the acquired image. In this way, after determining the time series corresponding to the interval time, it can be determined whether the current time node exists in the time series, and if so, the decoding method associated with the interval time can be determined as the current frame Target decoding method for image adaptation. S5: Decode the graphic code contained in the current frame image according to the target decoding method. In this embodiment, after determining the target decoding mode adapted to the current frame image, it may try to decode the graphic code contained in the current frame image according to the target decoding mode. If the decoding is successful, you can get the information contained in the graphic code, which can end the current scanning process. If the decoding fails, you can stop decoding the graphics code contained in the current frame image and obtain the next frame image. For the next frame image, the decoding method suitable for the next frame image can also be determined according to the description in steps S1 and S3, so as to try to decode the next frame image using the adapted decoding method. If decoding still fails for the next frame of image, you can continue to acquire subsequent images until the decoding succeeds or the decoding times out. In one embodiment, the current frame image may be adapted to at least two target decoding methods. For example, in Figure 2, the second frame image is adapted to the first decoding method and the second decoding method, and the fourth frame image is adapted to the three decoding methods. In this case, when decoding the graphic code included in the current frame image according to the target decoding method, the current target decoding method may be determined among the at least two target decoding methods. Specifically, the current target decoding mode may be determined randomly among the at least two target decoding modes, or the target decoding mode with the highest frequency defined by the interval information may be used as the current target decoding mode. Then, the graphics code contained in the current frame image may be decoded according to the current target decoding mode. If the decoding is successful, you can get the information contained in the graphics code, so you can directly stop the decoding process. If the current target decoding mode fails to decode, a target decoding mode different from the current target decoding mode may be determined in the at least two target decoding modes, and the current frame is determined according to the determined target decoding mode Decode the graphic code contained in the image. Of course, in practical applications, in order not to repeatedly use the same decoding method to try to decode the current frame multiple times, after the current target decoding method fails to decode, in the subsequent selection of a new target decoding method, you can no longer select the decoding failure The target decoding method. It can be seen that when there are multiple adapted target decoding methods, the multiple target decoding methods can be used to try to decode sequentially. Once the decoding is successful, the decoding process can be stopped. If the current target decoding method fails to decode, You can try another target decoding method to try to decode. If the adapted multiple target decoding methods fail to decode, you can abandon the process of decoding the current frame image, and then obtain the next frame image, and use the methods described in steps S1 to S5 for the next frame image Re-decode. In one embodiment, each decoding method applied in the scanning process may be preset with a priority order. The priority order can be set according to the usage rate of the decoding method. The higher the usage rate, the higher the priority of the decoding method. Specifically, it is possible to count the number of occurrences of each decoding mode in a specified number of graphic codes, and then set the priority order of each decoding mode according to the counted number of times. In addition, the priority of the decoding method can be set according to the set interval information. The smaller the value defined by the interval information, the higher the corresponding priority order. In this embodiment, when the current frame image is adapted to at least two target decoding modes, the at least two target decoding modes may be sorted according to a preset priority order. In practical applications, in order to complete the decoding process as soon as possible, multiple target decoding methods can be sorted in order of priority from high to low. Then, the graphics codes contained in the current frame image may be decoded in sequence according to the sorting result. Specifically, a target decoding method with a higher priority order may be preferentially used to try to decode. If the decoding is successful, the information contained in the graphic code can be obtained, and the decoding process can be stopped. If the currently selected target decoding method fails to decode, the target decoding method with a lower priority order may be selected to try to decode. If decoding fails according to the sorting results, the decoding process for the current frame image may be stopped, and then the next frame image may be acquired, and the next frame image may be decoded again in the manner described in steps S1 to S5. It can be seen from the above that according to the technical solution provided by the present application, not all decoding methods need to be tried for every frame of image, but the interval information is set for the decoding method according to the usage rate of the decoding method. Among them, the decoding method with higher usage rate, the smaller the value limited by the interval information can be. For example, for the QR Code decoding method, you can try to decode every frame of the image. For the decoding method of Data Matrix, you can try to decode on one frame of every 10 frames. The purpose of this process is that if the current frame image does not contain a graphic code, or due to the shooting angle, all decoding methods cannot be successfully decoded, then the target decoding method for the current frame image adaptation may be only one or a small amount Several types, then the decoding process for the current frame image will be quickly stopped, and the decoding process of the next frame image can be entered, thereby avoiding wasting more time in one frame image, thereby improving the entire scanning process speed. Referring to FIG. 3, this application also provides a user terminal, and the user terminal includes: A storage unit, configured to store decoding information, the decoding information includes a decoding method and interval information associated with the decoding method, and the interval information is used to define a frequency of the associated decoding method used in the decoding process; A current frame information determining unit, used to acquire a current frame image and determine the current frame information of the current frame image; A target decoding mode determining unit, configured to determine a target decoding mode adapted to the current frame image in the decoding mode of the decoding information based on the interval information and the current frame information; The decoding unit is configured to decode the graphic code contained in the current frame image according to the target decoding method. In one embodiment, the interval information includes the number of interval frames; accordingly, the current frame information determination unit includes: The frame number recording module is used to record the current frame number of the current frame image, and use the recorded current frame number as the current frame information. In one embodiment, the target decoding mode determination unit includes: A frame number sequence determining module, configured to determine a frame number sequence corresponding to the interval frame number, and the frame number sequence includes at least one frame number; The frame number matching module is used to determine whether the current frame number exists in the frame number sequence, and if so, determine the decoding method associated with the interval frame number as the target decoding for the current frame image adaptation the way. In one embodiment, the interval information includes an interval time; accordingly, the current frame information determination unit includes: The time node recording module is used to record the current time node when acquiring the current frame image, and use the current time node as the current frame information. In one embodiment, the target decoding mode determination unit includes: A time series determining module, configured to determine a time series corresponding to the interval time, the time series including at least one time node; The time node matching module is used to determine whether the current time node exists in the time sequence, and if so, determine the decoding method associated with the interval time as the target decoding method adapted for the current frame image. In one embodiment, the current frame image is adapted to at least two target decoding modes, and the target decoding mode has a preset priority order; accordingly, the decoding unit includes: A sorting module, configured to sort the at least two target decoding modes according to a preset priority order, and sequentially decode the graphic codes contained in the current frame image according to the sorting result; The decoding decision module is used to stop the current decoding process when the decoding is successful; when the decoding results are all failed according to the sorting results, stop the decoding process for the current frame image and obtain the next frame image Like. Referring to FIG. 4, the present application also provides a user terminal. The user terminal includes a processor and a memory. The memory is used to store a computer program. When the computer program is executed by the processor, the foregoing Graphic code decoding method. In this embodiment, the memory may include a physical device for storing information, usually the information is digitized and then stored on a medium using electrical, magnetic, or optical methods. The memory described in this embodiment may further include: devices that use electrical energy to store information, such as RAM, ROM, etc.; devices that use magnetic energy to store information, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, and magnetic bubbles Memory, USB flash drives; devices that store information optically, such as CDs or DVDs. Of course, there are other ways of memory, such as quantum memory, graphene memory and so on. In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may adopt, for example, a microprocessor or a processor and a computer-readable medium storing a computer-readable program code (such as software or hardware) executable by the (micro)processor, a logic gate, a switch, a dedicated Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller, etc. The specific functions implemented by the memory and the processor of the user terminal provided in the embodiments of this specification can be explained in comparison with the foregoing embodiments in this specification, and can achieve the technical effects of the foregoing embodiments, which will not be repeated here. As can be seen from the above, the technical solution provided by this application can set the associated interval information for each decoding method in the decoding information in advance. The interval information may be, for example, the number of interval frames or the interval time. Among them, the interval frame number can be used to limit a certain decoding method to try to decode only one frame image in consecutive multiple frame images. The interval time can be used to define that a certain decoding method only attempts to decode at a time node within a period of time. In this way, after the current frame image is acquired, the current frame information corresponding to the image can be determined. The current frame information may be the current frame number of the current frame image, or the current time node when acquiring the current frame image. In this way, by comparing the frame number/time node represented by the current frame information and the interval frame number/interval time node represented by the interval information in the decoded information, one or more target decoding modes suitable for the current frame image are determined. Then, you can try to decode the current frame image through the determined target decoding method. It can be seen from the above that in the technical solution provided by the present application, various decoding methods are not tried for each frame of image, but a part of the decoding methods are selectively selected to try to decode according to the interval information, thereby reducing the number of attempts to decode Time, which in turn increases the scanning speed. In the 1990s, the improvement of a technology can be clearly distinguished from the improvement of hardware (for example, the improvement of the circuit structure of diodes, transistors, switches, etc.) or the improvement of software (for the process flow Improve). However, with the development of technology, the improvement of many methods and processes can be regarded as a direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method and process cannot be achieved with hardware physical modules. For example, a programmable logic device (Programmable Logic Device, PLD) (such as a field programmable gate array (Field Programmable Gate Array, FPGA)) is such an integrated circuit, and its logic function is determined by the user programming the component. It is up to the designer to program a digital system to "integrate" a PLD without having to ask a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, this kind of programming is also mostly implemented with "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation must also be written in a specific programming language, which is called the hardware description language (Hardware Description Language, HDL), and HDL is not only one, but there are many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., Currently the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog2. Those skilled in the art should also understand that it is easy to obtain the hardware circuit that implements the logic method flow by only slightly programming the method flow using the above hardware description languages and programming it into the integrated circuit. Those skilled in the art also know that, in addition to implementing the user terminal in a pure computer-readable program code, the method can be logically programmed to make the user terminal controlled by logic gates, switches, dedicated integrated circuits, and programmable logic To achieve the same function in the form of a controller and embedded microcontroller. Therefore, such a user terminal can be regarded as a hardware component, and the device for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module of the implementation method and a structure in the hardware component. It can be known from the description of the above embodiments that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of software products in essence or part that contributes to the existing technology, and the computer software products can be stored in storage media, such as ROM/RAM, disk, An optical disc, etc., includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or some parts of the embodiments. The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the implementation of the user terminal, reference may be made to the introduction of the foregoing method implementation for comparative explanation. This application can be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment in which remote processing devices connected through a communication network perform tasks. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices. Although the application has been described through the embodiments, those of ordinary skill in the art know that there are many variations and changes in the application without departing from the spirit of the application, and it is hoped that the scope of the attached patent application includes these variations and changes without departing from the spirit of the application .

為了更清楚地說明本申請實施方式或現有技術中的技術方案,下面將對實施方式或現有技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,下面描述中的附圖僅僅是本申請中記載的一些實施方式,對於本領域普通技術人員來講,在不付出創造性勞動性的前提下,還可以根據這些附圖獲得其他的附圖。 圖1為本申請實施方式中圖形碼的解碼方法流程圖; 圖2為本申請實施方式中間隔幀數的示意圖; 圖3為本申請實施方式中用戶端的功能模組示意圖; 圖4為本申請實施方式中用戶端的結構示意圖。In order to more clearly explain the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only For some embodiments described in the application, for those of ordinary skill in the art, without paying any creative labor, other drawings may be obtained based on these drawings. FIG. 1 is a flowchart of a decoding method of a graphic code in an implementation manner of the present application; FIG. 2 is a schematic diagram of the number of interval frames in the embodiment of the present application; 3 is a schematic diagram of a functional module of a user terminal in an implementation manner of the application; FIG. 4 is a schematic structural diagram of a user terminal in an embodiment of this application.

Claims (15)

一種圖形碼的解碼方法,其特徵在於,提供有解碼資訊,該解碼資訊中包括解碼方式以及該解碼方式關聯的間隔資訊,該間隔資訊用於限定關聯的解碼方式在解碼過程中使用的頻率;該方法包括: 獲取當前幀圖像,並確定該當前幀圖像對應的當前幀資訊; 根據該間隔資訊和該當前幀資訊,在該解碼資訊的解碼方式中確定該當前幀圖像適配的目標解碼方式; 按照該目標解碼方式對該當前幀圖像中包含的圖形碼進行解碼。A decoding method of a graphic code, characterized in that decoding information is provided, and the decoding information includes a decoding method and interval information associated with the decoding method, and the interval information is used to limit the frequency of the associated decoding method used in the decoding process; The method includes: Obtain the current frame image and determine the current frame information corresponding to the current frame image; According to the interval information and the current frame information, determine the target decoding mode of the current frame image adaptation in the decoding mode of the decoding information; The graphics code contained in the current frame image is decoded according to the target decoding method. 根據請求項1所述的方法,其中,該間隔資訊包含間隔幀數;相應地,確定該當前幀圖像對應的當前幀資訊包括: 記錄該當前幀圖像的當前幀數,並將記錄的該當前幀數作為該當前幀資訊。The method according to claim 1, wherein the interval information includes the number of interval frames; accordingly, determining the current frame information corresponding to the current frame image includes: Record the current frame number of the current frame image, and use the recorded current frame number as the current frame information. 根據請求項2所述的方法,其中,在該解碼資訊的解碼方式中確定該當前幀圖像適配的目標解碼方式包括: 確定該間隔幀數對應的幀數序列,該幀數序列中包括至少一個幀數; 判斷該當前幀數是否存在於該幀數序列中,若存在,將該間隔幀數關聯的解碼方式確定為該當前幀圖像適配的目標解碼方式。The method according to claim 2, wherein determining the target decoding mode adapted for the current frame image in the decoding mode of the decoding information includes: Determining a frame number sequence corresponding to the interval frame number, the frame number sequence including at least one frame number; Determine whether the current frame number exists in the frame number sequence, and if it exists, determine the decoding method associated with the interval frame number as the target decoding method for the current frame image adaptation. 根據請求項1所述的方法,其中,該間隔資訊包含間隔時間;相應地,確定該當前幀圖像對應的當前幀資訊包括: 記錄獲取該當前幀圖像時的當前時間節點,並將該當前時間節點作為該當前幀資訊。The method according to claim 1, wherein the interval information includes an interval time; accordingly, determining the current frame information corresponding to the current frame image includes: Record the current time node when acquiring the current frame image, and use the current time node as the current frame information. 根據請求項4所述的方法,其中,在該解碼資訊的解碼方式中確定該當前幀圖像適配的目標解碼方式包括: 確定該間隔時間對應的時間序列,該時間序列中包括至少一個時間節點; 判斷該當前時間節點是否存在於該時間序列中,若存在,將該間隔時間關聯的解碼方式確定為該當前幀圖像適配的目標解碼方式。The method according to claim 4, wherein determining the target decoding mode adapted to the current frame image in the decoding mode of the decoding information includes: Determining a time series corresponding to the interval time, the time series including at least one time node; Determine whether the current time node exists in the time sequence, and if so, determine the decoding method associated with the interval time as the target decoding method for the current frame image adaptation. 根據請求項1所述的方法,其中,若按照該目標解碼方式解碼失敗,該方法還包括: 停止對該當前幀圖像中包含的圖形碼進行解碼,並獲取下一幀圖像。The method according to claim 1, wherein, if decoding fails according to the target decoding method, the method further includes: Stop decoding the graphics code contained in the current frame image and obtain the next frame image. 根據請求項1所述的方法,其中,若該當前幀圖像與至少兩個目標解碼方式相適配,按照該目標解碼方式對該當前幀圖像中包含的圖形碼進行解碼包括: 在所述至少兩個目標解碼方式中確定當前的目標解碼方式,並按照該當前的目標解碼方式對該當前幀圖像中包含的圖形碼進行解碼; 若解碼成功,停止本次的解碼過程; 若解碼失敗,在所述至少兩個目標解碼方式中確定與該當前的目標解碼方式不同的目標解碼方式,並按照確定的該目標解碼方式對該當前幀圖像中包含的圖形碼進行解碼。The method according to claim 1, wherein, if the current frame image is adapted to at least two target decoding modes, decoding the graphic code included in the current frame image according to the target decoding mode includes: Determining the current target decoding mode among the at least two target decoding modes, and decoding the graphic code contained in the current frame image according to the current target decoding mode; If the decoding is successful, stop this decoding process; If the decoding fails, determine a target decoding mode different from the current target decoding mode among the at least two target decoding modes, and decode the graphic code included in the current frame image according to the determined target decoding mode. 根據請求項1所述的方法,其中,該當前幀圖像與至少兩個目標解碼方式相適配,並且該目標解碼方式具備預設優先順序;相應地,按照該目標解碼方式對該當前幀圖像中包含的圖形碼進行解碼包括: 按照預設優先順序對所述至少兩個目標解碼方式排序,並按照排序結果依次對該當前幀圖像中包含的圖形碼進行解碼; 若解碼成功,停止本次的解碼過程; 若按照排序結果均解碼失敗,停止針對該當前幀圖像的解碼過程,並獲取下一幀圖像。The method according to claim 1, wherein the current frame image is adapted to at least two target decoding modes, and the target decoding mode has a preset priority order; accordingly, the current frame is processed according to the target decoding mode The decoding of the graphic code contained in the image includes: Sort the at least two target decoding modes according to a preset priority order, and sequentially decode the graphic codes contained in the current frame image according to the sorting result; If the decoding is successful, stop this decoding process; If decoding fails according to the sorting results, stop the decoding process for the current frame image and obtain the next frame image. 一種用戶端,其特徵在於,該用戶端包括: 儲存單元,用於儲存解碼資訊,該解碼資訊中包括解碼方式以及該解碼方式關聯的間隔資訊,該間隔資訊用於限定關聯的解碼方式在解碼過程中使用的頻率; 當前幀資訊確定單元,用於獲取當前幀圖像,並確定該當前幀圖像的當前幀資訊; 目標解碼方式確定單元,用於根據該間隔資訊和該當前幀資訊,在該解碼資訊的解碼方式中確定該當前幀圖像適配的目標解碼方式; 解碼單元,用於按照該目標解碼方式對該當前幀圖像中包含的圖形碼進行解碼。A user terminal, characterized in that the user terminal includes: The storage unit is used for storing decoding information, the decoding information includes a decoding method and interval information associated with the decoding method, and the interval information is used to define a frequency of the associated decoding method used in the decoding process; The current frame information determining unit is used to obtain the current frame image and determine the current frame information of the current frame image; The target decoding mode determining unit is used to determine the target decoding mode for the current frame image adaptation in the decoding mode of the decoding information based on the interval information and the current frame information; The decoding unit is configured to decode the graphic code contained in the current frame image according to the target decoding mode. 根據請求項9所述的用戶端,其中,該間隔資訊包含間隔幀數;相應地,該當前幀資訊確定單元包括: 幀數記錄模組,用於記錄該當前幀圖像的當前幀數,並將記錄的該當前幀數作為該當前幀資訊。The user terminal according to claim 9, wherein the interval information includes the number of interval frames; correspondingly, the current frame information determination unit includes: The frame number recording module is used to record the current frame number of the current frame image, and use the recorded current frame number as the current frame information. 根據請求項10所述的用戶端,其中,該目標解碼方式確定單元包括: 幀數序列確定模組,用於確定該間隔幀數對應的幀數序列,該幀數序列中包括至少一個幀數; 幀數匹配模組,用於判斷該當前幀數是否存在於所述幀數序列中,若存在,將該間隔幀數關聯的解碼方式確定為該當前幀圖像適配的目標解碼方式。The user terminal according to claim 10, wherein the target decoding mode determination unit includes: The frame number sequence determination module is used to determine a frame number sequence corresponding to the interval frame number, and the frame number sequence includes at least one frame number; The frame number matching module is used to determine whether the current frame number exists in the frame number sequence, and if it exists, determine the decoding method associated with the interval frame number as the target decoding method for the current frame image adaptation. 根據請求項9所述的用戶端,其中,該間隔資訊包含間隔時間;相應地,該當前幀資訊確定單元包括: 時間節點記錄模組,用於記錄獲取該當前幀圖像時的當前時間節點,並將該當前時間節點作為該當前幀資訊。The user terminal according to claim 9, wherein the interval information includes an interval time; correspondingly, the current frame information determination unit includes: The time node recording module is used to record the current time node when acquiring the current frame image, and use the current time node as the current frame information. 根據請求項12所述的用戶端,其中,該目標解碼方式確定單元包括: 時間序列確定模組,用於確定該間隔時間對應的時間序列,該時間序列中包括至少一個時間節點; 時間節點匹配模組,用於判斷該當前時間節點是否存在於該時間序列中,若存在,將該間隔時間關聯的解碼方式確定為該當前幀圖像適配的目標解碼方式。The user terminal according to claim 12, wherein the target decoding mode determination unit includes: The time series determining module is used to determine the time series corresponding to the interval time, and the time series includes at least one time node; The time node matching module is used to determine whether the current time node exists in the time sequence, and if so, determine the decoding method associated with the interval time as the target decoding method for the current frame image adaptation. 根據請求項9所述的用戶端,其中,該當前幀圖像與至少兩個目標解碼方式相適配,並且該目標解碼方式具備預設優先順序;相應地,該解碼單元包括: 排序模組,用於按照預設優先順序對所述至少兩個目標解碼方式排序,並按照排序結果依次對該當前幀圖像中包含的圖形碼進行解碼; 解碼判定模組,用於在解碼成功的情況下,停止本次的解碼過程;在按照排序結果均解碼失敗的情況下,停止針對該當前幀圖像的解碼過程,並獲取下一幀圖像。The user terminal according to claim 9, wherein the current frame image is adapted to at least two target decoding modes, and the target decoding mode has a preset priority order; accordingly, the decoding unit includes: A sorting module, configured to sort the at least two target decoding modes according to a preset priority order, and sequentially decode the graphic codes contained in the current frame image according to the sorting result; The decoding decision module is used to stop the current decoding process when the decoding is successful; when the decoding results are all failed according to the sorting results, stop the decoding process for the current frame image and obtain the next frame image . 一種用戶端,其特徵在於,該用戶端包括處理器和記憶體,該記憶體用於儲存電腦程式,該電腦程式被該處理器執行時,實現如申請專利範圍第1至8項中任一項所述的方法。A user terminal, characterized in that the user terminal includes a processor and a memory, and the memory is used to store a computer program, and when the computer program is executed by the processor, any one of items 1 to 8 of the patent application scope is realized. Item.
TW108106636A 2018-06-07 2019-02-27 Decoding method of graphic code and user terminal for decoding graphic code TWI759583B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810580159.3A CN108960384B (en) 2018-06-07 2018-06-07 Decoding method of graphic code and client
CN201810580159.3 2018-06-07

Publications (2)

Publication Number Publication Date
TW202001667A true TW202001667A (en) 2020-01-01
TWI759583B TWI759583B (en) 2022-04-01

Family

ID=64494038

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108106636A TWI759583B (en) 2018-06-07 2019-02-27 Decoding method of graphic code and user terminal for decoding graphic code

Country Status (3)

Country Link
CN (1) CN108960384B (en)
TW (1) TWI759583B (en)
WO (1) WO2019233144A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108960384B (en) * 2018-06-07 2020-04-28 阿里巴巴集团控股有限公司 Decoding method of graphic code and client
CN113935352A (en) * 2020-06-29 2022-01-14 比亚迪股份有限公司 Method, device and equipment for scanning and decoding riding two-dimensional code and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100479331C (en) * 2004-03-30 2009-04-15 深圳市朗科科技股份有限公司 Bar-code decoding method
JP2006238363A (en) * 2005-02-28 2006-09-07 Nippon Telegr & Teleph Corp <Ntt> Wireless tag system, wireless tag, and interrogator
CN100568975C (en) * 2005-04-15 2009-12-09 索尼株式会社 Decoding device, coding/decoding method
CN104811722B (en) * 2015-04-16 2019-05-07 华为技术有限公司 A kind of decoding method and device of video data
CN105117759B (en) * 2015-09-08 2019-02-15 北京意锐新创科技有限公司 Dynamic two-dimension code generates and read method, device
CN111291584B (en) * 2016-07-22 2023-05-02 创新先进技术有限公司 Method and system for identifying two-dimensional code position
CN107301366B (en) * 2017-05-12 2020-07-31 赵毅 Decoding method and device for graphic code in embedded code video
CN107908998B (en) * 2017-11-28 2020-11-03 百富计算机技术(深圳)有限公司 Two-dimensional code decoding method and device, terminal equipment and computer readable storage medium
CN108960384B (en) * 2018-06-07 2020-04-28 阿里巴巴集团控股有限公司 Decoding method of graphic code and client

Also Published As

Publication number Publication date
CN108960384A (en) 2018-12-07
WO2019233144A1 (en) 2019-12-12
TWI759583B (en) 2022-04-01
CN108960384B (en) 2020-04-28

Similar Documents

Publication Publication Date Title
TWI769360B (en) A scanning code image recognition method, device and equipment
EP3540649A1 (en) Target detection method and device
CN107609437B (en) Target graphic code identification method and device
KR20190094191A (en) Blockchain based data processing method and apparatus
KR102165134B1 (en) Methods and systems for using state vector data in a state machine engine
WO2019141108A1 (en) Doi scanning-based information processing method, apparatus, and device
CN108491897B (en) Information identification method, server, client and system
KR20210041637A (en) Information display method and device
KR20140103143A (en) Counter operation in a state machine lattice
CN107563297B (en) Waveform matching method and device
TWI759583B (en) Decoding method of graphic code and user terminal for decoding graphic code
WO2019179234A1 (en) Image identification method, apparatus and device
CN110895503B (en) Application performance monitoring method and client
CN105045676B (en) A kind of restoration methods of the loss data based on SQLite databases
EP3327613A1 (en) Fingerprint entry method, apparatus, and terminal device
TWI694392B (en) Method and device for displaying unique identifier of digital object
CN112347512A (en) Image processing method, device, equipment and storage medium
CN106973003A (en) Group message notification method, client, electronic equipment and server
WO2020119515A1 (en) Video transcoding method and device
US20200356830A1 (en) Method and system for applying barcode, and server
CN105022746A (en) Character library generation method, server and system
CN109460193B (en) IO processing method, device and terminal in storage system
US20110280486A1 (en) Electronic device and method for sorting pictures
WO2018077059A1 (en) Barcode identification method and apparatus
CN111652074B (en) Face recognition method, device, equipment and medium