Graphic code display method, device, computer equipment, storage medium
By receiving, converting, and encrypting graphic code images on devices such as smartwatches, the problem of smartwatches being unable to generate graphic codes is solved, enabling the display of graphic codes without an app installed, thus improving user experience and enhancing security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2026-03-13
AI Technical Summary
Smartwatches cannot generate graphic codes, causing inconvenience to users, and developing a dedicated app requires a lot of human resources.
The first terminal receives the execution request from the second terminal, obtains the graphic code image, converts it into the target format, encrypts it, and then sends it to the second terminal, which decrypts and displays it.
This technology enables smartwatches and other devices to display graphic codes even without an app installed, improving user experience and enhancing the security of the graphic codes.
Smart Images

Figure CN116187997B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a graphic code display method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] With the development of technology, smartphones, smartwatches, and tablets have become increasingly common in people's lives. To make life more convenient for users, various types of graphic codes, such as payment codes and information codes, have gradually emerged. Users can use their smartphones to present their graphic codes when making payments or authentications.
[0003] Currently, the generation of these graphic codes can only be done through an app on a smartphone or tablet. Smartwatches cannot run apps to generate the corresponding graphic codes, and there are no apps that can run on smartwatches, causing significant inconvenience. Developing a dedicated app for smartwatches would require substantial human resources. Summary of the Invention
[0004] Therefore, it is necessary to provide a graphic code display method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can transmit graphic codes between different terminals to address the above-mentioned technical problems.
[0005] In a first aspect, this application provides a graphic code display method applied to a first terminal, the method comprising:
[0006] Receive execution requests sent by the second terminal;
[0007] Respond to the execution request to obtain the graphic code image;
[0008] The graphic code image is converted into the target format and then encrypted.
[0009] Sending the encrypted graphic code image to the second terminal; the step of responding to the execution request to obtain the graphic code image includes:
[0010] In response to the execution request, the corresponding recording script is invoked;
[0011] Execute the recording script and capture the displayed pages during the execution process;
[0012] When a graphic code exists on the display page, the graphic code image is extracted from the display page.
[0013] In one embodiment, extracting the graphic code image from the display page includes:
[0014] Identify the outline of the graphic code and determine the corner positions based on the outline;
[0015] The graphic code image is extracted from the display page based on the corner point position.
[0016] In one embodiment, the method further includes:
[0017] Receive the recording instruction sent by the second terminal;
[0018] The process of displaying the graphic code image is scripted according to the recording instructions, and the resulting recording script is stored.
[0019] Secondly, this application provides an image display method applied to a second terminal, the method comprising:
[0020] An execution request is sent to a first terminal, the execution request instructing the first terminal to respond to the execution request and call the corresponding recording script; the recording script is executed, and the display page during the execution process is captured; when a graphic code exists in the display page, the graphic code image is extracted from the display page;
[0021] The system receives the encrypted graphic code image sent by the first terminal, decrypts the encrypted graphic code image, and then displays it.
[0022] In one embodiment, the step of decrypting and displaying the encrypted graphic code image includes:
[0023] The encrypted graphic code image is decrypted to obtain the decrypted image;
[0024] The decrypted image is inversely converted to obtain the graphic code image, and the graphic code image is displayed.
[0025] In one embodiment, displaying the graphic code image includes:
[0026] Get screen resolution;
[0027] The graphic code image is stretched and displayed according to the screen resolution.
[0028] In one embodiment, the method further includes:
[0029] Get the preset valid time;
[0030] The effective time range of the graphic code image is set according to the preset effective time.
[0031] When the time difference between the display time of the graphic code image and the reception time of the graphic code image exceeds the valid time range, the message that the graphic code image is invalid is output.
[0032] Thirdly, this application also provides a graphic code display device for use in a first terminal, the device comprising:
[0033] The execution request receiving module is used to receive execution requests sent by the second terminal;
[0034] The response module is used to obtain the graphic code image in response to the execution request;
[0035] The processing module is used to convert the graphic code image into a target format and encrypt it;
[0036] The first sending module is used to send the encrypted graphic code image to the second terminal.
[0037] In one embodiment, the response module includes:
[0038] The calling unit is used to call the corresponding recording script in response to the execution request;
[0039] An execution unit is used to execute the recording script and capture the displayed pages during the execution process;
[0040] The identification unit is used to extract the graphic code image from the display page when the graphic code exists on the display page.
[0041] In one embodiment, the identification unit includes:
[0042] A contour recognition subunit is used to recognize the contour of the graphic code and determine the corner positions based on the contour.
[0043] An extraction subunit is used to extract a graphic code image from the display page based on the corner point position.
[0044] In one embodiment, the device further includes:
[0045] The instruction receiving module is used to receive the recording instruction sent by the second terminal;
[0046] The recording module is used to record the script of the graphic code image display process according to the recording instructions, and to store the obtained recording script.
[0047] Fourthly, this application also provides a graphic code display device for use in a second terminal, the device comprising:
[0048] The second sending module is used to send an execution request to the first terminal, the execution request being used to instruct the first terminal to respond to the execution request and call the corresponding recording script; execute the recording script and capture the display page during the execution process; when there is a graphic code in the display page, extract the graphic code image from the display page;
[0049] The receiving module is used to receive the encrypted graphic code image sent by the first terminal, and to decrypt and display the encrypted graphic code image.
[0050] In one embodiment, the receiving module includes:
[0051] The decryption unit is used to decrypt the encrypted graphic code image to obtain a decrypted image;
[0052] The inverse conversion unit is used to inverse convert the decrypted image to obtain the graphic code image;
[0053] A graphic display unit is used to display the graphic code image.
[0054] In one embodiment, the inverse conversion unit includes:
[0055] The resolution acquisition subunit is used to obtain the screen resolution;
[0056] The display subunit is used to stretch and display the graphic code image according to the screen resolution.
[0057] In one embodiment, the device further includes:
[0058] The time acquisition module is used to acquire a preset valid time.
[0059] The setting module is used to set the effective time range of the target image according to the preset effective time.
[0060] The judgment module is used to output information indicating that the graphic code image is invalid when the time difference between the display time of the graphic code image and the reception time of the graphic code image exceeds the valid time range.
[0061] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the above embodiments.
[0062] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in any of the above embodiments.
[0063] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0064] The aforementioned graphic code display method, apparatus, computer equipment, storage medium, and computer program product involve a first terminal receiving an execution request from a second terminal, responding to the request to obtain a graphic code image, then converting the graphic code image into a target format and encrypting it, finally sending the encrypted graphic code image to the second terminal. This allows the second terminal to obtain the graphic code image without installing any app. Furthermore, because the first terminal converts the graphic code image into the target format before encryption, the security of the graphic code is further guaranteed. Attached Figure Description
[0065] Figure 1 This is an application environment diagram of the graphic code display method in one embodiment;
[0066] Figure 2 This is a flowchart illustrating a graphical code display method in one embodiment;
[0067] Figure 3 This is a flowchart illustrating the graphic code display step in another embodiment;
[0068] Figure 4 This is a schematic diagram of the graphic code display process of the first terminal in one embodiment;
[0069] Figure 5 This is a schematic diagram of the graphic code display process of the second terminal in one embodiment;
[0070] Figure 6 This is a structural block diagram of a graphic code display device in one embodiment;
[0071] Figure 7 This is a structural block diagram of a graphic code display device in another embodiment;
[0072] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0074] The graphic code display method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, the first terminal 102 communicates with the second terminal 104 via a network. A data storage system can store the data that needs to be processed on the first terminal 102. The data storage system can be integrated onto the first terminal 102 or placed on a cloud or other network server. The second terminal 104 sends an execution request to the first terminal 102. After receiving the execution request, the first terminal 102 responds by acquiring a graphic code image, converting the graphic code image into a target format, encrypting it, and sending the encrypted graphic code to the second terminal. After receiving the encrypted graphic code from the first terminal, the second terminal decrypts and displays it, enabling the second terminal to directly obtain and display the graphic code from the first terminal when needed. The first terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc. The second terminal 104 can be a computer, laptop, smartphone, tablet, or smartwatch.
[0075] In one embodiment, such as Figure 2 As shown, a graphical code display method is provided, which can be applied to... Figure 1 Taking the first terminal 102 as an example, the explanation includes the following steps:
[0076] S202, Receive execution request sent by the second terminal.
[0077] The execution request refers to the instruction sent by the second terminal to request the first terminal to obtain the graphic code image.
[0078] Optionally, the execution request also carries a script identifier, so that after the first terminal receives the execution request, it can call the corresponding recording script through the script identifier to obtain the graphic code image.
[0079] Optionally, the first terminal may also preset information, which refers to pre-defined information regarding whether to respond to execution requests sent by the second terminal, such as a whitelist. For example, when the first terminal receives an execution request from the second terminal, it can use the preset information to determine the identifier carried in the execution request. If the identifier carried by the second terminal is in the preset information, the first terminal responds to the execution request. Otherwise, it does not respond to the execution request and returns an error message to the second terminal.
[0080] Optionally, after receiving the execution request from the second terminal, the first terminal will also determine the signal strength between the first and second terminals. If the signal strength between the first and second terminals is within a preset threshold range, the first terminal will respond to the execution request from the second terminal. Otherwise, it will not respond to the execution request from the second terminal and will return an error message to the second terminal. This ensures that the execution request is only responded to when the signal strength between the first and second terminals is below the preset range, thereby guaranteeing the reliability of the execution request transmission. The preset threshold range is a pre-set indicator used to determine the reliability of the signal strength between the first and second terminals, and it can be set according to the actual usage scenario.
[0081] S204, respond to the execution request to obtain the graphic code image.
[0082] Among them, the graphic code image is the image acquired by the first terminal, which can be a QR code image, a one-dimensional code image, etc.
[0083] Optionally, the above-mentioned response to the execution request to obtain the graphic code image includes: responding to the execution request to call the corresponding recording script; executing the recording script and capturing the display page during the execution process; when a graphic code exists on the display page, extracting the graphic code image from the display page.
[0084] The recorded script refers to the script that has been recorded and generated on the first terminal. Running the script can obtain a graphic code image.
[0085] Specifically, after receiving the execution request from the second terminal, the first terminal responds to the request and invokes the corresponding recording script. Then, the first terminal executes the recording script, capturing the displayed pages during the script execution process. Here, "display page" refers to the page shown by the first terminal during script execution, such as the execution page during app execution. When a graphic code exists on the displayed page, the graphic code image is extracted from the displayed page.
[0086] Optionally, when the first terminal receives an execution request from the second terminal, the script identifier carried in the execution request is used to call the recording script corresponding to the script identifier. For example, when the script identifier is an Alipay identifier, the first terminal calls the recording script corresponding to the Alipay identifier.
[0087] S206 converts the graphic code image into the target format and encrypts it.
[0088] The target format refers to the final format of the image code conversion. The target format can be binary, decimal, or other formats.
[0089] Specifically, after acquiring the graphic code image, the first terminal converts the graphic code image into a target format, such as converting the graphic code image into binary, and then encrypts the graphic code image in the target format, such as through AES (Advanced Encryption Standard) data encryption.
[0090] Optionally, the first terminal may encrypt the graphic code image and then convert the encrypted graphic code into the target format.
[0091] Optionally, the first terminal converts the graphic code image according to a preset protocol to obtain a graphic code image in the target format. For example, the preset protocol first performs format A conversion, then format B conversion, and finally format C conversion to obtain the graphic code image in the target format. Then, the second terminal can reverse-convert the graphic code image in the target format according to a preset protocol agreed upon with the first terminal to obtain a graphic code image without format conversion. This further ensures the security of the graphic code.
[0092] S208, the encrypted graphic code image is sent to the second terminal.
[0093] Optionally, if multiple second terminals send execution requests to the first terminal, and the execution requests carry the terminal identifiers of the second terminals, then the first terminal can send the encrypted graphic code image to the corresponding second terminal based on the carried terminal identifiers of the second terminals.
[0094] Optionally, the first terminal includes multiple threads, which can respond to execution requests sent by multiple second terminals when available, and generate encrypted graphic code images to be sent to the corresponding multiple second terminals.
[0095] In the above-described graphic code display method, the first terminal first receives the execution request sent by the second terminal, responds to the execution to obtain the graphic code image, then converts the graphic code image into the target format and encrypts it, and finally sends the encrypted graphic code image to the second terminal. This allows the second terminal to obtain the graphic code image without installing any app. Furthermore, because the first terminal converts the graphic code image into the target format before encryption, the security of the graphic code is further guaranteed.
[0096] In one embodiment, the above-mentioned extraction of the graphic code image from the display page includes: identifying the outline of the graphic code and determining the corner positions based on the outline; and extracting the graphic code image from the display page based on the corner positions.
[0097] Specifically, when a graphic code exists on the display page, the first terminal first identifies the outline of the graphic code, and then determines the corner positions of the graphic code based on the outline. The corner positions refer to the corner locations of the graphic code, such as the four corners of the graphic code. Then, the graphic code image is extracted from the display page based on these corner positions.
[0098] For example, if the display page contains a graphic code as well as other information, such as the information below the graphic code, then the first terminal first identifies the outline of the graphic code from the display page, that is, the approximate location of the graphic code image on the display page. Then, it determines the corner position based on the outline, and finally extracts the graphic code image from the display page based on the corner position. In this way, a graphic code image without any other information can be obtained.
[0099] Optionally, the first terminal obtains the coordinates of the four corner points of the QR code (e.g., in iOS development, the corners array in AVMetadataMachineReadableCodeObject can be used) to determine the image of the QR code.
[0100] In the above embodiments, by recognizing the outline of the graphic code and determining the corner positions based on the outline, and then extracting the graphic code image from the display page based on the corner positions, a graphic code image without any other information can be obtained, thereby reducing the waste of resources in subsequent graphic code image processing.
[0101] In one embodiment, the method further includes: receiving a recording instruction sent by a second terminal; recording a script of the graphic code image display process according to the recording instruction; and storing the obtained recording script.
[0102] The recording instruction refers to the instruction sent by the second terminal, which instructs the first terminal to record a script.
[0103] Specifically, the first terminal receives the recording instruction sent by the second terminal, and records the display process of the graphic code according to the recording instruction, and stores the recording script.
[0104] Optionally, if the first terminal records multiple recording scripts, the recording scripts are stored together. For example, the recording scripts can be stored together based on the identifier of the APP that recorded the first terminal.
[0105] Optionally, the recording instruction may also include a recording identifier, which is used to instruct the first terminal to record the script of the graphic code image display process of a specific APP.
[0106] For example, if the recording identifier in the recording instruction is the Alipay identifier, the first terminal records the script of the Alipay generating graphic code image display process according to the Alipay identifier, and obtains the Alipay recording script.
[0107] Optionally, after receiving multiple recording scripts, the first terminal can set the priority of the recording scripts according to preset rules, for example, Alipay's priority is higher than WeChat's.
[0108] For example, after the first terminal records a script for the process of displaying the graphic code image and stores multiple recorded scripts, it sets a priority for the multiple recorded scripts. In this way, when the execution request does not carry the corresponding footer, the first terminal can obtain the graphic code image according to the priority of the recorded script.
[0109] In the above embodiment, the first terminal records the graphic code image display process according to the recording instruction and stores the obtained recording script. In this way, when the first terminal receives the execution request sent by the second terminal, it can directly call the corresponding recording script to obtain the graphic code image without having to record the graphic code image display process every time, making the process faster and more convenient.
[0110] In one embodiment, the execution request sent by the second terminal also carries the current location information of the second terminal. If the current location information is not in the historical location information, the first terminal will issue a reminder message, requiring the user to enter a key on the first terminal before the first terminal will respond to the execution request.
[0111] In the above embodiments, when the location information carried in the execution request sent by the second terminal is not in the historical location information, the first terminal will issue a reminder message. This can prevent criminals from maliciously forging information to obtain the image code image, thereby ensuring the security of the image code image.
[0112] In one embodiment, when the graphic code image is a payment code image, the first terminal can set a preset resource transfer limit for the payment code image. When the resource transfer limit of the second terminal exceeds the preset resource transfer limit when using the payment code image for payment, the second terminal needs to send a resource transfer request to the first terminal. Only after the first terminal responds to the resource transfer request can the second terminal use the payment code image for payment.
[0113] In the above embodiments, since the first terminal needs to respond to the resource transfer request sent by the second terminal when the resource transfer limit exceeds the preset resource transfer limit, the security of resource transfer can be guaranteed by setting the preset resource transfer limit, thus avoiding losses.
[0114] In one embodiment, such as Figure 3As shown, a graphical code display method is provided, which can be applied to... Figure 1 Taking the second terminal 104 as an example, the explanation includes the following steps:
[0115] S302, send an execution request to the first terminal, the execution request instructing the first terminal to respond to the execution request and call the corresponding recording script; execute the recording script and capture the display page during the execution process; when there is a graphic code in the display page, extract the graphic code image from the display page.
[0116] Specifically, when the second terminal has a corresponding need, it sends an execution request to the first terminal to obtain the graphic code image.
[0117] Optionally, when the user needs to specify a specific graphic code image generated by the APP, the system receives the script identifier instruction input by the user, sends the execution request and the script identifier together to the first terminal, so that the first terminal can call the recording script corresponding to the script identifier according to the script identifier, and thus obtain the graphic code image.
[0118] S304: Receive the encrypted graphic code image sent by the first terminal, decrypt the encrypted graphic code image, and then display it.
[0119] Specifically, after the first terminal receives the execution request sent by the second terminal, it responds by obtaining the graphic code image, converts the graphic code image into the target format and encrypts it, and finally sends the encrypted graphic code image to the second terminal. The second terminal receives the encrypted graphic code image sent by the first terminal, decrypts the encrypted graphic code image, and then displays it.
[0120] Optionally, the above-mentioned display of the encrypted graphic code image after decryption includes: decrypting the encrypted graphic code image to obtain a decrypted image; performing inverse conversion on the decrypted image to obtain a graphic code image, and displaying the graphic code image.
[0121] Here, a decrypted image refers to the image obtained by decrypting an encrypted graphic code image.
[0122] Specifically, the second terminal decrypts the encrypted graphic code to obtain a decrypted image, and then performs a reverse conversion on the decrypted image. This reverse conversion is the inverse process of the first terminal converting the graphic code image into the target format. For example, if the first terminal converts the graphic code image into a binary graphic code image, then the second terminal converts the binary graphic code image into a normal graphic code image.
[0123] Optionally, the second terminal can also reverse the decryption of the image according to a preset protocol to obtain a graphic code image and display the graphic code image.
[0124] In the above embodiment, after receiving the encrypted graphic code image sent by the first terminal, the second terminal decrypts the encrypted graphic code image and displays it. This allows the second terminal to obtain the graphic code image without installing any app. Furthermore, since the first terminal converts the graphic code image into the target format before encryption, the security of the graphic code is further guaranteed.
[0125] In one embodiment, the above-mentioned display of the graphic code image includes: obtaining the screen resolution; stretching the graphic code image according to the screen resolution and displaying it.
[0126] Among them, screen resolution refers to the number of pixels in the vertical and horizontal dimensions of the display interface of the second terminal. The second terminal can obtain the screen resolution through a screen resolution display device.
[0127] Specifically, the second terminal obtains the screen resolution, and then stretches and displays the graphic code image according to the screen resolution.
[0128] In the above embodiments, the second terminal obtains the screen resolution and stretches and displays the graphic code image according to the screen resolution, so that the graphic code image can be displayed completely on the second terminal.
[0129] In one embodiment, the method further includes: obtaining a preset valid time; setting a valid time range for the graphic code image based on the preset valid time; and outputting information indicating that the graphic code image is invalid when the time difference between the display time and the reception time of the graphic code image exceeds the valid time range.
[0130] The preset valid time is the pre-set validity period of the graphic code image, such as 1 minute or 30 seconds, which can be set according to the actual use scenario.
[0131] The display time refers to the time it takes for the second terminal to display the image after decrypting and reconverting the graphic code; the receiving time refers to the time it takes for the second terminal to receive the encrypted graphic code.
[0132] Specifically, the second terminal also acquires a preset valid time and displays the valid time of the graphic code image using the preset valid time. Therefore, the second terminal compares the display time of the graphic code image with the reception time of the graphic code image received by the second terminal to obtain the time difference between the display time and the reception time of the graphic code image. When the time difference between the display time and the reception time of the graphic code image exceeds the valid time range, the terminal outputs a message indicating that the graphic code image is invalid.
[0133] In the above embodiments, by using the time difference between the display time and the reception time of the graphic code image, it can be ensured that when the time difference between the display time and the reception time of the graphic code image is within a preset effective time range, the user can display the graphic code image multiple times, thereby reducing the number of interactions with the first terminal. At the same time, it can also ensure that when the time difference between the display time and the reception time of the graphic code image exceeds the effective time range, the graphic code image invalid information is output, further ensuring the security of graphic code display.
[0134] In one exemplary embodiment, such as Figure 4 and Figure 5 As shown, Figure 4 This is a schematic diagram of the graphic code display process of the first terminal in one embodiment; Figure 5 This is a schematic diagram illustrating the graphic code display process of the second terminal in one embodiment. In this embodiment, the first terminal is a smartphone, and the second terminal is a smartwatch.
[0135] Combination Figure 4 The process of displaying the graphic code on the first terminal is as follows:
[0136] S1: Record the script using a script recording tool. Specifically: Open the financial app, perform the process of opening the payment code, display the payment code page, and complete the script recording. The recording process includes: obtaining the coordinates of the four corner points of the QR code (e.g., in iOS development, the corners array in AVMetadataMachineReadableCodeObject can be used), determining the QR code area, and converting the QR code content into binary format.
[0137] S2: Set the display area. Specifically, set the display area in the script recording tool so that the interface can recognize the payment code part and display that part in full screen.
[0138] S3: Synchronize the script to the smartwatch connected to the mobile phone. The payment code transmission can be secured in two ways: first, via Bluetooth connection, device information is verified using a corresponding verification code; second, the payment code is encrypted during transmission using AES data encryption.
[0139] Combination Figure 5 The graphic code display process on the second terminal is as follows:
[0140] S1: Execute the script recorded on the phone on the smartwatch. The smartwatch receives the encrypted QR code content, decrypts it, obtains the watch screen resolution, and stretches the QR code area to ensure it is fully displayed on the watch.
[0141] S2: The smartphone app executes the pre-recorded script and displays the payment code;
[0142] S3: The smartphone displays the payment code area in full screen and completes the payment. Furthermore, it can be used multiple times within one minute; if the time expires, the script will automatically re-execute to obtain an updated QR code.
[0143] In the above embodiment, the first terminal then converts the graphic code image into the target format and encrypts it before sending the encrypted graphic code image to the second terminal. This allows the second terminal to obtain the graphic code image without installing any app. Secondly, because the first terminal converts the graphic code image into the target format before encryption, the security of the graphic code is further guaranteed. The second terminal, by setting a preset valid time, allows the user to display the graphic code image multiple times, thereby reducing the number of interactions with the first terminal and enhancing the security of the graphic code display.
[0144] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0145] Based on the same inventive concept, this application also provides a graphic code display device for implementing the graphic code display method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more graphic code display device embodiments provided below can be found in the limitations of the graphic code display method described above, and will not be repeated here.
[0146] In one embodiment, such as Figure 6 As shown, a graphic code display device is provided, comprising: an execution request receiving module 100, a response module 200, a processing module 300, and a first sending module 400, wherein:
[0147] The execution request receiving module 100 is used to receive execution requests sent by the second terminal.
[0148] The response module 200 is used to respond to the execution request and obtain the graphic code image.
[0149] The processing module 300 is used to convert the graphic code image into the target format and encrypt it.
[0150] The first sending module 400 is used to send the encrypted graphic code image to the second terminal.
[0151] In one embodiment, the response module 200 includes:
[0152] The calling unit is used to respond to execution requests and invoke the corresponding recording script.
[0153] The execution unit is used to execute the recorded script and capture the displayed pages during the execution process.
[0154] The recognition unit is used to extract the graphic code image from the display page when the graphic code exists on the display page.
[0155] In one embodiment, the identification unit includes:
[0156] The contour recognition subunit is used to recognize the contour of the graphic code and determine the corner positions based on the contour.
[0157] Extract sub-units, used to extract graphic code images from the display page based on corner point positions.
[0158] In one embodiment, the above-mentioned apparatus further includes:
[0159] The instruction receiving module is used to receive recording instructions sent by the second terminal.
[0160] The recording module is used to record the script of the graphic code image display process according to the recording instructions, and to store the obtained recording script.
[0161] In one embodiment, such as Figure 7 As shown, a graphic code display device is provided, including: a second transmitting module 500 and a receiving module 600, wherein:
[0162] The second sending module 500 is used to send an execution request to the first terminal. The execution request is used to instruct the first terminal to respond to the execution request and call the corresponding recording script; execute the recording script and capture the display page during the execution process; when there is a graphic code in the display page, extract the graphic code image from the display page.
[0163] The receiving module 600 is used to receive the encrypted graphic code image sent by the first terminal, and to decrypt and display the encrypted graphic code image.
[0164] In one embodiment, the receiving module 600 includes:
[0165] The decryption unit is used to decrypt the encrypted graphic code image to obtain the decrypted image.
[0166] The inverse conversion unit is used to inverse convert the decrypted image to obtain a graphic code image;
[0167] The graphic display unit is used to display graphic code images.
[0168] In one embodiment, the above-mentioned inverse conversion unit includes:
[0169] The resolution acquisition subunit is used to obtain the screen resolution.
[0170] The display subunit is used to stretch and display the graphic code image according to the screen resolution.
[0171] In one embodiment, the above-mentioned apparatus further includes:
[0172] The time acquisition module is used to acquire a preset valid time.
[0173] The settings module is used to set the effective time range of the target image according to the preset effective time.
[0174] The judgment module is used to output a message indicating that the graphic code image is invalid when the time difference between the display time and the reception time of the graphic code image exceeds the valid time range.
[0175] Each module in the aforementioned graphic code display device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0176] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores recording scripts. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a graphical code display method.
[0177] Those skilled in the art will understand that Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0178] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: receiving an execution request sent by a second terminal; responding to the execution request to acquire a graphic code image; converting the graphic code image into a target format and encrypting it; and sending the encrypted graphic code image to the second terminal. The step of responding to the execution request to acquire the graphic code image includes: responding to the execution request to call a corresponding recording script; executing the recording script and capturing the display page during the execution process; and when a graphic code exists on the display page, extracting the graphic code image from the display page.
[0179] In one embodiment, the extraction of a graphic code image from a display page by the processor executing a computer program includes: recognizing the outline of the graphic code and determining the corner positions based on the outline; and extracting the graphic code image from the display page based on the corner positions.
[0180] In one embodiment, the processor executing the computer program further includes: receiving a recording instruction sent by the second terminal; recording a script of the graphic code image display process according to the recording instruction; and storing the obtained recording script.
[0181] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: sending an execution request to a first terminal, the execution request instructing the first terminal to respond to the execution request and call a corresponding recording script; executing the recording script and capturing the display page during the execution process; when a graphic code exists in the display page, extracting the graphic code image from the display page; receiving an encrypted graphic code image sent by the first terminal, decrypting the encrypted graphic code image, and then displaying it.
[0182] In one embodiment, the process of decrypting and displaying an encrypted graphic code image when the processor executes a computer program includes: decrypting the encrypted graphic code image to obtain a decrypted image; performing an inverse conversion on the decrypted image to obtain a graphic code image; and displaying the graphic code image.
[0183] In one embodiment, the display of a graphic code image implemented by a processor executing a computer program includes: acquiring the screen resolution; stretching the graphic code image according to the screen resolution and displaying it.
[0184] In one embodiment, the processor executing the computer program further includes: acquiring a preset valid time; setting a valid time range for the graphic code image based on the preset valid time; and outputting a message indicating that the graphic code image is invalid when the time difference between the display time and the reception time of the graphic code image exceeds the valid time range.
[0185] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program performs the following steps: receiving an execution request sent by a second terminal; responding to the execution request to acquire a graphic code image; converting the graphic code image into a target format and encrypting it; and sending the encrypted graphic code image to the second terminal. The step of responding to the execution request to acquire the graphic code image includes: responding to the execution request to call a corresponding recording script; executing the recording script and capturing the display page during the execution process; and when a graphic code exists on the display page, extracting the graphic code image from the display page.
[0186] In one embodiment, the extraction of a graphic code image from a display page by a computer program executed by a processor includes: recognizing the outline of the graphic code and determining the corner positions based on the outline; and extracting the graphic code image from the display page based on the corner positions.
[0187] In one embodiment, when the computer program is executed by the processor, it further includes: receiving a recording instruction sent by the second terminal; recording a script of the graphic code image display process according to the recording instruction; and storing the obtained recording script.
[0188] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: sending an execution request to a first terminal, the execution request instructing the first terminal to respond to the execution request and call the corresponding recording script; executing the recording script and capturing the display page during the execution process; when a graphic code exists in the display page, extracting the graphic code image from the display page; receiving an encrypted graphic code image sent by the first terminal, decrypting the encrypted graphic code image, and then displaying it.
[0189] In one embodiment, the process of decrypting and displaying an encrypted graphic code image when the computer program is executed by the processor includes: decrypting the encrypted graphic code image to obtain a decrypted image; performing a reverse conversion on the decrypted image to obtain a graphic code image; and displaying the graphic code image.
[0190] In one embodiment, the display of a graphic code image implemented when a computer program is executed by a processor includes: acquiring the screen resolution; stretching the graphic code image according to the screen resolution and displaying it.
[0191] In one embodiment, the computer program, when executed by the processor, further includes: acquiring a preset valid time; setting a valid time range for the graphic code image based on the preset valid time; and outputting a message indicating that the graphic code image is invalid when the time difference between the display time and the reception time of the graphic code image exceeds the valid time range.
[0192] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: receiving an execution request sent by a second terminal; responding to the execution request to acquire a graphic code image; converting the graphic code image into a target format and encrypting it; and sending the encrypted graphic code image to the second terminal. The step of responding to the execution request to acquire the graphic code image includes: responding to the execution request to call a corresponding recording script; executing the recording script and capturing the display page during the execution process; and when a graphic code exists on the display page, extracting the graphic code image from the display page.
[0193] In one embodiment, the extraction of a graphic code image from a display page by a computer program executed by a processor includes: recognizing the outline of the graphic code and determining the corner positions based on the outline; and extracting the graphic code image from the display page based on the corner positions.
[0194] In one embodiment, when the computer program is executed by the processor, it further includes: receiving a recording instruction sent by the second terminal; recording a script of the graphic code image display process according to the recording instruction; and storing the obtained recording script.
[0195] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: sending an execution request to a first terminal, the execution request instructing the first terminal to respond to the execution request and call a corresponding recording script; executing the recording script and capturing the display page during the execution process; when a graphic code exists in the display page, extracting the graphic code image from the display page; receiving an encrypted graphic code image sent by the first terminal, decrypting the encrypted graphic code image, and then displaying it.
[0196] In one embodiment, the process of decrypting and displaying an encrypted graphic code image when the computer program is executed by the processor includes: decrypting the encrypted graphic code image to obtain a decrypted image; performing a reverse conversion on the decrypted image to obtain a graphic code image; and displaying the graphic code image.
[0197] In one embodiment, the display of a graphic code image implemented when a computer program is executed by a processor includes: acquiring the screen resolution; stretching the graphic code image according to the screen resolution and displaying it.
[0198] In one embodiment, the computer program, when executed by the processor, further includes: acquiring a preset valid time; setting a valid time range for the graphic code image based on the preset valid time; and outputting a message indicating that the graphic code image is invalid when the time difference between the display time and the reception time of the graphic code image exceeds the valid time range.
[0199] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0200] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0201] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A graphic code display method characterized by, Applied to a first terminal, the method comprises: receiving an execution request sent by a second terminal; obtaining a graphic code image in response to the execution request; converting the graphic code image into a target format and encrypting the graphic code image; sending the encrypted graphic code image to the second terminal; wherein the obtaining the graphic code image in response to the execution request comprises: calling a corresponding recording script in response to the execution request; wherein the execution request carries a script identifier, and the corresponding recording script of an APP is called according to the script identifier; executing the recording script and collecting a display page in an execution process; when the display page contains a graphic code, extracting a graphic code image from the display page.
2. The method of claim 1, wherein, The extracting the graphic code image from the display page comprises: identifying an outline of the graphic code and determining a corner point position according to the outline; extracting the graphic code image from the display page according to the corner point position.
3. The method of claim 1, wherein, The method further comprises: receiving a recording instruction sent by the second terminal; performing script recording on a graphic code image display process according to the recording instruction, and storing a recording script obtained.
4. A graphic code display method characterized by Applied to a second terminal, the method comprises: sending an execution request to a first terminal, the execution request being used to instruct the first terminal to call a corresponding recording script in response to the execution request, execute the recording script, collect a display page in an execution process, and extract a graphic code image from the display page when the display page contains a graphic code; wherein the execution request carries a script identifier, and the corresponding recording script of an APP is called according to the script identifier; receiving the graphic code image converted into a target format and encrypted by the first terminal, and displaying the graphic code image after decryption and reverse conversion.
5. The method of claim 4, wherein, The displaying the graphic code image after decryption and reverse conversion comprises: decrypting the encrypted graphic code image to obtain a decrypted image; performing reverse conversion on the decrypted image to obtain the graphic code image; displaying the graphic code image.
6. The method of claim 5, wherein, The displaying the graphic code image comprises: obtaining a screen resolution; stretching the graphic code image according to the screen resolution and displaying the graphic code image.
7. The method of claim 4, wherein, The method further comprises: obtaining a preset valid time; setting a valid time range of the graphic code image according to the preset valid time; when a time difference between a display time of the graphic code image and a receiving time of the graphic code image exceeds the valid time range, outputting information that the graphic code image is invalid.
8. A graphic code display device, characterized by comprising: Applied to a first terminal, the device comprises: an execution request receiving module configured to receive an execution request sent by a second terminal; a response module configured to obtain a graphic code image in response to the execution request; wherein the response module comprises: a calling unit configured to call a corresponding recording script in response to the execution request; wherein the execution request carries a script identifier, and the corresponding recording script of an APP is called according to the script identifier; an execution unit configured to execute the recording script and collect a display page in an execution process; An identifying unit is configured to extract a graphic code image from the display page when the graphic code exists in the display page; A processing module is configured to convert the graphic code image into a target format and encrypt the graphic code image; A first sending module is configured to send the encrypted graphic code image to the second terminal.
9. The apparatus of claim 8, wherein, The identifying unit comprises: A contour identifying sub-unit is configured to identify a contour of the graphic code and determine a corner point position according to the contour; An extracting sub-unit is configured to extract a graphic code image from the display page according to the corner point position.
10. The apparatus of claim 8, wherein, The device further comprises: An instruction receiving module is configured to receive a recording instruction sent by the second terminal; A recording module is configured to record a script according to the recording instruction and store a recording script obtained.
11. A graphic code display device, characterized by comprising: Applied to the second terminal, the device comprises: A second sending module is configured to send an execution request to the first terminal, the execution request being used to instruct the first terminal to call a corresponding recording script in response to the execution request; execute the recording script and collect a display page in an execution process; and extract a graphic code image from the display page when the graphic code exists in the display page; wherein the execution request carries a script identifier, and the corresponding recording script of an APP is called according to the script identifier; A receiving module is configured to receive the graphic code image converted into a target format and encrypted by the first terminal and display the encrypted and inversely converted graphic code image.
12. The apparatus of claim 11, wherein, The receiving module comprises: A decrypting unit is configured to decrypt the encrypted graphic code image to obtain a decrypted image; An inverse converting unit is configured to inversely convert the decrypted image to obtain the graphic code image; A graphic displaying unit is configured to display the graphic code image.
13. The apparatus of claim 12, wherein, The inverse converting unit comprises: A resolution obtaining sub-unit is configured to obtain a screen resolution; A displaying sub-unit is configured to stretch and display the graphic code image according to the screen resolution.
14. The apparatus of claim 11, wherein, The device further comprises: A time obtaining module is configured to obtain a preset valid time; A setting module is configured to set a valid time range of the graphic code image according to the preset valid time; A judging module is configured to output information that the graphic code image is invalid when a time difference between a display time of the graphic code image and a receiving time of the graphic code image exceeds the valid time range.
15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 3 or 4 to 7.
16. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 3 or 4 to 7.
17. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 3 or 4 to 7.
Citation Information
Patent Citations
Graphical code determination method and device and industrial camera
CN112241640A
Graphic code display method and device and readable storage medium
CN112583976A