CN110717750A - Two-dimensional code display method, two-dimensional code display device and mobile terminal - Google Patents

Two-dimensional code display method, two-dimensional code display device and mobile terminal Download PDF

Info

Publication number
CN110717750A
CN110717750A CN201910881513.0A CN201910881513A CN110717750A CN 110717750 A CN110717750 A CN 110717750A CN 201910881513 A CN201910881513 A CN 201910881513A CN 110717750 A CN110717750 A CN 110717750A
Authority
CN
China
Prior art keywords
scanned
dimensional code
mobile terminal
dimension
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910881513.0A
Other languages
Chinese (zh)
Inventor
刘真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910881513.0A priority Critical patent/CN110717750A/en
Publication of CN110717750A publication Critical patent/CN110717750A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3274Short range or proximity payments by means of M-devices using a pictured code, e.g. barcode or QR-code, being displayed on the M-device

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a two-dimensional code display method, a two-dimensional code display device, a mobile terminal and a computer readable storage medium, wherein the two-dimensional code display method comprises the following steps: detecting whether a two-dimension code to be scanned exists in a display page of the current mobile terminal; if the two-dimension code to be scanned exists, storing the two-dimension code to be scanned as a two-dimension code image to be scanned; adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal; and displaying the two-dimensional code image to be scanned after the size is adjusted at more than two preset positions of a screen of the mobile terminal. According to the scheme, when a user needs to scan the two-dimensional code through a merchant to complete payment operation, the two-dimensional code is tiled and displayed to the screen area, and the success rate of code scanning equipment in reading the two-dimensional code of the mobile terminal is improved.

Description

Two-dimensional code display method, two-dimensional code display device and mobile terminal
Technical Field
The present application belongs to the technical field of data processing, and in particular, to a two-dimensional code display method, a two-dimensional code display apparatus, a mobile terminal, and a computer-readable storage medium.
Background
With the popularization of the two-dimension code technology, the electronic wallet is widely accepted, and people more and more use the two-dimension code to complete daily payment operation. Currently, there are several payment methods for payment through two-dimensional codes as follows: one is that the user scans the two-dimensional code of the merchant, and the payment is finished after the payment amount is confirmed; the other method is that the merchant scans the two-dimensional code of the user, and the merchant directly finishes the money deduction operation. In the above process that the second merchant scans the two-dimensional code of the user to complete the payment of the two-dimensional code, the user is often required to face the screen of the mobile terminal to the merchant code scanning device. However, the screen of the mobile terminal is usually opposite to the user in the above process, which causes that the user cannot accurately send the two-dimensional code area on the screen into the window area of the code scanning device, thereby reducing the payment efficiency and the operation fluency of the user to a certain extent.
Disclosure of Invention
In view of this, the present application provides a two-dimensional code display method, a two-dimensional code display apparatus, a mobile terminal and a computer-readable storage medium, which can improve the operation smoothness and the electronic payment efficiency of a user during electronic payment.
A first aspect of the present application provides a two-dimensional code display method, including:
detecting whether a two-dimension code to be scanned exists in a display page of the current mobile terminal;
if the two-dimension code to be scanned exists, storing the two-dimension code to be scanned as a two-dimension code image to be scanned;
adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal;
and displaying the two-dimensional code image to be scanned after the size is adjusted at more than two preset positions of a screen of the mobile terminal.
A second aspect of the present application provides a two-dimensional code display device including:
the mobile terminal comprises a detection unit, a processing unit and a display unit, wherein the detection unit is used for detecting whether a two-dimension code to be scanned exists in a display page of the current mobile terminal;
the storage unit is used for storing the two-dimension code to be scanned as a two-dimension code image to be scanned if the two-dimension code to be scanned exists;
the adjusting unit is used for adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal;
and the display unit is used for displaying the two-dimensional code image to be scanned after the size is adjusted at more than two preset positions of the screen of the mobile terminal.
A third aspect of the present application provides a mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect as described above.
A fifth aspect of the application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method as described in the first aspect above.
As can be seen from the above, in the present application, whether a two-dimensional code to be scanned exists in a display page of a current mobile terminal is detected, if the two-dimensional code to be scanned exists, the two-dimensional code to be scanned is stored as a two-dimensional code image to be scanned, the size of the two-dimensional code image to be scanned is adjusted based on the screen size of the mobile terminal, and finally the two-dimensional code image to be scanned after the size adjustment is displayed at two or more preset positions on the screen of the mobile terminal. According to the scheme, when a user needs to scan the two-dimensional code through a merchant to complete payment operation, the two-dimensional code is tiled and displayed to the screen area, and the success rate of code scanning equipment in reading the two-dimensional code of the mobile terminal is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an implementation flow of a two-dimensional code display method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of a specific implementation flow of step 101 in a two-dimensional code display method provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a specific implementation flow of step 102 in a two-dimensional code display method provided in the embodiment of the present application;
fig. 4 is a schematic diagram of a specific implementation flow of step 103 in the two-dimensional code display method provided in the embodiment of the present application;
FIG. 5-a is a diagram illustrating a two-dimensional code display example under an adjustment parameter provided in an embodiment of the present application;
5-b is a two-dimensional code display example diagram under another adjustment parameter provided by the embodiment of the present application;
fig. 6 is a block diagram of a two-dimensional code display device according to an embodiment of the present application
Fig. 7 is a schematic diagram of a mobile terminal provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution of the present application, the following description will be given by way of specific examples.
Example one
In the embodiment of the application, the execution subject of the flow is the mobile terminal. The mobile terminal includes but is not limited to: the device comprises a tablet computer, a smart phone and the like which can execute two-dimensional code display operation. Fig. 1 shows a flowchart of an implementation of a two-dimensional code display method provided in an embodiment of the present application, which is detailed as follows:
in step 101, detecting whether a two-dimensional code to be scanned exists in a display page of a current mobile terminal;
in the embodiment of the application, when the mobile terminal is in a bright screen state, whether the two-dimensional code to be scanned exists in a display page of the current mobile terminal can be detected, wherein the two-dimensional code to be scanned specifically refers to a payment code. Optionally, the mobile terminal may continuously detect whether the two-dimensional code to be scanned exists in the display page in a bright screen state; or, the mobile terminal may periodically detect whether the two-dimensional code to be scanned exists in the display page in a bright screen state; or the mobile terminal may also monitor whether a payment application program runs in the current foreground in a bright screen state, and continuously or periodically detect whether a two-dimensional code to be scanned exists in the display page when the payment application program runs in the foreground, where the execution time of step 101 is not limited here. Optionally, as shown in fig. 2, the step 101 specifically includes:
in step 1011, when the display page of the mobile terminal is refreshed, detecting whether a two-dimensional code exists in the refreshed display page;
in the embodiment of the application, the mobile terminal may be configured with a two-dimensional code detection module, and whenever a display page of the mobile terminal is refreshed (for example, when page jump is performed, a page needs to be refreshed), it may be detected whether a two-dimensional code exists on the refreshed display page. And if the two-dimension code does not exist in the refreshed display page, suspending the detection of the current display page, namely, in the process of displaying the current refreshed display page by the mobile terminal, not continuously detecting whether the two-dimension code to be scanned exists in the display page.
In step 1012, if two-dimensional codes exist in the refreshed display page, counting the number of the two-dimensional codes;
in the embodiment of the application, when it is detected that the two-dimensional code exists in the display page, it is considered that the two-dimensional code for payment often exists independently, that is, the mobile terminal often does not display a plurality of different two-dimensional codes during payment, so that the number of the two-dimensional codes displayed on the display page after refreshing can be further counted at this time, and the possibility that the two-dimensional code displayed at present is the two-dimensional code to be scanned is estimated based on the number of the two-dimensional codes.
In step 1013, if the number of the two-dimensional codes is one, it is determined that the two-dimensional code to be scanned exists in the display page of the current mobile terminal.
In the embodiment of the application, when the number of the two-dimensional codes is one, it can be considered that the probability that the two-dimensional code to be scanned exists in the display page of the current mobile terminal is high. Further, in order to improve the detection accuracy of the two-dimensional codes to be scanned, when the number of the two-dimensional codes is one, it can be determined whether the mobile terminal is currently in a code scanning payment scene by adopting other methods:
for example, a target application and a target interface for displaying the two-dimensional code may be obtained, that is, the two-dimensional code called by the interface of the application is obtained. Specifically, in a payment scenario, the two-dimensional code to be scanned is necessarily a two-dimensional code generated by calling a payment interface by an application program with a payment function, but not other types of two-dimensional codes, for example, when a friend is added to the two-dimensional code, a mobile terminal may also generate the two-dimensional code and display the two-dimensional code on a page for others to scan the code; or when reading public account content and microblog content, the tail ends of the content can often display two-dimensional codes for others to scan codes so as to realize the attention function: obviously, the two-dimensional codes are not in the scope of the two-dimensional codes to be scanned for code scanning payment in the embodiment of the present application. Therefore, the target application program and the target interface for displaying the two-dimensional code can be detected, and the two-dimensional code is more likely to be the two-dimensional code for code scanning payment only when the target application program is the payment application program and the target interface is the payment interface.
Secondly, whether the mobile terminal is in a payment scene can be further judged according to the current position of the mobile terminal. Generally, in the residential category, there are few scenarios where payment is made by a code scanning device. In fact, the code scanning device is often used in some formal commercial places, and ordinary small vendors, small stores and the like often adopt a user code scanning merchant to complete payment instead of the merchant code scanning user to complete payment. Therefore, the current position of the mobile terminal can be detected simultaneously, and the two-dimensional code is more likely to be a two-dimensional code for code scanning payment only when the mobile terminal is currently located in a preset area, namely a preset commercial place.
Or, whether the mobile terminal is in the payment scene or not can be judged according to the current posture of the mobile terminal. Generally speaking, a code scanning device adopted by a merchant often requires a mobile terminal of a user to be placed flat with a screen facing downward (i.e., the screen is parallel to a horizontal plane) for code scanning payment; or the mobile terminal of the user is required to be vertically placed, the screen is forward (namely the screen is vertical to the horizontal plane), and code scanning payment is carried out. When a user plays a mobile phone to read the contents of the microblog or the public number (in this case, a two-dimensional code may be carried in the contents), or when a friend is added to the contents by scanning the code for another person, the screen of the mobile terminal often forms a certain inclination angle with the horizontal plane. Therefore, by detecting the posture of the mobile terminal, the two-dimensional code is more likely to be the two-dimensional code for code scanning payment only when the mobile terminal is currently in the posture that the screen is horizontally or vertically placed. Of course, considering that it is difficult for a user to achieve an absolute horizontal placement and an absolute vertical placement when holding the mobile terminal, the horizontal placement actually refers to a preset horizontal range (i.e., allowing the horizontal direction to be inclined within a preset angle range), and the vertical placement actually refers to a preset vertical range (i.e., allowing the vertical direction to be inclined within a preset angle range), which is not limited herein.
Further, a front camera of the mobile terminal can be triggered to judge whether the mobile terminal is in a payment scene. If the front camera detects that a code reading window of code scanning equipment exists in front, the two-dimensional code can be considered to be a two-dimensional code for code scanning payment.
The above-mentioned several ways of detecting whether the mobile terminal is in the code scanning payment scenario may be executed simultaneously or may be executed by choosing, which is not limited herein.
In step 102, if the two-dimension code to be scanned exists, storing the two-dimension code to be scanned as a two-dimension code image to be scanned;
in this embodiment of the application, once it is detected that the two-dimensional code to be scanned exists in the display page, the mobile terminal may store the two-dimensional code to be scanned as a two-dimensional code image to be scanned, so as to be used in subsequent adjustment and display. Optionally, for the payment security of the user, the two-dimensional code image to be scanned is not stored in a media library directly accessible from the foreground, but stored in a cache database. Optionally, as shown in fig. 3, the step 102 specifically includes:
in step 1021, detecting whether the two-dimensional code to be scanned has a storage option, if yes, executing step 1022, and if not, executing step 1023;
in the embodiment of the application, some two-dimensional codes can pop up a storage option through long-time pressing operation of a user; considering that the two-dimensional code to be scanned is a payment code, the possibility that the storage function is disabled exists, and therefore, whether the two-dimensional code to be scanned has a storage option or not can be detected first, specifically, whether the mobile terminal simulates long-time pressing operation of a user or not, and whether the two-dimensional code to be scanned has the storage option or not is detected by whether a storage option frame is popped up or not.
In step 1022, a two-dimensional code storage instruction is generated, and the two-dimensional code to be scanned is stored as a two-dimensional code image to be scanned based on the two-dimensional code storage instruction;
in this embodiment of the application, if it is detected that the two-dimensional code to be scanned has a storage option, it can be known that the two-dimensional code to be scanned can be currently stored, based on this, a two-dimensional code storage instruction can be generated, and based on the two-dimensional code storage instruction, the two-dimensional code to be scanned is stored as a two-dimensional code image to be scanned.
In step 1023, a screen shot is performed on the current page to obtain a screen shot image;
in the embodiment of the application, if it is detected that the two-dimensional code to be scanned does not have a storage option, it can be known that the two-dimensional code to be scanned cannot be stored currently, and based on this, a screenshot function of the system can be called to perform screenshot on the current page, so as to obtain a screenshot image. Alternatively, the screenshot image may be temporarily stored in the cache database instead of the media library.
In step 104, the two-dimensional code to be scanned is segmented in the screenshot image, and the segmented two-dimensional code to be scanned is stored as a two-dimensional code image to be scanned.
In this embodiment of the application, the two-dimensional code to be scanned is first positioned in the screenshot image to determine a specific position of the two-dimensional code to be scanned, then the two-dimensional code to be scanned is segmented based on the specific position of the two-dimensional code to be scanned in the screenshot image, and the segmented two-dimensional code to be scanned is stored as a two-dimensional code image to be scanned. Optionally, after the payment operation based on the two-dimensional code to be scanned is completed, deleting the two-dimensional code image to be scanned from the cache database to avoid that the two-dimensional code image continues to occupy system resources of the mobile terminal.
In step 103, adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal;
in the embodiment of the application, when the application calls the two-dimensional code to be scanned to be displayed in the page, the two-dimensional code is often large in size and occupies the central position of the screen, so that the code scanning device is not easy to align when code scanning operation is performed. Therefore, in the embodiment of the present application, when the two-dimensional code image to be scanned, which is saved and obtained based on the two-dimensional code to be scanned, is obtained, the size of the two-dimensional code image to be scanned may be adjusted based on the screen size of the mobile terminal. Optionally, as shown in fig. 4, the step 103 specifically includes:
in step 1031, acquiring the screen size of the mobile terminal;
in step 1032, a target width value is calculated based on the screen size and a preset adjustment ratio;
in the embodiment of the present application, the mobile terminal may first obtain its screen size from its own parameters. Considering that the mobile terminal is generally rectangular, here, when obtaining the screen size, the length value of the short side of the mobile terminal is focused, and the target width value is obtained based on the multiplication of the length value of the short side and the preset adjustment ratio. Alternatively, the adjustment ratio may be a fixed value, such as 0.3, 0.4, etc.; or, the adjustment ratio may also be a dynamically changing value, specifically, the distance between the mobile terminal and the code scanning device may be obtained through a distance sensor disposed on the front side of the mobile terminal, and it is considered that the smaller the distance is, the closer the screen of the mobile terminal and the code scanning device is, the larger the area on the screen display area read by the code scanning device is, and the smaller the area occupied by the object with the same size on the screen display area is; thus, the target width value may be adjusted in a proportional relationship based on the distance within a preset ratio range, which may be [0.2,0.8] for example, and is not limited herein. Further, when the adjustment ratio is a fixed value, the target width value may also be uniquely determined, and based on this, the target width value may be locally stored in the mobile terminal after the target width value is obtained through initial calculation; when the method of the embodiment of the application is needed to be used for displaying the two-dimensional code subsequently, the target width value can be directly called to adjust the size of the two-dimensional code image to be scanned.
In step 1033, the size of the two-dimensional code image to be scanned is adjusted according to the target width value.
In this embodiment of the application, after the target width value is obtained, the two-dimensional code image to be scanned is scaled, so that the width of the two-dimensional code image to be scanned matches the target width value.
In step 104, the two-dimensional code image to be scanned after the size adjustment is displayed at more than two preset positions of the screen of the mobile terminal.
In this embodiment of the application, after the size adjustment operation is performed on the to-be-scanned two-dimensional code image, the to-be-scanned two-dimensional code image after the size adjustment may be displayed at a plurality of preset positions on the screen of the mobile terminal. Specifically, the adjustment ratio may correspond to a plurality of different preset positions. For example, when the adjustment ratio is 0.4, the display condition of the two-dimensional code image to be scanned is as shown in fig. 5-a; when the adjustment ratio is 0.25, the display condition of the two-dimensional code image to be scanned is as shown in fig. 5-b, and the corresponding relationship between the adjustment ratio and the preset position is not limited here. Through step 104, a tiling operation of the two-dimensional code to be scanned on the screen can be realized. Optionally, an execution time may be defined for the step 104, for example, the two-dimensional code image to be scanned after the size adjustment is displayed at two or more preset positions on the screen of the mobile terminal, and is kept for a preset time period; after a preset time period, returning to the original display page, that is, returning to the display page in step 101; or after the code scanning device reads the two-dimensional code and successfully executes the deduction operation, triggering a display page to display the related feedback information of successful payment.
Therefore, in the embodiment of the application, the mobile terminal determines whether the mobile terminal is in a payment scene currently through modes such as posture and position, the size of the two-dimensional code to be scanned is adjusted in the payment scene, the two-dimensional code after size adjustment is finally tiled and displayed on a screen, and the success rate of the code scanning device in reading the two-dimensional code of the mobile terminal can be improved to a certain extent.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example two
A second embodiment of the present application provides a two-dimensional code display device, where the two-dimensional code display device may be integrated in a mobile terminal, as shown in fig. 6, a two-dimensional code display device 600 in the embodiment of the present application includes:
the detecting unit 601 is configured to detect whether a two-dimensional code to be scanned exists in a display page of a current mobile terminal;
a storage unit 602, configured to store the to-be-scanned two-dimensional code as a to-be-scanned two-dimensional code image if the to-be-scanned two-dimensional code exists;
an adjusting unit 603, configured to adjust a size of the to-be-scanned two-dimensional code image based on a screen size of the mobile terminal;
the display unit 604 is configured to display the two-dimensional code image to be scanned after the size adjustment at two or more preset positions on the screen of the mobile terminal.
Optionally, the detecting unit 601 includes:
the mobile terminal comprises a detection subunit, a display unit and a display unit, wherein the detection subunit is used for detecting whether a two-dimensional code exists in a display page after refreshing when the display page of the mobile terminal refreshes;
the counting subunit is used for counting the number of the two-dimensional codes if the two-dimensional codes exist in the refreshed display page;
and the determining subunit is used for determining that the two-dimension code to be scanned exists in the display page of the current mobile terminal if the number of the two-dimension codes is one.
Optionally, the determining sub-unit comprises:
a target determination subunit, configured to determine a target application and a target interface for displaying the two-dimensional code if the number of the two-dimensional codes is one;
a position obtaining subunit, configured to obtain a current position of the mobile terminal;
an attitude detection subunit, configured to detect a current attitude of the mobile terminal;
and the two-dimension code determining subunit is configured to determine that the two-dimension code to be scanned exists in a display page of the current mobile terminal if the target application program is a payment application program, the target interface is a payment interface, the current position is in a preset area, and the current posture is a posture in which a screen is horizontally placed or vertically placed.
Optionally, the storage unit 602 includes:
the storage detection subunit is used for detecting whether the two-dimensional code to be scanned has a storage option or not;
the first storage subunit is used for generating a two-dimensional code storage instruction if the two-dimensional code image to be scanned has a storage option, and storing the two-dimensional code to be scanned as a two-dimensional code image to be scanned based on the two-dimensional code storage instruction;
the page screen capturing subunit is used for capturing a screen of the current page to obtain a screen capturing image if the two-dimensional code image to be scanned does not have a storage option;
and the second storage subunit is used for segmenting the two-dimensional code to be scanned on the screen capture image and storing the segmented two-dimensional code to be scanned as a two-dimensional code image to be scanned.
Optionally, the adjusting unit 603 includes:
a screen size obtaining subunit, configured to obtain a screen size of the mobile terminal;
the target width value calculation operator unit is used for calculating to obtain a target width value based on the screen size and a preset adjustment ratio;
and the size adjusting subunit is used for adjusting the size of the two-dimensional code image to be scanned according to the target width value.
Optionally, the two-dimensional code display device 600 further includes:
a distance obtaining unit, configured to obtain, by a distance sensor, a distance between the mobile terminal and a code scanning device before a target width value is calculated based on the screen size and a preset adjustment ratio;
and the ratio setting subunit is used for setting the adjustment ratio within a preset ratio range based on the distance, wherein the distance and the adjustment ratio are in a direct proportion relation.
Therefore, in the embodiment of the application, the two-dimensional code display device determines whether the two-dimensional code is in a payment scene currently or not through modes such as posture and position, the size of the two-dimensional code to be scanned is adjusted in the payment scene, the two-dimensional code after size adjustment is finally tiled and displayed on a screen, and the success rate of the code scanning device in reading the two-dimensional code of the mobile terminal can be improved to a certain extent.
EXAMPLE III
Referring to fig. 7, a mobile terminal 7 in the embodiment of the present application includes: a memory 701, one or more processors 702 (only one shown in fig. 7), and a computer program stored on the memory 701 and executable on the processors. Wherein: the memory 701 is used for storing software programs and modules, and the processor 702 executes various functional applications and data processing by running the software programs and units stored in the memory 701, so as to acquire resources corresponding to the preset events. Specifically, the processor 702 realizes the following steps by running the above-mentioned computer program stored in the memory 701:
detecting whether a two-dimension code to be scanned exists in a display page of the current mobile terminal;
if the two-dimension code to be scanned exists, storing the two-dimension code to be scanned as a two-dimension code image to be scanned;
adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal;
and displaying the two-dimensional code image to be scanned after the size is adjusted at more than two preset positions of a screen of the mobile terminal.
Assuming that the foregoing is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the detecting whether the two-dimensional code to be scanned exists in the display page of the current mobile terminal includes:
when a display page of the mobile terminal is refreshed, detecting whether the refreshed display page has a two-dimensional code;
if the two-dimensional codes exist in the refreshed display page, counting the number of the two-dimensional codes;
and if the number of the two-dimension codes is one, determining that the two-dimension codes to be scanned exist in the display page of the current mobile terminal.
In a third possible implementation manner provided on the basis of the second possible implementation manner, the determining that the two-dimensional code to be scanned exists in the display page of the current mobile terminal if the number of the two-dimensional codes is one includes:
if the number of the two-dimension codes is one, determining a target application program and a target interface for displaying the two-dimension codes;
acquiring the current position of the mobile terminal;
detecting the current posture of the mobile terminal;
and if the target application program is a payment application program, the target interface is a payment interface, the current position is in a preset area, and the current posture is a posture that a screen is horizontally placed or vertically placed, determining that the two-dimensional code to be scanned exists in a display page of the current mobile terminal.
In a fourth possible implementation manner provided on the basis of the first possible implementation manner, the storing the two-dimensional code to be scanned as a two-dimensional code image to be scanned includes:
detecting whether the two-dimension code to be scanned has a storage option or not;
if the two-dimensional code image to be scanned has a storage option, generating a two-dimensional code storage instruction, and storing the two-dimensional code to be scanned as the two-dimensional code image to be scanned based on the two-dimensional code storage instruction;
if the two-dimensional code image to be scanned does not have a storage option, performing screen capture on the current page to obtain a screen capture image;
and segmenting the two-dimensional code to be scanned at the screen capturing image, and storing the segmented two-dimensional code to be scanned as a two-dimensional code image to be scanned.
In a fifth possible implementation manner provided on the basis of the first possible implementation manner, the adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal includes:
acquiring the screen size of the mobile terminal;
calculating to obtain a target width value based on the screen size and a preset adjustment ratio;
and adjusting the size of the two-dimensional code image to be scanned according to the target width value.
In a sixth possible implementation manner provided on the basis of the fifth possible implementation manner, before the target width value is calculated based on the screen size and a preset adjustment ratio, the processor 702 further implements the following steps when running the computer program stored in the memory 701:
acquiring the distance between the mobile terminal and the code scanning device through a distance sensor;
and setting the adjustment ratio within a preset ratio range based on the distance, wherein the distance and the adjustment ratio are in a direct proportional relation.
It should be understood that, in the embodiment of the present Application, the Processor 702 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Memory 701 may include both read-only memory and random access memory and provides instructions and data to processor 702. Some or all of memory 701 may also include non-volatile random access memory. For example, memory 701 may also store information of device types.
Therefore, in the scheme of the application, the mobile terminal determines whether the mobile terminal is in a payment scene currently or not through modes such as posture and position, the size of the two-dimensional code to be scanned is adjusted in the payment scene, the two-dimensional code after size adjustment is finally tiled and displayed on a screen, and the success rate of the code scanning device in reading the two-dimensional code of the mobile terminal can be improved to a certain extent.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of external device software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A two-dimensional code display method is characterized by comprising the following steps:
detecting whether a two-dimension code to be scanned exists in a display page of the current mobile terminal;
if the two-dimension code to be scanned exists, storing the two-dimension code to be scanned as a two-dimension code image to be scanned;
adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal;
and displaying the two-dimensional code image to be scanned after the size is adjusted at more than two preset positions of a screen of the mobile terminal.
2. The two-dimension code display method of claim 1, wherein the detecting whether the two-dimension code to be scanned exists in the display page of the current mobile terminal comprises:
when a display page of the mobile terminal is refreshed, detecting whether a two-dimensional code exists in the refreshed display page;
if the two-dimension codes exist in the refreshed display page, counting the number of the two-dimension codes;
and if the number of the two-dimension codes is one, determining that the two-dimension codes to be scanned exist in the display page of the current mobile terminal.
3. The two-dimensional code display method according to claim 2, wherein determining that the two-dimensional code to be scanned exists in the display page of the current mobile terminal if the number of the two-dimensional codes is one includes:
if the number of the two-dimension codes is one, determining a target application program and a target interface for displaying the two-dimension codes;
acquiring the current position of the mobile terminal;
detecting the current posture of the mobile terminal;
and if the target application program is a payment application program, the target interface is a payment interface, the current position is in a preset area, and the current posture is a posture that a screen is horizontally or vertically placed, determining that the two-dimensional code to be scanned exists in a display page of the current mobile terminal.
4. The two-dimensional code display method according to claim 1, wherein the storing the two-dimensional code to be scanned as a two-dimensional code image to be scanned comprises:
detecting whether the two-dimension code to be scanned has a storage option or not;
if the two-dimension code to be scanned has a storage option, generating a two-dimension code storage instruction, and storing the two-dimension code to be scanned as a two-dimension code image to be scanned based on the two-dimension code storage instruction;
if the two-dimensional code to be scanned does not have a storage option, performing screen capture on the current page to obtain a screen capture image;
and segmenting the two-dimension code to be scanned at the screen capturing image, and storing the segmented two-dimension code to be scanned as a two-dimension code image to be scanned.
5. The two-dimensional code display method according to claim 1, wherein the adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal comprises:
acquiring the screen size of the mobile terminal;
calculating to obtain a target width value based on the screen size and a preset adjustment ratio;
and adjusting the size of the two-dimensional code image to be scanned according to the target width value.
6. The two-dimensional code display method according to claim 5, wherein before the calculating of the target width value based on the screen size and a preset adjustment ratio, the two-dimensional code display method further comprises:
acquiring the distance between the mobile terminal and a code scanning device through a distance sensor;
and setting the adjusting ratio within a preset ratio range based on the distance, wherein the distance and the adjusting ratio are in a direct proportional relation.
7. A two-dimensional code display device, comprising:
the mobile terminal comprises a detection unit, a processing unit and a display unit, wherein the detection unit is used for detecting whether a two-dimension code to be scanned exists in a display page of the current mobile terminal;
the storage unit is used for storing the two-dimension code to be scanned as a two-dimension code image to be scanned if the two-dimension code to be scanned exists;
the adjusting unit is used for adjusting the size of the two-dimensional code image to be scanned based on the screen size of the mobile terminal;
and the display unit is used for displaying the two-dimensional code image to be scanned after the size is adjusted at more than two preset positions of the screen of the mobile terminal.
8. The two-dimensional code display device according to claim 7, wherein the detection unit includes:
the detection subunit is used for detecting whether the two-dimensional code exists in the refreshed display page or not when the display page of the mobile terminal is refreshed;
the counting subunit is used for counting the number of the two-dimension codes if the two-dimension codes exist in the refreshed display page;
and the determining subunit is used for determining that the two-dimension code to be scanned exists in the display page of the current mobile terminal if the number of the two-dimension codes is one.
9. A mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN201910881513.0A 2019-09-18 2019-09-18 Two-dimensional code display method, two-dimensional code display device and mobile terminal Pending CN110717750A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910881513.0A CN110717750A (en) 2019-09-18 2019-09-18 Two-dimensional code display method, two-dimensional code display device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910881513.0A CN110717750A (en) 2019-09-18 2019-09-18 Two-dimensional code display method, two-dimensional code display device and mobile terminal

Publications (1)

Publication Number Publication Date
CN110717750A true CN110717750A (en) 2020-01-21

Family

ID=69210575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910881513.0A Pending CN110717750A (en) 2019-09-18 2019-09-18 Two-dimensional code display method, two-dimensional code display device and mobile terminal

Country Status (1)

Country Link
CN (1) CN110717750A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111476053A (en) * 2020-04-03 2020-07-31 支付宝(杭州)信息技术有限公司 Identification method and device
CN111652338A (en) * 2020-06-12 2020-09-11 北京星天地信息科技有限公司 Method and device for identifying and positioning based on two-dimensional code
CN111738736A (en) * 2020-07-24 2020-10-02 支付宝(杭州)信息技术有限公司 Method and system for data feedback
CN111915291A (en) * 2020-07-07 2020-11-10 浙江恒科实业有限公司 Two-dimensional code dynamic display method and payment system
CN112863022A (en) * 2021-02-18 2021-05-28 支付宝(杭州)信息技术有限公司 Bright code identification method and device and access control system
CN113643024A (en) * 2021-07-06 2021-11-12 阿里巴巴新加坡控股有限公司 Graphic code processing method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108846663A (en) * 2018-06-21 2018-11-20 维沃移动通信有限公司 A kind of two dimensional code method of adjustment, device and mobile terminal
CN109214810A (en) * 2018-07-25 2019-01-15 努比亚技术有限公司 A kind of two-dimensional code display method, mobile terminal and computer readable storage medium
CN110197457A (en) * 2019-05-07 2019-09-03 平安科技(深圳)有限公司 Pattern code position method of adjustment, device and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108846663A (en) * 2018-06-21 2018-11-20 维沃移动通信有限公司 A kind of two dimensional code method of adjustment, device and mobile terminal
CN109214810A (en) * 2018-07-25 2019-01-15 努比亚技术有限公司 A kind of two-dimensional code display method, mobile terminal and computer readable storage medium
CN110197457A (en) * 2019-05-07 2019-09-03 平安科技(深圳)有限公司 Pattern code position method of adjustment, device and computer readable storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111476053A (en) * 2020-04-03 2020-07-31 支付宝(杭州)信息技术有限公司 Identification method and device
CN111476053B (en) * 2020-04-03 2022-03-01 支付宝(杭州)信息技术有限公司 Identification method and device
CN111652338A (en) * 2020-06-12 2020-09-11 北京星天地信息科技有限公司 Method and device for identifying and positioning based on two-dimensional code
CN111652338B (en) * 2020-06-12 2022-06-07 北京星天地信息科技有限公司 Method and device for identifying and positioning based on two-dimensional code
CN111915291A (en) * 2020-07-07 2020-11-10 浙江恒科实业有限公司 Two-dimensional code dynamic display method and payment system
CN111738736A (en) * 2020-07-24 2020-10-02 支付宝(杭州)信息技术有限公司 Method and system for data feedback
CN112863022A (en) * 2021-02-18 2021-05-28 支付宝(杭州)信息技术有限公司 Bright code identification method and device and access control system
CN113643024A (en) * 2021-07-06 2021-11-12 阿里巴巴新加坡控股有限公司 Graphic code processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN110717750A (en) Two-dimensional code display method, two-dimensional code display device and mobile terminal
US10817705B2 (en) Method, apparatus, and system for resource transfer
EP3163498B1 (en) Alarming method and device
US11321575B2 (en) Method, apparatus and system for liveness detection, electronic device, and storage medium
CN108230333B (en) Image processing method, image processing apparatus, computer program, storage medium, and electronic device
US9672523B2 (en) Generating barcode and authenticating based on barcode
CN113408403A (en) Living body detection method, living body detection device, and computer-readable storage medium
US20190132550A1 (en) Electronic apparatus and communication method thereof
CN109889724A (en) Image weakening method, device, electronic equipment and readable storage medium storing program for executing
KR20180013208A (en) Apparatus and Method for Processing Differential Beauty Effect
CN108551552B (en) Image processing method, device, storage medium and mobile terminal
CN106599758A (en) Image quality processing method and terminal
CN113780212A (en) User identity verification method, device, equipment and storage medium
CN113643024A (en) Graphic code processing method and device and electronic equipment
CN111401238A (en) Method and device for detecting character close-up segments in video
CN110751004B (en) Two-dimensional code detection method, device, equipment and storage medium
CN109683698A (en) Payment verification method, apparatus, electronic equipment and computer readable storage medium
CN107577973B (en) image display method, image identification method and equipment
US20150371367A1 (en) Method and terminal device for retargeting images
CN113920083A (en) Image-based size measurement method and device, electronic equipment and storage medium
CN108763491B (en) Picture processing method and device and terminal equipment
US11973756B2 (en) Systems and methods for improving computer identification
CN115840550A (en) Angle-adaptive display screen display method, device and medium
CN113177954B (en) Image processing method and device
CN107578233B (en) Two-dimensional code information leakage prevention method and device and storage device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200121