CN110955398A - Two-dimensional code display method and device, computer equipment and storage medium - Google Patents

Two-dimensional code display method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110955398A
CN110955398A CN201911150050.7A CN201911150050A CN110955398A CN 110955398 A CN110955398 A CN 110955398A CN 201911150050 A CN201911150050 A CN 201911150050A CN 110955398 A CN110955398 A CN 110955398A
Authority
CN
China
Prior art keywords
dimensional code
client
dimension
server
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.)
Granted
Application number
CN201911150050.7A
Other languages
Chinese (zh)
Other versions
CN110955398B (en
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.)
Suzhou Dajiaying Information Technology Co Ltd
Original Assignee
Suzhou Dajiaying Information Technology 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 Suzhou Dajiaying Information Technology Co Ltd filed Critical Suzhou Dajiaying Information Technology Co Ltd
Priority to CN201911150050.7A priority Critical patent/CN110955398B/en
Publication of CN110955398A publication Critical patent/CN110955398A/en
Application granted granted Critical
Publication of CN110955398B publication Critical patent/CN110955398B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a two-dimensional code display method, a two-dimensional code display device, computer equipment and a storage medium, wherein the method comprises the following steps: applying for obtaining the two-dimensional code from a server; receiving two-dimensional code character string data fed back by the server; analyzing the two-dimensional code character string data, and generating a two-dimensional code according to an analysis result to display; acquiring two-dimensional code state information pushed by the server side in real time through a server push event SSE connection established with the server side; and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client. The technical scheme of the embodiment of the invention can reduce the resource occupancy rate and the consumption of the system in the process of displaying the two-dimensional code by the client in real time, thereby improving the system performance.

Description

Two-dimensional code display method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer information, in particular to a two-dimensional code display method and device, computer equipment and a storage medium.
Background
The popularity and development of the internet has brought about a large number of network service providers. Many network service providers provide login functionality, wherein login via two-dimensional code scanning is a major login method.
When scanning the sign-on through the two-dimensional code, need acquire the two-dimensional code state in order to show the two-dimensional code in real time. The existing two-dimensional code state modes mainly include the following two types: firstly, a timer is used for regularly polling and calling an API (application programming Interface) to acquire and display a two-dimensional code state; and secondly, acquiring and displaying the two-dimension code state in a WebSocket (network technology for full duplex communication between a client browser and a server).
In the process of implementing the invention, the inventor finds that the prior art has the following defects: the mode of acquiring the two-dimensional code state by regularly polling and calling the API needs to occupy higher system resources, thereby reducing the system performance. Since the WebSocket is a bidirectional channel, the mode of acquiring the two-dimensional code state through the Web Socket mode may cause greater system resource consumption.
Disclosure of Invention
The embodiment of the invention provides a two-dimension code display method and device, computer equipment and a storage medium, which are used for reducing the resource occupancy rate and the consumption of a system in the process of displaying a two-dimension code by a client in real time, thereby improving the system performance.
In a first aspect, an embodiment of the present invention provides a two-dimensional code display method, applied to a two-dimensional code display client, including:
applying for obtaining the two-dimensional code from a server;
receiving two-dimensional code character string data fed back by the server;
analyzing the two-dimensional code character string data, and generating a two-dimensional code according to an analysis result to display;
acquiring two-dimensional code state information pushed by the Server in real time through SSE (Server-send Events) connection established with the Server;
and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
In a second aspect, an embodiment of the present invention further provides a two-dimensional code display method, applied to a server, including:
receiving an application for acquiring a two-dimensional code sent by a two-dimensional code display client;
feeding back the two-dimensional code character string data to the two-dimensional code display client;
pushing two-dimensional code state information to the two-dimensional code display client in real time through SSE connection established with the two-dimensional code display client;
and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code.
In a third aspect, an embodiment of the present invention further provides a two-dimensional code display device, configured at a two-dimensional code display client, including:
the two-dimension code application module is used for applying for obtaining the two-dimension code from the server;
the two-dimensional code character string data receiving module is used for receiving the two-dimensional code character string data fed back by the server;
the two-dimensional code display module is used for analyzing the two-dimensional code character string data and generating a two-dimensional code according to an analysis result for display;
the two-dimension code state information acquisition module is used for acquiring the two-dimension code state information pushed by the server side in real time through SSE connection established with the server side;
and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
In a fourth aspect, an embodiment of the present invention further provides a two-dimensional code display device, configured at a server, including:
the two-dimension code application receiving module is used for receiving an application for acquiring a two-dimension code, which is sent by a two-dimension code display client;
the two-dimensional code character string data feedback module is used for feeding back the two-dimensional code character string data to the two-dimensional code display client;
the two-dimension code state information pushing module is used for pushing the two-dimension code state information to the two-dimension code display client in real time through SSE connection established with the two-dimension code display client;
and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code.
In a fifth aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the two-dimensional code display method provided by any embodiment of the invention.
In a sixth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the two-dimensional code display method provided in any embodiment of the present invention.
According to the embodiment of the invention, the two-dimensional code is applied to the server side through the two-dimensional code display client side to obtain the two-dimensional code, after the two-dimensional code character string data fed back by the server side are received, the two-dimensional code character string data are analyzed, the two-dimensional code is generated according to the analysis result and displayed, meanwhile, the server pushes the two-dimensional code state information to the two-dimensional code display client side in real time through the SSE connection established between the two-dimensional code display client side and the server side, so that the two-dimensional code display client side can switch the state of the two-dimensional code in time, the problems of high resource occupancy rate, high consumption and the like in the conventional two-dimensional code display method are solved, the system resource occupancy rate and consumption are reduced in the process of displaying.
Drawings
Fig. 1a is a flowchart of a two-dimensional code display method according to an embodiment of the present invention;
fig. 1b is a schematic diagram illustrating an effect of a two-dimensional code display state according to an embodiment of the present invention;
fig. 1c is a schematic diagram illustrating an effect of a two-dimensional code display state according to an embodiment of the present invention;
fig. 2 is a flowchart of a two-dimensional code display method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a two-dimensional code display method according to a third embodiment of the present invention;
fig. 4 is a schematic diagram of a two-dimensional code display device according to a fourth embodiment of the present invention;
fig. 5 is a schematic view of a two-dimensional code display device according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1a is a flowchart of a two-dimensional code display method according to an embodiment of the present invention, where this embodiment is applicable to a case where a client displays a two-dimensional code with a low system resource occupancy rate, and the method may be executed by a two-dimensional code display apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a client device and used in cooperation with a server for providing two-dimensional code character string data and pushing two-dimensional code status information in real time. Accordingly, as shown in fig. 1a, the method comprises the following operations:
and S110, applying for obtaining the two-dimensional code from the server.
In the embodiment of the invention, before the two-dimension code is displayed, the two-dimension code display client side firstly needs to apply for obtaining the two-dimension code from the server side.
And S120, receiving the two-dimensional code character string data fed back by the server.
Correspondingly, after receiving the two-dimensional code acquisition application sent by the two-dimensional code display client, the server can feed back the two-dimensional code character string data to the two-dimensional code display client.
And S130, analyzing the character string data of the two-dimensional code, and generating the two-dimensional code according to the analysis result for displaying.
Correspondingly, after the two-dimensional code display client receives the two-dimensional code character string data fed back by the server, the two-dimensional code character string data can be analyzed, and the two-dimensional code is generated according to the analysis result and displayed.
It should be noted that, when the two-dimensional code display client generates the two-dimensional code according to the analysis result, the two-dimensional code display style can be customized by the user. For example, a title, two-dimensional code rendering, a refresh button or prompt information and the like corresponding to the two-dimensional code display page can be set individually according to the requirements of the user.
S140, acquiring the two-dimension code state information pushed by the server side in real time through SSE connection established with the server side.
And the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
The SSE is a unidirectional channel, and may be used for the server to unilaterally send a message to the client. The two-dimensional code state information can be various associated state information of the two-dimensional code, for example, failure information of the currently displayed two-dimensional code, and the information reflecting the state of the two-dimensional code can be used as the two-dimensional code state information.
In the embodiment of the invention, in the process of interaction between the two-dimension code display client and the server, the server can push the two-dimension code state information to the two-dimension code display client in real time through SSE connection established with the two-dimension code display client. After the two-dimensional code display client receives the two-dimensional code state information, the state of the currently displayed two-dimensional code can be switched according to the specific content of the two-dimensional code state information. Since the SSE is a one-way channel from the server to the client, the mode of pushing the two-dimensional code state information by using the SSE connection can save system resources, such as bandwidth resources, memory resources, or CPU (Central Processing Unit) resources, in the process of interaction between the client and the server. Therefore, compared with the traditional two-dimensional code display method, the two-dimensional code display method provided by the embodiment of the invention can effectively reduce the occupancy rate and consumption of system resources, thereby improving the system performance.
It should be noted that, the server for feeding back the two-dimensional code string data and the server for pushing the two-dimensional code status information in real time through the SSE connection may be the same server or two different servers, which is not limited in the embodiment of the present invention.
In an optional embodiment of the present invention, applying for obtaining a two-dimensional code from a server may include: sending a two-dimensional code acquisition request to the server; after the two-dimensional code is generated according to the parsing result and displayed, the method may include: and establishing SSE connection with the server.
Optionally, in the embodiment of the present invention, the two-dimensional code display client may apply for obtaining the two-dimensional code from the server by sending a two-dimensional code obtaining request to the server. The client only sends a request to the server due to the two-dimension code display. Therefore, after the two-dimensional code display client displays the two-dimensional code, the server needs to establish an SSE connection with the server, so that the server can push the state information of the two-dimensional code to the two-dimensional code display client in real time.
In an optional embodiment of the present invention, after the SSE connection is established with the server, the method may further include: if the two-dimension code is determined to be valid and the scanning client successfully scans the two-dimension code, displaying a target display page; and if the two-dimension code is determined to be invalid or the scanning of the two-dimension code by the scanning client is failed, receiving a two-dimension code refreshing request sent by the scanning client, and returning to execute the operation of sending a two-dimension code obtaining request to the server.
The scanning client may be a client that scans the two-dimensional code displayed by the two-dimensional code display client. The target display page may be various types of pages bound by the two-dimensional code, such as a login home page of a certain system, and may be specifically set according to actual requirements. The two-dimensional code refreshing request may be a request for refreshing a two-dimensional code currently displayed by the two-dimensional code display client.
Fig. 1b is a schematic diagram illustrating an effect of a two-dimensional code display state according to an embodiment of the present invention, and fig. 1c is a schematic diagram illustrating an effect of a two-dimensional code display state according to an embodiment of the present invention. In the embodiment of the present invention, specifically, after the two-dimensional code display client displays the two-dimensional code, the scanning client may scan the two-dimensional code. The two-dimensional code display client can receive the two-dimensional code state information pushed by the server through SSE connection in real time in the process of waiting for the scanning client to scan the two-dimensional code, and confirms whether the currently displayed two-dimensional code is valid or not according to the received two-dimensional code state information. In a specific example, as shown in fig. 1b, if the two-dimensional code display client determines that the currently displayed two-dimensional code is valid and determines that the scanning client scans the two-dimensional code successfully, it is determined that the scanning client logs in successfully, the state of the currently displayed two-dimensional code may be switched to the state of successful two-dimensional code scanning as shown in fig. 1b, and a target display page is displayed to the scanning client. When the two-dimensional code display client judges that the currently displayed two-dimensional code is invalid according to the two-dimensional code state information, the state of the currently displayed two-dimensional code can be switched to the state that the two-dimensional code is invalid as shown in fig. 1c, and meanwhile, a refresh button of the two-dimensional code can be displayed to the scanning client; or when the scanning client fails to scan the two-dimensional code, the scanning client can send a two-dimensional code refreshing request to the two-dimensional code display client through a refreshing button displayed by the two-dimensional code display client. After receiving the two-dimensional code refreshing request sent by the scanning client, the two-dimensional code display client can return to execute the operation of sending the two-dimensional code obtaining request to the server.
In an optional embodiment of the present invention, applying for obtaining a two-dimensional code from a server may include: establishing SSE connection with the server; the SSE connection is used for indicating the server side to feed back the two-dimensional code character string data; after generating the two-dimensional code according to the parsing result and displaying the two-dimensional code, the method may further include: if the two-dimension code is determined to be valid and the scanning client successfully scans the two-dimension code, displaying a target display page; and if the two-dimension code is determined to be invalid or the scanning client fails to scan the two-dimension code, receiving a two-dimension code refreshing request sent by the scanning client, and returning to execute the operation of receiving the two-dimension code character string data fed back by the server.
Optionally, in the embodiment of the present invention, the two-dimensional code display client may first establish an SSE connection with the server, and after the SSE connection is established, the two-dimensional code display client applies for obtaining the two-dimensional code from the server. At the moment, the server can directly feed back the two-dimensional code character string data to the two-dimensional code display client, and the two-dimensional code display client is not required to send a two-dimensional code acquisition request to the server. Correspondingly, the SSE connection is established between the two-dimension code display client and the server side in advance, so that after the two-dimension code display client successfully displays the two-dimension code, the SSE connection with the server side is not needed to be established, and the two-dimension code state information pushed by the server side in real time can be directly received through the pre-established SSE connection.
Correspondingly, after the two-dimensional code display client displays the two-dimensional code, the scanning client can scan the two-dimensional code. The two-dimensional code display client can receive the two-dimensional code state information pushed by the server through the pre-established SSE connection in real time in the process of waiting for the scanning client to scan the two-dimensional code, and confirms whether the currently displayed two-dimensional code is valid or not according to the received two-dimensional code state information. And if the two-dimensional code display client determines that the currently displayed two-dimensional code is valid and determines that the scanning client successfully scans the two-dimensional code, determining that the scanning client successfully logs in and displaying a target display page to the scanning client. When the two-dimensional code display client judges that the currently displayed two-dimensional code is invalid according to the two-dimensional code state information, the invalid information of the currently displayed two-dimensional code can be prompted to the scanning client, and meanwhile, a refreshing button of the two-dimensional code can be displayed to the scanning client; or when the scanning client fails to scan the two-dimensional code, the scanning client can send a two-dimensional code refreshing request to the two-dimensional code display client through a refreshing button displayed by the two-dimensional code display client. After receiving the two-dimensional code refreshing request sent by the scanning client, the two-dimensional code display client can return to execute the operation of receiving the two-dimensional code character string data fed back by the server.
In an optional embodiment of the present invention, the two-dimension code status information may include expired two-dimension code information and updated two-dimension code information; after generating the two-dimensional code according to the parsing result and displaying the two-dimensional code, the method may further include: receiving the expired two-dimension code information and the updated two-dimension code information which are pushed by the server through SSE connection; analyzing the overdue two-dimensional code information, and determining that the two-dimensional code currently displayed by the two-dimensional code display client is the overdue two-dimensional code according to an analysis result; analyzing the updated two-dimensional code information, and generating an updated two-dimensional code according to an analysis result; and replacing the expired two-dimensional code with the updated two-dimensional code for displaying.
The expired two-dimensional code information can be information for prompting expiration of the two-dimensional code, and the updated two-dimensional code information can be information for updating the expired two-dimensional code. For example, the character string data of the expired two-dimensional code is used as the expired two-dimensional code information, and the new two-dimensional code character string data is used as the updated two-dimensional code information.
In the embodiment of the present invention, optionally, the server may further push expired two-dimensional code information and update the two-dimensional code information to the two-dimensional code display client through an SSE connection. Correspondingly, after the two-dimensional code display client receives the expired two-dimensional code information and the updated two-dimensional code information, the expired two-dimensional code information and the updated two-dimensional code information can be analyzed, and when the currently displayed two-dimensional code is determined to be the expired two-dimensional code according to the analysis result, the updated two-dimensional code generated according to the updated two-dimensional code information is displayed in place of the expired two-dimensional code.
According to the embodiment of the invention, the two-dimensional code is applied to the server side through the two-dimensional code display client side to obtain the two-dimensional code, after the two-dimensional code character string data fed back by the server side are received, the two-dimensional code character string data are analyzed, the two-dimensional code is generated according to the analysis result and displayed, meanwhile, the server pushes the two-dimensional code state information to the two-dimensional code display client side in real time through the SSE connection established between the two-dimensional code display client side and the server side, so that the two-dimensional code display client side can switch the state of the two-dimensional code in time, the problems of high resource occupancy rate, high consumption and the like in the conventional two-dimensional code display method are solved, the system resource occupancy rate and consumption are reduced in the process of displaying.
Example two
Fig. 2 is a flowchart of a two-dimensional code display method according to a second embodiment of the present invention, where this embodiment is applicable to a case where a server sends two-dimensional code string data to a client, so that the client displays a two-dimensional code with a low system resource occupancy rate, and the method may be executed by a two-dimensional code display apparatus, which may be implemented by software and/or hardware, and may be generally integrated in a server device and used in cooperation with the client for displaying a two-dimensional code. Accordingly, as shown in fig. 2, the method includes the following operations:
s210, receiving an application for acquiring the two-dimensional code sent by the two-dimensional code display client.
And S220, feeding back the two-dimensional code character string data to the two-dimensional code display client.
S230, pushing two-dimension code state information to the two-dimension code display client in real time through SSE connection established with the two-dimension code display client.
And the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code.
In the embodiment of the invention, before the two-dimension code is displayed, the two-dimension code display client side firstly needs to apply for obtaining the two-dimension code from the server side. Correspondingly, after receiving the two-dimensional code acquisition application sent by the two-dimensional code display client, the server can feed back the two-dimensional code character string data to the two-dimensional code display client. In the process of interaction between the two-dimension code display client and the server, the server can push the two-dimension code state information to the two-dimension code display client in real time through SSE connection established with the two-dimension code display client. After the two-dimensional code display client receives the two-dimensional code state information, the state of the currently displayed two-dimensional code can be switched according to the specific content of the two-dimensional code state information. Because the SSE is a one-way channel from the server to the client, the mode of pushing the two-dimensional code state information by using SSE connection can save system resources, such as bandwidth resources, memory resources or CPU resources, in the interactive process between the client and the server. Therefore, compared with the traditional two-dimensional code display method, the two-dimensional code display method provided by the embodiment of the invention can effectively reduce the occupancy rate and consumption of system resources, thereby improving the system performance.
It should be noted that, the server for feeding back the two-dimensional code string data and the server for pushing the two-dimensional code status information in real time through the SSE connection may be the same server or two different servers, which is not limited in the embodiment of the present invention.
In an optional embodiment of the present invention, receiving an application for acquiring a two-dimensional code sent by a two-dimensional code display client may include: receiving a two-dimensional code acquisition request sent by the two-dimensional code display client; feeding back the two-dimensional code character string data to the two-dimensional code display client, which may include: acquiring two-dimensional code character string data from an API according to the two-dimensional code acquisition request, and feeding the two-dimensional code character string data back to the two-dimensional code display client; after the two-dimensional code character string data is fed back to the two-dimensional code display client, the method may include: and establishing SSE connection with the two-dimension code display client.
Optionally, in the embodiment of the present invention, the two-dimensional code display client may apply for obtaining the two-dimensional code from the server by sending a two-dimensional code obtaining request to the server. Correspondingly, after receiving the two-dimension code acquisition request, the server can acquire the two-dimension code character string data from an external API according to the two-dimension code acquisition request and feed the two-dimension code character string data back to the two-dimension code display client. The client only sends a request to the server due to the two-dimension code display. Therefore, after the two-dimensional code display client displays the two-dimensional code, the server needs to establish an SSE connection with the server, so that the server can push the state information of the two-dimensional code to the two-dimensional code display client in real time.
In an optional embodiment of the present invention, receiving an application for acquiring a two-dimensional code sent by a two-dimensional code display client may include: SSE connection is established with the two-dimension code display client; the SSE connection is used for indicating the server side to feed back the two-dimensional code character string data; feeding back the two-dimensional code character string data to the two-dimensional code display client, which may include: and feeding back the locally stored two-dimensional code character string data to the two-dimensional code display client according to the SSE connection.
Optionally, in the embodiment of the present invention, the two-dimensional code display client may first establish an SSE connection with the server, and after the SSE connection is established, the two-dimensional code display client applies for obtaining the two-dimensional code from the server. At this time, the server side does not need to receive a two-dimensional code acquisition request sent by the two-dimensional code display client side, and locally stored two-dimensional code character string data can be fed back to the two-dimensional code display client side according to the pre-established SSE connection. Correspondingly, the SSE connection is pre-established between the two-dimension code display client and the server, so that after the two-dimension code display client successfully displays the two-dimension code, the SSE connection with the server is not needed, and the server can directly push the state information of the two-dimension code to the two-dimension code display client in real time through the pre-established SSE connection.
In an optional embodiment of the present invention, after feeding back the two-dimensional code character string data to the two-dimensional code display client, the method may include: receiving scanning information of a scanning client to the two-dimensional code through an API (application programming interface); if the scanning of the scanning client is determined to be successful according to the scanning information of the two-dimensional code, the two-dimensional code display client is indicated to display a target display page; otherwise, sending target two-dimensional code state information to the two-dimensional code display client through the SSE connection; and the state information of the target two-dimensional code is used for prompting the scanning failure.
The target two-dimensional code state information can be two-dimensional code state information prompting code scanning failure.
Correspondingly, after the two-dimensional code display client displays the two-dimensional code, the scanning client can scan the two-dimensional code, and the server receives the scanning information of the scanning client on the two-dimensional code through the API. The two-dimensional code display client can receive the two-dimensional code state information pushed by the server through the pre-established SSE connection in real time in the process of waiting for the scanning client to scan the two-dimensional code, and confirms whether the currently displayed two-dimensional code is valid or not according to the received two-dimensional code state information. If the two-dimensional code display client determines that the currently displayed two-dimensional code is valid and determines that the scanning client successfully scans the two-dimensional code according to the two-dimensional code state information pushed by the server, the server determines that the scanning client successfully logs in, and can indicate the two-dimensional code display client to display a target display page to the scanning client. When the server judges that the currently displayed two-dimensional code is invalid, the SSE connection can be used for indicating the two-dimensional code display client to prompt the scanning client of the information that the currently displayed two-dimensional code is invalid, or when the server determines that the scanning client fails to scan the two-dimensional code, the SSE connection can be used for sending target two-dimensional code state information prompting the scanning failure to the two-dimensional code display client, so that the two-dimensional code scanning client prompts the scanning failure to the scanning client.
In an optional embodiment of the present invention, the two-dimension code status information may include expired two-dimension code information and updated two-dimension code information; after the two-dimensional code character string data is fed back to the two-dimensional code display client, the method may further include: and if the two-dimensional code currently displayed by the two-dimensional code display client is determined to be an expired two-dimensional code according to the two-dimensional code attribute information, the expired two-dimensional code information is pushed to the two-dimensional code display client through SSE connection, and the two-dimensional code information is updated.
The two-dimensional code attribute information may be attribute information preset for a two-dimensional code, for example, two-dimensional code size information, two-dimensional code effective time information, and the like.
In the embodiment of the present invention, optionally, if the server determines that the two-dimensional code currently displayed by the two-dimensional code display client is the expired two-dimensional code according to the two-dimensional code attribute information, the server may push the expired two-dimensional code information to the two-dimensional code display client and update the two-dimensional code information through an SSE connection. Correspondingly, after the two-dimensional code display client receives the expired two-dimensional code information and the updated two-dimensional code information, the expired two-dimensional code information and the updated two-dimensional code information can be analyzed, and when the currently displayed two-dimensional code is determined to be the expired two-dimensional code according to the analysis result, the updated two-dimensional code generated according to the updated two-dimensional code information is displayed in place of the expired two-dimensional code.
According to the embodiment of the invention, after the server receives the application for acquiring the two-dimensional code sent by the two-dimensional code display client, the two-dimensional code character string data is fed back to the two-dimensional code display client, and the two-dimensional code state information is pushed to the two-dimensional code display client in real time through SSE connection established with the two-dimensional code display client, so that the two-dimensional code display client can switch the state of the two-dimensional code in time, the problems of high resource occupancy rate, high consumption and the like in the conventional two-dimensional code display method are solved, the system resource occupancy rate and consumption are reduced in the process of displaying the two-dimensional code by the client in real time, and the system performance is.
EXAMPLE III
Fig. 3 is a flowchart of a two-dimensional code display method according to a third embodiment of the present invention, which is applicable to a case where a client interacts with a server to display a two-dimensional code. Accordingly, as shown in fig. 3, the method includes the following operations:
s310, the two-dimension code display client applies for obtaining the two-dimension code from the server.
And S320, the server feeds the two-dimension code character string data back to the two-dimension code display client.
S330, the two-dimension code display client analyzes the two-dimension code character string data and generates a two-dimension code according to an analysis result to display.
S340, the server side pushes the two-dimension code state information to the two-dimension code display client side in real time through SSE connection established with the two-dimension code display client side.
According to the embodiment of the invention, the two-dimension code display client applies for the server side to obtain the two-dimension code, the server side receives the application of the two-dimension code and feeds the two-dimension code character string data back to the two-dimension code display client, and the client side can receive and analyze the two-dimension code character string data fed back by the server side and generate the two-dimension code according to the analysis result for display. The server can push the two-dimension code state information to the two-dimension code display client in real time through SSE connection established with the two-dimension code display client, so that the two-dimension code display client can switch the state of the two-dimension code in time, the problems of high resource occupancy rate, high consumption and the like of the conventional two-dimension code display method are solved, the system resource occupancy rate and the consumption are reduced in the process of displaying the two-dimension code by the client in real time, and the system performance is improved.
It should be noted that any permutation and combination between the technical features in the above embodiments also belong to the scope of the present invention.
Example four
Fig. 4 is a schematic diagram of a two-dimensional code display apparatus according to a fourth embodiment of the present invention, which may be configured at a two-dimensional code display client, as shown in fig. 4, the apparatus includes: two-dimensional code application module 410, two-dimensional code character string data receiving module 420, two-dimensional code display module 430 and two-dimensional code status information acquisition module 440, wherein:
a two-dimension code application module 410, configured to apply for obtaining a two-dimension code from a server;
a two-dimensional code string data receiving module 420, configured to receive two-dimensional code string data fed back by the server;
the two-dimensional code display module 430 is configured to analyze the two-dimensional code character string data, and generate a two-dimensional code according to an analysis result to display the two-dimensional code;
the two-dimension code status information acquiring module 440 is configured to acquire two-dimension code status information pushed by the server in real time through an SSE connection established with the server;
and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
According to the embodiment of the invention, the two-dimensional code is applied to the server side through the two-dimensional code display client side to obtain the two-dimensional code, after the two-dimensional code character string data fed back by the server side are received, the two-dimensional code character string data are analyzed, the two-dimensional code is generated according to the analysis result and displayed, meanwhile, the server pushes the two-dimensional code state information to the two-dimensional code display client side in real time through the SSE connection established between the two-dimensional code display client side and the server side, so that the two-dimensional code display client side can switch the state of the two-dimensional code in time, the problems of high resource occupancy rate, high consumption and the like in the conventional two-dimensional code display method are solved, the system resource occupancy rate and consumption are reduced in the process of displaying.
Optionally, the two-dimensional code application module 410 is specifically configured to: sending a two-dimensional code acquisition request to the server; the device further comprises: and the first SSE connection establishing module is used for establishing SSE connection with the server.
Optionally, the apparatus further comprises: the first target display page display module is used for displaying a target display page if the two-dimension code is determined to be valid and the scanning client scans the two-dimension code successfully; and the first two-dimensional code refreshing module is used for receiving a two-dimensional code refreshing request sent by the scanning client and returning to execute the operation of sending a two-dimensional code acquisition request to the server if the two-dimensional code is determined to be invalid or the scanning of the scanning client to the two-dimensional code fails.
Optionally, the two-dimensional code application module 410 is specifically configured to: establishing SSE connection with the server; the SSE connection is used for indicating the server side to feed back the two-dimensional code character string data; the device further comprises: the second target display page display module is used for displaying a target display page if the two-dimension code is determined to be valid and the scanning client scans the two-dimension code successfully; and the second two-dimensional code refreshing module is used for receiving a two-dimensional code refreshing request sent by the scanning client and returning to execute the operation of receiving the two-dimensional code character string data fed back by the server if the two-dimensional code is determined to be invalid or the scanning of the scanning client to the two-dimensional code fails.
Optionally, the two-dimension code state information includes expired two-dimension code information and updated two-dimension code information; the device further comprises: the two-dimension code replacing and updating module is used for receiving the expired two-dimension code information and the updated two-dimension code information which are pushed by the server through SSE connection; analyzing the overdue two-dimensional code information, and determining that the two-dimensional code currently displayed by the two-dimensional code display client is the overdue two-dimensional code according to an analysis result; analyzing the updated two-dimensional code information, and generating an updated two-dimensional code according to an analysis result; and replacing the expired two-dimensional code with the updated two-dimensional code for displaying.
The two-dimensional code display device can execute the two-dimensional code display method provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the two-dimensional code display method provided in the first embodiment of the present invention, reference may be made to the following description.
EXAMPLE five
Fig. 5 is a schematic view of a two-dimensional code display device according to a fifth embodiment of the present invention, where the two-dimensional code display device may be configured at a server, and as shown in fig. 5, the two-dimensional code display device includes: two-dimensional code application receiving module 510, two-dimensional code string data feedback module 520, and two-dimensional code status information pushing module 530, wherein:
the two-dimensional code application receiving module 510 receives an application for acquiring a two-dimensional code, which is sent by a two-dimensional code display client;
a two-dimensional code string data feedback module 520, configured to feed back two-dimensional code string data to the two-dimensional code display client;
the two-dimension code status information pushing module 530 is configured to push two-dimension code status information to the two-dimension code display client in real time through an SSE connection established with the two-dimension code display client;
and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code.
According to the embodiment of the invention, after the server receives the application for acquiring the two-dimensional code sent by the two-dimensional code display client, the two-dimensional code character string data is fed back to the two-dimensional code display client, and the two-dimensional code state information is pushed to the two-dimensional code display client in real time through SSE connection established with the two-dimensional code display client, so that the two-dimensional code display client can switch the state of the two-dimensional code in time, the problems of high resource occupancy rate, high consumption and the like in the conventional two-dimensional code display method are solved, the system resource occupancy rate and consumption are reduced in the process of displaying the two-dimensional code by the client in real time, and the system performance is.
Optionally, the two-dimensional code application receiving module 510 is specifically configured to: receiving a two-dimensional code acquisition request sent by the two-dimensional code display client; the two-dimensional code string data feedback module 520 is specifically configured to: acquiring two-dimensional code character string data from an API according to the two-dimensional code acquisition request, and feeding the two-dimensional code character string data back to the two-dimensional code display client; the device further comprises: and the second SSE connection establishing module is used for establishing SSE connection with the two-dimensional code display client.
Optionally, the two-dimensional code application receiving module 510 is specifically configured to: SSE connection is established with the two-dimension code display client; the SSE connection is used for indicating the server side to feed back the two-dimensional code character string data; the two-dimensional code string data feedback module 520 is specifically configured to: and feeding back the locally stored two-dimensional code character string data to the two-dimensional code display client according to the SSE connection.
Optionally, the apparatus further comprises: the scanning information receiving module is used for receiving the scanning information of the scanning client to the two-dimensional code through an API (application programming interface); the page display indicating module is used for indicating the two-dimensional code display client to display a target display page if the scanning of the scanning client is determined to be successful according to the scanning information of the two-dimensional code; the scanning failure prompt module is used for sending target two-dimensional code state information to the two-dimensional code display client through the SSE connection when the scanning failure of the scanning client is determined according to the scanning information of the two-dimensional code; and the state information of the target two-dimensional code is used for prompting the scanning failure.
Optionally, the two-dimension code state information includes expired two-dimension code information and updated two-dimension code information; the device further comprises: and the two-dimension code replacing information sending module is used for pushing overdue two-dimension code information to the two-dimension code display client and updating the two-dimension code information through SSE connection if the two-dimension code currently displayed by the two-dimension code display client is determined to be the overdue two-dimension code according to the two-dimension code attribute information.
The two-dimensional code display device can execute the two-dimensional code display method provided by the second embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the two-dimensional code display method provided in the second embodiment of the present invention, reference may be made to the technical details not described in detail in the present embodiment.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a computer device according to a sixth embodiment of the present invention. FIG. 6 illustrates a block diagram of a computer device 612 suitable for use in implementing embodiments of the present invention. The computer device 612 shown in fig. 6 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention. The computing device 612 is typically a computing device that assumes a terminal function, such as various smart phones, tablet computers, or personal computers.
As shown in fig. 6, the computer device 612 is in the form of a general purpose computing device. Components of computer device 612 may include, but are not limited to: one or more processors 616, a memory device 628, and a bus 618 that couples the various system components including the memory device 628 and the processors 616.
Bus 618 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 612 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 612 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 628 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 630 and/or cache Memory 632. The computer device 612 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 634 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In such cases, each drive may be connected to bus 618 by one or more data media interfaces. Storage device 628 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program 636 having a set (at least one) of program modules 626 may be stored, for example, in storage device 628, such program modules 626 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 626 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
Computer device 612 may also communicate with one or more external devices 614 (e.g., keyboard, pointing device, camera, display 624, etc.), with one or more devices that enable a user to interact with computer device 612, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 612 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 622. Further, computer device 612 may also communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via Network adapter 620. As shown, the network adapter 620 communicates with the other modules of the computer device 612 via the bus 618. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the computer device 612, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 616 executes various functional applications and data processing by executing programs stored in the storage device 628, for example, implementing the two-dimensional code display method provided by the above-described embodiment of the present invention.
That is, the processing unit implements, when executing the program: applying for obtaining the two-dimensional code from a server; receiving two-dimensional code character string data fed back by the server; analyzing the two-dimensional code character string data, and generating a two-dimensional code according to an analysis result to display; acquiring two-dimensional code state information pushed by the server side in real time through a server push event SSE connection established with the server side; and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
EXAMPLE seven
A seventh embodiment of the present invention is an apparatus for executing a two-dimensional code display method according to the second embodiment of the present invention, where the apparatus includes: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the two-dimensional code display method according to the second embodiment of the present invention: receiving an application for acquiring a two-dimensional code sent by a two-dimensional code display client; feeding back the two-dimensional code character string data to the two-dimensional code display client; pushing two-dimensional code state information to the two-dimensional code display client in real time through SSE connection established with the two-dimensional code display client; and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code. The specific structure and the details thereof can be referred to fig. 6 and the sixth embodiment.
Example eight
An eighth embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is executed by a computer processor to perform the two-dimensional code display method according to the first embodiment of the present invention: applying for obtaining the two-dimensional code from a server; receiving two-dimensional code character string data fed back by the server; analyzing the two-dimensional code character string data, and generating a two-dimensional code according to an analysis result to display; acquiring two-dimensional code state information pushed by the server side in real time through a server push event SSE connection established with the server side; and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM) or flash Memory), an optical fiber, a portable compact disc Read Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Example nine
The ninth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, can implement the two-dimensional code display method according to the second embodiment: receiving an application for acquiring a two-dimensional code sent by a two-dimensional code display client; feeding back the two-dimensional code character string data to the two-dimensional code display client; pushing two-dimensional code state information to the two-dimensional code display client in real time through SSE connection established with the two-dimensional code display client; and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code. The specific details thereof are described with reference to example eight.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (14)

1. A two-dimension code display method is applied to a two-dimension code display client side and is characterized by comprising the following steps:
applying for obtaining the two-dimensional code from a server;
receiving two-dimensional code character string data fed back by the server;
analyzing the two-dimensional code character string data, and generating a two-dimensional code according to an analysis result to display;
acquiring two-dimensional code state information pushed by the server side in real time through a server push event SSE connection established with the server side;
and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
2. The method of claim 1, wherein applying for obtaining the two-dimensional code from the server comprises:
sending a two-dimensional code acquisition request to the server;
after generating the two-dimensional code according to the analysis result and displaying, the method comprises the following steps:
and establishing SSE connection with the server.
3. The method of claim 2, further comprising, after establishing the SSE connection with the server:
if the two-dimension code is determined to be valid and the scanning client successfully scans the two-dimension code, displaying a target display page;
and if the two-dimension code is determined to be invalid or the scanning of the two-dimension code by the scanning client is failed, receiving a two-dimension code refreshing request sent by the scanning client, and returning to execute the operation of sending a two-dimension code obtaining request to the server.
4. The method of claim 1, wherein applying for obtaining the two-dimensional code from the server comprises:
establishing SSE connection with the server; the SSE connection is used for indicating the server side to feed back the two-dimensional code character string data;
after the two-dimensional code is generated according to the analysis result and displayed, the method further comprises the following steps:
if the two-dimension code is determined to be valid and the scanning client successfully scans the two-dimension code, displaying a target display page;
and if the two-dimension code is determined to be invalid or the scanning client fails to scan the two-dimension code, receiving a two-dimension code refreshing request sent by the scanning client, and returning to execute the operation of receiving the two-dimension code character string data fed back by the server.
5. The method according to any one of claims 1 to 4, wherein the two-dimension code status information includes expired two-dimension code information and updated two-dimension code information;
after the two-dimensional code is generated according to the analysis result and displayed, the method further comprises the following steps:
receiving the expired two-dimension code information and the updated two-dimension code information which are pushed by the server through SSE connection;
analyzing the overdue two-dimensional code information, and determining that the two-dimensional code currently displayed by the two-dimensional code display client is the overdue two-dimensional code according to an analysis result;
analyzing the updated two-dimensional code information, and generating an updated two-dimensional code according to an analysis result;
and replacing the expired two-dimensional code with the updated two-dimensional code for displaying.
6. A two-dimensional code display method is applied to a server side and is characterized by comprising the following steps:
receiving an application for acquiring a two-dimensional code sent by a two-dimensional code display client;
feeding back the two-dimensional code character string data to the two-dimensional code display client;
pushing two-dimensional code state information to the two-dimensional code display client in real time through SSE connection established with the two-dimensional code display client;
and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code.
7. The method of claim 6, wherein receiving an application for obtaining the two-dimensional code sent by a two-dimensional code display client comprises:
receiving a two-dimensional code acquisition request sent by the two-dimensional code display client;
feeding back the two-dimensional code character string data to the two-dimensional code display client, comprising:
acquiring two-dimensional code character string data from an API according to the two-dimensional code acquisition request, and feeding the two-dimensional code character string data back to the two-dimensional code display client;
after the two-dimensional code character string data is fed back to the two-dimensional code display client, the method further comprises the following steps:
and establishing SSE connection with the two-dimension code display client.
8. The method of claim 6, wherein receiving an application for obtaining the two-dimensional code sent by a two-dimensional code display client comprises:
SSE connection is established with the two-dimension code display client; the SSE connection is used for indicating the server side to feed back the two-dimensional code character string data;
feeding back the two-dimensional code character string data to the two-dimensional code display client, comprising:
and feeding back the locally stored two-dimensional code character string data to the two-dimensional code display client according to the SSE connection.
9. The method according to claim 7 or 8, wherein after feeding back the two-dimensional code character string data to the two-dimensional code display client, the method further comprises:
receiving scanning information of a scanning client to the two-dimensional code through an API (application programming interface);
if the scanning of the scanning client is determined to be successful according to the scanning information of the two-dimensional code, the two-dimensional code display client is indicated to display a target display page;
otherwise, sending target two-dimensional code state information to the two-dimensional code display client through the SSE connection; and the state information of the target two-dimensional code is used for prompting the scanning failure.
10. The method of claim 9, wherein the two-dimensional code status information comprises expired two-dimensional code information and updated two-dimensional code information;
after the two-dimensional code character string data is fed back to the two-dimensional code display client, the method further comprises the following steps:
and if the two-dimensional code currently displayed by the two-dimensional code display client is determined to be an expired two-dimensional code according to the two-dimensional code attribute information, the expired two-dimensional code information is pushed to the two-dimensional code display client through SSE connection, and the two-dimensional code information is updated.
11. A two-dimensional code display device is configured at a two-dimensional code display client, and is characterized by comprising:
the two-dimension code application module is used for applying for obtaining the two-dimension code from the server;
the two-dimensional code character string data receiving module is used for receiving the two-dimensional code character string data fed back by the server;
the two-dimensional code display module is used for analyzing the two-dimensional code character string data and generating a two-dimensional code according to an analysis result for display;
the two-dimension code state information acquisition module is used for acquiring the two-dimension code state information pushed by the server side in real time through SSE connection established with the server side;
and the two-dimension code state information is used for switching the state of the two-dimension code by the two-dimension code display client.
12. A two-dimensional code display device is configured at a server side, and is characterized by comprising:
the two-dimension code application receiving module is used for receiving an application for acquiring a two-dimension code, which is sent by a two-dimension code display client;
the two-dimensional code character string data feedback module is used for feeding back the two-dimensional code character string data to the two-dimensional code display client;
the two-dimension code state information pushing module is used for pushing the two-dimension code state information to the two-dimension code display client in real time through SSE connection established with the two-dimension code display client;
and the two-dimension code state information is used for the two-dimension code display client to switch the state of the two-dimension code.
13. A computer device, characterized in that the computer device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the two-dimensional code display method of any one of claims 1-5, or the two-dimensional code display method of any one of claims 6-10.
14. A computer storage medium on which a computer program is stored, the program, when executed by a processor, implementing a two-dimensional code display method according to any one of claims 1 to 5, or implementing a two-dimensional code display method according to any one of claims 6 to 10.
CN201911150050.7A 2019-11-21 2019-11-21 Two-dimensional code display method and device, computer equipment and storage medium Active CN110955398B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911150050.7A CN110955398B (en) 2019-11-21 2019-11-21 Two-dimensional code display method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911150050.7A CN110955398B (en) 2019-11-21 2019-11-21 Two-dimensional code display method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110955398A true CN110955398A (en) 2020-04-03
CN110955398B CN110955398B (en) 2022-10-28

Family

ID=69977969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911150050.7A Active CN110955398B (en) 2019-11-21 2019-11-21 Two-dimensional code display method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110955398B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970252A (en) * 2020-07-29 2020-11-20 腾讯科技(深圳)有限公司 Two-dimensional code display control method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103401857A (en) * 2013-07-26 2013-11-20 北京奇虎科技有限公司 Interactive method and system of two-dimension code information, client and server
CN103903038A (en) * 2014-02-21 2014-07-02 黄昱钊 System for dynamically displaying two-dimension codes and implementation method and application thereof
WO2017071506A1 (en) * 2015-10-28 2017-05-04 阿里巴巴集团控股有限公司 Two-dimensional code processing method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103401857A (en) * 2013-07-26 2013-11-20 北京奇虎科技有限公司 Interactive method and system of two-dimension code information, client and server
CN103903038A (en) * 2014-02-21 2014-07-02 黄昱钊 System for dynamically displaying two-dimension codes and implementation method and application thereof
WO2017071506A1 (en) * 2015-10-28 2017-05-04 阿里巴巴集团控股有限公司 Two-dimensional code processing method and apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970252A (en) * 2020-07-29 2020-11-20 腾讯科技(深圳)有限公司 Two-dimensional code display control method and device
CN111970252B (en) * 2020-07-29 2023-08-29 腾讯科技(深圳)有限公司 Two-dimensional code display control method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110955398B (en) 2022-10-28

Similar Documents

Publication Publication Date Title
CN109618225B (en) Video frame extraction method, device, equipment and medium
CN108055304B (en) Remote data synchronization method, device, server, equipment and storage medium
US9906626B2 (en) Resource demand-based network page generation
US20230328026A1 (en) Mail processing method and apparatus, and electronic device, and computer readable medium
US11758087B2 (en) Multimedia conference data processing method and apparatus, and electronic device
CN113784049B (en) Camera calling method of android system virtual machine, electronic equipment and storage medium
US20230007059A1 (en) Information switching and sharing method, device, electronic apparatus, and storage medium
CN112383787A (en) Live broadcast room creating method and device, electronic equipment and storage medium
CN110781437A (en) Method and device for acquiring webpage image loading duration and electronic equipment
CN111669447A (en) Page display method, device, equipment and medium
CN110955398B (en) Two-dimensional code display method and device, computer equipment and storage medium
CN109165372B (en) Webpage loading method, device, equipment and storage medium
CN114237890A (en) Application collaborative display method and device, server, terminal and program product
CN113656193A (en) Application communication method, system, electronic equipment and storage medium
CN113569173A (en) Page loading method and device, storage medium and electronic equipment
US20230319325A1 (en) Information interaction method, apparatus and device
CN109831673B (en) Live broadcast room data processing method, device, equipment and storage medium
CN114584618A (en) Information interaction method, device, equipment, storage medium and system
AU2018403361B2 (en) Data transmission
CN110908660B (en) Two-dimensional code generation method and device, computer equipment and storage medium
CN112714331B (en) Information prompting method and device, storage medium and electronic equipment
CN113542335A (en) Information sharing method and device, electronic equipment and storage medium
CN110351602B (en) Method for electronic device, information processing system and electronic device
CN113114698B (en) Network data request method, system, device, equipment and storage medium
US20240089560A1 (en) Video generation method, apparatus, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant