Small program login method, system and device, storage medium and program product

By using temporary login credential codes, user unified identifiers and encrypted session keys in applet login, the dependence on the fast verification component of WeChat mobile terminal number is reduced, the cost is reduced, and the user experience and security is improved.

CN119675957APending Publication Date: 2025-03-21SHENZHEN QIANHAI EVOC ASIA-PACIFIC ELECTRONIC EQUIP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411861879.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing WeChat applet one-click login technical solution requires payment every time you call WeChat’s mobile terminal number to quickly verify components, resulting in higher fees for companies with large business visits.

Method used

The temporary login credential code is obtained through the client, and it is passed to the server for the user's unified identifier and session key. The server encrypts the session key to generate a preset login key and returns it to the client. The client obtains the mobile terminal number based on the user's unified identifier and preset key, and then passes it to the server to verify and log in to the applet.

Benefits of technology

Reduces the number of times you directly call the application fast mobile terminal number verification component, reduces expenses, and improves user experience and login security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119675957A_ABST
    Figure CN119675957A_ABST
Patent Text Reader

Abstract

The invention discloses an applet login method, system and device, a storage medium and a program product, and the method comprises the steps that a client calls an applet login interface of an application program to obtain a temporary login credential code, and transmits the temporary login credential code to a server to exchange a user uniform identifier and a session key; the server encrypts the session key to generate a preset login key and returns the preset login key to the client; and the server obtains the mobile terminal number bound by the user from the member center through the user uniform identifier sent by the client and feeds back the mobile terminal number to the client, and the client transmits a preset login key and the mobile terminal number to the server for verification and login. According to the method, the mobile terminal number bound by the user is acquired according to the user uniform identifier returned by the application program interface to perform applet login, the number of times of directly calling and applying the rapid mobile terminal number to verify the component is reduced, so that the cost is saved while the user experience is ensured, and meanwhile, the session key is encrypted, so that the user experience is improved. And the security of the whole login process is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to mini-program technology in the field of computer technology, and in particular to mini-program login methods, systems, devices, storage media, and program products. Background Art

[0002] The existing one-click login technical solution for WeChat mini-programs is generally as follows: when a user enters the mini-program, the front-end will call the WeChat mini-program login interface, pass the js_code (temporary login credential code) returned by the authorization to the server, and the server will call the WeChat authentication interface to obtain unionId (user unified identifier) ​​and session_key (session key), and then return the unionId to the mini-program front-end.

[0003] The mini program front end calls the mobile terminal number quick verification component, obtains the code and passes it to the server. The server calls the / wxa / business / getuserphonenumber interface to obtain the mobile terminal number bound to WeChat. The obtained mobile terminal number is passed to the server, and the server calls the user center interface to log in. After successful login, the user center returns the user ID, and the server returns the successful login information to the mini program front end.

[0004] However, the existing WeChat mini-program one-click login technology solution requires payment each time the WeChat mobile terminal number quick verification component is called, which will incur considerable costs for companies with large business visits. Summary of the invention

[0005] The main purpose of this application is to provide a mini-program login method, system, device, storage medium and program product, aiming to solve the technical problem of how to reduce the cost of calling a one-click login mobile terminal number quick verification component and save operating costs.

[0006] To achieve the above purpose, the present application proposes a method for logging into a mini-program, which is applied to a client, on which an application program connected to the mini-program is installed, and the method includes:

[0007] Calling the mini-program login interface of the application to obtain a temporary login credential code, and passing the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key;

[0008] Receive the user unified identifier and the preset login key returned by the server, and send the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and the preset login key and feeds it back to the client;

[0009] The preset login key and the mobile terminal number bound to the user are sent to the server, so that when the preset login key is verified successfully, the server uses the mobile terminal number bound to the user to log in to the mini program.

[0010] In one embodiment, after the step of sending the preset login key and the mobile terminal number bound to the user to the server, the method further includes:

[0011] Receive the successful login information sent by the server, and display the successful login information to the user.

[0012] In addition, to achieve the above purpose, the present application also proposes a mini-program login method, which is applied to the server and includes:

[0013] Receive a temporary login credential code transmitted by a client that has installed an application that has been connected to the mini-program, and obtain a user unified identifier and a session key through the mini-program authentication interface based on the temporary login credential code;

[0014] Encrypting the session key to generate a preset login key, and returning the user unified identifier and the preset login key to the client;

[0015] Receive the user unified identifier sent by the client, obtain the mobile terminal number and preset login key bound to the user from the member center based on the user unified identifier, and feed back to the client;

[0016] Receive the preset login key and the mobile terminal number bound to the user transmitted by the client, and verify the preset login key. If the preset login key verification is successful, use the mobile terminal number bound to the user to log in to the mini program.

[0017] In one embodiment, the step of encrypting the session key, generating a preset login key, and returning the user unified identifier and the preset login key to the client comprises:

[0018] Encrypting the session key according to a preset encryption strategy to generate the preset login key;

[0019] The preset login key is stored in a database, and the user unified identifier and the preset login key are returned to the client.

[0020] In one embodiment, the step of receiving the preset login key and the mobile terminal number bound to the user transmitted by the client, and verifying the preset login key, and if the preset login key verification succeeds, using the mobile terminal number bound to the user to log in to the mini program includes:

[0021] Receiving the mobile terminal number bound to the user and the preset login key transmitted by the client;

[0022] Determining whether the preset login key that meets the preset condition is consistent with the preset login key stored in the database;

[0023] If the preset login key is consistent with the preset login key stored in the database, it is confirmed that the preset login key verification is successful, and the mini program is logged in by calling the member center interface and using the mobile terminal number bound to the user.

[0024] In one embodiment, after the step of calling the member center interface and logging into the mini program using the mobile terminal number bound by the user, the method further includes:

[0025] When a successful login instruction is identified, requesting a user identifier from the member center interface based on the successful login instruction;

[0026] Based on the user identifier, generate login success information;

[0027] The successful login information is returned to the client so that the client can display the successful login information.

[0028] In addition, to achieve the above purpose, the present application also proposes a mini-program login system, the system includes a client and a client, the client includes:

[0029] A transmission module, used for calling the mini-program login interface of the application to obtain a temporary login credential code, and transmitting the temporary login credential code to the server, so that the server obtains the user unified identifier and the session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key;

[0030] The first receiving module is used to receive the user unified identifier and the preset login key returned by the server, and send the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client

[0031] The transmission module is further used to send the preset login key and the mobile terminal number bound to the user to the server, so that the server uses the mobile terminal number bound to the user to log in to the mini program when the preset login key is successfully verified;

[0032] The system further includes a server, which includes:

[0033] A second receiving module is used to receive a temporary login credential code transmitted by a client that has installed an application that has been connected to the mini program, and obtain a user unified identifier and a session key through the mini program authentication interface according to the temporary login credential code;

[0034] An encryption module, used to encrypt the session key, generate a preset login key, and return the user unified identifier and the preset login key to the client;

[0035] The second receiving module is further configured to receive the user unified identifier sent by the client, and based on the user unified identifier, obtain the mobile terminal number bound to the user from the member center and feed it back to the client;

[0036] The login module is used to receive the preset login key and the mobile terminal number bound to the user transmitted by the client, and verify the preset login key. If the preset login key verification is successful, the mobile terminal number bound to the user is used to log in to the mini program.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a mini-program login device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the mini-program login method described above.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the mini-program login method described above are implemented.

[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the mini-program login method described above.

[0040] The embodiment of the present application provides a method, system, device, storage medium and program product for logging into a mini program. Specifically, the client obtains a temporary login credential code and transmits it to the server in exchange for a user unified identifier and a session key; the server encrypts the session key to generate a preset login key and returns it to the client; the client obtains the mobile terminal number based on the user unified identifier and the preset key, and then transmits it to the server for verification and logging into the mini program. This method obtains the mobile terminal number bound to the user according to the user unified identifier returned by the application program interface for login, reducing the number of times the application fast mobile terminal number verification component is directly called, thereby saving costs while ensuring user experience. At the same time, the session key is encrypted to enhance the security of the entire login process. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A flowchart diagram of the first embodiment of the method for logging into the applet of this application;

[0044] Figure 2 A flowchart diagram of the second embodiment of the method for logging into the applet of this application;

[0045] Figure 3 A logic flow chart of generating and comparing preset login keys for the mini-program login method provided in Example 2 of the present application;

[0046] Figure 4 A brief flowchart of the mini-program login method provided in Embodiment 1 and Embodiment 2 of the present application;

[0047] Figure 5 This is a schematic diagram of the module structure of the mini-program login system in the embodiment of the present application;

[0048] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the mini-program login method in the embodiment of the present application.

[0049] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0051] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0052] The main solution of the embodiment of the present application is: calling the mini-program login interface of the application to obtain a temporary login credential code, and passing the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key;

[0053] Receive the user unified identifier and the preset login key returned by the server, and send the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client;

[0054] The preset login key and the mobile terminal number bound to the user are sent to the server, so that when the preset login key is verified successfully, the server uses the mobile terminal number bound to the user to log in to the mini program.

[0055] The existing one-click login technology solution for application mini-programs is generally as follows: when a user enters the application, the front end calls the WeChat application interface and passes the js_code (temporary login credential code) returned by the authorization to the server. The server calls the WeChat interface to obtain unionId (user unified identifier) ​​and session_key (session key), and then returns the unionId to the application front end.

[0056] The front end of the application mini program calls the mobile terminal number quick verification component, obtains the code and passes it to the server. The server calls the / wxa / business / getuserphonenumber interface to obtain the mobile terminal number bound to WeChat. The obtained mobile terminal number is passed to the server, and the server calls the user center interface to log in. After successful login, the user center returns the user ID, and the server returns the successful login information to the application front end.

[0057] The existing one-click login technology solution for applications requires payment every time the WeChat mobile terminal number quick verification component is called, which will incur considerable costs for companies with large business visits.

[0058] The present application provides a solution, wherein the client calls the mini-program login interface of the application to obtain a temporary login credential code, and passes the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key; receives the user unified identifier and preset login key returned by the server, and sends the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client; sends the preset login key and the mobile terminal number bound to the user to the server, so that the server uses the mobile terminal number bound to the user to log in to the mini-program when the preset login key verification succeeds. The solution obtains the mobile terminal number bound to the user for login according to the user unified identifier returned by the application interface, reduces the number of times the quick mobile terminal number verification component of the application is directly called, thereby achieving the purpose of saving, and the mobile terminal number bound to the user in the application can be directly used for quick login when the mobile terminal number bound to the application is subsequently logged in, thereby improving the user experience. At the same time, by encrypting the session key, it is possible to prevent the key from being leaked, thereby causing hackers to arbitrarily pass the mobile terminal number for login, thereby improving security.

[0059] Technical terms involved in the embodiments of this application:

[0060] js_code (temporary login credential code): the code obtained when the application is authorized to log in, used to obtain session_key later.

[0061] unionId (user unified identifier): a unique ID used by applications to distinguish users. For the same user, different applications under the same application open platform have the same unionId.

[0062] Session_key: It is a code generated by application authorization. It is a unique key returned by calling the mini program authentication interface. When using the application, the same user can only have one valid session_key at the same time.

[0063] loginKey (preset login key): the key agreed upon by the backend and the frontend to determine whether to allow login. When a user enters the mini program for the first time, the key is generated by encrypting the session_key returned by calling the mini program authentication interface. It is passed to the backend at login time. The backend takes the session_key from the redis (database) cache, encrypts it, and then verifies it with the key passed by the frontend. If they are consistent, login is allowed. Otherwise, an error message is displayed and login is blocked.

[0064] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a mobile phone as an example to illustrate this embodiment and the following embodiments.

[0065] Based on this, the present application embodiment provides a method for logging into a mini program. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the mini-program login method of the present application.

[0066] In this embodiment, the mini-program login method is applied to a client, and an application is installed on the client. The method includes steps S10 to S30:

[0067] Step S10, calling the mini-program login interface of the application to obtain a temporary login credential code, and passing the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key;

[0068] Optionally, when the user logs in to the application applet on the client, the application applet front end calls the applet login interface provided by the application (for example, wx.login, WeChat login interface), and returns a temporary login credential code after successful authorization. The temporary login credential code is a one-time ticket with a validity period of 5 minutes.

[0069] The application on the client sends the obtained temporary login credential code to the developer's server through a network request, such as an HTTP POST request. The server initiates a request to the application server in exchange for the unionId (user unified identifier) ​​and session_key (session key), and encrypts the session key to generate a preset login key.

[0070] Step S20, receiving the user unified identifier and the preset login key returned by the server, and sending the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client;

[0071] Optionally, after the temporary login credential code is sent to the developer's server through step S10, the server obtains unionId (user unified identifier) ​​and session_key (session key) based on the temporary login credential code, and generates loginKey (preset login key) based on unionId and session_key and returns it to the client. At the same time, the mobile terminal number (such as mobile phone number) bound to the user is obtained from the member center based on unionId. Specifically, the member center queries the user record associated with unionId in the database, especially to find out whether the user has bound the mobile terminal number. If the user associated with unionId is found and the user has bound the mobile terminal number, the member center returns the mobile terminal number to the client as part of the response.

[0072] Among them, the mobile terminal number bound to the user saved in the member center is the mobile terminal number authorization function of the application configured with the authorized application software, and the user is requested to authorize the acquisition of the mobile terminal number through the application interface provided by the authorized application software.

[0073] Step S30, sending the preset login key and the mobile terminal number bound to the user to the server, so that the server uses the mobile terminal number bound to the user to log in to the mini program when the preset login key is verified successfully.

[0074] Optionally, when the mini program on the client receives the user-bound mobile terminal number returned by the membership center, the mobile terminal number and loginKey bound to the user are passed to the server for consistency verification using a preset login key. If the verification passes, the mobile terminal number bound to the user is used to log in to the application mini program with one click.

[0075] When the server successfully logs in, it will return a successful login message to the application on the client. After receiving the response returned by the server, the application will parse the response to confirm whether it is a successful login message. If the response indicates that the login is successful, the application will display a successful login prompt message to the user. This can be achieved by popping up a prompt box, updating the page content, jumping to the homepage, etc. Through this step, the application can effectively receive the successful login message sent by the server and display the successful login prompt to the user. This not only improves the user experience, but also ensures that users can understand their login status in a timely manner.

[0076] The above-mentioned embodiment method specifically includes the client calling the mini-program login interface of the application to obtain a temporary login credential code, and passing the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key; receiving the user unified identifier and the preset login key returned by the server, and sending the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client; sending the preset login key and the mobile terminal number bound to the user to the server, so that the server uses the mobile terminal number bound to the user to log in to the mini-program when the preset login key verification succeeds. This method obtains the mobile terminal number for login according to the user unified identifier returned by the application interface, reduces the number of direct calls to the application fast mobile terminal number verification component, thereby saving costs while ensuring user experience, and at the same time, encrypts the session key to enhance the security of the entire login process.

[0077] Based on this, the present application embodiment provides a method for logging into a mini program. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the mini-program login method of the present application.

[0078] In this embodiment, the mini-program login method is applied to the server, and the method includes steps S40 to S70:

[0079] Step S40, receiving a temporary login credential code transmitted by a client having installed an application program connected to the mini program, and obtaining a user unified identifier and a session key through the mini program authentication interface according to the temporary login credential code;

[0080] Optionally, when the application applet on the client obtains the temporary login credential code by calling the applet login interface and passes it to the server, the server receives the temporary login credential code and initiates a request to the server of the authorized application software through the applet authentication interface (for example, / sns / jscode2session interface) to obtain the corresponding unionId (user unified identifier) ​​and session_key (session key).

[0081] Step S50, encrypting the session key to generate a preset login key, and returning the user unified identifier and the preset login key to the client;

[0082] It is worth noting that in order to avoid leakage and tampering during the transmission and storage of session_key, executing step S50 can improve the security of the system, simplify the login process, and enhance the user experience.

[0083] In a feasible embodiment, step S50 further includes steps S51 to S53:

[0084] Step S51, encrypting the session key according to a preset encryption strategy to generate the preset login key;

[0085] Optionally, after the application obtains the session_key through the application program interface, the application program then intercepts the 0th to the fourth last digit of the session_key. For example, if the session_key is abcdefg1234567890, the interception results in abcdefg123456. Subsequently, the intercepted session_key is encrypted using the AES-256-CBC algorithm to generate the loginKey (preset login key).

[0086] In summary, by intercepting session_key and encrypting it to generate loginKey, the system security can be improved, the login process can be simplified, and the user experience can be enhanced. This not only reduces the risk of direct exposure of sensitive information, but also provides a more secure identity authentication mechanism.

[0087] Step S52: store the preset login key in a database, and return the user unified identifier and the preset login key to the client.

[0088] Optionally, after the loginKey is generated through step S41, the loginKey is first stored in Redis (database) for consistency verification with the loginKey in the database when the server receives the loginKey returned by the application, so as to verify whether the loginKey returned by the application has been tampered with, so as to ensure the security of the system.

[0089] Then extract a loginKey from Redis, and return the loginKey and unionId to the client. After receiving the loginKey and unionId, the client returns the unionId to the server for obtaining the mobile terminal number bound to the user from the member center.

[0090] Step S60: receiving the user unified identifier sent by the client, and based on the user unified identifier, obtaining the mobile terminal number bound to the user from the member center and feeding back the number to the client.

[0091] It should be noted that the member center refers to a system or database that centrally manages user information and member data. It stores detailed information of users, including but not limited to basic personal information (such as name, gender), contact information (such as email address, mobile terminal number), member level, points balance, consumption records, etc.

[0092] Specifically, when the server receives the unionId sent by the client through the API, it uses the user unified identifier as the query condition, accesses the member center database or the corresponding service interface, and searches for the user record associated with the identifier. Once a matching user record is found, the bound mobile terminal number is extracted from it. An HTTP response containing the found mobile terminal number is created. The constructed response is sent back to the client through the network to complete the information feedback.

[0093] Step S70, receiving the preset login key and the mobile terminal number bound to the user transmitted by the client, and verifying the preset login key. If the preset login key verification is successful, the mobile terminal number bound to the user is used to log in to the mini program.

[0094] It is worth noting that in order to avoid the preset login key delivered by the application being inconsistent with the preset login key originally stored in the database, thereby causing login failure or security problems, therefore, executing step S70 can verify the consistency of the loginKey and improve the security of the system.

[0095] In a feasible embodiment, step S70 further includes steps S71 to S73:

[0096] Step S71, receiving the mobile terminal number bound to the user and the preset login key transmitted by the client;

[0097] Optionally, through step S20, the client can obtain the mobile terminal number through the member center, and return the mobile terminal number and loginKey (preset login key) to the server through a network request (such as HTTP POST). After the server receives the request from the application, it parses the loginKey in the request. The loginKey is extracted from the database by the server and returned to the application, and the application uses it to obtain the mobile terminal number.

[0098] Step S72, determining whether the preset login key is consistent with the preset login key stored in the database;

[0099] Optionally, the loginKey passed by the client is compared with the loginKey stored in the database to see if they are consistent.

[0100] Step S73, if the preset login key is consistent with the preset login key stored in the database, confirm that the preset login key verification is successful, and log in to the mini program by calling the member center interface and using the mobile terminal number bound to the user.

[0101] Optionally, if the loginKey matches successfully, the member center interface is called to use the mobile terminal number bound by the user to perform one-click login to the mini program, and a login success instruction is generated. When the server recognizes the login success instruction, it requests memberId from the member center interface based on the login success instruction, and generates login success information based on the memberId, and returns the login success information and memberId to the server. The server then returns the login success information to the application, so that the application can display the login success information to the user in the form of a pop-up window or voice.

[0102] Through the above-mentioned embodiment method, the server receives the temporary login credential code transmitted by the client of the application program that has been connected to the mini program, and obtains the user unified identifier and session key through the mini program authentication interface according to the temporary login credential code; encrypts the session key, generates a preset login key, and returns the user unified identifier and the preset login key to the client; receives the user unified identifier sent by the client, obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client; receives the preset login key and the mobile terminal number bound to the user transmitted by the client, and verifies the preset login key. If the preset login key verification succeeds, the mobile terminal number bound to the user is used to log in to the mini program. This method obtains the mobile terminal number bound to the user through the user unified identifier for login, reduces the number of times the quick mobile terminal number verification component is directly called for application, thereby achieving the purpose of saving, and the mobile terminal number bound to the user in the application can be directly used for quick login when the mobile terminal number bound to the application is subsequently logged in, thereby improving the user experience. At the same time, by encrypting the session key, it is possible to prevent the key from being leaked, thereby causing hackers to arbitrarily pass the mobile terminal number for login, thereby improving security.

[0103] For example, to help understand the implementation process of the mini-program login method obtained by combining this embodiment with the above-mentioned embodiment 2, please refer to Figure 3 , Figure 3 A logic flow chart of generating and comparing preset login keys for a mini-program login method is provided, specifically:

[0104] The server obtains the session_key by requesting the application interface, where the application interface can be the WeChat / sns / jscode2session interface. Then the 0th to the last 4th digits of the session_key are intercepted, and the loginKey is generated after encryption according to the secretKey agreed upon by the application front end and returned to the front end. When the application front end logs in, the loginKey and the mobile terminal number are passed to the server. The server obtains the sessionKey from the Redis cache, encrypts it according to the agreed secretKey to generate the loginKey, and then compares it with the loginKey passed in by the application to see if they are consistent. If they are consistent, it means that the login using the mobile terminal number is successful.

[0105] Through the above embodiment method, not only the session_key is intercepted and then encrypted with a specific secretKey, which further improves the security of the data, but also a set of authentication mechanisms based on loginKey is established between the client and the server in advance, making the entire login process more concise and clear. The user only needs to provide the mobile terminal number and the loginKey generated by the information returned by the front end to complete the login operation, without the need to enter a password or other complex information.

[0106] For example, to help understand the implementation process of the mini-program login method obtained by combining the above-mentioned embodiment 1 and embodiment 2, please refer to Figure 4 , Figure 4 A brief flowchart of a method for logging into a mini program is provided, specifically:

[0107] When the user enters the application, the application needs to call the application authorization and pass the data returned by the authorization to the server. The server calls the application interface to obtain the unionId and session_key, encrypts the session_key to generate a loginKey, saves it in the server database, and returns a loginKey to the client.

[0108] Subsequently, the client passes the obtained unionId to the client, and the client obtains the mobile terminal number bound to the user from the member center based on the unionId, and feeds back the mobile terminal number bound to the user to the client. After receiving the mobile terminal number bound to the user, the client passes it and the loginKey to the server. The server verifies whether the loginKey passed by the client is consistent with the loginKey stored in the database. If they are consistent, the member center interface is called to use the mobile terminal number bound to the user for one-click login to the mini program. After successful login, the member center returns memberId, and the server returns the successful login information to the client.

[0109] Through the above-mentioned embodiment method, the application on the client obtains a temporary login credential code and transmits it to the server in exchange for a user unified identifier and a session key; the server encrypts the session key to generate a preset login key and returns it to the client; the client sends the user unified identifier to the client, so that the client obtains the bound mobile terminal number from the member center based on the user unified identifier and returns it to the client; the client sends the preset login key and the user-bound mobile terminal number to the server for verification, and when the verification is successful, the user-bound mobile terminal number is used to log in to the mini program with one click. This method obtains the user's bound mobile terminal number according to the user unified identifier returned by the application interface for login, reduces the number of direct calls to the application's fast mobile terminal number verification component, thereby saving costs and improving user experience. At the same time, the session key is encrypted to enhance the security of the entire login process.

[0110] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the mini-program login method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0111] This application also provides a small program login system, please refer to Figure 5 , the system includes a client and a server, the client includes:

[0112] The transmission module 10 is used to call the mini-program login interface of the application to obtain a temporary login credential code, and transmit the temporary login credential code to the server, so that the server obtains the user unified identifier and the session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key;

[0113] The first receiving module 20 is used to receive the user unified identifier and the preset login key returned by the server, and send the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client;

[0114] The transmission module 10 is further used to send the preset login key and the mobile terminal number bound to the user to the server, so that the server uses the mobile terminal number bound to the user to log in to the mini program when the preset login key is successfully verified;

[0115] The server includes:

[0116] The second receiving module 30 is used to receive a temporary login credential code transmitted by a client having installed an application program connected to the mini program, and obtain a user unified identifier and a session key through the mini program authentication interface according to the temporary login credential code;

[0117] The encryption module 40 is used to encrypt the session key, generate a preset login key, and return the user unified identifier and the preset login key to the client;

[0118] The second receiving module 30 is further configured to receive the user unified identifier sent by the client, obtain the mobile terminal number bound to the user from the member center based on the user unified identifier, and feed the mobile terminal number back to the client;

[0119] The login module 50 is used to receive the preset login key and the mobile terminal number bound to the user transmitted by the client, and verify the preset login key. If the preset login key verification is successful, the mobile terminal number bound to the user is used to log in to the mini program.

[0120] The mini-program login system provided by the present application adopts the mini-program login method in the above-mentioned embodiment, which can solve the technical problem of how to reduce the cost of calling the one-click login mobile terminal number quick verification component and save operating costs. Compared with the prior art, the beneficial effects of the mini-program login system provided by the present application are the same as the beneficial effects of the mini-program login method provided by the above-mentioned embodiment, and the other technical features of the mini-program login system are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0121] The present application provides a mini-program login device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the mini-program login method in the above-mentioned embodiment one.

[0122] Reference below Figure 6 , which shows a schematic diagram of the structure of a small program login device suitable for implementing the embodiment of the present application. The small program login device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The mini-program login device shown is merely an example and should not bring any limitations to the functions and scope of use of the embodiments of the present application.

[0123] like Figure 6 As shown, the applet login device may include a processing system 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage system 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the applet login device are also stored. The processing system 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage system 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication system 1009. The communication system 1009 can allow the applet login device to communicate wirelessly or wired with other devices to exchange data. Although the applet login device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided alternatively.

[0124] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication system, or installed from a storage system 1003, or installed from a ROM 1002. When the computer program is executed by the processing system 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0125] The mini-program login device provided by the present application adopts the mini-program login method in the above embodiment, which can solve the technical problem of how to reduce the cost of calling the one-click login mobile terminal number quick verification component and save operating costs. Compared with the prior art, the beneficial effects of the mini-program login device provided by the present application are the same as the beneficial effects of the mini-program login method provided by the above embodiment, and the other technical features in the mini-program login device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0126] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0128] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the mini-program login method in the above-mentioned embodiment.

[0129] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0130] The above-mentioned computer-readable storage medium may be included in the mini-program login device; or it may exist independently without being assembled into the mini-program login device.

[0131] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the mini-program login device, the mini-program login device: obtains a temporary login credential code by calling the application program interface through the client, and passes the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the application program interface according to the temporary login credential code and generates a preset login key after encryption; receives the user unified identifier and preset login key returned by the server, and obtains the mobile terminal number in the member center based on the user unified identifier and the preset login key; passes the mobile terminal number and the preset login key to the server for the server to verify the preset login key. When the preset login key passes the verification, the mobile terminal number is used to log in.

[0132] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0133] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0134] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0135] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned small program login method, and can solve the technical problem of how to reduce the cost of calling the one-click login mobile terminal number quick verification component and save operating costs. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the small program login method provided by the above-mentioned embodiment, and will not be repeated here.

[0136] The present application also provides a computer program product, including a computer program, which implements the steps of the mini-program login method as described above when executed by a processor.

[0137] The computer program product provided by this application can solve the technical problem of how to reduce the cost of calling the one-click login mobile terminal number quick verification component and save operating costs. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the mini-program login method provided in the above embodiment, which will not be repeated here.

[0138] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for logging into a mini program, characterized in that: The method is applied to a client, on which an application program that has been connected to a mini-program is installed, and the method includes: Calling the mini-program login interface of the application to obtain a temporary login credential code, and passing the temporary login credential code to the server, so that the server obtains the user unified identifier and session key through the mini-program authentication interface of the application according to the temporary login credential code, and encrypts the session key to generate a preset login key; Receive the user unified identifier and the preset login key returned by the server, and send the user unified identifier to the server, so that the server obtains the mobile terminal number bound to the user from the member center based on the user unified identifier and feeds it back to the client; The preset login key and the mobile terminal number bound to the user are sent to the server, so that when the preset login key is verified successfully, the server uses the mobile terminal number bound to the user to log in to the mini program.

2. The method according to claim 1, characterized in that After the step of sending the preset login key and the mobile terminal number bound to the user to the server, the method further includes: Receive the successful login information sent by the server and display the successful login information.

3. A method for logging into a mini program, characterized in that: The method is applied to the server, and the method includes: Receive a temporary login credential code transmitted by a client that has installed an application that has been connected to the mini-program, and obtain a user unified identifier and a session key through the mini-program authentication interface based on the temporary login credential code; Encrypting the session key to generate a preset login key, and returning the user unified identifier and the preset login key to the client; Receive the user unified identifier sent by the client, obtain the mobile terminal number bound to the user from the member center based on the user unified identifier, and feed it back to the client; Receive the preset login key and the mobile terminal number bound to the user transmitted by the client, and verify the preset login key. If the preset login key verification is successful, use the mobile terminal number bound to the user to log in to the mini program.

4. The method according to claim 3, characterized in that The step of encrypting the session key, generating a preset login key, and returning the user unified identifier and the preset login key to the client comprises: Encrypting the session key according to a preset encryption strategy to generate the preset login key; The preset login key is stored in a database, and the user unified identifier and the preset login key are returned to the client.

5. The method according to claim 3, characterized in that The step of receiving the preset login key and the mobile terminal number bound to the user transmitted by the client, and verifying the preset login key, and if the preset login key verification succeeds, using the mobile terminal number bound to the user to log in to the mini program includes: Receiving the mobile terminal number bound to the user and the preset login key transmitted by the client; Determining whether the preset login key is consistent with the preset login key stored in the database; If the preset login key is consistent with the preset login key stored in the database, it is confirmed that the preset login key verification is successful, and the mini program is logged in by calling the member center interface and using the mobile terminal number bound to the user.

6. The method according to claim 5, characterized in that After the step of calling the member center interface and logging into the mini program using the mobile terminal number bound by the user, the method further includes: When a successful login instruction is identified, requesting a user identifier from the member center interface based on the successful login instruction; Based on the user identifier, generate login success information; The successful login information is returned to the client so that the client can display the successful login information.

7. A mini-program login system, characterized in that: It includes a client and a server; the client is installed with an application that has been connected to the mini program; The client is used to execute the mini program login method described in any one of claims 1 to 2; The server is used to execute the mini program login method described in any one of claims 3 to 6.

8. A mini-program login device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the mini-program login method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the mini-program login method as described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product includes a computer program, which, when executed by a processor, implements the steps of the mini-program login method as described in any one of claims 1 to 6.