Account logout method, system, device and storage medium based on near-field communication
By using near-field communication technology to generate a target token and public key on the server side for hash operation, the tedious problem of users logging out of their accounts one by one on multiple terminals is solved, and an efficient and secure account logout process is achieved without manual operation.
Patent Information
- Application Number
- CN202310657823.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-06-05
AI Technical Summary
In the prior art, users need to log out of the same account one by one on multiple terminals, which is very cumbersome especially for older users.
Through near-field communication (NFC) technology, the server generates a target token and public key for hash operation to generate a target hash value, and communicates between different terminals through prompt information and the target hash value to automatically log out of the target account.
It enables users to log out of the same account on multiple terminals without manual operation, improving efficiency and security. It is especially user-friendly for elderly users and easy to understand and operate.
Smart Images

Figure CN116582278B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and in particular to an account logout method, system, device, and storage medium based on near-field communication. Background Art
[0002] Nowadays, most application software across different systems supports logging in with the same account on multiple devices. This facilitates users' ability to use the same software across different devices, enabling, for example, data synchronization across multiple devices, improving user efficiency. However, when users need to log out of their accounts, they must perform the same logout operation on each device in turn, making the process extremely cumbersome, especially for older users. Summary of the Invention
[0003] In view of this, one of the purposes of this application is to provide an account logout method, system, device and storage medium based on near-field communication, which can at least solve some of the above-mentioned technical problems.
[0004] In a first aspect, an embodiment of the present application provides an account logout method based on near field communication, which is applied to a server. The method includes:
[0005] receiving a first access request from a first terminal, the first access request including a target account number, for requesting the server to log out of the target account on a second terminal, wherein the first terminal and the second terminal are different terminals;
[0006] Generate a target token and a server public key according to the first access request;
[0007] Performing a hash operation on the target token and the server public key according to a preset hash algorithm to obtain a target hash value, and storing the target hash value, the target token, and the target account in association;
[0008] Generate prompt information, and send the prompt information and the target hash value to the first terminal, where the prompt information is used to prompt the first terminal to approach the second terminal, and the first terminal is used to send the target hash value to the second terminal through near field communication when the first terminal is close to the second terminal;
[0009] receiving a second access request from the second terminal, the second access request including the target hash value and all initial accounts logged in on the second terminal;
[0010] querying the associated target account according to the target hash value, and generating a logout instruction if the target account is detected among all the initial accounts;
[0011] The logout instruction is sent to the second terminal, where the logout instruction is used to instruct the second terminal to log out of the target account.
[0012] In one possible implementation, the first access request further includes a first timestamp, where the first timestamp is used to indicate a generation time of the first access request. The performing a hash operation on the target token and the server public key according to a preset hash algorithm to obtain a target hash value includes:
[0013] A hash operation is performed on the target token, the server-side public key and the first timestamp according to the preset hash algorithm to obtain the target hash value.
[0014] In a possible implementation, the second access request further includes a second timestamp, wherein the second timestamp is used to indicate the time when the second access request was generated. Before querying the associated target account according to the target hash value, the method further includes:
[0015] Parsing the target hash value to obtain the first timestamp;
[0016] Calculating the interval between the first timestamp and the second timestamp;
[0017] When it is detected that the interval duration is less than or equal to the preset duration, determining that the target hash value is valid;
[0018] When it is detected that the interval time is greater than the preset time, the target hash value is determined to be invalid and the step of receiving the first access request from the first terminal is repeated until a new target hash value is determined to be valid.
[0019] In a possible implementation, generating a logout instruction when detecting that the target account exists among all the initial accounts includes:
[0020] Acquiring historical session information between the second terminal and the server;
[0021] In the case where it is detected that the target account exists in all the initial accounts, a logout instruction is generated according to the historical session information and the target token.
[0022] In one possible implementation, the method further includes:
[0023] receiving a feedback instruction and generating an NFC on instruction according to the feedback instruction, wherein the feedback instruction is generated by the first terminal when detecting a failure in sending the target hash value to the second terminal, and is used to feedback to the server that the NFC of the second terminal is in a turned-off state;
[0024] The NFC activation instruction is sent to the first terminal, and the first terminal is further configured to send the NFC activation instruction to the second terminal via Bluetooth, wherein the NFC activation instruction is used to instruct the second terminal to activate NFC.
[0025] In a second aspect, an embodiment of the present application provides an account logout method based on near field communication, applied to a first terminal, the method comprising:
[0026] Generate a first access request and send the first access request to the server, so that the server executes the steps of the account logout method based on near field communication as described in the first aspect.
[0027] In one possible implementation, the method further includes:
[0028] In a case where it is detected that sending the target hash value to the second terminal fails, generating a feedback instruction and sending the feedback instruction to the server, so that the server generates an NFC turn-on instruction, wherein the feedback instruction is used to feedback to the server that the NFC of the second terminal is in a turned-off state;
[0029] The NFC activation instruction is received and sent to the second terminal via Bluetooth, wherein the NFC activation instruction is used to instruct the second terminal to activate NFC.
[0030] In a third aspect, an embodiment of the present application provides an account logout method based on near field communication, which is applied to a second terminal, and the method includes:
[0031] Receiving a logout instruction generated by the server by executing the steps of the account logout method based on near field communication as described in the first aspect;
[0032] Log out of the target account according to the logout instruction.
[0033] In a fourth aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the computer device implements:
[0034] The account logout method based on near field communication as described in the first aspect; and / or,
[0035] The account logout method based on near field communication as described in the second aspect; and / or,
[0036] The account logout method based on near field communication as described in the third aspect.
[0037] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by one or more processors, the computer program implements:
[0038] The account logout method based on near field communication as described in the first aspect; and / or,
[0039] The account logout method based on near field communication as described in the second aspect; and / or,
[0040] The account logout method based on near field communication as described in the third aspect.
[0041] The account logout method based on near-field communication provided in the embodiment of the present application receives a first access request from a first terminal, generates a target token and a server-side public key according to the first access request, performs a hash operation on the target token and the server-side public key according to a preset hash algorithm, obtains a target hash value, and stores the target hash value, the target token, and the target account in association. A prompt message is then generated and sent to the first terminal. The prompt message is used to prompt the first terminal to approach the second terminal. The first terminal is used to send the target hash value to the second terminal via near-field communication when it is close to the second terminal. Then, a second access request from the second terminal is received, and the associated target account is queried based on the target hash value. When the target account is detected in all the initial accounts, a logout instruction is generated. Finally, the logout instruction is sent to the second terminal. The logout instruction is used to instruct the second terminal to log out of the target account. The entire process does not require the user to operate multiple second terminals separately to log out of the same account, thereby improving the efficiency and security of the user logging out of the same account on multiple terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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. It should be understood that the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A schematic diagram of an application environment for an account logout method based on near field communication provided in an embodiment of the present application;
[0044] Figure 2A flowchart of an account logout method based on near field communication provided in an embodiment of the present application;
[0045] Figure 3 A diagram of the internal structure of a computer device provided in an embodiment of the present application.
[0046] Description of reference numerals:
[0047] First terminal 110 , second terminal 120 , server 130 . DETAILED DESCRIPTION
[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.
[0051] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0052] In various embodiments of the present application, the expression "or" or "at least one of A or / and B" includes any or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0053] In the description of this application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the invented product is usually placed when in use. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application.
[0054] In addition, the terms "first", "second", etc., if used, are merely used to distinguish and describe, and should not be understood as indicating or implying relative importance.
[0055] It should be noted that, in the absence of conflict, the features in the embodiments of this application can be combined with each other.
[0056] See Figure 1 , Figure 1 A schematic diagram of the application environment of an account logout method based on near field communication provided in an embodiment of the present application. The method can be applied to an account logout system based on near field communication. The system may include a first terminal 110, a second terminal 120 and a server 130. The first terminal 110 and the second terminal 120 are respectively connected to the server 130 through a network. The first terminal 110 and the second terminal 120 can specifically be desktop terminals or mobile terminals with near field communication functions. The mobile terminal can specifically be at least one of a mobile phone, a tablet computer and a notebook. The server 130 can be implemented as an independent server 130 or a server cluster composed of multiple servers 130. The first terminal 110 is used to send a logout request of the target account to the server 130. The server 130 is used to log out of the target account on the second terminal 120 according to the logout request of the target account. The second terminal 120 is used to log out of the target account according to the instruction of the server 130.
[0057] See Figure 2 , Figure 2 A flowchart of a near field communication method is provided in an embodiment of the present application. The following describes each step of the method in detail.
[0058] S210: Receive a first access request from a first terminal, where the first access request includes a target account and is used to request a server to log out of the target account on a second terminal, wherein the first terminal and the second terminal are different terminals.
[0059] In this embodiment, the introduction to the first terminal 110 and the second terminal 120 is referred to the introduction to the above embodiment. The first terminal 110 can be a different terminal and will not be further described here. The target account can be any of a bank savings account, checking account, credit card account, loan account, and fund account. Taking a savings account as an example, the first terminal 110, such as a mobile phone, and the second terminal 120, such as a tablet computer, are both logged into the same savings account. A user can log out of the savings account on the second terminal 120, such as a tablet computer, through the first terminal 110, such as a mobile phone. Specifically, the first terminal 110 generates a first access request, which is then received, verified, and processed by the server 130, thereby enabling the second terminal 120, such as a tablet computer, to log out of the savings account. Both the first terminal 110 and the second terminal 120 can be multiple sub-terminals, such as multiple smartphones or tablet computers.
[0060] S220: Generate a target token and a server public key according to the first access request.
[0061] In this embodiment, the target token can be used as a way to verify identity. The generated token can ensure that the operating user of the first terminal 110 is a legitimate user who has been authenticated and authorized. The server 130 generates the target token to represent that the operating user of the first terminal 110 is a legitimate user. In addition, the target token can also be used for authorization, such as allowing the operating user of the first terminal 110 to access some resources and functions through the first terminal 110. In short, the use of the target token can improve the security of the system. Using the target token for identity authentication and authorization can avoid security threats such as plaintext password leakage and session hijacking.
[0062] In a public-key cryptography system, the server generates a public key and a private key. The public key is publicly available, while the private key is held only by the server 130. The server's public key ensures confidentiality and integrity in communications between the first terminal 110 and the server 130, preventing third parties from eavesdropping or tampering with the communication data. Furthermore, the server's public key can be used to authenticate the identity of the server 130, preventing malicious attackers from impersonating the server 130 to conduct fraud and attacks.
[0063] This embodiment can improve the security of the session between the first terminal 110 and the server 130 by generating a server-side public key, especially in scenarios involving requests to withdraw from a bank account, and can further reduce the risk of bank account disclosure during the session.
[0064] S230, performing a hash operation on the target token and the server-side public key according to a preset hash algorithm to obtain a target hash value, and then associating and storing the target hash value, the target token, and the target account.
[0065] In this embodiment, the preset hash algorithm includes at least one of the MD5 hash algorithm, the SHA hash algorithm, and the DES hash algorithm. The specific hash algorithm can be selected based on actual needs and is not limited here. A target hash value is generated based on the target token and the server-side public key. Due to the unidirectional nature of hash values, external users cannot infer the original data based on the target hash value in this embodiment, further reducing the risk of leakage of the target account, such as a bank account number, and improving the security of the entire process of the first terminal 110 requesting to withdraw from the bank account on the second terminal 120.
[0066] To facilitate subsequent data verification and query, the server 130 may associate and store the target hash value, target token, and target account.
[0067] S240: Generate prompt information and send the prompt information and the target hash value to the first terminal. The prompt information is used to prompt the first terminal to approach the second terminal. The first terminal is used to send the target hash value to the second terminal through near field communication when it is close to the second terminal.
[0068] In this embodiment, considering that the application scenario of the first terminal 110 requesting to exit the target account on the second terminal 120 is near field communication, wherein near field communication may include any one of WiFi, Bluetooth, NFC and RFID, all of which are applicable to this embodiment, considering that the near field communication request to exit the target account, especially for exiting the bank account, needs to ensure security to avoid unnecessary security risks caused by the leakage of the bank account, the applicable scenario in this embodiment can select NFC or RFID, wherein, considering that NFC technology is evolved from the integration of RFID technology and interoperability technology, the scenarios in this embodiment and the following embodiments are all explained with near field communication formed by NFC. It should be noted that near field communication technologies similar to NFC should all be within the protection scope of this embodiment.
[0069] After explaining the applicable scenarios of this embodiment, it is clear to understand why the server 130 generates the prompt information, that is, the prompt information generated by the server 130 can prompt the first terminal 110 to approach the second terminal 120. The prompt information can be text such as "Please approach the account device". The prompt information can also be a graphic, which can be a dynamic process of two mobile phones approaching each other. This makes it easier for older users to quickly judge the intention of the prompt information and perform corresponding approach operations based on the first terminal 110, so that users can understand what they need to do at a glance, which can also improve user stickiness.
[0070] Among them, both the first terminal 110 and the second terminal 120 have NFC functions. In other words, a first NFC tag is provided in the first terminal 110, and a second NFC tag is provided in the second terminal 120. Considering that the implementation distance of existing NFC sensing is generally within 10 cm, the first terminal 110 in this embodiment is close to the second terminal 120, which can be understood as the distance between the first NFC tag and the second NFC tag is less than or equal to 10 cm.
[0071] S250: Receive a second access request from the second terminal, where the second access request includes a target hash value and all initial accounts logged in on the second terminal.
[0072] Specifically, the second access request includes the target hash value sent by the first terminal 110 and all initial accounts logged in on the second terminal 120. The server 130 can perform further verification and analysis based on the second access request to ensure the validity and security of the second request.
[0073] S260: query the associated target account according to the target hash value, and generate an exit instruction when it is detected that the target account exists in all the initial accounts.
[0074] S270: Send a logout instruction to the second terminal, where the logout instruction is used to instruct the second terminal to log out of the target account.
[0075] Specifically, the server 130 can query the target account indirectly associated with the target hash value based on the associated stored information in the above embodiment, and compare the target account with all the initial accounts. If the target account exists in all the initial accounts, the server 130 can generate an exit instruction, and the second terminal 120 can perform an exit operation on the target account according to the exit instruction.
[0076] From the above analysis, it can be seen that the account logout method based on near-field communication provided in the embodiment of the present application receives a first access request from a first terminal, generates a target token and a server-side public key according to the first access request, and then performs a hash operation on the target token and the server-side public key according to a preset hash algorithm to obtain a target hash value, which can prevent malicious attacks and improve the security of communication between the first terminal and the server. Then, a prompt message is generated and sent to the first terminal. The first terminal is used to send the target hash value to the second terminal through near-field communication when it is close to the second terminal. Then, a second access request from the second terminal is received, and the associated target account is queried according to the target hash value. When the target account is detected in all the initial accounts, a logout instruction is generated, and finally the logout instruction is sent to the second terminal. The logout instruction is used to instruct the second terminal to log out of the target account. The entire process does not require the user to operate multiple second terminals separately to log out of the same account, which improves the efficiency of users logging out of the same account on multiple terminals. In addition, the prompt information can be set in a variety of ways, which is easier for older users to understand and can also improve user stickiness.
[0077] To ensure the security of exiting the target account, especially a bank account, or to meet the compliance requirements of some industries, such as banks, regarding characteristics such as system usage period and verification information expiration time, in one possible implementation, the first access request also includes a first timestamp, where the first timestamp is used to indicate the generation time of the first access request. A hash operation is performed on the target token and the server-side public key according to a preset hash algorithm to obtain a target hash value, including:
[0078] A hash operation is performed on the target token, the server-side public key and the first timestamp according to a preset hash algorithm to obtain a target hash value.
[0079] Specifically, this implementation introduces a first timestamp in the process of calculating the target hash value. The first timestamp can be used to determine the generation time of the first access request. Considering the short response time of the server 130, the first timestamp can be used as the generation time of the target hash value, which facilitates further verification of the validity period of the target hash value and ensures the legitimacy and security of the entire process of the first terminal 110 requesting to exit the target account on the second terminal 120.
[0080] Optionally, the second access request further includes a second timestamp, where the second timestamp is used to indicate the time when the second access request was generated. Before querying the associated target account according to the target hash value, the method further includes:
[0081] Parse the target hash value to get the first timestamp;
[0082] Calculate the interval between the first timestamp and the second timestamp;
[0083] When it is detected that the interval time is less than or equal to the preset time, the target hash value is determined to be valid;
[0084] When it is detected that the interval time is longer than the preset time, the target hash value is determined to be invalid and the step of receiving the first access request from the first terminal 110 is repeated until a new target hash value is determined to be valid.
[0085] In this embodiment, the second timestamp is the moment when the second access request is generated. The second timestamp can also participate in the process of server 130 verifying the validity of the target hash value, that is, calculating the interval between the first timestamp and the second timestamp and comparing it with a preset time length such as 1min, 2min or 10min. If the preset time length is 1min and the interval length is 30s, the server 130 can determine that the target hash value is valid and can further process the second access request. If the server 130 determines that the target hash value is invalid, the first terminal 110 needs to resend the first access request and repeat the steps in the above embodiment until the server 130 determines that the new target hash value is valid.
[0086] The preset duration can be set according to the actual scenario. The examples in this embodiment are only for explanation and do not specifically limit the preset duration.
[0087] It is understandable that in general scenarios, the validity period of the target hash value is often set to permanent. However, considering that the target account to be exited involves a bank account, in order to ensure the security of the bank account and avoid malicious attacks during the process of exiting the bank account, thereby causing unnecessary economic losses to bank users, the target hash value in this embodiment is set to a shorter validity period. The server 130 needs to verify the validity period of the target hash value to ensure the security of the bank account.
[0088] In one possible implementation, generating a logout instruction when detecting that the target account exists among all the initial accounts includes:
[0089] Acquire historical session information between the second terminal 120 and the server 130;
[0090] When it is detected that the target account exists in all the initial accounts, an exit instruction is generated based on the historical session information and the target token.
[0091] Specifically, in this embodiment, the server 130 can generate an exit instruction based on historical session information and the target token, which can not only instruct the second terminal 120 to exit the target account, but also instruct the second terminal 120 to exit the user identity information, user status information and user operation information associated with the target account. For example, user identity information includes user name, password and user permissions, user status information includes login status and user's fund purchase record, and user operation information includes user browsing history and search history.
[0092] This embodiment can instruct the second terminal 120 to completely log out of the target account by generating a logout instruction based on historical session information and the target token, thereby reducing the risk of leakage of information associated with the target account due to unclean logout of the target account.
[0093] In some embodiments, after the server 130 generates the target token and the server public key according to the first access request, the method further includes:
[0094] The target token is sent to the second terminal 120 , and the second terminal 120 is configured to send a second access request to the server 130 when detecting that the target account associated with the target token exists in all the initial accounts.
[0095] Specifically, the server 130 sends the target token to the second terminal 120. The second terminal 120 can verify with the server 130 through the target token to ensure that the target token is authorized by the first terminal 110, thereby avoiding security issues caused by the target token not being verified.
[0096] In some embodiments, the target token can be set to have an expiration date. For specific implementations, see the process for validating the expiration date for the target hash value in the above embodiments, which will not be described in detail here. Setting an expiration date for the target token, server 130 can also verify the expiration date of the target token. Once the target token detected by server 130 is invalid, it is necessary to regenerate the target token to prevent the target token from being tampered with or forged.
[0097] In some embodiments, during the entire process of the first terminal 110 requesting to log out of the target account on the second terminal 120, the target token can be protected by encryption or signing to improve the security of the process of logging out of the target account.
[0098] The above embodiments have clearly indicated that the first terminal 110 and the second terminal 120 have near-field communication functions. Specifically, the first terminal 110 and the second terminal 120 may include NFC components such as the first NFC tag and the second NFC tag in the above embodiments. However, considering that there is a situation where the NFC of the first terminal 110 is turned on and the NFC of the second terminal 120 is turned off, in this situation, near-field communication cannot be achieved between the first terminal 110 and the second terminal 120.
[0099] In one possible implementation, the method further includes:
[0100] receiving a feedback instruction and generating an NFC on instruction according to the feedback instruction, wherein the feedback instruction is generated by the first terminal 110 when detecting a failure in sending the target hash value to the second terminal 120, and is used to feedback to the server 130 that the NFC of the second terminal 120 is in a turned-off state;
[0101] The NFC activation instruction is sent to the first terminal 110 , and the first terminal 110 is further configured to send the NFC activation instruction to the second terminal 120 via Bluetooth, wherein the NFC activation instruction is configured to instruct the second terminal 120 to activate NFC.
[0102] In this embodiment, if the first terminal 110 fails to send the target hash value, it can be determined that the NFC of the second terminal 120 is turned off. In this case, the server 130 can generate an NFC activation instruction and transmit the NFC activation instruction to the Bluetooth of the second terminal 120 via the Bluetooth of the first terminal 110 to activate the NFC of the second terminal 120 and realize near-field communication between the first terminal 110 and the second terminal 120.
[0103] In some embodiments, the server 130 may also directly send an NFC activation instruction to the second terminal 120 to activate the NFC of the second terminal 120 .
[0104] In some embodiments, the target hash value sent by the server 130 can be stored in the first NFC tag of the first terminal 110, and when the first NFC tag is close to the second NFC tag of the second terminal 120, the target hash value is automatically sent to the second terminal 120 and stored in the second NFC tag.
[0105] In some embodiments, the target hash value issued by the server 130 may be stored in another idle cache area of the first terminal 110. When the first NFC tag approaches the second NFC tag of the second terminal 120, the first terminal 110 transfers the target hash value in the idle cache area to the first NFC tag and automatically sends the target hash value to the second terminal 120, where it is stored in the second NFC tag. This embodiment takes into account that the first NFC tag has a large amount of cached data and cannot store more data. Instead, the target hash value is temporarily stored in the idle cache area of the first terminal 110. When the first NFC tag approaches the second NFC tag, the target hash value is temporarily stored in the first NFC tag and sent directly to the second terminal 120. This avoids the situation where the first NFC tag caches too much data and ensures the normal use of the first NFC tag.
[0106] In summary, the account logout method based on near-field communication provided in the embodiment of the present application receives a first access request from a first terminal, generates a target token and a server-side public key based on the first access request, and then performs a hash operation on the target token and the server-side public key according to a preset hash algorithm to obtain a target hash value, which can prevent malicious attacks and improve the security of communication between the first terminal and the server. Then, a prompt message is generated and sent to the first terminal. The first terminal is used to send the target hash value to the second terminal via near-field communication when it is close to the second terminal. Then, a second access request from the second terminal is received, and the associated target account is queried based on the target hash value. When the target account is detected in all the initial accounts, a logout instruction is generated, and finally the logout instruction is sent to the second terminal. The logout instruction is used to instruct the second terminal to log out of the target account. The entire process does not require the user to operate multiple second terminals separately to log out of the same account, which improves the efficiency and security of users logging out of the same account on multiple terminals. The prompt message can be set in a variety of ways, which is easier for older users to understand and can also improve user stickiness. In addition, the activation of the NFC of the second terminal can be controlled by Bluetooth, avoiding the situation where the account logout fails due to device problems.
[0107] The present embodiment further provides an account logout method based on near field communication, which is applied to the first terminal 110 and includes:
[0108] A first access request is generated and sent to the server 130 , so that the server 130 executes the steps of the near field communication-based account logout method applied to the server 130 in the above embodiment.
[0109] The specific implementation process can be found in the description of the above embodiment and will not be described in detail here.
[0110] An embodiment of the present application provides an account logout method based on near-field communication, which is applied to a first terminal. The entire process does not require the user to operate multiple second terminals separately to log out of the same account, thereby improving the efficiency and security of the user logging out of the same account on multiple terminals.
[0111] In one possible implementation, the method further includes:
[0112] In the event that a failure to send the target hash value to the second terminal 120 is detected, a feedback instruction is generated and sent to the server 130, so that the server 130 generates an NFC turn-on instruction, wherein the feedback instruction is used to feedback to the server 130 that the NFC of the second terminal 120 is in the turned-off state;
[0113] An NFC activation instruction is received and sent to the second terminal 120 via Bluetooth, wherein the NFC activation instruction is used to instruct the second terminal 120 to activate NFC.
[0114] Specifically, for the method of transmitting the NFC opening instruction via Bluetooth and other possible implementation methods, please refer to the specific implementation process of the above embodiment, which will not be repeated here.
[0115] An embodiment of the present application provides an account logout method based on near-field communication, which is applied to a first terminal. The entire process does not require the user to operate multiple second terminals separately to log out of the same account, thereby improving the efficiency and security of the user logging out of the same account on multiple terminals.
[0116] The present embodiment also provides an account logout method based on near field communication, which is applied to the second terminal 120 and includes:
[0117] Receiving a logout instruction generated by the server 130 by executing the steps of the near field communication-based account logout method applied to the server 130 in the above embodiment;
[0118] Log out of the target account according to the logout instructions.
[0119] An embodiment of the present application provides an account logout method based on near-field communication, which is applied to a second terminal. The entire process does not require the user to operate multiple second terminals separately to log out of the same account, thereby improving the efficiency and security of the user logging out of the same account on multiple terminals.
[0120] This application also provides a computer device, see Figure 3 , Figure 3A diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor may implement the account logout method based on near-field communication applied to the computer device in the above embodiment. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor may execute the account logout method based on near-field communication. Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0121] An embodiment of the present application further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the account logout method based on near-field communication as in the method embodiment is implemented.
[0122] The computer device and computer-readable storage medium provided in the present application receive a first access request from a first terminal, generate a target token and a server-side public key according to the first access request, perform a hash operation on the target token and the server-side public key according to a preset hash algorithm, obtain a target hash value, and store the target hash value, the target token, and the target account in association. Subsequently, a prompt message is generated and the prompt message and the target hash value are sent to the first terminal. The prompt message is used to prompt the first terminal to approach the second terminal. The first terminal is used to send the target hash value to the second terminal through near-field communication when it is close to the second terminal. Then, a second access request from the second terminal is received, and the associated target account is queried according to the target hash value. When the target account is detected in all the initial accounts, an exit instruction is generated. Finally, the exit instruction is sent to the second terminal. The exit instruction is used to instruct the second terminal to exit the target account. The entire process does not require the user to operate multiple second terminals separately to exit the same account, thereby improving the efficiency and security of the user exiting the same account on multiple terminals.
[0123] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRD RAM), and RAMbus dynamic RAM (RDRAM).
[0124] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A method for logging out of an account based on near field communication, characterized in that: Applied to a server, the method includes: receiving a first access request from a first terminal, the first access request including a target account number, for requesting the server to log out of the target account on a second terminal, wherein the first terminal and the second terminal are different terminals; Generate a target token and a server public key according to the first access request; Performing a hash operation on the target token and the server public key according to a preset hash algorithm to obtain a target hash value, and storing the target hash value, the target token, and the target account in association; Generate prompt information, and send the prompt information and the target hash value to the first terminal, where the prompt information is used to prompt the first terminal to approach the second terminal, and the first terminal is used to send the target hash value to the second terminal through near field communication when the first terminal is close to the second terminal; receiving a second access request from the second terminal, the second access request including the target hash value and all initial accounts logged in on the second terminal; querying the associated target account according to the target hash value, and generating a logout instruction if the target account is detected among all the initial accounts; The logout instruction is sent to the second terminal, where the logout instruction is used to instruct the second terminal to log out of the target account.
2. The account logout method based on near field communication according to claim 1, characterized in that: The first access request further includes a first timestamp, wherein the first timestamp is used to represent the generation time of the first access request. The performing a hash operation on the target token and the server public key according to a preset hash algorithm to obtain a target hash value includes: A hash operation is performed on the target token, the server-side public key and the first timestamp according to the preset hash algorithm to obtain the target hash value.
3. The account logout method based on near field communication according to claim 2, characterized in that: The second access request further includes a second timestamp, wherein the second timestamp is used to indicate the time when the second access request was generated. Before querying the associated target account according to the target hash value, the method further includes: Parsing the target hash value to obtain the first timestamp; Calculating the interval between the first timestamp and the second timestamp; When it is detected that the interval duration is less than or equal to the preset duration, determining that the target hash value is valid; When it is detected that the interval time is greater than the preset time, the target hash value is determined to be invalid and the step of receiving the first access request from the first terminal is repeated until a new target hash value is determined to be valid.
4. The method for logging out of an account based on near field communication according to claim 1, wherein: The generating of the exit instruction when it is detected that the target account exists in all the initial accounts includes: Acquiring historical session information between the second terminal and the server; In the case where it is detected that the target account exists in all the initial accounts, a logout instruction is generated according to the historical session information and the target token.
5. The account logout method based on near field communication according to claim 1, characterized in that: The method further comprises: receiving a feedback instruction and generating an NFC on instruction according to the feedback instruction, wherein the feedback instruction is generated by the first terminal when detecting a failure in sending the target hash value to the second terminal, and is used to feedback to the server that the NFC of the second terminal is in a turned-off state; The NFC activation instruction is sent to the first terminal, and the first terminal is further configured to send the NFC activation instruction to the second terminal via Bluetooth, wherein the NFC activation instruction is used to instruct the second terminal to activate NFC.
6. A method for logging out of an account based on near field communication, characterized in that: Applied to a first terminal, the method includes: Generate a first access request and send the first access request to a server, so that the server executes the steps of the account logout method based on near field communication as described in any one of claims 1 to 5.
7. The account logout method based on near field communication according to claim 6, characterized in that: The method further comprises: In a case where it is detected that sending the target hash value to the second terminal fails, generating a feedback instruction and sending the feedback instruction to the server, so that the server generates an NFC turn-on instruction, wherein the feedback instruction is used to feedback to the server that the NFC of the second terminal is in a turned-off state; The NFC activation instruction is received and sent to the second terminal via Bluetooth, wherein the NFC activation instruction is used to instruct the second terminal to activate NFC.
8. A method for logging out of an account based on near field communication, characterized in that: Applied to the second terminal, the method includes: Receiving a logout instruction generated by the server by executing the steps of the account logout method based on near field communication according to any one of claims 1 to 5; Log out of the target account according to the logout instruction.
9. A computer device, characterized in that: The computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the computer program implements: The account logout method based on near field communication according to any one of claims 1 to 5; and / or, The account logout method based on near field communication according to claim 6 or 7; and / or, The account logout method based on near field communication as described in claim 8.
10. A computer-readable storage medium, characterized in that The computer readable storage medium stores a computer program, which, when executed by one or more processors, implements: The account logout method based on near field communication according to any one of claims 1 to 5; and / or, The account logout method based on near field communication according to claim 6 or 7; and / or, The account logout method based on near field communication as described in claim 8.
Citation Information
Patent Citations
Data backup method and device
CN106550031A
Account exit method and device, computer equipment and storage medium
CN115510410A