Graphic code recognition method and device and electronic equipment
By receiving the interface of the second application that entered and scanning the background operation on the interface of the first application, the problem of scanning cumbersome cross -application graphic code is solved, and the simplified operating process and user experience are realized.
Patent Information
- Application Number
- CN202411041279.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-01-24
AI Technical Summary
When scanning graphics codes across applications, the processing process is cumbersome and the user operations are complicated.
By receiving the first input by displaying the first interface of the first application, and scanning the second interface of the second application running in the background based on the first interface, the graphic code recognition of across applications is directly realized.
It simplifies the cross-application graphic code scanning operation process, reduces the complexity of user operations, and eliminates the steps that users need to take screenshots and save images.
Smart Images

Figure CN119358576A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to a graphic code recognition method, device and electronic device. Background Technology
[0002] With the rapid development of electronic technology, electronic devices have been widely used. With the rapid development of the mobile Internet, graphic codes such as QR codes have gradually become an indispensable part of life, and have been widely used in mobile payment, information sharing, business activities and other scenarios.
[0003] Currently, some QR codes can only be recognized and used within their paired applications. When a QR code from the first application is displayed in the interface of a second application, the user typically takes a screenshot and saves the image containing the QR code in the second application, then exits the second application from the foreground, and finally opens the scanning interface of the first application, selects the desired image, and completes the scan. It is evident that the process for scanning image codes across applications is cumbersome and complex for the user. Summary of the Invention
[0004] The purpose of this application is to provide a graphic code recognition method, device, and electronic device to solve the problem of cumbersome processing flow and complicated user operation when scanning graphic codes across applications in related technologies.
[0005] In a first aspect, embodiments of this application provide a graphic code recognition method, the method comprising:
[0006] When displaying a first interface of a first application, a first input is received, wherein the first interface is used for scanning a graphic code.
[0007] In response to the first input, a second interface of the second application running in the background is scanned based on the first interface.
[0008] Secondly, embodiments of this application provide a graphic code recognition device, the device comprising:
[0009] A receiving module is used to receive a first input when a first interface of a first application is displayed, wherein the first interface is used for scanning a graphic code.
[0010] The first scanning module is used to scan the second interface of the second application running in the background based on the first interface in response to the first input.
[0011] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and the program or instructions, when executed by the processor, implement the steps of the graphic code recognition method as described in the first aspect.
[0012] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the graphic code recognition method as described in the first aspect.
[0013] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the graphic code recognition method as described in the first aspect.
[0014] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the graphic code recognition method as described in the first aspect.
[0015] In this embodiment, by receiving a first input while displaying a first interface of a first application, the first interface is used for graphic code scanning; in response to the first input, scanning is performed on the second interface of a second application running in the background based on the first interface. This allows scanning of the second interface of a second application running in the background directly from the first interface of the first application displayed in the foreground, thereby eliminating the need for multiple user actions such as taking a screenshot of the second interface and saving the screenshot. This simplifies the cross-application graphic code scanning process and simplifies user operation. Attached Figure Description
[0016] Figure 1 This is a flowchart of a graphic code recognition method provided in some embodiments of this application;
[0017] Figure 2 This is one of the schematic diagrams of the first interface;
[0018] Figure 3 This is the second illustration of the first interface display;
[0019] Figure 4 This is a schematic diagram of the third interface;
[0020] Figure 5 This is one of the display diagrams shown when the second interface is running in the foreground;
[0021] Figure 6 This is the second illustration of the display when the second interface is running in the foreground;
[0022] Figure 7 This is the third illustration of the second interface running in the foreground;
[0023] Figure 8 This is the fourth illustration of the second interface running in the foreground;
[0024] Figure 9 This is a schematic diagram of the scanning image of the second interface from the first interface;
[0025] Figure 10 This is a display illustration of the photo album, including the target folder;
[0026] Figure 11 These are schematic diagrams of the structure of a graphic code recognition device provided in some embodiments of this application;
[0027] Figure 12 These are schematic diagrams of the structure of electronic devices provided in some embodiments of this application;
[0028] Figure 13 A schematic diagram of the hardware structure of an electronic device provided for some embodiments of this application. Detailed Implementation
[0029] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0030] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0031] The graphic code recognition method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0032] Figure 1 This is a flowchart illustrating the graphic code recognition method provided in the embodiments of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0033] Step 101: When the first interface of the first application is displayed, receive the first input, the first interface being used for graphic code scanning.
[0034] In this embodiment, the first application is an application installed on the electronic device that has a graphic code scanning function, and the first interface is a graphic code scanning interface. The graphic code can be a one-dimensional code such as a barcode, a two-dimensional code, or a three-dimensional code. In the following embodiments, a two-dimensional code will be used as an example for explanation.
[0035] Users can trigger the graphic code scanning function of the first application through shortcuts, or they can trigger the scanning function within the application's interface. Correspondingly, the electronic device can display the first interface of the first application on the screen. A schematic diagram of the first interface is shown below. Figure 2 and Figure 3 As shown.
[0036] When the first interface of the first application is displayed, the user can perform a first input, and the electronic device can receive the user's first input accordingly. The first input can be input to the first interface, such as input to a first control on the first interface, such as... Figure 2 As shown, the first interface 201 may include a first control 202, which may be a "scan background application" control. The first control is used to trigger the scanning of the graphic code in the second interface of the second application running in the background. The first input may also be the input of the physical button of the electronic device, which is not specifically limited here.
[0037] The first input can be touch input, voice input, or gesture input. Taking touch input as an example, the first input can be click input, double-click input, long-press input, etc. The first input can be a click input at any position on the first interface, or it can be a click input on a specified control on the first interface, such as the first control or the second control.
[0038] The first input can be a single input from the user, or it can be two or even more inputs from the user; there is no specific limitation here.
[0039] Step 102: In response to the first input, scan the second interface of the second application running in the background based on the first interface.
[0040] The first interface is the application interface displayed in the foreground, and the second interface is the application interface running in the background. The first interface and the second interface are located on different display layers. The display layer of the first interface is located above the display layer of the second interface. In this way, the display layer of the first interface is displayed on the screen of the electronic device, while the display layer of the second interface is hidden in the background.
[0041] In some embodiments, based on the first interface, a second interface hidden in a background display layer can be scanned to identify whether a graphic code matching the first application exists in the second interface of the second application. Here, a graphic code matching the first application refers to a graphic code that can be scanned and identified by the first application.
[0042] In some embodiments, based on the first interface, the display data of the display layer hidden in the background can be scanned to achieve the scanning of the second interface of the second application running in the background, wherein the display data is used to display the second interface of the second application on the display layer hidden in the background.
[0043] In some embodiments, the second interfaces of each of the second applications running in the background can be scanned one by one based on the first interface. In some embodiments, the second interface of the second application that has recently exited the foreground and entered the background can also be scanned based on the first interface. In some embodiments, the second interface of the second application selected by the user from the background application interfaces can also be scanned based on the first interface.
[0044] In this way, by scanning the second interface of the second application running in the background directly based on the first interface, no interface image that occupies storage space is generated, thus optimizing the storage space of electronic devices.
[0045] In some embodiments, the screen image of the second interface of the second application running in the background can be scanned based on the first interface. The screen image can be automatically captured by the electronic device when the second interface of the second application exits the foreground, or automatically captured from the display layer hidden in the background after the second interface of the second application exits the foreground.
[0046] Electronic devices can employ image recognition technology to scan the second interface of a second application running in the background. The scanned graphic code information can be sent to the backend server of the first application. The backend server of the first application compares the graphic code information sent by the electronic device with pre-stored graphic code information in its database and sends the matching graphic code information back to the electronic device. This enables the electronic device to recognize the graphic code in the second interface of the second application running in the background. The pre-stored graphic code information in the database can include application scenario information and user information, such as payment scenarios, friend-adding scenarios, or login scenarios.
[0047] In this embodiment, by receiving a first input while displaying a first interface of a first application, the first interface is used for graphic code scanning; in response to the first input, scanning is performed on the second interface of a second application running in the background based on the first interface. This allows scanning of the second interface of a second application running in the background directly from the first interface of the first application displayed in the foreground, thereby eliminating the need for multiple user actions such as taking a screenshot of the second interface and saving the screenshot. This simplifies the cross-application graphic code scanning process and simplifies user operation.
[0048] Optionally, step 102 specifically includes:
[0049] In response to the first input, a scan is performed on the second interface of the second application that has recently exited the foreground and is running in the background, based on the first interface.
[0050] The second interface of the second application that was last exited from the foreground to run in the background refers to the second interface of the second application that was last exited from the foreground, relative to the moment when the first interface of the first application was displayed.
[0051] For example, if a user finds a QR code matching the first application on the browser interface (the second interface of the second application) and wants to scan it using the first application, the user simply needs to bring the second interface of the second application from the foreground to the background. Then, the user can launch the first application and activate its scanning function. Correspondingly, the electronic device can display the first interface of the first application and, upon receiving the first input, scan the browser interface based on the first interface to recognize the QR code on the browser interface.
[0052] In this embodiment, the entire process of cross-application graphic code scanning is very simple and does not generate interface images that occupy storage space.
[0053] Optionally, the first interface includes a first control, and step 102 specifically includes:
[0054] In response to a first sub-input to the first control, a third interface is displayed, which displays M application interfaces running in the background, the first input including the first sub-input, and M being a positive integer;
[0055] Upon receiving a second sub-input from the user for the second interface of the second application among the M application interfaces, the second interface of the second application selected by the user is scanned based on the first interface, wherein the first input further includes the second sub-input.
[0056] In this embodiment, the first input may include a first sub-input and a second sub-input. The first sub-input may be user input to the first control. The first sub-input is used to trigger the display of the third interface. The background application interface may be displayed in the third interface as a thumbnail or as a floating window. Figure 4 As shown, the third interface displays the application interfaces 401, 402, and 403 running in the background in the form of floating windows.
[0057] Users can select an interface based on the third interface to choose the second interface of the second application that they want to scan from the first interface. For example, ... Figure 4 As shown, the user can select application interface 401, which includes a QR code, from application interfaces 401, 402, and 403. Correspondingly, upon receiving a second sub-input from the user regarding the second interface of a second application among the M application interfaces, the second interface of the second application selected by the user can be scanned based on the first interface. In this way, the user can freely choose the second interface of the second application they want to scan from the first interface of the first application, improving the flexibility of cross-application QR code scanning.
[0058] Optionally, after step 102, the method further includes:
[0059] If scanning of the second interface of the second application running in the background fails, feature recognition is performed on the second interface to obtain the feature information of the second interface.
[0060] If the feature information of the second interface indicates that there is a graphic code matching the first application in the second interface, the position of the graphic code in the second interface is adjusted to obtain the fourth interface of the second application.
[0061] The fourth interface of the second application running in the background is scanned based on the first interface.
[0062] There are several reasons why scanning the second interface of a background application might fail. The first is that the second interface of the second application does not contain a graphic code. The second is that although the second interface of the second application contains a graphic code, it is not a graphic code that matches the first application. The third is that the second interface of the second application contains a graphic code that matches the first application, but the scan fails due to low resolution or incomplete display of the graphic code.
[0063] Electronic devices may not guarantee the presence of a graphic code in the second interface when the device is no longer in the foreground. In cases where scanning the second interface of a background application fails, image recognition technology can be used to identify the features of the second interface and obtain its characteristic information. Because graphic codes have unique characteristics, and the characteristics of graphic codes differ between applications, the presence of a graphic code in the second interface, and whether the second interface contains a graphic code matching the first application, will result in different characteristic information. This characteristic information can indicate whether a graphic code matching the first application exists in the second interface.
[0064] Electronic devices may not guarantee that the graphic code displayed on the second interface is complete when the device is no longer in the foreground. If the feature information of the second interface indicates the presence of a graphic code matching the first application, it can be determined that the scanning failure of the second interface of the background-running application is due to the graphic code's low resolution or incomplete display. There are three possible scenarios that could lead to graphic code recognition failure: the first is that the graphic code size is too small, resulting in low resolution and recognition failure. Figure 5 As shown. The second type is display misalignment of the graphic code, where the graphic code fails to be recognized due to the lack of features in a certain direction, such as... Figure 6 As shown. The third type is where the graphic code is too large, causing recognition failure due to the lack of features around the graphic code, such as... Figure 7 As shown.
[0065] The graphic code in the second interface can be re-identified for features, or the feature information of the graphic code can be obtained from the feature information in the second interface. The feature information of the graphic code can indicate whether the graphic code's features are complete.
[0066] If the feature information of the graphic code indicates that the graphic code features are complete, it can be determined that the reason for the failure of graphic code recognition may be that the size of the graphic code is too small. In this case, the graphic code in the second interface can be enlarged to adjust the position of the graphic code in the second interface and update the second interface running in the background in real time to obtain the fourth interface of the second application. The magnification factor of the graphic code can be preset and is not specifically limited here.
[0067] If the feature information of the graphic code indicates that the graphic code's features are incomplete, the reason for the failure to recognize the graphic code may be that the graphic code is too large or the graphic code is misaligned. The position of the graphic code in the second interface can be adjusted by reducing its size and / or shifting it, thus updating the second interface running in the background in real time, resulting in the fourth interface of the second application. The reduction factor of the graphic code can be preset and is not specifically limited here.
[0068] In some embodiments, the method for adjusting the position of the image code in the second interface can be determined based on the direction of the missing features indicated by the feature information of the image code. For example, if the feature information of the image code indicates that only some directional features are missing, the reason for the failure of image code recognition may be due to the display misalignment of the image code. The position of the image code in the second interface can be adjusted by shifting the image code in the second interface, and the shifting direction of the image code in the second interface can be determined based on the direction of the missing features indicated by the feature information of the image code. For another example, if the direction of the missing features indicated by the feature information of the image code is to the right, the shifting direction of the image code in the second interface is to the left. For yet another example, if the feature information of the image code indicates that features are missing on all four sides, the reason for the failure of image code recognition may be that the size of the image code is too large. The position of the image code in the second interface can be adjusted by reducing the size of the image code in the second interface.
[0069] Next, based on the first interface, the fourth interface of the second application running in the background can be scanned. The method for scanning the fourth interface of the second application running in the background is similar to the method for scanning the second interface of the second application running in the background, and will not be described in detail here.
[0070] In this way, if the size of the graphic code in the interface of the second application is too small, adjusting the position of the graphic code can improve the resolution of the graphic code in the interface of the second application. If the size of the graphic code in the interface of the second application is too large or the display is off-center, adjusting the position of the graphic code can make the features of the graphic code complete, thereby improving the recognition rate of graphic code scanning across applications.
[0071] It should be noted that the methods for adjusting the position of the image code in the second interface include, but are not limited to, enlarging, shrinking, or moving the image code in the second interface, so that the fourth interface can present the complete image code. In this way, when scanning the fourth interface of the second application running in the background based on the first interface, the image code can be accurately scanned by the first interface.
[0072] Optionally, the method further includes:
[0073] If the feature information of the second interface indicates that there is no matching graphic code of the first application in the second interface, the target scan result is displayed, and the target scan result indicates that the scan of the second interface of the second application running in the background failed.
[0074] If the feature information on the second interface indicates that there is no matching graphic code for the first application in the second interface, the electronic device can output the target scan result to prompt the user that the graphic code scanning is incorrect or the graphic code cannot be recognized. This ends the cross-application graphic code scanning process.
[0075] Optionally, step 102 specifically includes:
[0076] In response to the first input, a screenshot is taken of the second interface of the second application running in the background to obtain the first image to be scanned.
[0077] The first image to be scanned is scanned based on the first interface.
[0078] The first input can be, for example... Figure 2 The first control 202 shown is the input of the "Scan Background Applications" control. The first control is used to trigger the scanning of the graphic code in the second interface of the second application running in the background.
[0079] In this embodiment, before displaying the first interface of the first application, the electronic device may display the second interface of the second application, such as... Figure 8 As shown, the second application is a browser. The second interface 801 of the second application displays a QR code 802, and the user can perform corresponding operations to bring the second application from the foreground to the background.
[0080] The user can launch the first application and operate the scanning function of the first application. Correspondingly, the electronic device can display the first interface of the first application, such as... Figure 2 As shown. The user can click the first control 202, and the electronic device can receive the user's first input to the first control 202. Upon receiving the first input to the first control 202, the device can take a screenshot of the second interface of the second application running in the background to obtain the first image to be scanned.
[0081] If the first image to be scanned is obtained, such as Figure 9 As shown, the electronic device can display a first image to be scanned 901 on a first interface and scan the first image to be scanned, thereby completing cross-application graphic code scanning.
[0082] In this embodiment, since the first image to be scanned is automatically captured upon receiving the first input to the first control, it is typically stored in a cache and automatically deleted when the first application exits. Therefore, no image code image is generated in the photo album, eliminating the need to delete the image and reducing system junk. Furthermore, after the second application exits from the foreground to the background, automatically capturing the second interface of the background-running second application upon receiving the first input to the first control eliminates the need for the user to take a screenshot of the second interface and save the screenshot. This simplifies the cross-application image code scanning process and simplifies user operation.
[0083] In some embodiments, the first interface includes a second control, and step 102 specifically includes:
[0084] In response to the first input to the second control, based on the first interface, a second image to be scanned stored in the target folder is scanned, wherein the second image to be scanned is a screen image of the second interface of a second application running in the background;
[0085] Wherein, the second image to be scanned is obtained by taking a screenshot of the second interface of the second application upon receiving a second input to the second interface of the second application; the second image to be scanned is stored in the target folder before the first interface of the first application is displayed; the second input is used to exit the second application from the foreground; the second image to be scanned stored in the target folder is deleted when a first preset condition is met; the first preset condition includes at least one of the following:
[0086] The second application has finished running;
[0087] The storage time has reached the preset time.
[0088] In this embodiment, before displaying the first interface of the first application, the electronic device may display the second interface of the second application, such as... Figure 8 As shown, the second application is a browser. A QR code 802 is displayed on the second interface 801 of the second application, allowing the user to switch the second application from the foreground to the background. Correspondingly, when the electronic device receives a second input to the second interface of the second application, it can automatically capture the second interface displayed before the application switches to the background and store the captured second image to be scanned in the target folder.
[0089] The second input is used to exit the second application from the foreground. The second input can be touch input, voice input, or gesture input. Taking touch input as an example, the second input can be click input, double-click input, long-press input, etc. The second input can be a click input at any position in the second interface, and the first input can also be a click input at a specified control in the second interface.
[0090] The electronic device can detect whether the second image to be scanned contains a graphic code. If the second image to be scanned contains a graphic code, it saves the second image to be scanned to a target folder. The target folder is used for temporary image storage. In some embodiments, images stored in the target folder can be automatically deleted after a preset storage time. The preset time can be set according to actual conditions and is not specifically limited here. In some embodiments, images stored in the target folder can also be automatically deleted when the second application ends. For example, when the electronic device determines that the second application has been closed in the background, or when the second application actively or passively exits the background, it can trigger the deletion of screenshots related to the second application from the target folder.
[0091] Afterwards, the user can launch the first application and operate the scanning function of the first application. The electronic device can then display the first interface of the first application, such as... Figure 3 As shown, the first interface 301 may include a second control 302, which can be a control for an "album". The second control is used to trigger the scanning of graphic codes in images pre-stored in the album.
[0092] The user can click the second control 302, and the electronic device can receive the user's first input to the second control 302. Upon receiving the first input to the second control 302, the device can scan the second image to be scanned in the target folder based on the first interface. The second image to be scanned scanned on the first interface is the one most recently stored in the target folder. The electronic device can also display a photo album, such as... Figure 10 As shown, the album includes a folder called "Temporary Background Screenshots," which is the target folder 1001. Users can select an image in the target folder 1001 and use it as the second image to be scanned, thereby completing the cross-application image code scanning.
[0093] In this embodiment, the second image to be scanned is automatically captured upon receiving a second input to the second interface of the second application and stored in a target folder. This target folder is a temporary image storage folder, and the images stored there will be deleted when the second application terminates or when the storage time reaches a preset time. Therefore, the image deletion operation is eliminated, and system junk is reduced. Furthermore, automatically capturing the second interface of the second application upon receiving a second input to exit the foreground eliminates the need for multiple user actions to take and save screenshots of the second interface, thus simplifying the cross-application image code scanning process and user operation.
[0094] In some embodiments, before scanning the second image to be scanned stored in the target folder based on the first interface in response to the first input to the second control, the method further includes:
[0095] If the screen image of the second interface of the second application contains a graphic code that meets the second preset condition, the screen image is stored as the second image to be scanned in the target folder;
[0096] The second preset condition includes feature information of the graphic code indicating that the features of the graphic code are complete.
[0097] After the second application exits the foreground and before the first interface of the first application is displayed, the electronic device can detect whether the features of the graphic code in the captured image of the second interface are complete. Only if the features of the graphic code in the image of the second interface are detected to be complete will the image of the second interface be stored as the second image to be scanned in the target folder.
[0098] Electronic devices can utilize image recognition technology to acquire feature information of graphic codes in the image of a second interface. Based on this feature information, they can determine whether the graphic code features are complete. If the feature information indicates that the graphic code features are missing, i.e., the graphic code features are incomplete, the position of the graphic code in the second interface can be adjusted by zooming in, zooming out, or moving it to update the second interface until the updated image of the second interface has complete graphic code features. At this point, the updated image of the second interface can be stored as the second image to be scanned in the target folder for the first application to perform graphic code recognition. This improves the recognition rate of the graphic codes in the second interface by the first application.
[0099] The graphic code recognition method provided in this application can be executed by a graphic code recognition device. This application uses a graphic code recognition device executing the graphic code recognition method as an example to illustrate the graphic code recognition device provided in this application.
[0100] See Figure 11 , Figure 11 This is a schematic diagram of the structure of the graphic code recognition device provided in the embodiments of this application. The device includes:
[0101] The receiving module 1101 is used to receive a first input when a first interface of a first application is displayed, wherein the first interface is used for scanning a graphic code.
[0102] The first scanning module 1102 is used to scan the second interface of the second application running in the background based on the first interface in response to the first input.
[0103] Optionally, the first scanning module 1102 is specifically used for:
[0104] In response to the first input, a scan is performed on the second interface of the second application that has recently exited the foreground and is running in the background, based on the first interface.
[0105] Optionally, the first interface includes a first control, and the first scanning module 1102 is specifically used for:
[0106] In response to a first sub-input to the first control, a third interface is displayed, which displays M application interfaces running in the background, the first input including the first sub-input, and M being a positive integer;
[0107] Upon receiving a second sub-input from the user for the second interface of the second application among the M application interfaces, the second interface of the second application selected by the user is scanned based on the first interface, wherein the first input further includes the second sub-input.
[0108] Optionally, the device further includes:
[0109] The feature recognition module is used to perform feature recognition on the second interface when scanning the second interface of the second application running in the background fails, and to obtain the feature information of the second interface.
[0110] The position adjustment module is used to adjust the position of the image code in the second interface when the feature information of the second interface indicates that there is a graphic code matching the first application in the second interface, so as to obtain the fourth interface of the second application.
[0111] The second scanning module is used to scan the fourth interface of the second application running in the background based on the first interface.
[0112] Optionally, the device further includes:
[0113] The display module is used to display the target scan result when the feature information of the second interface indicates that there is no matching graphic code of the first application in the second interface, and the target scan result indicates that the scan of the second interface of the second application running in the background failed.
[0114] Optionally, the first scanning module 1102 is specifically used for:
[0115] In response to the first input, a screenshot is taken of the second interface of the second application running in the background to obtain the first image to be scanned.
[0116] The first image to be scanned is scanned based on the first interface.
[0117] Optionally, the first interface includes a second control, and the first scanning module 1102 is specifically used for:
[0118] In response to the first input to the second control, based on the first interface, a second image to be scanned stored in the target folder is scanned, wherein the second image to be scanned is a screen image of the second interface of a second application running in the background;
[0119] Wherein, the second image to be scanned is obtained by taking a screenshot of the second interface of the second application upon receiving a second input to the second interface of the second application; the second image to be scanned is stored in the target folder before the first interface of the first application is displayed; the second input is used to exit the second application from the foreground; the second image to be scanned stored in the target folder is deleted when a first preset condition is met; the first preset condition includes at least one of the following:
[0120] The second application has finished running;
[0121] The storage time has reached the preset time.
[0122] Optionally, the device further includes:
[0123] The storage module is used to store the screen image as a second image to be scanned into the target folder when the screen image of the second interface of the second application contains a graphic code that meets the second preset conditions.
[0124] The second preset condition includes feature information of the graphic code indicating that the features of the graphic code are complete.
[0125] In this embodiment, by receiving a first input while displaying a first interface of a first application, the first interface is used for graphic code scanning; in response to the first input, scanning is performed on the second interface of a second application running in the background based on the first interface. This allows scanning of the second interface of a second application running in the background directly from the first interface of the first application displayed in the foreground, thereby eliminating the need for multiple user actions such as taking a screenshot of the second interface and saving the screenshot. This simplifies the cross-application graphic code scanning process and simplifies user operation.
[0126] The graphic code recognition device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0127] The graphic code recognition device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0128] The graphic code recognition device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0129] Optionally, such as Figure 12As shown, this application embodiment also provides an electronic device 1200, including a processor 1201 and a memory 1202. The memory 1202 stores a program or instructions that can run on the processor 1201. When the program or instructions are executed by the processor 1201, they implement the various steps of the above-described graphic code recognition method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0130] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0131] Figure 13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0132] The electronic device 1300 includes, but is not limited to, components such as: radio frequency unit 1301, network module 1302, audio output unit 1303, input unit 1304, sensor 1305, display unit 1306, user input unit 1307, interface unit 1308, memory 1309, and processor 1310.
[0133] Those skilled in the art will understand that the electronic device 1300 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 13 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0134] Display unit 1306 is used to display a first interface of a first application, the first interface being used for graphic code scanning.
[0135] User input unit 1307 is used to receive first input when the first interface of the first application is displayed;
[0136] Processor 1310 is configured to, in response to the first input, scan a second interface of a second application running in the background based on the first interface.
[0137] In this embodiment, by receiving a first input while displaying a first interface of a first application, the first interface is used for graphic code scanning; in response to the first input, scanning is performed on the second interface of a second application running in the background based on the first interface. This allows scanning of the second interface of a second application running in the background directly from the first interface of the first application displayed in the foreground, thereby eliminating the need for multiple user actions such as taking a screenshot of the second interface and saving the screenshot. This simplifies the cross-application graphic code scanning process and simplifies user operation.
[0138] Optionally, the processor 1310 is also used for:
[0139] In response to the first input, a scan is performed on the second interface of the second application that has recently exited the foreground and is running in the background, based on the first interface.
[0140] Optionally, the first interface includes a first control, and the user input unit 1307 is further configured to receive a first sub-input to the first control, wherein the first input includes the first sub-input.
[0141] The display unit 1306 is also configured to display a third interface in response to a first sub-input to the first control, wherein the third interface displays M application interfaces running in the background, where M is a positive integer;
[0142] User input unit 1307 is further configured to receive a second sub-input from a user to the second interface of the second application in the M application interfaces, wherein the first input further includes the second sub-input.
[0143] The processor 1310 is further configured to, upon receiving a second sub-input from a user on a second interface of the second application among the M application interfaces, scan the second interface of the second application selected by the user based on the first interface.
[0144] Optionally, the processor 1310 is also used for:
[0145] If scanning of the second interface of the second application running in the background fails, feature recognition is performed on the second interface to obtain the feature information of the second interface.
[0146] If the feature information of the second interface indicates that there is a graphic code matching the first application in the second interface, the position of the graphic code in the second interface is adjusted based on the feature information of the graphic code to obtain the fourth interface of the second application.
[0147] The fourth interface of the second application running in the background is scanned based on the first interface.
[0148] Optionally, the display unit 1306 is further configured to display a target scan result when the feature information of the second interface indicates that there is no matching graphic code of the first application in the second interface, wherein the target scan result indicates that the scan of the second interface of the second application running in the background has failed.
[0149] Optionally, the processor 1310 is also used for:
[0150] In response to the first input, a screenshot is taken of the second interface of the second application running in the background to obtain the first image to be scanned.
[0151] The first image to be scanned is scanned based on the first interface.
[0152] Optionally, the first interface includes a second control, and the processor 1310 is further used for:
[0153] In response to the first input to the second control, based on the first interface, a second image to be scanned stored in the target folder is scanned, wherein the second image to be scanned is a screen image of the second interface of a second application running in the background;
[0154] Wherein, the second image to be scanned is obtained by taking a screenshot of the second interface of the second application upon receiving a second input to the second interface of the second application; the second image to be scanned is stored in the target folder before the first interface of the first application is displayed; the second input is used to exit the second application from the foreground; the second image to be scanned stored in the target folder is deleted when a first preset condition is met; the first preset condition includes at least one of the following:
[0155] The second application has finished running;
[0156] The storage time has reached the preset time.
[0157] Optionally, the processor 1310 is also used for:
[0158] If the screen image of the second interface of the second application contains a graphic code that meets the second preset condition, the screen image is stored as the second image to be scanned in the target folder;
[0159] The second preset condition includes feature information of the graphic code indicating that the features of the graphic code are complete.
[0160] It should be understood that, in this embodiment, the input unit 1304 may include a graphics processing unit (GPU) 13041 and a microphone 13042. The GPU 13041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1306 may include a display panel 13061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1307 includes a touch panel 13071 and at least one of other input devices 13072. The touch panel 13071 is also called a touch screen. The touch panel 13071 may include a touch detection device and a touch controller. Other input devices 13072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0161] The memory 1309 can be used to store software programs and various data. The memory 1309 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1309 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1309 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0162] Processor 1310 may include one or more processing units; in some embodiments, processor 1310 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the modem processor may also not be integrated into processor 1310.
[0163] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described graphic code recognition method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0164] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0165] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described graphic code recognition method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0166] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0167] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described graphic code recognition method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0168] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause an electronic device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0170] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for identifying a graphic code, characterized in that: include: receiving a first input while displaying a first interface of a first application, wherein the first interface is used for scanning a graphic code; In response to the first input, a second interface of a second application running in the background is scanned based on the first interface.
2. The method according to claim 1, characterized in that The step of scanning a second interface of a second application program running in the background based on the first interface in response to the first input includes: In response to the first input, a second interface of the second application program that has recently exited from the foreground to run in the background is scanned based on the first interface.
3. The method according to claim 1, characterized in that The first interface includes a first control, and in response to the first input, scanning a second interface of a second application program running in the background based on the first interface includes: In response to a first sub-input to the first control, a third interface is displayed, wherein the third interface displays M application interfaces running in the background, the first input includes the first sub-input, and M is a positive integer; When a second sub-input of the user to the second interface of the second application among the M application interfaces is received, the second interface of the second application selected by the user is scanned based on the first interface, and the first input also includes the second sub-input.
4. The method according to claim 1, characterized in that After scanning the second interface of the second application program running in the background, the method further includes: In the case where scanning of the second interface of the second application program running in the background fails, performing feature recognition on the second interface to obtain feature information of the second interface; When the characteristic information of the second interface indicates that a graphic code matching the first application exists in the second interface, based on the characteristic information of the graphic code, the position of the graphic code in the second interface is adjusted to obtain a fourth interface of the second application; The fourth interface of the second application program running in the background is scanned based on the first interface.
5. The method according to claim 4, characterized in that The method further comprises: When the characteristic information of the second interface indicates that the graphic code matching the first application does not exist in the second interface, a target scanning result is displayed, and the target scanning result indicates that the scanning of the second interface of the second application running in the background has failed.
6. The method according to claim 1, characterized in that The step of scanning a second interface of a second application program running in the background based on the first interface in response to the first input includes: In response to the first input, a second interface of a second application program running in the background is captured to obtain a first image to be scanned; The first image to be scanned is scanned based on the first interface.
7. The method according to claim 1, characterized in that The first interface includes a second control, and in response to the first input, scanning a second interface of a second application program running in the background based on the first interface includes: In response to the first input to the second control, based on the first interface, scanning a second image to be scanned stored in a target folder, where the second image to be scanned is a screen image of a second interface of a second application program running in the background; The second image to be scanned is obtained by taking a screenshot of the second interface of the second application program when a second input to the second interface of the second application program is received; the second image to be scanned is stored in the target folder before the first interface of the first application program is displayed; the second input is used to exit the second application program from the foreground; and the second image to be scanned stored in the target folder is triggered to be deleted when a first preset condition is met, and the first preset condition includes at least one of the following: The second application ends running; The storage time reaches the preset time.
8. The method according to claim 7, characterized in that In response to the first input to the second control, before scanning the second to-be-scanned image stored in the target folder based on the first interface, the method further includes: When it is detected that the screen image of the second interface of the second application contains a graphic code that meets a second preset condition, storing the screen image as a second image to be scanned in the target folder; The second preset condition includes that the feature information of the graphic code indicates that the feature of the graphic code is complete.
9. A graphic code recognition device, characterized in that: include: A receiving module, configured to receive a first input while displaying a first interface of a first application, wherein the first interface is used for scanning a graphic code; The first scanning module is used to scan a second interface of a second application program running in the background based on the first interface in response to the first input.
10. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the graphic code recognition method as described in any one of claims 1 to 8 are implemented.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the graphic code recognition method as described in any one of claims 1-8 are implemented.