CN110069723B - Graphic code identification method, device and storage medium - Google Patents
Graphic code identification method, device and storage medium Download PDFInfo
- Publication number
- CN110069723B CN110069723B CN201710719276.9A CN201710719276A CN110069723B CN 110069723 B CN110069723 B CN 110069723B CN 201710719276 A CN201710719276 A CN 201710719276A CN 110069723 B CN110069723 B CN 110069723B
- Authority
- CN
- China
- Prior art keywords
- information
- graphic code
- picture
- webpage
- address
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 230000004044 response Effects 0.000 claims abstract description 72
- 230000004913 activation Effects 0.000 claims abstract description 53
- 230000008569 process Effects 0.000 claims abstract description 26
- 230000006870 function Effects 0.000 claims description 70
- 238000012790 confirmation Methods 0.000 claims description 18
- 238000001514 detection method Methods 0.000 claims description 11
- 230000003993 interaction Effects 0.000 claims description 6
- 238000003825 pressing Methods 0.000 claims description 2
- 230000002452 interceptive effect Effects 0.000 claims 1
- 238000012545 processing Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000010079 rubber tapping Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9554—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL] by using bar codes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a graphic code identification method, a graphic code identification device and a storage medium, and belongs to the technical field of information. The method comprises the following steps: when the webpage loading is finished and the image in the webpage is detected to contain the graphic code, identifying the graphic code to obtain the information contained in the graphic code, and establishing the corresponding relation between the source address of the image and the information contained in the graphic code; and in the process of displaying the webpage, when the activation operation of the picture is detected, responding according to the corresponding relation. When the user triggers the activation operation of the picture, the response can be immediately carried out, so that the waiting time of the user is shortened, and the recognition efficiency of the picture code is improved.
Description
Technical Field
The present invention relates to the field of information technology, and in particular, to a method, an apparatus, and a storage medium for identifying a graphic code.
Background
The graphic code is a certain specific geometric figure formed by arranging black and white figures according to a certain coding rule, can be used for recording information such as webpage addresses, telephone numbers and the like, and can acquire information contained in the graphic code by identifying the graphic code.
The method comprises the steps that a graphic code is usually arranged in a webpage in a picture form, in the process of displaying the webpage on a terminal, when the activation operation of a user on the picture is detected and the picture is detected to include the graphic code, an identification option is displayed, when the click operation of the user on the identification option is detected, the graphic code in the picture is identified to obtain information contained in the graphic code, and the information contained in the graphic code is processed according to the information contained in the graphic code.
In the process of implementing the invention, the inventor finds that the related technology has at least the following defects: after the user triggers the activation operation on the picture, the process of identifying the graphic code takes a while, which may result in inefficient identification of the graphic code.
Disclosure of Invention
In order to solve the problems of the related art, embodiments of the present invention provide a method, an apparatus, and a storage medium for identifying a graphic code. The technical scheme is as follows:
in a first aspect, a method for identifying a graphic code is provided, where the method includes:
when the webpage is loaded and the picture in the webpage is detected to contain the graphic code, identifying the graphic code to obtain the information contained in the graphic code;
establishing a corresponding relation between a source address of the picture and information contained in the picture code;
and in the process of displaying the webpage, when the activation operation on the picture is detected, responding according to the corresponding relation.
In a second aspect, there is provided a graphic code recognition apparatus, the apparatus including:
the identification module is used for identifying the graphic code when the webpage is completely loaded and the graphic code is detected to be contained in the picture in the webpage to obtain the information contained in the graphic code;
the establishing module is used for establishing a corresponding relation between the source address of the picture and the information contained in the picture code;
and the response module is used for responding according to the corresponding relation when the activation operation of the picture is detected in the process of displaying the webpage.
In a third aspect, there is provided a graphic code recognition apparatus, which includes a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, and the instruction, the program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the operations performed in the graphic code recognition method according to the first aspect.
In a fourth aspect, there is provided a computer-readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement the operations performed in the pattern code recognition method according to the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
according to the method, the device and the storage medium provided by the embodiment of the invention, when the webpage is loaded and the picture in the webpage is detected to contain the graphic code, the graphic code is identified to obtain the information contained by the graphic code, the corresponding relation between the source address of the picture and the information contained by the graphic code is established, and in the process of displaying the webpage, a user can immediately respond when triggering the activation operation of the picture, so that the waiting time of the user is shortened, and the identification efficiency of the graphic code is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an application client according to an embodiment of the present invention;
fig. 2 is a flowchart of a graphic code identification method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a display option provided by an embodiment of the present invention;
FIG. 4 is a schematic flow chart of an operation provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a graphic code recognition apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Before describing the embodiments of the present invention in detail, the concepts related to the embodiments of the present invention will be explained as follows:
1. specifying the application: the application is installed in an operating system of the terminal, and various functions provided by the operating system of the terminal, such as an audio playing function of a speaker, a shooting function of a camera, and the like, can be applied.
The designated application may be developed in Java (an object-oriented programming language) or other languages and published in an application store for terminal download installation. For example, the specified application may be a native application in an android system.
2. And a browsing function kernel: the terminal is responsible for interpreting and rendering the web page syntax and determining how the terminal displays the web page content and the web page format information.
In the embodiment of the invention, the hybrid application client is an application client formed by embedding the browsing function kernel into the specified application, and the hybrid application client can realize functions of some terminals through the specified application and can also realize the function of displaying the webpage through the browsing function kernel.
Fig. 1 is a schematic structural diagram of an application client according to an embodiment of the present invention, and referring to fig. 1, the application client is a hybrid application client, and may display a page provided by a specific application, and may also access a service of a browsing function kernel to extend a web page, for example, the application client may be an instant messaging client, an information display client, a payment client, and the like.
The application client comprises a designated application 101 and a browsing function kernel 102, wherein a graphic code recognition library 1021 is arranged in the browsing function kernel 102. The designated application 101 may generate and display a page of a designated type, the browsing function kernel 102 may load and display a web page, and the graphic code recognition library 1021 may detect whether a picture includes a graphic code, or may recognize the graphic code to obtain information included in the graphic code.
The embodiment of the invention is applied to the scene of identifying the graphic code in the webpage, and the graphic code can comprise various forms such as a two-dimensional code, a bar code and the like. When a user triggers an activation operation on any picture in a webpage, the designated application 101 detects the activation operation triggered by the user and interacts with the browsing function kernel 102, the browsing function kernel 102 is used for detecting and identifying a graphic code through the graphic code identification library 1021, and the designated application 101 and the browsing function kernel 102 work cooperatively to realize automatic identification of the graphic code.
In consideration of the fact that after a user triggers an activation operation on a picture, a process of detecting a graphic code and a process of identifying the graphic code take a certain time, that is, the user needs to wait for a period of time to identify information contained in the graphic code, and the identification efficiency is very low. In order to save time and improve identification efficiency, the embodiment of the invention detects and identifies the graphic code when the webpage is loaded and before the user triggers the activation operation on the picture, so that the user can directly acquire the identification result when triggering the activation operation on the picture without waiting for a long time. The specific process is described in detail in the following examples.
Fig. 2 is a flowchart of a graphic code identification method provided in an embodiment of the present invention, where an execution subject of the graphic code identification method is an application client shown in fig. 1, and referring to fig. 2, the method includes:
201. and when the browsing function kernel finishes loading the webpage, acquiring the data information of the picture from the data information of the webpage, calling a first interface provided by a graphic code identification library according to the data information, and detecting whether the picture contains a graphic code.
The web page may be any web page provided by a web server. The specified application initiates a webpage loading request, such as webview. When the webpage loading is completed, the browsing function kernel sends a page loading completion message, such as a webview.
When the webpage is loaded, the browsing function kernel acquires data information of the webpage, the webpage can include various types of data such as texts, pictures and videos, and correspondingly, the data information of the webpage can include data information of various types of data such as texts, pictures and videos.
Because the graphic code is usually set in the web page in the form of a picture, in order to identify the graphic code, the browsing function kernel obtains data information of the picture from the web page, where the data information may include original data information of the picture, and a data type (i.e., picture type), a size, an occupied storage space, a source address, and the like, where the original data information of the picture may be in multiple formats such as Bitmap (Bitmap), JPEG (Joint Photographic Experts Group, and international image compression standard formulated by Joint image Experts Group), and the storage space refers to a storage address of the picture in the application client, and the source address refers to a storage address of the picture in the web server, such as a src (source) address.
The browsing function kernel is internally provided with a graphic code recognition library which is used for detecting and recognizing graphic codes and can be a zxing recognition library, a zbar recognition library and the like. The graphic code recognition library can provide a first interface and a second interface for the browsing function kernel, wherein the first interface is used for detecting whether the graphic code is included in the picture to realize coarse recognition, and the second interface is used for recognizing the graphic code to obtain information contained in the graphic code to realize fine recognition.
And after the browsing function kernel acquires the data information of the picture, calling a first interface provided by a graphic code identification library according to the data information, and detecting whether the picture contains a graphic code. In a possible implementation manner, the browsing function kernel may call the first interface, create a detection task for the picture, execute the detection task by the sub-thread, and detect whether the picture contains a graphic code.
It should be noted that, in the embodiment of the present invention, only any picture in the web page is taken as an example for description, and actually, the web page may include multiple pictures, and each picture may be identified by using the method provided in the embodiment of the present invention. Accordingly, when the browsing function kernel finishes loading the web page, the data information of each picture can be acquired, the first interface is called, the detection task corresponding to each picture is created, the created detection tasks are respectively executed by the sub-threads, whether each picture contains the graphic code is detected, so that the picture containing the graphic code is screened out, and the following step 202 is executed on the screened picture.
Another point to be described is that the mode of detecting by using the graphic code recognition library is an optional mode, and the browsing function kernel may also detect whether the picture contains the graphic code by using other modes, for example, the browsing function kernel may send the picture to a network server, and the detection result is returned to the browsing function kernel after the detection by the network server.
202. When detecting that the picture contains the graphic code, the browsing function kernel calls a second interface provided by the graphic code identification library according to the data information to identify the graphic code to obtain information contained in the graphic code, and establishes a corresponding relation between a source address of the picture and the information contained in the graphic code.
Aiming at the identification process of the graphic code, when the browsing function kernel determines that the picture contains the graphic code, the picture can be preprocessed before identification, and then the graphic code in the processed picture is identified. The preprocessing may include rotation processing, noise reduction processing, image enhancement processing, and the like, and may be determined as needed.
Aiming at the information type contained in the graphic code, the information contained in the graphic code can be a webpage address, business card information, a mobile phone number, a mailbox address and the like.
Aiming at the process of establishing the corresponding relation, the corresponding relation can be stored in a form of a table, a browsing function kernel can create a hash table, a source address of a picture is used as a Key, information identified by a graphic code in the picture is used as a Value, and the Key and the Value are correspondingly stored in the hash table.
It should be noted that, for a plurality of pictures in the web page, the step 202 may be executed to establish a corresponding relationship for the picture including the graphic code, but the picture not including the graphic code does not establish the corresponding relationship, so that if the corresponding relationship includes the source address of a certain picture, it indicates that the picture includes the graphic code, and if the corresponding relationship does not include the source address of a certain picture, it indicates that the picture does not include the graphic code.
It should be noted that, the manner of identifying by using the graphic code identification library is an optional manner, and the browsing function kernel may also identify the graphic code by using other manners, for example, the browsing function kernel may send the picture to an identification server, and the identification server identifies the graphic code in the picture and returns the identified information to the browsing function kernel.
203. And in the process of displaying the webpage by the designated application, when the activation operation of the picture is detected, sending an information request message to the browsing function kernel.
When the browsing function kernel finishes loading the webpage, the webpage can be sent to the specified application, and the specified application can display the webpage for the user to browse. The method comprises the steps that a user can trigger activation operation on any picture in a webpage in the browsing process, the activation operation can be click operation, long press operation and other operations, when the activation operation is detected, an appointed application sends an information request message for the picture to a browsing function kernel, and the information request message comprises position information of the picture in the webpage and is used for requesting to acquire data information of the picture.
In one possible implementation, the specified application may call a webview. GetHitTestResult interface, sending a getHitTestResult message to the browse function kernel.
204. And the browsing function kernel receives the information request message, acquires the data information of the picture according to the position information, and generates an information response message according to the data information and the information contained in the graphic code corresponding to the source address of the picture when the established corresponding relationship is determined to comprise the information contained in the graphic code.
205. And the browsing function kernel sends an information response message to the specified application.
The information response message includes data information of the picture and information corresponding to the source address of the picture, that is, information included in the picture code in the picture.
When the browsing function kernel receives the information request message, the display element triggering the activation operation at this time can be determined to be the picture according to the position information included in the information request message and the position information of each display element in the webpage, and the data information of the picture is obtained from the data information of the webpage, wherein the data information includes the source address of the picture.
After the source address of the picture is obtained, the established corresponding relation can be inquired according to the source address of the picture, information corresponding to the source address is obtained, namely information contained in the graphic code of the picture, an information response message is generated according to the data information of the picture and the information contained in the graphic code, and the information response message is sent to the designated application. That is, the embodiment of the present invention expands the information response message, and adds information included in the graphic code in the picture to the information response message in addition to the data information of the picture.
Based on the possible implementation manner of step 203, the browsing function kernel receives the getHitTestResult message, and sends the HitTestResult message to the specified application, where the HitTestResult message includes the data information of the picture and the information corresponding to the source address.
The HitTestResult message includes a plurality of fields, such as a data type field, a size field, a storage space field, a source address field, and an identification content field, where the data type field is used to carry a data type of the picture, the size field is used to carry a size of the picture, the storage space field is used to carry a storage space occupied by the picture, the source address field is used to carry a source address of the picture, and the identification content field is used to carry information corresponding to the source address of the picture, that is, information included in the picture code.
In another embodiment, if the corresponding relationship does not include the source address of the picture, the browsing function kernel cannot acquire the information corresponding to the source address when querying the corresponding relationship according to the source address of the picture, and at this time, the content field is identified as empty in the generated HitTestResult message.
206. And the designated application receives the information response message and responds according to the information response message.
When the designated application receives the information response message, whether the information response message includes information corresponding to the source address of the picture can be judged, so that whether the picture includes the graphic code can be determined. For example, it may be determined whether the identification content field of the HitTestResult message is empty, where if the identification content field is empty, it indicates that the current picture does not include the graphics code, and if the identification content field is not empty, it indicates that the current picture includes the graphics code.
In a first possible implementation manner, when it is determined that the information response message includes the information included in the graphic code, responding according to the information included in the graphic code according to the operation type of the activation operation.
When the activation operation is a long-press operation, the designated application may display one or more options, such as a view big picture option, a save picture option, a send option, a collect option, and an identify option, at this time, the user may trigger a confirmation operation for any option according to a requirement, and the designated application performs corresponding processing according to the detected confirmation operation. When the confirmation operation of the identification option is detected, the response is carried out according to the information contained in the graphic code.
For example, referring to FIG. 3, a user, when long-pressing a graphic code in a web page, displays a view big picture option, a save picture option, a send option, a collect option, and an identify option. When the designated application detects the confirmation operation of viewing the large picture option, displaying an original picture corresponding to the picture; when the appointed application detects the confirmation operation of the picture saving option, the picture is stored in the picture library; when the appointed application detects the confirmation operation of the sending option, the picture is sent to a friend selected from the address list by the user; when the appointed application detects the confirmation operation of the collection option, collecting the picture; when the specified application detects a confirmation operation for the identification option, processing is performed in accordance with the information.
In addition, when the activation operation is a click operation, the specified application may not display the option but directly respond to information included in the graphic code.
In a second possible implementation manner, when it is determined that the information response message includes information included in the graphic code, the configuration information of the web page is acquired, and when the configuration information does not include a response operation corresponding to the activation operation, the response is performed according to the information included in the graphic code.
The configuration information includes response operations corresponding to a plurality of operations, and when a certain operation is triggered for a certain display element in the web page, the response operation corresponding to the operation triggered in the configuration information can be executed.
In the embodiment of the present invention, when the activation operation on the picture is detected, the configuration information may be queried first, and when the configuration information does not include a response operation corresponding to the activation operation, it indicates that there is no response logic for the activation operation in the web page, and at this time, the designated application may directly respond according to the information included in the graphic code, which is equivalent to expanding a response logic for identifying the graphic code for the activation operation in the case that there is no response logic for the activation operation originally in the web page.
In the embodiment of the present invention, according to different types of information contained in the graphic code, the process of responding according to the information contained in the graphic code may include the following several ways:
and when the information contained in the graphic code is a webpage address, loading a corresponding webpage according to the webpage address, and displaying the loaded webpage. And when the information contained in the graphic code is the business card information, displaying the business card information and displaying an adding option, and when the confirming operation of the adding option is detected, adding the business card information into the address book of the application client. And when the information contained in the graphic code is the mobile phone number, displaying the mobile phone number and displaying an addition option, and when the confirmation operation of the addition option is detected, adding the mobile phone number into an address book of a terminal where the application client is located. And when the information contained in the graphic code is a mailbox address, displaying the mailbox address and an adding option, and when a confirmation option of the adding option is detected, calling a mailbox management application of the current terminal to add the mailbox address to an address book of the mailbox management application.
In practical application, in order to distinguish the two possible implementation manners, one or more options may be displayed for the user to select when the activation operation is a long-press operation, and when the activation operation is a click operation and the configuration information does not include a response operation corresponding to the click operation, the user directly responds according to information included in the graphic code.
In another embodiment, when it is determined that the information corresponding to the source address of the picture is not included in the information response message, the picture does not include the graphic code, and at this time, the activation operation may not be responded, or an option of viewing a large picture and an option of saving the picture may be displayed, and an identification option is not displayed.
In the related technology, after a user presses a graphic code for a long time, rough identification is initiated, after a period of time, an option of identifying the graphic code in a picture is displayed, after the user clicks the option, fine identification of the graphic code is initiated, information contained in the graphic code is analyzed, and link skipping or content display is achieved. In the process, the waiting time of the user is too long, the identification path is long, and the user experience is influenced.
In the embodiment of the invention, the application client detects and identifies the graphic code when the webpage is loaded, so that the identification result can be immediately obtained when the user triggers the activation operation on the picture, and the identification option can be directly displayed or the response can be directly carried out according to the identification result without waiting.
According to the method provided by the embodiment of the invention, when the webpage is loaded and the picture in the webpage is detected to contain the graphic code, the graphic code is identified to obtain the information contained in the graphic code, the corresponding relation between the source address of the picture and the information contained in the graphic code is established, and in the process of displaying the webpage, when a user triggers the activation operation of the picture, the response can be immediately carried out, so that the waiting time of the user is shortened, and the identification efficiency of the graphic code is improved. In addition, under the condition of directly responding without displaying the identification options, the user does not need to trigger the confirmation operation of the identification options, the identification path can be shortened, and the user experience is improved.
An exemplary operation flow of an application client is provided in an embodiment of the present invention, and referring to fig. 4, the operation flow includes:
1. the specified application initiates a web page load request.
2. And loading the corresponding webpage by the browsing function kernel, sending a webpage loading end notification to the specified application when the webpage loading is completed, and initiating a graphic code identification task.
3. In the process of executing the graphic code identification task, the browsing function kernel acquires all pictures in a webpage, performs rough identification on all the pictures, and detects whether each picture comprises a graphic code, so that the pictures comprising the graphic code are screened out.
4. And accurately identifying the screened picture comprising the graphic code, taking the src address of the picture as Key, and taking the information identified by the graphic code as Value, and storing the Value in a hash table.
5. When a user presses a picture for a long time, a designated application initiates a getHitTestResult message, after a browsing function kernel acquires data information of the picture, the src address of the picture is taken as Key, information contained in a corresponding graphic code is searched in a hash table, if the information contained in the graphic code exists, the information is stored in an identification content field newly added to the HitTestResult message, and the HitTestResult message is returned to the designated application.
6. When the specified application determines that the identification content field of the HitTestResult message has information, it may be determined that the picture includes a graphic code, and at this time, the menu item may be displayed: the "view big picture" option, the "save picture" option, and the "identify graphic code in picture" option.
7. And when the user clicks the option of 'graphic code in the identification graph', responding according to the information in the identification content field.
In addition, if the user clicks on the picture in step 5, when the specified application determines that the identification content field of the HitTestResult message has information in step 6, the application can directly respond according to the information in the identification content field.
It should be added that, the above embodiment is only described by taking an example that the application client includes a specified application and a browsing function kernel, and in an actual application, the above embodiment may be implemented by the application client without limiting a specific structure of the application client.
For example, the step of detecting whether the picture includes the graphic code through the first interface, the step of identifying the graphic code through the second interface, the step of responding according to the operation type of the activation operation or the step of responding according to the configuration information of the web page, and the like, may all be implemented by the application client.
Fig. 5 is a schematic structural diagram of a graphic code recognition apparatus according to an embodiment of the present invention. Referring to fig. 5, the apparatus is applied to an application client, and includes:
an identifying module 501, configured to perform the identifying process in step 202 in the foregoing embodiment;
an establishing module 502, configured to execute the process of establishing a corresponding relationship in step 202 in the foregoing embodiment;
a response module 503, configured to perform steps 203-205 in the above embodiments.
Optionally, the apparatus further comprises:
and the detection module is used for executing the process of detecting by calling the first interface in the embodiment.
Optionally, the identifying module 501 is configured to perform a process of identifying by calling the second interface in the foregoing embodiment.
Optionally, the application client includes a designated application and a browsing function kernel, the designated application includes a response module 503, and the browsing function kernel includes an interaction module;
a response module 503, configured to execute the step of sending the information request message to the browsing function kernel in the foregoing embodiment;
the interaction module is used for executing the step of sending the information response message to the specified application in the embodiment;
a response module 503, configured to perform the step of responding according to the information response message in the foregoing embodiment.
Optionally, the response module 503 is configured to execute the step of responding according to the information included in the graphic code in the foregoing embodiment.
It should be noted that: the graphic code recognition apparatus provided in the above embodiment only exemplifies the division of the above functional modules when recognizing the graphic code, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the application client is divided into different functional modules to complete all or part of the above described functions. In addition, the graphic code identification device and the graphic code identification method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention. The terminal is provided with an application client, and the application client can be used for implementing the functions executed by the application client in the graphic code identification method shown in the above embodiment. Specifically, the method comprises the following steps:
the terminal 600 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a transmission module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 6 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other terminals via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), and the like.
The memory 120 may be used to store software programs and modules, such as the software programs and modules corresponding to the terminal shown in the above exemplary embodiment, and the processor 180 executes various functional applications and data processing, such as implementing video-based interaction, by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 600, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, input unit 130 may include a touch-sensitive surface 131 as well as other input terminals 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding link device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input terminals 132. In particular, other input terminals 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 600, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 6, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 600 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or a backlight when the terminal 600 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 600, detailed descriptions thereof are omitted.
The terminal 600 may assist the user in e-mail, web browsing, streaming media access, etc. through the transmission module 170, which provides the user with wireless or wired broadband internet access. Although fig. 6 shows the transmission module 170, it is understood that it does not belong to the essential constitution of the terminal 600 and can be omitted entirely as needed within a scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 600, links various parts of the entire handset using various interfaces and lines, and performs various functions of the terminal 600 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby integrally monitoring the handset. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
The terminal 600 further includes a power supply 190 (e.g., a battery) for supplying power to the various components, which may preferably be logically connected to the processor 180 via a power management system, such that functions of managing charging, discharging, and power consumption are performed via the power management system. The power supply 190 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal 600 may further include a camera, a bluetooth module, and the like, which will not be described herein. Specifically, in this embodiment, the display unit of the terminal 600 is a touch screen display, and the terminal 600 further includes a memory and at least one instruction, at least one program, a code set, or a set of instructions, where the at least one instruction, the at least one program, the code set, or the set of instructions is stored in the memory and is configured to be loaded and executed by one or more processors, so as to implement the operations executed in the graph code identification method in the foregoing embodiments.
The embodiment of the present invention further provides a graphic code recognition apparatus, where the graphic code recognition apparatus includes a processor and a memory, where the memory stores at least one instruction, at least one section of program, code set, or instruction set, and the instruction, the program, the code set, or the instruction set is loaded and executed by the processor to implement the operations executed in the graphic code recognition method of the foregoing embodiment.
The embodiment of the present invention further provides a computer-readable storage medium, where at least one instruction, at least one program, a code set, or a set of instructions is stored in the computer-readable storage medium, and the instruction, the program, the code set, or the set of instructions is loaded and executed by a processor to implement the operations performed in the graph code recognition method of the foregoing embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (14)
1. A graphic code identification method is applied to an application client, and comprises the following steps:
when the webpage is loaded and the picture in the webpage is detected to contain the graphic code, identifying the graphic code to obtain the information contained in the graphic code, wherein the information contained in the graphic code comprises a webpage address, business card information, a mobile phone number or a mailbox address;
establishing a corresponding relation between a source address of the picture and information contained in the picture code;
in the process of displaying the webpage, when the activation operation of the picture is detected, determining an information response message according to the corresponding relation;
when the information response message is determined to include the information contained in the graphic code, acquiring configuration information of the webpage, and executing response operation corresponding to the activation operation in the configuration information, wherein the configuration information includes response operation corresponding to various operations;
when the configuration information does not include a response operation corresponding to the activation operation and the information contained in the graphic code is the webpage address, loading a corresponding webpage according to the webpage address and displaying the loaded webpage;
when the configuration information does not include a response operation corresponding to the activation operation and the information contained in the graphic code is the business card information, displaying the business card information and displaying a first adding option corresponding to the business card information; when the confirmation operation of the first adding option is detected, adding the business card information into an address book of the application client;
when the configuration information does not include response operation corresponding to the activation operation and the information contained in the graphic code is the mobile phone number, displaying the mobile phone number and displaying a second adding option corresponding to the mobile phone number, and when confirmation operation of the second adding option is detected, adding the mobile phone number to an address list of a terminal where the application client is located;
and when the configuration information does not include response operation corresponding to the activation operation and the information contained in the graphic code is the mailbox address, displaying the mailbox address and a third adding option corresponding to the mailbox address, and when the confirmation operation of the third adding option is detected, calling a mailbox management application of the current terminal to add the mailbox address to an address book of the mailbox management application.
2. The method of claim 1, further comprising:
when the webpage is loaded, acquiring the data information of the picture from the data information of the webpage;
and calling a first interface provided by a graphic code identification library according to the data information, and detecting whether the picture contains a graphic code.
3. The method according to claim 1, wherein the identifying the graphic code to obtain the information contained in the graphic code comprises:
calling a second interface provided by a graphic code identification library according to the data information of the picture, identifying the graphic code to obtain the information contained in the graphic code, wherein the data information comprises the source address of the picture.
4. The method of any of claims 1 to 3, wherein the application client comprises a specified application and a browsing function kernel, the method further comprising:
when the activation operation of the picture is detected, the designated application sends an information request message to the browsing function kernel, wherein the information request message comprises the position information of the picture in the webpage;
the browsing function kernel receives the information request message and acquires data information of the picture according to the position information, wherein the data information comprises a source address of the picture;
when the browsing function kernel determines that the established corresponding relationship comprises information contained in the graphic code corresponding to the source address of the picture, the browsing function kernel generates an information response message according to the data information and the information contained in the graphic code, and sends the information response message to the specified application, wherein the information response message comprises the data information and the information contained in the graphic code;
and the designated application receives the information response message and responds according to the information response message.
5. The method of claim 4, wherein responding according to the information response message comprises:
and when the information response message is determined to include the information contained in the graphic code, responding according to the information contained in the graphic code according to the operation type of the activation operation.
6. The method according to claim 5, wherein responding according to the operation type of the activation operation and the information contained in the graphic code comprises:
when the activation operation is a long-time pressing operation, displaying an identification option, wherein the identification option is used for triggering and identifying the graphic code in the picture, and when the confirmation operation of the identification option is detected, responding according to information contained in the graphic code; or,
and when the activation operation is click operation, responding according to the information contained in the graphic code.
7. A graphic code recognition device is applied to an application client, and the device comprises:
the identification module is used for identifying the graphic code when the webpage is loaded and the graphic code is detected to be contained in the picture of the webpage, so as to obtain the information contained in the graphic code, wherein the information contained in the graphic code comprises a webpage address, business card information, a mobile phone number or a mail address;
the establishing module is used for establishing a corresponding relation between the source address of the picture and the information contained in the picture code;
the response module is used for responding according to the corresponding relation when the activation operation of the picture is detected in the process of displaying the webpage;
the interaction module is used for determining an information response message according to the corresponding relation;
the response module is configured to:
when the information response message is determined to include the information contained in the graphic code, acquiring configuration information of the webpage, and executing response operation corresponding to the activation operation in the configuration information, wherein the configuration information includes response operation corresponding to various operations;
when the configuration information does not include a response operation corresponding to the activation operation and the information contained in the graphic code is the webpage address, loading a corresponding webpage according to the webpage address and displaying the loaded webpage;
when the configuration information does not include a response operation corresponding to the activation operation and the information contained in the graphic code is the business card information, displaying the business card information and displaying an addition option; when the confirmation operation of the adding option is detected, the business card information is added into an address book of the application client;
when the configuration information does not include response operation corresponding to the activation operation and the information contained in the graphic code is the mobile phone number, displaying the mobile phone number and displaying an addition option, and when the confirmation operation of the addition option is detected, adding the mobile phone number to an address list of a terminal where the application client is located;
and when the configuration information does not include response operation corresponding to the activation operation and the information contained in the graphic code is the mailbox address, displaying the mailbox address and the adding option, and when the confirming operation of the adding option is detected, calling the mailbox management application of the current terminal and adding the mailbox address to the address list of the mailbox management application.
8. The apparatus of claim 7, further comprising:
the detection module is used for acquiring the data information of the picture from the data information of the webpage when the webpage is loaded; and calling a first interface provided by a graphic code identification library according to the data information, and detecting whether the picture contains a graphic code.
9. The apparatus according to claim 7, wherein the identifying module is configured to call a second interface provided by a graphic code identification library according to the data information of the picture, identify the graphic code, and obtain information included in the graphic code, where the data information includes a source address of the picture.
10. The apparatus according to any of claims 7-9, wherein the application client comprises a designated application and a browsing function kernel, the designated application comprising the response module, the browsing function kernel comprising an interaction module;
the response module is used for sending an information request message to the browsing function kernel when the activation operation of the picture is detected, wherein the information request message comprises the position information of the picture in the webpage;
the interactive module is used for receiving the information request message and acquiring data information of the picture according to the position information, wherein the data information comprises a source address of the picture;
the interaction module is further configured to, when it is determined that the established correspondence includes information included in the graphic code corresponding to the source address of the picture, generate the information response message according to the data information and the information included in the graphic code, and send the information response message to the designated application, where the information response message includes the data information and the information included in the graphic code;
and the response module is used for receiving the information response message and responding according to the information response message.
11. The apparatus according to claim 10, wherein the response module is further configured to, when it is determined that the information response message includes the information included in the graphic code, respond according to the information included in the graphic code according to the operation type of the activation operation.
12. The device according to claim 11, wherein the response module is further configured to display an identification option when the activation operation is a long-press operation, the identification option is used to trigger identification of a graphic code in the picture, and when a confirmation operation on the identification option is detected, respond according to information contained in the graphic code; or,
and the response module is used for responding according to the information contained in the graphic code when the activation operation is a click operation.
13. A device for recognizing a graphic code, the device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, and the instruction, the program, the set of codes, or the set of instructions is loaded and executed by the processor to realize the operations executed in the method for recognizing a graphic code according to any one of claims 1 to 6.
14. A computer readable storage medium, having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to perform the operations as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710719276.9A CN110069723B (en) | 2017-08-21 | 2017-08-21 | Graphic code identification method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710719276.9A CN110069723B (en) | 2017-08-21 | 2017-08-21 | Graphic code identification method, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110069723A CN110069723A (en) | 2019-07-30 |
CN110069723B true CN110069723B (en) | 2023-01-06 |
Family
ID=67364553
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710719276.9A Active CN110069723B (en) | 2017-08-21 | 2017-08-21 | Graphic code identification method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110069723B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103198163A (en) * | 2013-04-28 | 2013-07-10 | 百度在线网络技术(北京)有限公司 | Search result providing method and search engine |
CN103268328A (en) * | 2013-05-02 | 2013-08-28 | 百度在线网络技术(北京)有限公司 | QR (quick response) code validation method and search engine server |
CN103544272A (en) * | 2013-10-18 | 2014-01-29 | 北京奇虎科技有限公司 | Method and device for displaying pictures in browser |
CN103997567A (en) * | 2014-04-30 | 2014-08-20 | 小米科技有限责任公司 | Method and device for acquiring graphic code information |
CN104281629A (en) * | 2013-07-12 | 2015-01-14 | 贝壳网际(北京)安全技术有限公司 | Method and device for extracting picture from webpage and client equipment |
CN105824893A (en) * | 2016-03-11 | 2016-08-03 | 北京锤子数码科技有限公司 | Method and device for accessing and loading two-dimensional link |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104717125B (en) * | 2013-12-17 | 2016-06-22 | 腾讯科技(深圳)有限公司 | Graphic code store method and device |
-
2017
- 2017-08-21 CN CN201710719276.9A patent/CN110069723B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103198163A (en) * | 2013-04-28 | 2013-07-10 | 百度在线网络技术(北京)有限公司 | Search result providing method and search engine |
CN103268328A (en) * | 2013-05-02 | 2013-08-28 | 百度在线网络技术(北京)有限公司 | QR (quick response) code validation method and search engine server |
CN104281629A (en) * | 2013-07-12 | 2015-01-14 | 贝壳网际(北京)安全技术有限公司 | Method and device for extracting picture from webpage and client equipment |
CN103544272A (en) * | 2013-10-18 | 2014-01-29 | 北京奇虎科技有限公司 | Method and device for displaying pictures in browser |
CN103997567A (en) * | 2014-04-30 | 2014-08-20 | 小米科技有限责任公司 | Method and device for acquiring graphic code information |
CN105824893A (en) * | 2016-03-11 | 2016-08-03 | 北京锤子数码科技有限公司 | Method and device for accessing and loading two-dimensional link |
Non-Patent Citations (1)
Title |
---|
二维码业务实现及其典型应用;杨彦格等;《信息通信技术》;20080215(第01期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110069723A (en) | 2019-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108549519B (en) | Split screen processing method and device, storage medium and electronic equipment | |
US10853437B2 (en) | Method and apparatus for invoking application programming interface | |
CN105824641B (en) | Graphic code display methods and device | |
CN109857403B (en) | Page updating method and device, page processing method and device | |
CN108039963B (en) | Container configuration method and device and storage medium | |
CN109003194B (en) | Comment sharing method, terminal and storage medium | |
CN110020293B (en) | Multimedia data display method, device and storage medium | |
CN104915091B (en) | A kind of method and apparatus for the prompt information that Shows Status Bar | |
CN105975190B (en) | Graphical interface processing method, device and system | |
CN106254910B (en) | Method and device for recording image | |
CN106547844B (en) | A kind for the treatment of method and apparatus of user interface | |
CN110674662A (en) | Scanning method and terminal equipment | |
CN114565070B (en) | Label binding method and device and mobile terminal | |
CN105955739A (en) | Graphical interface processing method, apparatus and system | |
CN105095161B (en) | Method and device for displaying rich text information | |
CN112749074B (en) | Test case recommending method and device | |
CN106708390B (en) | Screen capturing method, device and system | |
CN108182090B (en) | Flash plug-in loading method and device based on blink kernel | |
CN106055598B (en) | Information display method and device | |
CN106095423B (en) | Method, terminal and server for providing browsing service | |
CN106302101B (en) | Message reminding method, terminal and server | |
CN117435109A (en) | Content display method and device and computer readable storage medium | |
CN106330875B (en) | Message display method and device | |
CN110069723B (en) | Graphic code identification method, device and storage medium | |
CN107219986A (en) | A kind of wallpaper method to set up, device and mobile terminal applied to terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |