Code scanning login method and device, equipment and storage medium
By establishing a persistent connection on large-screen devices and utilizing the push service's login confirmation information, the problem of login failure caused by unexpected closure or timeout of the login page is resolved, and successful login by scanning the QR code is achieved in abnormal situations, thus improving the user experience.
Patent Information
- Application Number
- CN202511018817.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-10
AI Technical Summary
During the QR code scanning login process for large-screen devices such as smart TVs or smart projectors, the login page closes unexpectedly or the inquiry time expires, making it impossible to complete the login operation, resulting in a poor user experience.
By establishing a long connection between the first application on the scanned end and the push service, and receiving the status update request from the scanned end, a login code is generated and displayed, and the login operation is completed using the login confirmation information sent by the push service, ensuring that scanning and logging in can still be achieved even if the login page is accidentally closed or the inquiry time is exceeded.
It improves the success rate of scanning code login, simplifies the operation process, enhances user experience, and reduces login failures.
Smart Images

Figure CN120768638A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of code scanning login, and in particular to a code scanning login method, apparatus, device and storage medium. Background Art
[0002] Scanning a QR code is a QR code recognition function. With its safe and convenient operation, it is widely used in various scenarios such as login, payment, downloading applications or opening web pages. Scanning code login refers to the scanning function in the login scenario. After installing Internet applications on current large-screen devices such as smart TVs and smart projectors, users only need to scan the code with their mobile phones to complete the login operation of the application. For example: when scanning the code to log in on the TV, the TV displays the QR code for login, and needs to send a request to the server at regular intervals to ask whether it has been confirmed by the user's scan code; if the user scans the code with the mobile phone and clicks "Confirm", then the TV will be informed of the successful confirmation the next time it asks the server for the token status, and will return a successful login. At this point, the TV has completed the login.
[0003] During this process, after the TV displays the QR code on the login page, it will continuously ask the server whether it has been confirmed. The login page cannot be closed during the entire login process. If the login page is accidentally closed or the inquiry time is exceeded, the TV will not be able to regularly inquire the server, and the TV client will no longer have the opportunity to successfully log in. At this time, the user needs to reopen the login page and re-execute the code scanning login process. The operation is more cumbersome and the user experience is poor.
[0004] Therefore, how to implement the scan code login function when the login page is accidentally closed or the inquiry time is exceeded is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] The present application provides a code scanning login method, apparatus, device and storage medium, so that the code scanning login function can still be implemented when the login page is accidentally closed or the inquiry time is exceeded.
[0006] In a first aspect, the present application provides a code scanning login method, which is applied to a first application on a scanned terminal, and includes:
[0007] Receive scan code login request;
[0008] Generate a login code according to the scan code login request and display it so that the user can scan the login code through the second application on the code scanning end and then send a status update request to the server end;
[0009] Receiving login confirmation information sent by the push service; wherein the login confirmation information is: the login confirmation information sent by the server to the first application through the push service after receiving the status update request;
[0010] Using the login confirmation information, a login query request is sent to the server to complete the login operation of the first application.
[0011] Optionally, before receiving the scan code login request, the method further includes:
[0012] After the first application is started, a persistent connection is automatically established between the first application and the push service to transmit interactive data through the persistent connection.
[0013] Optionally, receiving login confirmation information sent by the push service includes:
[0014] Receive login confirmation information sent by the push service through the persistent connection.
[0015] Optionally, after generating and displaying a login code according to the scan code login request, the method further includes:
[0016] Sending a login query request to the server with a predetermined duration as the query cycle;
[0017] If a login success message is received from the server, or the total duration of the current inquiry exceeds a predetermined duration threshold, the sending of the login inquiry request to the server is stopped.
[0018] Optionally, generating a login code according to the scan code login request includes:
[0019] Get login credentials from the server;
[0020] The login code is generated according to the login credential; wherein, the second application on the code scanning end scans the login code to obtain the login credential, and sends a status update request to the server, wherein the status update request includes: the login credential and account information.
[0021] Optionally, using the login confirmation information to send a login query request to the server includes:
[0022] Obtaining a first hash value from the login confirmation information; the first hash value is a hash value calculated by the server according to the login credentials carried in the status update request;
[0023] Calculating a second hash value of the login credential obtained from the server;
[0024] Determining whether the first hash value is the same as the second hash value;
[0025] If so, a login query request is sent to the server.
[0026] In a second aspect, the present application provides a code scanning login method, which is applied to the server and includes:
[0027] Receiving a status update request sent by a second application on the scanning end; wherein the status update request is a status update request sent to the server by a user scanning the login code through the second application after the first application on the scanning end generates and displays the login code;
[0028] generating login confirmation information according to the status update request;
[0029] sending the login confirmation information to the first application via a push service, so that the first application generates a login query request using the login confirmation information;
[0030] A login query request sent by the first application is received, and a login operation of the first application is completed according to the login query request.
[0031] In a third aspect, the present application provides a code scanning login device, which is applied to a first application on a scanned terminal, and includes:
[0032] The first receiving module is used to receive a scan code login request;
[0033] A first generating module, configured to generate a login code according to the scan code login request;
[0034] A display module, configured to display a login code so that the user can scan the login code through a second application on the code scanning terminal and then send a status update request to the server;
[0035] a second receiving module, configured to receive login confirmation information sent by a push service; wherein the login confirmation information is the login confirmation information sent by the server to the first application via the push service after receiving the status update request;
[0036] The first sending module is used to use the login confirmation information to send a login query request to the server to complete the login operation of the first application.
[0037] In a fourth aspect, the present application provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0038] Memory for storing computer programs;
[0039] The processor is used to implement the above-mentioned code scanning login method steps when executing the program stored in the memory.
[0040] In a fifth aspect, the present application also provides a computer storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to execute the steps of the above-mentioned code scanning login method.
[0041] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the present application provides a code scanning login method, device, equipment and storage medium. In the present application, the first application on the scanned end receives the code scanning login request, generates and displays the login code, and after the user scans the login code through the second application on the scanned end, it sends a status update request to the server; after the server receives the status update request, it sends a login confirmation message to the first application through the push service, and the first application can send a login inquiry request to the server according to the login confirmation message to complete the login operation of the first application. It can be seen that in the present application, after the second application on the scanned end sends a status update request to the server, the first application will receive the login confirmation message sent by the server, thereby completing the login operation of the first application. In this way, the code scanning login function can still be realized after the login page is accidentally closed or the inquiry time is exceeded, thereby simplifying the code scanning login operation and improving login efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0045] Figure 1 A flowchart of a code scanning login method provided in an embodiment of the present application;
[0046] Figure 2 A flowchart of another code scanning login method provided in an embodiment of the present application;
[0047] Figure 3A specific code scanning login process schematic diagram provided for an embodiment of the present application;
[0048] Figure 4 Another specific code scanning login process schematic diagram provided for an embodiment of the present application;
[0049] Figure 5 A code scanning login device structure schematic diagram provided for an embodiment of the present application;
[0050] Figure 6 An electronic device structure schematic diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0051] At present, smart televisions, smart projectors and other large-screen devices have undergone great changes in functions compared to traditional televisions or projectors, such as smart televisions, projectors and the like can install Internet applications (Application, App). These Apps generally provide a login function in order to provide users with a better use experience.
[0052] However, smart televisions and other large-screen devices are mostly operated through remote controls, and the input experience of users is far inferior to that of computer or mobile phone keyboard operation, so code scanning login is very suitable for this scenario, and users only need to scan the code with their mobile phones to complete the login operation.
[0053] The code scanning login process of a smart television or projector is similar to the code scanning login process on a computer, and the general steps are as follows:
[0054] 1. The client of a television or projector device displays a two-dimensional code for login. The two-dimensional code contains a credential for login, which can be a token. After that, the client will carry the credential to send a request to the server every certain period of time (such as every 5 seconds) to inquire whether the credential has been confirmed by the user through code scanning;
[0055] 2. After the user scans the two-dimensional code with a mobile phone, the user is generally prompted that the code scanning login is being performed, and is asked whether to allow the client to log in;
[0056] 3. At this time, the user clicks "Confirm" or "Allow", so that the client will be informed of the successful confirmation when inquiring the token state from the server next time, and returns login success. Thus, the client completes the login.
[0057] As can be seen from the above code scanning login steps, the user does not need to perform any input through the remote control of the television (the remote control is also not suitable for inputting a mobile phone number, an account or a password, etc.) in the entire process, which greatly facilitates the login process of the user.
[0058] But also see, the client in the display of two-dimensional code, should not stop asking the server token has been confirmed. The entire login process page can not be closed, the request can not be interrupted, because once closed or interrupted, the client can not be timed to ask the server token has been confirmed. Even if the user has passed the mobile phone scan code, and confirm that the television equipment allows login, the television client also has no opportunity to successfully log in.
[0059] And, the current smart TV or smart projector remote control, generally small, and the operation button is closely connected, easy to mispress or mispress a button to two-dimensional code page accidentally exit or close, resulting in the user's login operation failure.
[0060] In addition, considering the performance of smart TV is generally not as good as mobile devices, and the television client each time to initiate a request to ask the server token has been confirmed, also consume certain network bandwidth and server processing and storage resources, usually the client inquiry operation will be automatically terminated after a period of time, such as 1 minute if there is no scan code confirmation, will not continue to initiate inquiry request, to save the client, network and server resources. If the user in the first 1 minute 01 seconds through the mobile phone scan code confirmation, although the token has been confirmed, but due to the television client in more than 1 minute after no longer continue to inquire the status of the token, therefore, the scene will also be logged in failure.
[0061] From the above, it can be seen that the two scenarios of smart TV and other large screen devices for scanning code login failure are: the two-dimensional code page is accidentally closed, resulting in the client no longer initiating inquiry request; inquiry timeout is more than a certain time, the client no longer initiates inquiry request. Through analysis, the common point of the two scenarios is that the client no longer inquires the status of the token, resulting in not getting the token confirmed by the user within a specified time through the interface.
[0062] Therefore, in the present application, a scanning code login method, device, equipment and storage medium are disclosed. The present application can be used for smart TV or smart projector devices and other devices that need to be operated by remote control. In the scanning code login process, the two-dimensional code page is accidentally closed or exited due to misoperation, or the user's operation is too slow and the last time for the client to inquire the token state is missed, resulting in login failure. The present application proposes a real-time scanning code login implementation scheme. The present application can still realize the scanning code login function when the login page is accidentally closed or exceeds the inquiry time.
[0063] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0064] The disclosure below provides many different embodiments or examples for implementing different configurations of the present invention. To simplify the disclosure of the present invention, the components and configurations of specific examples are described below. Of course, these are merely examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numerals and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or configurations discussed.
[0065] See also Figure 1 , is a flowchart of a code scanning login method provided in an embodiment of the present application, which is applied to a first application on the scanned terminal, including:
[0066] S101: Receive a scan code login request.
[0067] In this application, the code scanning login system includes the scanned end and the scanning end. The scanned end refers to large-screen devices such as smart TVs and smart projectors. The scanned end is deployed with a first application. The scanning end refers to a device that supports code scanning, such as a mobile phone or pad. The second application is deployed on the scanning end. The first application and the second application are the same application deployed on different devices. For example, if the scanning end is a smart TV, the first application installed on the smart TV is a TV-side video software, and the scanning end is a mobile phone, the second application installed on the mobile phone is a mobile-side video software.
[0068] The application scenario of this solution is that after the user opens the first application on the scanned end, if the user needs to log in to the first application through the scan code login function, the user needs to trigger a scan code login request on the first application. The scan code login request is the scan code login request received by the first application.
[0069] S102: Generate a login code according to the code scanning login request and display it so that the user can scan the login code through the second application on the code scanning end and then send a status update request to the server end.
[0070] In this application, after the first application receives the scan code login request, it needs to generate a login code based on the scan code login request. The login code can be a QR code or other form of operation code that can realize the login function, which is not specifically limited here. After the application generates the login code, it needs to display the login code on the scanned end. At this time, the user needs to scan the login code displayed on the scanned end through the second application on the scanned end. In addition, after scanning the login code, a control for confirming the login can be displayed on the scanned end. After the user clicks the control, the second application can send a status update request to the server to let the server know that the user has confirmed the login.
[0071] In another embodiment provided in the present application, the process of generating a login code based on a scan code login request specifically includes: obtaining login credentials from a server; generating a login code based on the login credentials; wherein, the second application on the scan code end scans the login code to obtain the login credentials, and sends a status update request to the server, and the status update request includes: login credentials and account information.
[0072] Specifically, the process of generating a login code based on a scan code login request is as follows: after receiving the scan code login request, the first application obtains the login credential from the server. The login credential can be a token. After receiving the login credential, the first application renders the login credential into a login code. After scanning the login code, the second application on the scanning end can obtain the login credential. After the user clicks the control for confirming the login, the second application sends a status update request to the server, including the login credential and account information.
[0073] S103. Receive login confirmation information sent by the push service; wherein the login confirmation information is: login confirmation information sent by the server to the first application through the push service after receiving the status update request.
[0074] In this application, after the server receives the status update request, it can obtain the login credentials and account information from the status update request. The server can confirm which login credentials are confirmed by the user through the login credentials so that the user can log in through the account information. Specifically, the status of each login credential on the server includes: unconfirmed status, confirmed status, canceled status and used status. The unconfirmed status means that the user has not scanned the code to confirm, the confirmed status means that the user has scanned the code and confirmed the login, the canceled status means that the user clicked on "Do not allow login" after scanning the code, and the used status means that the TV initiates a polling request. If the polling request is successful, the server will also change the status of the credential to "used" to ensure that the credential can only be used once. Therefore, in this application, after the server receives the status update request, it updates the status of the login credential in the status update request to "confirmed".
[0075] And, the application provides a real-time code scanning login implementation method for the problem of how to enable a user to continue to successfully log in a large-screen device such as a smart television in a scenario without a login request, that is, after the service end receives a state update request sent by the user after scanning code confirmation, the service end actively pushes the latest state of the token to the first application of the scanned code end through login confirmation information, and the login confirmation information is used to notify the first application that the state of the login credential is a confirmed state.
[0076] In the application, in order to ensure that the login confirmation information is sent to the first application of the scanned code end in time, the service end needs to send the login confirmation information to the first application through a push service, which can be a service independent of the service end and does not occupy the resources of the service end, so as to send the login confirmation information to the first application in time.
[0077] S104, using the login confirmation information, sending a login inquiry request to the service end to complete the login operation of the first application.
[0078] It can be understood that after the first application receives the login confirmation information, it can be understood that the login credential in the service end has been confirmed by the user, and at this time, in order to ensure security, the first application needs to actively send a login inquiry request to the service end to complete the login operation of the first application.
[0079] As can be seen from the above, the application provides a compensation scheme for the inconvenience caused by the limitation of the remote control operation in the code scanning login scenario of a large-screen device such as a smart television, which causes the code scanning login page to be closed due to misoperation or long operation time, and the inquiry request is no longer initiated. After the second application of the scanned code end sends a state update request to the service end, the first application receives the login confirmation information sent by the service end, and at this time, the first application can actively send a login inquiry request, thereby completing the login operation of the first application. Through this way, the problem of login failure caused by accidental closing of the two-dimensional code page or timeout can be greatly reduced, the user login rate is effectively improved, and the user experience is improved.
[0080] Referring to Figure 2 Another code scanning login method flow diagram provided by the embodiment of the application is provided, which is applied to the first application of the scanned code end, and includes:
[0081] S201, after the first application is started, a long connection between the first application and the push service is automatically established to transmit interactive data through the long connection;
[0082] S202, receiving a code scanning login request;
[0083] S203, generating a login code according to the code scanning login request and displaying the login code, so that after the user scans the login code through the second application of the scanned code end, the service end sends a state update request;
[0084] S204, sending a login query request to the server with a predetermined duration as the query cycle;
[0085] S205: If a login success message is received from the server, or if the total duration of the current query exceeds a predetermined duration threshold, stop sending login query requests to the server.
[0086] S206. Receive login confirmation information sent by the push service via the persistent connection; wherein the login confirmation information is the login confirmation information sent by the server to the first application via the push service after receiving the status update request;
[0087] S207: Using the login confirmation information, send a login query request to the server to complete the login operation of the first application.
[0088] In this application, in order for the first application to receive the login confirmation information sent by the push service in real time, a connection between the first application and the push service can be silently established after the first application is started. This connection state will remain until the user closes the first application or closes the scanned end, so this connection is also called a long connection. After the first application establishes a long connection with the push service, the push service can push the login confirmation information sent by the server to the first application through the long connection in a timely manner after receiving the login confirmation information; and the push service can also send other data to the first application through the long connection, which is not specifically limited here.
[0089] It should be noted that the real-time code scanning login implementation method provided in this application is not intended to replace the existing code scanning login process. Its role is to provide a compensation mechanism for the existing code scanning login process, solving the problem of login failure in some abnormal scenarios. Even in scenarios without abnormalities, it can be used in conjunction with the existing code scanning login process. That is, after the first application generates and displays the login code, it needs to send a login query request to the server with a predetermined query period. If the total query time does not exceed the predetermined time threshold, the server receives a login success message, or the total query time exceeds the predetermined time threshold, the server stops sending login query requests. For example, the first application sends a login query request to the server every 5 seconds; at the same time, after the user confirms the code scanning, the push service sends a login confirmation message to the scanned terminal. When the two are used in combination, whether the first application initiates the query request after receiving the push notification or actively initiates the request every 5 seconds, the purpose of the two is the same. Regardless of which party receives the result first, the user can successfully log in.
[0090] In another embodiment provided by the present application, the process of sending a login query request to the server using the login confirmation information includes: obtaining a first hash value from the login confirmation information; the first hash value is a hash value calculated by the server based on the login credentials carried in the status update request; calculating a second hash value of the login credentials obtained from the server; determining whether the first hash value and the second hash value are the same; if so, sending a login query request to the server.
[0091] Specifically, the login confirmation information sent by the server to the first application through the push service is to inform the first application that a certain login credential has been confirmed by the user. Therefore, the login credential needs to be carried in the login confirmation information. However, in order to ensure the security of the login credential, the original login credential will be converted through a hash algorithm to generate a first hash value, and the first hash value and the status of the login credential will be used to generate the login confirmation information, and then forwarded to the first application on the scanned end through the push service; among them, the status in the login confirmation information is the confirmed status.
[0092] A hash algorithm, also known as a hashing algorithm or hashing algorithm, is a function that transforms input data of any length into an output value of fixed length. This output value is often called a hash value. The key characteristic of a hash algorithm is that the same input data always produces the same hash value, while different input data is likely to produce different hashes.
[0093] Therefore, after the hash conversion, the plaintext login credentials do not need to be transmitted during the transmission process of the entire push link; after the first application receives the login confirmation information sent by the push service, it needs to calculate the local login credentials obtained from the server with the same hash algorithm to generate a second hash value, and determine whether the first hash value and the second hash value are the same. If the first hash value and the second hash value are the same, it is determined that the confirmed login credentials are consistent with the local login credentials. The hash algorithm in this application can be MD5 (Message Digest Algorithm 5), SHA-1 (Secure Hash Algorithm 1), SHA256 (Secure Hash Algorithm 256-bit, Secure Hash Algorithm), etc., which is not specifically limited here.
[0094] From the above, it can be seen that after the first application is started, this application will automatically establish a long connection between the first application and the push service, so that the push service can send the login confirmation information to the first application in a timely manner through the long connection, thereby improving the speed of scanning code login; the server can ensure the security of the login credentials by hashing the login credentials and then sending them to the first application.
[0095] In another embodiment of the present application, a specific code scanning login process is provided to specifically illustrate the present solution. Referring to Figure 3 A specific code scanning login process diagram is provided for the embodiment of the present application. Referring to Figure 4 Another specific code scanning login process diagram is provided for the embodiment of the present application. As shown in the figure, the present embodiment mainly includes the following nodes: smart TV, mobile phone terminal, Passport login service and push service.
[0096] Among them, the smart TV is the scanned end, the first application installed on the smart TV is the TV terminal video software, and the user expects to log in by scanning the two-dimensional code displayed by the TV terminal video software; the mobile phone terminal is the code scanning end, and the second application installed on the mobile phone terminal is the same software as the TV terminal video software or the software under the same company, which is referred to as the mobile phone terminal video software. The user is in a logged-in state at the mobile phone terminal video software; the Passport login service is used to provide account login and registration service, and provides token issuing, mobile phone terminal token confirmation and other functions in the code scanning login scene, and is responsible for managing the changes between different states in the whole life cycle of the token. Passport is used to represent the account related service; the push service is responsible for pushing the specified message to the smart TV.
[0097] Here, the implementation method and interaction details of each step in Figure 3 and Figure 4 are described:
[0098] 1.1, the user opens the smart TV client, and the client silently creates a long connection with the push service; the smart TV client is the video software installed on the smart TV;
[0099] 1.2, after the connection is successfully established, the push service returns the creation success to the video software, and the video software can receive information from the push service in real time;
[0100] 2.1, if the user wants to log in to the video software of the smart TV at this time, he will click the login button in the video software through the remote controller. At this time, the video software will request the account service (Passport login service) to initialize the token required by the two-dimensional code;
[0101] 2.2. The Passport login service returns a token to the video app. After receiving the token, the video app renders it into a QR code and then sends a request to the Passport login service every 5 seconds to check if the token has been confirmed on the phone. The request automatically stops after 30 seconds. Upon receiving the request, the Passport login service returns the current token status. If the token has been confirmed, it returns a successful login and a login certificate. This example uses 5-second and 30-second intervals to illustrate the implementation steps; the specific interval can be adjusted based on actual needs.
[0102] 3.1. The user scans the QR code generated in 2.2 through the video software on the mobile phone;
[0103] 3.2. The video software on the mobile phone obtains the token in the QR code;
[0104] 3.3. The mobile video app requests the Passport login service using the mobile account and the TV token, and updates the token status to "Confirmed", indicating that the user confirms that they want to log in to the TV video app by scanning the code;
[0105] 3.4. The Passport login service returns a confirmation of success to the video software on the mobile phone. Under normal circumstances, after the video software on the TV confirms the token on the mobile phone, it can obtain the information that the token has been confirmed by sending a request every 5 seconds, thus successfully logging in. However, if the QR code page is accidentally closed, or the time interval between the user scanning the code is too long, 2.2 will no longer be able to know that the token has been confirmed by actively asking, and the login will not be successful.
[0106] 4.1. After the Passport login service receives the QR code scan confirmation request from the mobile phone, it simultaneously initiates a request to the push service, converts the original token into a hash value through the hash algorithm, and notifies the push service along with the token status;
[0107] 4.2. After the push service obtains the token status and token hash value, it pushes the data to the video software of the smart TV;
[0108] 4.3. After receiving the notification, if the pushed token hash value matches the local token hash value on the TV, the video software on the smart TV can confirm that the token scanned by the user on the mobile phone is the same token displayed by the QR code on the TV.
[0109] 4.4. The video software of the smart TV re-initiates a query request, which carries the local token;
[0110] 4.5. When the Passport login service queries the token status and it is confirmed, it returns a login success message to the smart TV client.
[0111] As can be seen from the above, by the scheme, the code scanning login failure of a large-screen device such as a smart television that needs to be operated by a remote controller can be reduced, the success rate of code scanning login of a user can be provided, the overall login rate can be improved, and the user experience can be improved.
[0112] In another embodiment of the present application, a code scanning login method is provided, which is applied to a server, and the code scanning login method comprises:
[0113] receiving a state update request sent by a second application of a code scanning end; wherein the state update request is a state update request sent by a user to the server through the second application after the first application of the scanned end generates and displays a login code and the user scans the login code;
[0114] generating login confirmation information according to the state update request;
[0115] sending the login confirmation information to the first application through a push service, so that the first application generates a login inquiry request by using the login confirmation information;
[0116] receiving a login inquiry request sent by the first application, and completing the login operation of the first application according to the login inquiry request.
[0117] It should be noted that the code scanning login method provided by the embodiment and applied to the server has the same specific content as the code scanning login method provided by the above-mentioned embodiment and applied to the first application of the scanned end, and only the execution subject is different, so the present embodiment and any method embodiment can be mutually referred to, and thus the specific description is not repeated here.
[0118] Referring to Figure 5 , Figure 5 A code scanning login device structure diagram is provided for the embodiment of the present application, the code scanning login device is applied to the first application of the scanned end, and the code scanning login device comprises:
[0119] The first receiving module 11 is configured to receive a code scanning login request.
[0120] The first generating module 12 is configured to generate a login code according to the code scanning login request.
[0121] The display module 13 is configured to display the login code, so that the user sends a state update request to the server after scanning the login code through the second application of the code scanning end.
[0122] The second receiving module 14 is configured to receive login confirmation information sent by a push service; wherein the login confirmation information is login confirmation information sent by the server to the first application through the push service after receiving the state update request.
[0123] The first sending module 15 is configured to use the login confirmation information to send a login query request to the server to complete the login operation of the first application.
[0124] As an optional embodiment, the device further includes:
[0125] An establishing module is used to automatically establish a persistent connection between the first application and the push service after the first application is started, so as to transmit interactive data through the persistent connection.
[0126] As an optional embodiment, the second receiving module is specifically configured to:
[0127] Receive login confirmation information sent by the push service through the persistent connection.
[0128] As an optional embodiment, the device further includes:
[0129] The second sending module is used to send a login query request to the server with a predetermined time period as the query cycle after displaying the login code; if a login success message sent by the server is received, or the current total query time exceeds the predetermined time threshold, stop sending the login query request to the server.
[0130] As an optional embodiment, the generation module is specifically used to: obtain login credentials from the server; generate the login code based on the login credentials; wherein, the second application of the code scanning end scans the login code to obtain the login credentials, and sends a status update request to the server, and the status update request includes: the login credentials and account information.
[0131] As an optional embodiment, the device further includes:
[0132] An acquisition module, configured to acquire a first hash value from the login confirmation information; the first hash value is a hash value calculated by the server according to the login credentials carried in the status update request;
[0133] a calculation module, configured to calculate a second hash value of the login credential obtained from the server;
[0134] The judging module is configured to judge whether the first hash value and the second hash value are the same; if so, triggering the first sending module to send a login query request to the server.
[0135] In another embodiment provided by the present application, a code scanning login device is disclosed. The code scanning login device is applied to a server, and the code scanning login device includes:
[0136] a third receiving module, configured to receive a status update request sent by a second application on the scanning end; wherein the status update request is a status update request sent to the server by a user scanning the login code through the second application after the first application on the scanned end generates and displays the login code;
[0137] A second generating module, configured to generate login confirmation information according to the status update request;
[0138] a third sending module, configured to send the login confirmation information to the first application via a push service, so that the first application generates a login query request using the login confirmation information;
[0139] The fourth receiving module is configured to receive a login query request sent by the first application, and complete a login operation of the first application according to the login query request.
[0140] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0141] See also Figure 6 , Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application includes a processor 21, a communication interface 22, a memory 23, and a communication bus 24, wherein the processor 21, the communication interface 22, and the memory 23 communicate with each other via the communication bus 24;
[0142] Memory 23, for storing computer programs;
[0143] The processor 21 is used to execute the program stored in the memory 23 to implement the steps of the code scanning login method described in any of the above method embodiments, which will not be repeated here.
[0144] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0145] The communication interface is used for communication between the above terminal and other devices.
[0146] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0147] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0148] In another exemplary embodiment, a computer storage medium is provided, wherein when the program instructions are executed by a processor, the steps of the code scanning login method described in any of the above method embodiments are implemented. The storage medium may include: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program code.
[0149] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0150] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0151] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A code scanning login method, characterized in that: The code scanning login method is applied to the first application of the scanned terminal, and the code scanning login method includes: Receive scan code login request; Generate a login code according to the scan code login request and display it so that the user can scan the login code through the second application on the code scanning end and then send a status update request to the server end; Receiving login confirmation information sent by the push service; wherein the login confirmation information is: the login confirmation information sent by the server to the first application through the push service after receiving the status update request; Using the login confirmation information, a login query request is sent to the server to complete the login operation of the first application.
2. The code scanning login method according to claim 1, characterized in that: Before receiving the scan code login request, it also includes: After the first application is started, a persistent connection is automatically established between the first application and the push service to transmit interactive data through the persistent connection.
3. The code scanning login method according to claim 2, characterized in that: Receive login confirmation information sent by the push service, including: Receive login confirmation information sent by the push service through the persistent connection.
4. The code scanning login method according to claim 1, characterized in that: After generating and displaying a login code according to the scan code login request, the method further includes: Sending a login query request to the server with a predetermined duration as the query cycle; If a login success message is received from the server, or the total duration of the current inquiry exceeds a predetermined duration threshold, the sending of the login inquiry request to the server is stopped.
5. The code scanning login method according to any one of claims 1 to 4, characterized in that: Generating a login code according to the scan code login request includes: Get login credentials from the server; The login code is generated according to the login credential; wherein, the second application on the code scanning end scans the login code to obtain the login credential, and sends a status update request to the server, wherein the status update request includes: the login credential and account information.
6. The code scanning login method according to claim 5, characterized in that: Using the login confirmation information, sending a login query request to the server, including: Obtaining a first hash value from the login confirmation information; the first hash value is a hash value calculated by the server according to the login credentials carried in the status update request; Calculating a second hash value of the login credential obtained from the server; Determining whether the first hash value is the same as the second hash value; If so, a login query request is sent to the server.
7. A code scanning login method, characterized in that: The code scanning login method is applied to the server, and the code scanning login method includes: Receiving a status update request sent by a second application on the scanning end; wherein the status update request is a status update request sent to the server by a user scanning the login code through the second application after the first application on the scanning end generates and displays the login code; generating login confirmation information according to the status update request; sending the login confirmation information to the first application via a push service, so that the first application generates a login query request using the login confirmation information; A login query request sent by the first application is received, and a login operation of the first application is completed according to the login query request.
8. A code scanning login device, characterized in that: The code scanning login device is applied to the first application of the scanned terminal, and the code scanning login device includes: The first receiving module is used to receive a scan code login request; A first generating module, configured to generate a login code according to the scan code login request; A display module, configured to display a login code so that the user can scan the login code through a second application on the code scanning terminal and then send a status update request to the server; a second receiving module, configured to receive login confirmation information sent by a push service; wherein the login confirmation information is the login confirmation information sent by the server to the first application via the push service after receiving the status update request; The first sending module is used to use the login confirmation information to send a login query request to the server to complete the login operation of the first application.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; The processor is used to implement the steps of the code scanning login method described in any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer storage medium, characterized in that The computer storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the steps of the code scanning login method described in any one of claims 1 to 7.