Two-dimensional code scanning method and device, electronic equipment and storage medium
By acquiring and detecting the environment image when the terminal receives an external input event, and scanning only when the QR code is detected, the problem of cumbersome and incorrect operation of QR code scanning steps in the prior art is solved, and the scanning efficiency and Convenience, enhanced reliability and accuracy.
Patent Information
- Application Number
- CN202310739102.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, the QR code scanning process is complicated, the efficiency is low and the convenience is poor. The user needs to open the application and click on the scanning control, which leads to complex scanning operations and prone to incorrect operations, resulting in invalid scanning of the code.
By obtaining the environment image when the terminal receives an external input event and performing QR code detection on the image, scanning is performed only when the QR code is detected, the scanning step is simplified, efficiency and convenience are improved, and multi-dimensional Detection reduces misoperation.
It has achieved simplified QR code scanning operations, improved the efficiency and convenience of scanning codes, enhanced the reliability and accuracy of scanning codes, and avoided the situation of invalid scanning codes.
Smart Images

Figure CN119167960A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a two-dimensional code scanning method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Users can scan QR codes to perform various functions, such as scanning to pay, scanning to add friends, etc.
[0003] In the related art, when scanning a code, it is necessary to open an application capable of scanning a code and click a scanning control in the application to perform the scanning. The above scanning process has many steps, resulting in low scanning efficiency and poor convenience. Summary of the invention
[0004] The purpose of the present disclosure is to provide a two-dimensional code scanning method and device, an electronic device, and a storage medium, thereby overcoming the problem of having many steps in the code scanning operation due to the limitations and defects of the relevant technology at least to a certain extent.
[0005] According to a first aspect of the present disclosure, a QR code scanning method is provided, comprising: in response to a terminal receiving an external input event, acquiring an environmental image of an environment in which the terminal is located; performing QR code detection on the environmental image to determine a detection result; in response to the detection result being that a QR code image exists in the environmental image, scanning the QR code image and executing an operation corresponding to the QR code image.
[0006] According to a second aspect of the present disclosure, a two-dimensional code scanning device is provided, including: an environmental image acquisition module, used to acquire an environmental image of the environment in which a terminal is located in response to the terminal receiving an external input event; a two-dimensional code detection module, used to perform two-dimensional code detection on the environmental image and determine the detection result; a scanning control module, used to scan the two-dimensional code image in response to the detection result that the two-dimensional code image exists in the environmental image, and perform operations corresponding to the two-dimensional code image.
[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the two-dimensional code scanning method of the above-mentioned first aspect and its possible implementation method by executing the executable instructions.
[0008] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the two-dimensional code scanning method of the first aspect and its possible implementation methods are implemented.
[0009] In the technical solution provided in the embodiment of the present disclosure, on the one hand, by acquiring the environment image of the environment where the terminal is located when receiving an external input event on the terminal, and only when it is determined that there is a two-dimensional code image in the environment image, the two-dimensional code image is scanned, and the two-dimensional code scanning can be performed after multiple dimensions of detection such as external input event detection and image detection, and the user only needs to perform a simple external input event, which reduces the cumbersome steps required for two-dimensional code scanning in related technologies, improves the scanning efficiency, and improves the convenience of scanning. On the other hand, after detecting the external input event, the environment image is detected for two-dimensional code, and the two-dimensional code image is scanned when there is a two-dimensional code image in the environment image, which avoids invalid scanning caused by user misoperation and improves the reliability and effectiveness of scanning.
[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0012] Figure 1 A schematic diagram shows an application scenario in which the two-dimensional code scanning method of the embodiment of the present disclosure can be applied.
[0013] Figure 2 A schematic diagram schematically illustrates a two-dimensional code scanning method according to an embodiment of the present disclosure.
[0014] Figure 3 A schematic diagram schematically illustrates the terminal direction in an embodiment of the present disclosure.
[0015] Figure 4 The following is a schematic diagram showing the principle of detecting two tapping events in an embodiment of the present disclosure.
[0016] Figure 5 The flowchart of performing QR code detection on each frame of environment image according to an embodiment of the present disclosure is schematically shown.
[0017] Figure 6 The flowchart schematically illustrates the operation performed according to the type of the two-dimensional code image according to the embodiment of the present disclosure.
[0018] Figure 7A-7B A schematic diagram of an interface for executing operations corresponding to a two-dimensional code image based on a selection control according to an embodiment of the present disclosure is schematically shown.
[0019] Figure 8 The overall process diagram of the code scanning control according to the embodiment of the present disclosure is schematically shown.
[0020] Fig. 9 A block diagram of a two-dimensional code scanning device in an embodiment of the present disclosure is schematically shown.
[0021] Fig.10 A block diagram of an electronic device in an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0022] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0023] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0024] In some embodiments, taking an instant messaging application as an example, the code scanning process generally goes through at least the following steps: the first step is to open the application, the second step is to click "Discover" or other parent controls belonging to the "Scan" control, and the third step is to click "Scan" to scan the code. If the user is using other applications, if you need to scan the code at this time, you need to return to the desktop first, and then find the icon of the application to perform the code scanning operation. If the user opens application A and is in the chat interface, or is watching a public account or mini program, if you need to scan the code, you need to exit the current page, and then open application A, click the "Discover" control, and click the "Scan" control to implement the code scanning operation. In the above steps, the steps for scanning the code are complicated, and it is difficult to scan the code quickly.
[0025] In order to solve the above technical problems, a two-dimensional code scanning method is provided in an embodiment of the present disclosure, which can be applied to an application scenario in which a terminal is used to scan a two-dimensional code. Figure 1 A schematic diagram showing a system architecture to which the two-dimensional code scanning method and device of the embodiments of the present disclosure can be applied.
[0026] like Figure 1 As shown, first, it is possible to detect whether an external input event is received through sensor data. Under the condition that an external input event is detected, the camera of the terminal can be called to obtain an environmental image of the environment where the terminal is located. Further, the environmental image can be detected to determine whether there is a QR code image in the environmental image. When there is a QR code image in the environmental image, the QR code image can be scanned to achieve fast code scanning.
[0027] It should be noted that the above-mentioned QR code scanning method can be executed by a terminal, and the terminal can be any smart device, such as a smart phone, computer, tablet computer, smart watch, scanner or barcode scanning gun, etc., which has a camera and can perform a barcode scanning function.
[0028] Next, refer to Figure 2 As shown in , each step of the two-dimensional code scanning method in the embodiment of the present disclosure is described in detail.
[0029] In step S210, in response to the terminal receiving an external input event, an environment image of the environment where the terminal is located is acquired.
[0030] In the embodiments of the present disclosure, the terminal may be any type of intelligent terminal having a camera and capable of scanning a code, such as a smart phone, a tablet computer, etc. The external input event may be an event that causes the acceleration data of the terminal to change in a certain direction, such as any one or more of a tap event, a press event, or a press-slide event acting on the terminal. Here, the external input event is described as a tap event.
[0031] Before the terminal receives an external input event to obtain an environmental image of the environment where the terminal is located, it can first be determined whether the terminal receives the external input event based on the sensor data of the terminal. The terminal can be provided with a sensor, which can include a gravity acceleration sensor or a linear acceleration sensor, or other types of sensors, such as a gyroscope, etc. Here, the sensor is a gravity acceleration sensor or a linear acceleration sensor as an example for description.
[0032] In some embodiments, sensor data can be acquired in real time, and the sensor data can be acceleration data generated by a gravity acceleration sensor, or linear acceleration data generated by a linear acceleration sensor. The gravity acceleration sensor acquires acceleration data of the three axes X, Y, and Z, and the acceleration data includes the gravitational influence of the earth's gravity. The linear acceleration sensor is the data acquired by the gravity acceleration sensor minus the gravity influence, which does not include the gravity influence. Among them, the gravity acceleration sensor or the linear acceleration sensor can generate sensor data at a fixed frequency. The fixed frequency is used to represent the number of frames per second, and can be any value, for example, it can include but is not limited to any frequency of 200Hz, 100Hz, and 50Hz. Here, a fixed frequency of 200Hz is used as an example for explanation.
[0033] After acquiring the sensor data, it can be determined based on the sensor data whether the terminal has received an external input event. A tap event can cause the terminal to generate acceleration data or linear acceleration data. When a tap event is executed, an obvious acceleration data or linear acceleration data will be generated. When the external input event is a tap event, it can specifically be a tap event acting on a target direction of the terminal. The target direction can be any one of the back of the terminal, multiple frame parts, and the screen.
[0034] Based on this, the sensor data output by the gravity acceleration sensor or the linear acceleration sensor can be identified to determine whether the terminal has received an external input event through the sensor data. In some embodiments, the sensor data can be input into the knock detection model. Exemplarily, a time interval can be determined, and the sensor data that needs to be input into the knock detection model can be determined based on the time interval. The time interval can be a pre-set value, such as 0.1 seconds, or other values, which are determined based on actual needs.
[0035] Based on this, a sliding window method can be used to input the sensor data in the time period corresponding to the current moment into the knock detection model at each time interval. Among them, the sliding window method is used to slide a pre-set window on the time axis, for example, sliding in a positive or negative direction, and the length of the window remains unchanged during the sliding process. The length of the time period is the length of the window in the sliding window method. The knock detection model is a neural network model based on deep learning. The knock detection model can include multiple convolutional layers and fully connected layers. The input of the knock detection model is a 3*200 list, and the output is a probability value. Among them, 3*200 means: 200 is 200 frames of data in the time period to which the current moment belongs (the last 1 second). Each frame of sensor data contains 3 dimensions: the value of acceleration in the X-axis direction, the value of acceleration in the Y-axis direction, and the value of acceleration in the Z-axis direction. Such as Figure 3As shown, the short side direction of the terminal is the direction of the X-axis, the long side direction of the terminal is the direction of the Y-axis, and the vertical direction of the terminal is the direction of the Z-axis.
[0036] The time period of the current moment refers to the time period closest to the current moment, and the time period can be determined by taking the current moment as the end point. The time period can be 1 second or 2 seconds, etc., which can be determined according to actual needs. For example, when the current moment is any time between the 0th second and the 1st second, since it is less than 1 second, there is no need to run the knock detection model. When the current moment is 1.0 seconds, the 200 frames of data generated between the 0th second and the 1st second are input into the knock detection model. Then, wait for the time interval, and when the current moment is 1.1 seconds, the sensor data from the 0th second to the 1.1th second is input into the knock detection model. When the current moment is 1.2 seconds, the sensor data from the 0th second to the 1.2th second is input into the knock detection model; when the current moment is 1.3 seconds, the sensor data from the 0.3th second to the 1.3th second is input into the knock detection model, and so on, the sensor data in the time period corresponding to the current moment can be input into the knock detection model in sequence.
[0037] In the process of inputting the sensor data within the time period to which the current moment belongs into the knock detection model, the sensor data can be fitted based on the knock detection model to obtain the event probability corresponding to the sensor data as the output of the knock detection model. Exemplarily, the sensor data can be convolved through multiple convolutional layers to extract features and obtain multiple feature data; further, the multiple feature data can be fused through a fully connected layer to fuse the multiple feature data into a value output to obtain the event probability corresponding to the sensor data.
[0038] It should be added that, for sensor data that is acceleration data or linear acceleration data, the model structure of the tap detection model is the same, and both can include convolutional layers and fully connected layers. The training process of the tap detection model is also the same, but the training data may be different, and the model parameters of the tap detection model corresponding to the acceleration data are different from the model parameters of the tap detection model corresponding to the linear acceleration data.
[0039] When the external input event is a knock event, the event probability can be used to indicate the probability that the sensor data belongs to a knock event. The value range of the event probability can be (0,1). The closer the event probability is to 1, the greater the probability that the sensor data belongs to a knock event. Furthermore, after obtaining the event probability, the event probability can be compared with the first probability threshold, and whether the knock event is received can be determined based on the comparison result. Exemplarily, if the event probability is greater than or equal to the first probability threshold, it can be considered that the terminal has received the knock event. If the event probability is less than the first probability threshold, it can be considered that the terminal has not received the knock event. The first probability threshold here can be set to 0.5 or other values, for example, and can be determined based on actual needs.
[0040] Figure 4 The schematic diagram shows the detection principle of determining whether two tap events are received based on sensor data. Figure 4 As shown in the figure, this is a 1-second sensor data. The length of the horizontal axis is 200, representing 200 frames. The image includes the value of the acceleration in the Z-axis direction acc_Z, the value of the acceleration in the X-axis direction acc_X, and the value of the acceleration in the Y-axis direction acc_Y. Every time the user taps the back of the phone, the Z-axis will produce an obvious acceleration, so one tap event will cause a peak. If there are two tap events, there will be two obvious accelerations, and then two obvious peaks will appear. When there are two obvious peaks, it can be considered that two tap events have been received.
[0041] When the external input event is a press event or a press-slide event, the sensor data can be fitted through the corresponding event detection model to determine whether a press event or a press-slide event is received based on the probability or output value obtained by fitting. No specific limitation is made here.
[0042] In the disclosed embodiment, by fitting the sensor data through the tap detection model, it is possible to accurately determine whether a tap event is received. When the event probability output by the tap detection model is greater than the first probability threshold, it is considered that a tap event acting on the terminal is received. After detecting the tap event, it can be detected whether the tap event is within the valid input range of the terminal. When the tap event is within the valid input range of the terminal, the step of QR code recognition can be entered. It should be noted that the valid input range can be determined according to the state of the terminal screen. When the screen state of the terminal is the bright screen state, the valid input range may include the frame portion, the upper area and the middle area of the back; when the screen state of the terminal is the off screen state, the valid input range may include the frame portion, the upper area and the middle area of the back, and any position of the screen.
[0043] It should be added that after detecting an external input event, it can be determined whether to trigger the acquisition of the environment image of the environment where the terminal is located according to whether the external input event meets the image acquisition condition. If the number of external input events is greater than the number threshold, it can be considered that the external input event meets the image acquisition condition, so the QR code recognition step can be entered. The number threshold here can be any value, for example, it can be 1 or 2, etc., which is determined according to actual needs and is not specifically limited here.
[0044] If the event probability output by the tap detection model is less than the first probability threshold, it is considered that no tap event acting on the terminal is received, and the QR code recognition step will not be entered. Alternatively, if the event probability output by the tap detection model is greater than the first probability threshold, but the number of tap events detected is less than the number threshold, it can also be considered that the image acquisition condition is not met, and therefore the QR code recognition step will not be entered.
[0045] In the disclosed embodiment, by inputting sensor data into the corresponding knock detection model, it is possible to determine whether the terminal receives a knock event based on the output event probability, thereby improving the accuracy of knock event recognition.
[0046] In the embodiment of the present disclosure, when the terminal receives an external input event, the terminal can obtain an environmental image of the environment in which the terminal is located. The environment in which the terminal is located can be an environment corresponding to the location of the terminal, which can be an indoor environment, an outdoor environment, or an augmented reality environment, etc.
[0047] In some embodiments, the environment image of the environment where the terminal is located can be obtained when the received external input event meets the image acquisition condition. Exemplarily, the camera of the terminal can be called to collect the image within the scanning range corresponding to the camera as the environment image of the environment where the terminal is located. It should be noted that multiple frames of environment images can be collected by the camera of the terminal within a preset time. The camera can be a rear camera of the terminal, an external camera, or a virtual camera configured for the terminal. The preset time can be, for example, 2 seconds or other values, and the number of collected environment images is specifically determined according to the frame rate per second. The frame rate can be 10 frames per second. If 2 seconds are collected at a frame rate of 10 frames per second, the number of obtained environment images can be 20 frames. In addition, the number of environment images can also be 30 frames, etc., which is specifically determined by the length of the preset time and the frame rate per second. For the multiple frames of environment images collected by the camera of the terminal, since the terminal may be in motion or in a stationary state, the objects and objects contained in the multiple frames of environment images can be the same or different, and the coverage, clarity and other information of each object in different frames of environment images can also be the same or different, which is not specifically limited here.
[0048] In step S220, two-dimensional code detection is performed on the environment image to determine the detection result.
[0049] In the disclosed embodiment, after acquiring the environment image, the content of the environment image can be subjected to QR code detection to determine the detection result. The number of environment images is multiple frames, and each frame of the environment image can be input into the QR code recognition model to perform QR code detection on each frame of the environment image through the QR code recognition model to determine whether there is a QR code image in each frame of the environment image, so as to determine the reference detection result of each frame of the environment image.
[0050] The QR code recognition model may be a deep learning model, which is used to identify whether an image contains a QR code. The QR code recognition model may include a convolutional layer and a fully connected layer. The input of the QR code recognition model may be an environment image acquired by the terminal, for example, an image of size 240*240. The output of the QR code recognition model may be a QR code recognition probability. The value range of the QR code recognition probability may be [0,1]. The closer the QR code recognition probability is to 1, the greater the probability that the QR code exists in the environment image.
[0051] When each frame of the environment image is input into the two-dimensional code recognition model, the process may include the following steps: inputting the environment image into the two-dimensional code recognition model, performing various types of downsampling operations on the environment image based on the convolution layer of the two-dimensional code recognition model to implement convolution processing to obtain multiple environment image features, and the multiple environment features may be features of different scales; further, the multiple environment image features may be fused through the fully connected layer in the two-dimensional code recognition model to obtain a two-dimensional code recognition probability as the output of the two-dimensional code recognition model. Here, the multiple image features may be compressed by the convolution operation to obtain the number of channels, and then the multiple image features after the compression of the number of channels may be spliced to achieve the fusion operation of multiple environment features. It should be noted that no matter how many two-dimensional code images are contained in each frame of the environment image, the output of each frame of the environment image after the two-dimensional code recognition model is a two-dimensional code recognition probability, and the two-dimensional code recognition probability is used to indicate whether each frame of the environment image contains a two-dimensional code image.
[0052] Since multiple frames of environmental images can be collected, in order to improve detection accuracy and detection efficiency, each frame of environmental images can be identified in turn, so as to determine the reference detection result of each frame of environmental images, and the reference detection result is used to indicate whether each frame of environmental images contains a two-dimensional code image. Exemplarily, the probability of two-dimensional code recognition of each frame of environmental images can be compared with the second probability threshold, and the reference detection result is determined according to the comparison result. If the comparison result is that the probability of two-dimensional code recognition is greater than or equal to the second probability threshold, the reference detection result is determined to be that the frame of environmental image contains a two-dimensional code image; if the comparison result is that the probability of two-dimensional code recognition is less than the second probability threshold, the reference detection result is determined to be that the frame of environmental image does not contain a two-dimensional code image. The second probability threshold can be any value, for example, it can be set to 0.6 or 0.8 according to actual needs, etc., and is not specifically limited here.
[0053] For example, if the probability of QR code recognition of the first frame of the environment image is 0.9, it is considered that the first frame of the environment image contains a QR code image. If the probability of QR code recognition of the second frame of the environment image is 0.5, it is considered that the second frame of the environment image does not contain a QR code image.
[0054] refer to Figure 5 As shown in, after determining whether each frame of the environmental image contains a two-dimensional code image, if the number of environmental images containing the two-dimensional code image is greater than the number threshold, it is determined that there is a two-dimensional code image in the environmental image. The number threshold can be determined according to the application scenario, for example, it can be 3 or other values. If it is detected that the number of environmental images containing the two-dimensional code image is greater than the number threshold, the process of performing two-dimensional code detection on the environmental image is stopped. For example, if the first frame, the second frame, and the third frame of the environmental image all contain a two-dimensional code image, it can be determined that there is a two-dimensional code image in the multiple frames of environmental images collected by the terminal, and the two-dimensional code detection of the environmental image can be stopped at this time, that is, there is no need to detect the environmental image after the third frame. If the first frame and the second frame of the environmental image both contain the environmental image, and the third frame of the environmental image does not contain the two-dimensional code image, the fourth frame of the environmental image continues to be detected. If there is a two-dimensional code image in the fourth frame of the environmental image, the two-dimensional code detection of the environmental image can be stopped at this time, that is, there is no need to detect the environmental image after the fourth frame.
[0055] By performing QR code detection on the environmental image before scanning the QR code image to identify whether the environmental image contains the QR code image, it is possible to avoid the situation where the user directly scans the QR code due to an external input event triggered by an erroneous operation, thereby reducing erroneous operations and erroneous code scanning and improving the accuracy, effectiveness and reliability of the code scanning operation.
[0056] Next, continue to refer to Figure 2As shown in , in step S230, in response to the detection result that there is a two-dimensional code image in the environment image, the two-dimensional code image is scanned and an operation corresponding to the two-dimensional code image is performed.
[0057] In the disclosed embodiment, under the condition that it is determined that there is a two-dimensional code image in the environmental image, the two-dimensional code image can be scanned to perform the operation corresponding to the two-dimensional code image, and the corresponding operation page can be jumped to and the operation result corresponding to the two-dimensional code image can be displayed on the interactive interface. Exemplarily, in order to avoid frequent execution of operations corresponding to the two-dimensional code image due to mis-scanning of the two-dimensional code, the type of the two-dimensional code image can be identified to determine the type of the two-dimensional code image. The type of the two-dimensional code image can be used to characterize the business type of the two-dimensional code image. The type of the two-dimensional code image can include a first type or a second type. The first type refers to a two-dimensional code containing a payment identifier. The payment identifier can be an identifier corresponding to each application platform, and the payment identifier can be a text or a symbol, etc., which is determined according to each application platform. The first type of two-dimensional code can be used for payment. The second type refers to a two-dimensional code that does not contain a payment identifier, and can include any type of two-dimensional code other than the first type.
[0058] In the disclosed embodiment, the image identifier in the QR code image can be identified, or the QR code image can be identified based on a scanning operation to determine the type of the QR code image, and then determine whether the operation corresponding to the QR code image needs to be performed based on the type of the QR code image.
[0059] When the type of the QR code image is identified by the image identifier, specifically, the convolution operation can be performed on the QR code image through the machine learning model to obtain the probability that its image identifier belongs to the payment identifier, and then determine whether the QR code image belongs to the first type based on the probability of belonging to the payment identifier. When the identification is performed through the scanning operation, it can be determined whether the type of the QR code image is the first type based on the parsed URL information. After determining the type of the QR code image, the operation corresponding to the QR code image can be performed in a manner corresponding to the type of the QR code image.
[0060] In the case where the type of the two-dimensional code image is determined according to the image identification or by a scanning operation, if the type of the two-dimensional code image is the first type, the operation corresponding to the two-dimensional code image is directly executed. The operation corresponding to the two-dimensional code image executed here may be a payment operation. In the process of executing the operation corresponding to the two-dimensional code image, the page corresponding to the operation of the two-dimensional code image may be jumped to and the operation result may be displayed.
[0061] If the QR code image is of the second type, the operation corresponding to the QR code image can be performed in combination with the user behavior information corresponding to the terminal. Exemplarily, the user behavior information may include any one or more of the user behavior preference and the user selection operation. First, the user behavior information includes the user behavior preference as an example for explanation. In this case, the website information corresponding to the QR code image obtained by scanning the QR code image can be obtained, and further keywords in the website information can be extracted, and the keywords can be matched with the user behavior preference to obtain a matching result, and whether to perform the operation corresponding to the QR code image is determined according to the matching result.
[0062] Among them, the website information may include a website link, and in addition, it may be content used to describe the QR code image. For example, the website information may be a link, and may also point to a content-based web page, such as a news, video, or commodity web page. The corresponding keywords, such as movie A, may be extracted from the website information by a keyword extraction algorithm. User behavior preferences may be determined based on the historical behavior data of the user using the terminal. For example, if the frequency of scanning codes to read novels, scanning codes to read news, or scanning codes to shop appears high in the user's historical behavior data, the user behavior preferences are determined to be scanning codes to read novels, scanning codes to read news, and scanning codes to shop. If the extracted keywords successfully match the user behavior preferences, the operation corresponding to the QR code image may be executed; if the extracted keywords fail to match the user behavior preferences, there is no need to execute the operation corresponding to the QR code image.
[0063] For example, if the keyword of the URL information obtained by parsing the QR code image is movie A, and the user behavior preferences include scanning the code to read novels, scanning the code to read news, and scanning the code to shop, the two fail to match, so there is no need to perform the operation corresponding to the QR code image. By parsing the QR code image to obtain the URL information, judging whether to perform the operation corresponding to the QR code image based on the keyword of the URL information and the matching result of the user behavior preference, the probability of performing an erroneous operation when scanning the code can be reduced, the effectiveness of scanning the code can be improved, and the user experience can be improved.
[0064] When the operation corresponding to the QR code image does not need to be executed, a prompt icon can be displayed on the interactive interface of the terminal so that the user can promptly know that the operation corresponding to the QR code image has not been executed because the user preference has not been successfully matched. In this case, if the user's tap event is received again, the QR code image will continue to be scanned and the operation corresponding to the QR code image will be executed. The number of tap events here can be any number. For the specific process, refer to Figure 6 as shown in .
[0065] In the disclosed embodiment, after scanning the two-dimensional code image, if the type of the two-dimensional code image is determined to be the first type according to the image identification, or if the type of the two-dimensional code image is determined to be the first type according to the scanning operation, the operation corresponding to the two-dimensional code image can be directly executed. If the type of the two-dimensional code image is determined to be the second type according to the image identification, or if the type of the two-dimensional code image is determined to be the second type according to the scanning operation, the operation corresponding to the two-dimensional code image can be executed according to the user behavior information. By controlling whether to execute the operation corresponding to the two-dimensional code image according to the type of the two-dimensional code image, the probability of performing an erroneous operation when scanning the code can be reduced, and the user scanning experience can be improved.
[0066] In the disclosed embodiment, the scanning of the QR code can be controlled by tapping the terminal without touching the screen of the terminal with a finger, thereby avoiding the limitation that the user cannot scan the code when it is inconvenient for the user to touch the screen to trigger the scanning control, increasing flexibility and expanding the scope of application.
[0067] In other embodiments, when the type of the two-dimensional code image is the second type, a selection control may be displayed on the interactive interface of the terminal, and the selection control is used to respond to the trigger operation to determine whether to perform the operation corresponding to the two-dimensional code image. After determining that the two-dimensional code image exists in the environment image and scanning it, the scanning box of the application may be displayed on the interactive interface of the terminal, or the scanning box of the application may not be displayed. The operation corresponding to the two-dimensional code image is performed in different ways according to whether the scanning box is displayed on the interactive interface of the application.
[0068] In the case where the application scan box is not displayed on the interactive interface, the selection control can be a new selection control presented on the interactive interface and can be located anywhere on the interactive interface. In the case where the application scan box is displayed on the interactive interface, the scan control on the interactive interface can be changed to a selection control to achieve the reuse of the scan control. In either case, if a trigger operation on the selection control is detected, the operation corresponding to the QR code image can be performed. If no trigger operation on the selection control is detected, there is no need to scan the QR code image. Reference Fig. 7A As shown in , when the application scan box is not displayed on the interactive interface, a selection control 701 can be provided at any position of the interactive interface 700, and when a trigger operation acting on the selection control is detected, an operation corresponding to the QR code image can be executed. Figure 7B As shown in the figure, when the application scan box is displayed on the interactive interface, you can Figure 7BThe scanning control 702 in the interactive interface 700 shown is changed to a selection control 703. When a trigger operation acting on the selection control is detected and received, the operation corresponding to the QR code image can be executed. Among them, the selection control can display the continued execution operation, or it can be in other forms, such as whether to jump to a page, etc., which are not specifically limited here. The trigger operation can be a click operation, a press operation, a sliding operation, etc., as long as it can trigger the selection control, which is not specifically limited here.
[0069] In some embodiments, when scanning a two-dimensional code image, an application installed on the terminal may be called to scan. The application that can scan the code may include multiple types. In order to improve accuracy, an application may be selected to scan the code. Exemplarily, the force level corresponding to the input force of the external input event received by the terminal may be determined according to the sensor data of the terminal. Specifically, the sensor data of the terminal may be used to reflect the input force of the external input event received by the terminal. The input force is used to represent the pressure intensity of the external input event. Among them, there may be a mapping relationship between the sensor data and the input force. The mapping relationship may be a one-to-one correspondence or a many-to-one correspondence, which is specifically set according to actual needs. Further, the input force of the external input event reflected by the sensor data may be determined according to the mapping relationship determined in advance by the sensor data. Specifically, the input force of the external input event may be determined according to the linear acceleration data or the amount of change of the acceleration data in a certain direction. Further, the sensor data may be compared with a preset acceleration threshold to determine the force level to which the input force corresponding to the external input event belongs. The acceleration threshold can be set according to actual needs, for example, it can be set to 15 or other values, but the acceleration thresholds corresponding to the acceleration data and the linear acceleration data are different. When the sensor data is less than the acceleration threshold, the force level can be the first level, which can be used to indicate a light tap; when the sensor data is greater than or equal to the acceleration threshold, the force level can be the second level, which can be used to indicate a heavy tap. At different force levels, applications that match the force level can be called to scan the QR code. At different force levels, the matching applications can be the same or different, which can be set in the terminal.
[0070] For example, when the input force is at the first level, application 1 can be called to scan the QR code; when the input force is at the second level, application 2 can be called to scan the QR code. It should be added that the user can configure in advance the applications that can be called for each force level. If the terminal does not install the application corresponding to a certain force level or an application corresponding to a certain force level has an abnormality, other pre-configured applications that can perform code scanning operations can be called to scan. For example, the application that matches the force level is application 2, but application 2 is not installed in the terminal, or application 2 is in an abnormal state, then any one of the other pre-configured applications that can perform code scanning operations is called to scan the QR code. The abnormal state here can be an application crash or an inability to log in, etc.
[0071] In the disclosed embodiment, by calling an application that matches the force level of the input force of the external input event to scan the code, the user does not need to consider which application to use to scan the code, thereby improving convenience and flexibility.
[0072] Figure 8 The overall flow chart of code scanning control is shown schematically, refer to Figure 8 As shown in , it mainly includes the following steps:
[0073] In step S802, sensor data of the terminal is obtained;
[0074] In step S804, determine whether an external input event is received according to the sensor data; if so, go to step S806; if not, continue to execute step S802;
[0075] In step S806, it is determined whether the external input event meets the image acquisition condition; if so, the process goes to step S808; if not, the process continues to execute step S804;
[0076] In step S808, an environment image of the environment where the terminal is located is obtained;
[0077] In step S810, determine whether there is a two-dimensional code image in the environment image; if so, go to step S812; if not, end;
[0078] In step S812, an application corresponding to the force level of the input force of the external input event is called to scan the QR code image;
[0079] In step S814, determine whether the type of the two-dimensional code image is the first type; if so, go to step S816; if not, go to step S818;
[0080] In step S816, the operation corresponding to the two-dimensional code image is directly executed;
[0081] In step S818, the operation corresponding to the QR code image is performed according to the user behavior information.
[0082] Exemplarily, the operation corresponding to the QR code may be a payment operation, a friend adding operation, obtaining detailed information, or a login URL, etc., which is specifically determined according to the content of the QR code image.
[0083] The technical solution in the disclosed embodiment, on the one hand, performs QR code detection on the environmental image of the terminal's environment when the terminal receives an external input event, and scans the QR code image when the QR code image exists in the environmental image. Since the code can be scanned only by executing an external input event without touching the terminal screen, the operation steps of QR code scanning are simplified, the scanning efficiency and operation convenience are improved, and the flexibility is also increased. On the other hand, after receiving the external input event, it is further detected whether there is a QR code image in the environmental image, and the code is scanned only when the QR code image exists, thereby avoiding invalid code scanning and improving the reliability and accuracy of the scanning process.
[0084] The present disclosure provides a two-dimensional code scanning device, referring to Fig. 9 As shown in , the two-dimensional code scanning device 900 may include: an environment image acquisition module 901, a two-dimensional code detection module 902 and a scanning control module 903, wherein:
[0085] The environment image acquisition module 901 may be used to acquire an environment image of the environment where the terminal is located in response to the terminal receiving an external input event;
[0086] The two-dimensional code detection module 902 can be used to perform two-dimensional code detection on the environment image and determine the detection result;
[0087] The scanning control module 903 may be configured to scan the two-dimensional code image and perform an operation corresponding to the two-dimensional code image in response to a detection result indicating that the two-dimensional code image exists in the environment image.
[0088] In an exemplary embodiment of the present disclosure, the external input event is a knock event; before acquiring the environmental image of the environment where the terminal is located, the device also includes: a sensor data acquisition module, used to acquire sensor data of the terminal; an event probability determination module, used to fit the sensor data through a knock detection model to obtain the event probability corresponding to the sensor data; wherein the event probability is used to represent the probability that the sensor data belongs to a knock event; an external input event detection module, used to determine that the terminal has received a knock event in response to the event probability being greater than a first probability threshold.
[0089] In an exemplary embodiment of the present disclosure, an event probability determination module includes: a feature extraction module, which is used to extract features from sensor data within a time period corresponding to a current moment to extract multiple feature data; and a feature fusion module, which is used to fuse multiple feature data to obtain event probabilities corresponding to the sensor data.
[0090] In an exemplary embodiment of the present disclosure, the environmental image acquisition module includes: an effective range determination module, which is used to determine the effective input range according to the screen state of the terminal; and an image acquisition module, which is used to acquire the environmental image of the environment in which the terminal is located in response to receiving an external input event that acts within the effective input range.
[0091] In an exemplary embodiment of the present disclosure, the number of environmental images is multiple frames; the QR code detection module includes: a reference detection result determination module, which is used to input each frame of the environmental image into the QR code recognition model respectively to determine the reference detection result of each frame of the environmental image; a QR code recognition module, which is used to determine that the detection result is that the QR code image exists in the environmental image in response to the reference detection result being that the number of environmental images containing the QR code image is greater than a quantity threshold.
[0092] In an exemplary embodiment of the present disclosure, a reference detection result determination module includes: a feature extraction module, used to perform multiple types of downsampling operations on each frame of the environmental image to extract multiple environmental image features; a feature fusion module, used to fuse multiple environmental image features to obtain a two-dimensional code recognition probability; wherein the two-dimensional code recognition probability is used to represent the probability of the existence of a two-dimensional code image in the environmental image; a two-dimensional code determination module, used to determine that the reference detection result is that a two-dimensional code image exists in the environmental image in response to the two-dimensional code recognition probability being greater than a second probability threshold.
[0093] In an exemplary embodiment of the present disclosure, the scanning control module includes: a type determination module, which is used to identify the two-dimensional code image and determine the type of the two-dimensional code image; the type of the two-dimensional code image is used to characterize the business type of the two-dimensional code image; and a classification execution module, which is used to execute operations corresponding to the two-dimensional code image according to the type of the two-dimensional code image.
[0094] In an exemplary embodiment of the present disclosure, the type of the QR code image includes a first type or a second type; the classification execution module includes: a first execution module, used to directly execute the operation corresponding to the QR code image in response to the type of the QR code image being the first type; a second execution module, used to obtain user behavior information corresponding to the terminal in response to the type of the QR code image being the second type, and execute the operation corresponding to the QR code image according to the user behavior information.
[0095] In an exemplary embodiment of the present disclosure, the second execution module includes: a user behavior preference determination module, which is used to extract the user behavior preference corresponding to the terminal based on the historical behavior data of the terminal; a URL parsing module, which is used to obtain the URL information obtained by scanning the QR code image; a keyword matching module, which is used to match the keywords of the URL information with the user behavior preference corresponding to the terminal to obtain a matching result; and an operation execution module, which is used to scan the QR code image according to the matching result.
[0096] In an exemplary embodiment of the present disclosure, the interactive interface of the terminal includes a selection control; the second execution module includes: a first selection execution module, which is used to execute the operation corresponding to the QR code image in response to a trigger operation acting on the selection control when the scanning box of the application is not displayed on the interactive interface; a second selection execution module, which is used to adjust the scanning control on the interactive interface to a selection control when the scanning box of the application is displayed on the interactive interface, and execute the operation corresponding to the QR code image in response to the trigger operation acting on the selection control.
[0097] In an exemplary embodiment of the present disclosure, a scanning control module includes: a force level determination module, used to compare the sensor data of the terminal with the acceleration threshold to determine the force level corresponding to the sensor data; wherein the sensor data is used to reflect the input force of an external input event, and the sensor data includes acceleration data or linear acceleration data; an application calling module, used to call an application matching the force level to scan a QR code image.
[0098] It should be noted that the specific details of each part of the above-mentioned two-dimensional code scanning device have been described in detail in some implementation methods of the corresponding methods. The undisclosed details can be found in the implementation content of the method part, and will not be repeated here.
[0099] The exemplary embodiment of the present disclosure also provides an electronic device. The electronic device may be the above-mentioned mobile terminal device. Generally, the electronic device may include a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the above-mentioned two-dimensional code scanning method by executing the executable instructions.
[0100] Below Fig.10 The mobile terminal 1000 in FIG. 1 is taken as an example to exemplify the structure of the electronic device. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Fig.10 The construction in can also be applied to fixed type equipment.
[0101] like Fig.10As shown, the mobile terminal 1000 may specifically include: a processor 1001, a memory 1002, a bus 1003, a mobile communication module 1004, an antenna 1, a wireless communication module 1005, an antenna 2, a display screen 1006, a camera module 1007, an audio module 1008, a power module 1009 and a sensor module 1010.
[0102] The processor 1001 may include one or more processing units, for example, the processor 1001 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc. The two-dimensional code scanning method in this exemplary embodiment may be executed by an AP, a GPU or a DSP. When the method involves processing related to a neural network, it may be executed by an NPU, for example, the NPU may load neural network parameters and execute algorithm instructions related to the neural network.
[0103] The encoder can encode (i.e. compress) an image or video to reduce the data size for easy storage or transmission. The decoder can decode (i.e. decompress) the encoded data of an image or video to restore the image or video data. The mobile terminal 1000 can support one or more encoders and decoders, such as: image formats such as JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap), and video formats such as MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, and HEVC (High Efficiency Video Coding).
[0104] The processor 1001 may be connected to the memory 1002 or other components via a bus 1003 .
[0105] The memory 1002 may be used to store computer executable program codes, which may include instructions. The processor 1001 executes various functional applications and data processing of the mobile terminal 1000 by running the instructions stored in the memory 1002. The memory 1002 may also store application data, such as images, videos, and other files.
[0106] The communication function of the mobile terminal 1000 can be implemented by the mobile communication module 1004, antenna 1, wireless communication module 1005, antenna 2, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 1004 can provide 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 1000. The wireless communication module 1005 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 1000.
[0107] The display screen 1006 is used to implement display functions, such as displaying user interfaces, images, videos, etc. The camera module 1007 is used to implement shooting functions, such as shooting images, videos, etc., and the camera module may include a color temperature sensor array. The audio module 1008 is used to implement audio functions, such as playing audio, collecting voice, etc. The power module 1009 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc. The sensor module 1010 may include one or more sensors for implementing corresponding sensing detection functions. For example, the sensor module 1010 may include an inertial sensor, which is used to detect the motion posture of the mobile terminal 1000 and output inertial sensing data.
[0108] It should be noted that a computer-readable storage medium is also provided in an embodiment of the present disclosure. The computer-readable storage medium may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device.
[0109] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0110] Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0111] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments.
[0112] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0113] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0114] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0115] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.
[0116] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A two-dimensional code scanning method, characterized in that: include: In response to the terminal receiving an external input event, acquiring an environment image of an environment where the terminal is located; Performing QR code detection on the environment image to determine a detection result; In response to the detection result that a two-dimensional code image exists in the environment image, the two-dimensional code image is scanned, and an operation corresponding to the two-dimensional code image is performed.
2. The two-dimensional code scanning method according to claim 1, characterized in that: The external input event is a tapping event; before acquiring the environment image of the environment where the terminal is located, the method further includes: Acquiring sensor data of the terminal; Fitting the sensor data through a knock detection model to obtain an event probability corresponding to the sensor data; wherein the event probability is used to indicate the probability that the sensor data belongs to the knock event; In response to the event probability being greater than a first probability threshold, it is determined that the terminal receives the tap event.
3. The two-dimensional code scanning method according to claim 2, characterized in that: The step of fitting the sensor data through a knock detection model to obtain event probabilities corresponding to the sensor data includes: Performing feature extraction on sensor data within a time period corresponding to the current moment to extract multiple feature data; The multiple feature data are fused to obtain the event probability corresponding to the sensor data.
4. The two-dimensional code scanning method according to claim 1, characterized in that: The step of acquiring an environment image of an environment where the terminal is located in response to the terminal receiving an external input event comprises: Determining a valid input range according to a screen state of the terminal; In response to receiving the external input event acting within the effective input range, acquiring the environment image of the environment where the terminal is located.
5. The two-dimensional code scanning method according to claim 1, characterized in that: The number of the environmental images is multiple frames; the performing of two-dimensional code detection on the environmental images and determining the detection result includes: Inputting each frame of the environment image into the two-dimensional code recognition model to determine the reference detection result of each frame of the environment image; In response to the reference detection result being that the number of environmental images containing two-dimensional code images is greater than a number threshold, it is determined that the detection result is that the two-dimensional code image exists in the environmental image.
6. The two-dimensional code scanning method according to claim 5, characterized in that: The step of inputting each frame of the environment image into the two-dimensional code recognition model to determine a reference detection result of each frame of the environment image includes: Performing multiple types of downsampling operations on each frame of the environment image to extract multiple environment image features; The plurality of environmental image features are fused to obtain a two-dimensional code recognition probability; wherein the two-dimensional code recognition probability is used to indicate a probability that a two-dimensional code image exists in the environmental image; In response to the two-dimensional code recognition probability being greater than a second probability threshold, determining that the reference detection result is that the two-dimensional code image exists in the environment image.
7. The two-dimensional code scanning method according to claim 1, characterized in that: The performing of the operation corresponding to the two-dimensional code image includes: Identify the two-dimensional code image and determine the type of the two-dimensional code image; the type of the two-dimensional code image is used to characterize the business type of the two-dimensional code image; An operation corresponding to the two-dimensional code image is performed according to the type of the two-dimensional code image.
8. The two-dimensional code scanning method according to claim 7, characterized in that: The type of the two-dimensional code image includes a first type or a second type; and performing an operation corresponding to the two-dimensional code image according to the type of the two-dimensional code image includes: In response to the type of the two-dimensional code image being the first type, directly executing an operation corresponding to the two-dimensional code image; In response to the type of the two-dimensional code image being the second type, user behavior information corresponding to the terminal is acquired, and an operation corresponding to the two-dimensional code image is performed according to the user behavior information.
9. The two-dimensional code scanning method according to claim 8, characterized in that: The performing the operation corresponding to the two-dimensional code image according to the user behavior information includes: Extracting user behavior preferences corresponding to the terminal according to the historical behavior data of the terminal; Obtaining website information obtained by scanning the two-dimensional code image; Matching the keywords of the website information with the user behavior preferences corresponding to the terminal to obtain a matching result; According to the matching result, an operation corresponding to the two-dimensional code image is performed.
10. The two-dimensional code scanning method according to claim 8, characterized in that: The interactive interface of the terminal includes a selection control; the operation corresponding to the two-dimensional code image is performed according to the user behavior information, including: In the case where a scanning box of the application is not displayed on the interactive interface, in response to a triggering operation acting on the selection control, executing an operation corresponding to the two-dimensional code image; When the scanning box of the application is displayed on the interactive interface, the scanning control on the interactive interface is adjusted to the selection control, and in response to the triggering operation acting on the selection control, the operation corresponding to the two-dimensional code image is performed.
11. The two-dimensional code scanning method according to claim 1, characterized in that: The scanning of the two-dimensional code image comprises: Comparing the sensor data of the terminal with the acceleration threshold to determine the force level corresponding to the sensor data; wherein the sensor data is used to reflect the input force of the external input event, and the sensor data includes acceleration data or linear acceleration data; An application program matching the force level is called to scan the two-dimensional code image.
12. A two-dimensional code scanning device, characterized in that: include: An environment image acquisition module, configured to acquire an environment image of an environment where the terminal is located in response to the terminal receiving an external input event; A two-dimensional code detection module, used to perform two-dimensional code detection on the environment image and determine the detection result; The scanning control module is used to scan the two-dimensional code image and execute the operation corresponding to the two-dimensional code image in response to the detection result that the two-dimensional code image exists in the environment image.
13. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the two-dimensional code scanning method described in any one of claims 1-11 by executing the executable instructions.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the two-dimensional code scanning method described in any one of claims 1 to 11 is implemented.
