User management method and device

Through the user management method of verifying random values and signatures, the problem of user management rules being evaded is solved, effective management of user behavior and prevention of attacks is achieved, and user experience is improved, especially in out-of-network or weak network environments.

CN115694834BActive Publication Date: 2025-08-01SHANGHAI HODE INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211301626.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2025-08-01
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

The existing user management methods have the problem of evading user behavior management rules and causing user management to fail, such as tampering with or replaying response messages to avoid anti-addiction rules.

Method used

By sending user login requests to the server and receiving response messages carrying random values and signatures for verification, the network connection status is detected in real time, and corresponding user behavior management rules are implemented according to different states, including offline and online behavior management, to prevent man-in-the-middle attacks and replay attacks.

Benefits of technology

Effectively identify the situation where response messages are tampered with or copied, prevent evasion of user behavior management rules, ensure the effectiveness of user behavior management, improve user experience, and realize user behavior management in an out-of-network or weak network environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115694834B_ABST
    Figure CN115694834B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a user management method and device. The method includes: sending a user login request to a server, and the server returns a first response message in response to the user login request; receiving the first response message returned by the server, and verifying the first random value and the first signature in the first response message; if the verification passes, perform a login operation, obtain user behavior management rules from the first response message, and real-time detect the network connection status of the client; if it is in a network-disconnected state or a weak-network state, manage the user behavior according to the offline behavior management rules in the user behavior management rules. By verifying the random value and the signature, the present application can effectively identify the situation where the response message is tampered with or maliciously copied, effectively prevent man-in-the-middle attacks and replay attacks, and manage the user behavior according to the user behavior management rules, thereby comprehensively realizing the effective management of user behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technologies, and particularly to a user management method and device. Background Art

[0002] With the rapid development of Internet technologies, a lot of convenience has been provided for people's daily life and work. People can obtain a lot of information from the Internet, and electronic devices used in conjunction with the Internet, such as smart phones and computers, have also become popular. Using electronic devices such as computers to learn videos on the Internet and query relevant knowledge is a simple and fast learning method. In order to obtain more information, more and more people use electronic devices. Therefore, it is necessary to manage users' Internet behaviors. For example, minors need anti-addiction rules when playing games, and anti-cheat rules are often required in games. However, in the prior art, some people avoid user behavior management rules by tampering with the response packets returned by the server, or replaying previous response packets, or repeating others' response packets, resulting in the failure of user management. Summary of the Invention

[0003] In view of the above problems, the present application provides a user management method, device, computing device, and computer storage medium to solve the following problems: The existing user management methods have the problem that the user management fails due to avoiding user behavior management rules.

[0004] According to one aspect of the embodiments of the present application, a user management method is provided, including:

[0005] Sending a user login request to the server for the server to return a first response packet in response to the user login request, where the first response packet carries a first random value and a first signature;

[0006] Receiving the first response packet returned by the server, and verifying the first random value and the first signature in the first response packet; if the verification of the first random value passes and the verification of the first signature passes, then perform a login operation, obtain user behavior management rules from the packet content of the first response packet, and detect the network connection status of the client in real time;

[0007] If the network connection status is a disconnected state or a weak network state, manage the user behavior according to the offline behavior management rules in the user behavior management rules; if the network connection status is a normal connection state, send a heartbeat request to the server at a preset time period for the server to return a second response packet in response to the heartbeat request, where the second response packet carries a second random value and a second signature;

[0008] The second random value and the second signature in the second response message are verified; if the second random value verification fails or the second signature verification fails, the user behavior is managed according to the heartbeat monitoring exception handling rules in the user behavior management rules.

[0009] Furthermore, verifying the first random value in the first response message further includes:

[0010] Determine whether the first random value in the first response message is consistent with the first original random value in the user login request;

[0011] If they are consistent, the first random value verification passes; if they are inconsistent, the first random value verification fails.

[0012] Furthermore, verifying the first signature in the first response message further includes:

[0013] Using a first preset encryption algorithm and a first preset key, processing the message content of the first response message to generate a first signature to be verified;

[0014] Determine whether the first signature to be verified is consistent with the first signature in the first response message;

[0015] If they are consistent, the first signature verification passes; if they are inconsistent, the first signature verification fails.

[0016] Furthermore, the method further comprises:

[0017] If the first random value verification fails or the first signature verification fails, a login failure message is displayed.

[0018] Furthermore, verifying the second random value in the second response message further includes:

[0019] Determine whether the second random value in the second response message is consistent with the second original random value in the heartbeat request;

[0020] If they are consistent, the second random value verification passes; if they are inconsistent, the second random value verification fails.

[0021] Furthermore, verifying the second signature in the second response message further includes:

[0022] Using the second preset encryption algorithm and the second preset key, processing the message content of the second response message to generate a second signature to be verified;

[0023] Determine whether the second signature to be verified and the second signature in the second response message are consistent;

[0024] If they are consistent, the second signature verification passes; if they are inconsistent, the second signature verification fails.

[0025] Further, the message content of the second response message includes the updated user behavior management rules; the method further includes:

[0026] If the second random value verification passes and the second signature verification passes, then use the second preset parsing algorithm to parse the message content of the second response message, and obtain the updated user behavior management rules from the second preset position of the message content of the second response message.

[0027] According to another aspect of the embodiments of the present application, there is provided a user management device, including:

[0028] A request module, configured to send a user login request to the server, so that the server returns a first response message in response to the user login request, and the first response message carries a first random value and a first signature;

[0029] A verification module, configured to receive the first response message returned by the server, and verify the first random value and the first signature in the first response message;

[0030] A management module, configured to, if the first random value verification passes and the first signature verification passes, perform a login operation, obtain the user behavior management rules from the message content of the first response message, and detect the network connection status of the client in real time; if the network connection status is a disconnected state or a weak network state, then manage the user behavior according to the offline behavior management rules in the user behavior management rules;

[0031] The request module is further configured to: if the network connection status is a normal connection state, send a heartbeat request to the server according to a preset time period, so that the server returns a second response message in response to the heartbeat request, and the second response message carries a second random value and a second signature;

[0032] The verification module is further configured to: verify the second random value and the second signature in the second response message;

[0033] The management module is further configured to: if the second random value verification fails or the second signature verification fails, then manage the user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules.

[0034] According to yet another aspect of the embodiments of the present application, there is provided a computing device, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus;

[0035] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the operations corresponding to the above-mentioned user management method.

[0036] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction causes the processor to perform operations corresponding to the above user management method.

[0037] A user management method and device provided according to the embodiments of the present application include: sending a user login request to a server so that the server returns a first response message in response to the user login request, where the first response message carries a first random value and a first signature; receiving the first response message returned by the server, and verifying the first random value and the first signature in the first response message; if the verification of the first random value passes and the verification of the first signature passes, then perform a login operation, obtain user behavior management rules from the message content of the first response message, and detect the network connection status of the client in real time; if the network connection status is a disconnected state or a weak network state, then manage user behavior according to the offline behavior management rules in the user behavior management rules; if the network connection status is a normal connection state, then send a heartbeat request to the server at a preset time period so that the server returns a second response message in response to the heartbeat request, where the second response message carries a second random value and a second signature; verify the second random value and the second signature in the second response message; if the verification of the second random value fails or the verification of the second signature fails, then manage user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules. By verifying the random value and the signature, the present application can effectively identify the situation where the response message is tampered with or maliciously copied, effectively prevent man-in-the-middle attacks and replay attacks, and ensure that the user behavior management rules are difficult to circumvent. According to the user behavior management rules, user behavior is managed, so as to comprehensively realize the effective management of user behavior and improve the user experience; further, this method sends a heartbeat request for monitoring at a preset time period, and realizes user behavior management in a disconnected or weak network environment. By monitoring the network connection status, when the network connection status is a disconnected state or a weak network state, user behavior is managed according to the offline behavior management rules in the user behavior management rules, so as to realize offline user behavior management.

[0038] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the embodiments of the present application more obvious and understandable, the following specifically gives the specific implementation manners of the embodiments of the present application. Description of the Drawings

[0039] Upon reading the following detailed description of the preferred embodiments, various other advantages and benefits will become apparent to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to limit the embodiments of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0040] Figure 1 A flowchart of a user management method according to an embodiment of the present application is shown;

[0041] Figure 2 A schematic diagram of the interaction process between the client and the server according to an embodiment of the present application is shown;

[0042] Figure 3 A flowchart of a user management method according to another embodiment of the present application is shown;

[0043] Figure 4 A block diagram of a user management device according to an embodiment of the present application is shown;

[0044] Figure 5 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. Detailed Embodiments

[0045] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Instead, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0046] First, the noun terms related to one or more embodiments of the present application are explained.

[0047] Anti-addiction for minors: It is a management measure to prevent minors from being addicted to online games and effectively protect the physical and mental health of minors.

[0048] Mobile game client: It refers to a mobile phone with a display screen installed with the game, hereinafter referred to as SDK.

[0049] Man-in-the-middle attack (MITM): In the fields of cryptography and computer security, it refers to an attacker establishing independent connections with both ends of the communication and exchanging the data it receives, so that both ends of the communication think they are directly communicating with each other through a private connection, but in fact the entire session is completely controlled by the attacker.

[0050] Replay Attack: Also known as playback attack, it is a form of network attack that maliciously or fraudulently repeats or delays valid data; this can be executed by the initiator or by an adversary who intercepts and retransmits the data; the replay attack is a lower-level version of the "man-in-the-middle attack".

[0051] Advanced Encryption Standard (AES): Also known as the Rijndael encryption method, it is a block encryption standard.

[0052] Signature verification: That is, verifying the signature. To prevent data from being tampered with during network transmission, it is a digest verification mechanism based on the data to be interacted.

[0053] Figure 1 The flowchart shows a user management method according to an embodiment of the present application. This method is suitable for a client, such as Figure 1 As shown, the method includes the following steps:

[0054] Step S101: Send a user login request to the server.

[0055] In this step, the client sends a user login request to the server for the server to return a first response message in response to the user login request. The first response message carries a first random value and a first signature.

[0056] In this embodiment, taking the client as a mobile game client (SDK) as an example, the client sends a user login request to the server through the user login page. To prevent signature tampering and response replay attacks, etc., the server returns a first response message in response to the user login request. The first response message carries a first random value and a first signature.

[0057] Step S102: Receive the first response message returned by the server, verify the first random value and the first signature in the first response message. If the first random value verification passes and the first signature verification passes, then execute step S103; if the first random value verification fails or the first signature verification fails, then execute step S110 to display a login failure message.

[0058] In this embodiment, the server and the client have pre-agreed on a first preset encryption algorithm and a first preset key for use in verifying the first signature. Among them, the first preset encryption algorithm can be a symmetric algorithm; in this step, receive the first response message returned by the server, verify the first random value in the first response message and verify the first signature through the pre-agreed symmetric algorithm.

[0059] Step S103: Perform a login operation and obtain user behavior management rules from the message content of the first response message.

[0060] It should be noted that the message content of the first response message sent by the server also includes user behavior management rules. In this step, if the first random value verification passes and the first signature verification passes, the client performs a login operation and obtains user behavior management rules from the message content of the first response message. Among them, the user behavior management rules may include: minor anti-addiction rules, data security rules, anti-cheat rules, etc. In an optional implementation manner, step S103 further includes: parsing the message content of the first response message using a first preset parsing algorithm, and obtaining user behavior management rules from a first preset position of the message content of the first response message.

[0061] Step S104: Detect the network connection status of the client in real time. If the network connection status is a disconnected state or a weak network state, execute step S105; if the network connection status is a normal connection state, execute step S106.

[0062] To solve the problem that user behavior management rules do not take effect in a disconnected or weak network environment, it is necessary to detect the network connection status of the client, so as to select appropriate management rules from the user behavior management rules to manage user behavior according to the detection result of the network connection status. Specifically, detecting the network connection status of the client is to identify the current network environment of the client. Generally speaking, if it is a normal network environment, the network connection status is a normal connection state; if it is a disconnected or weak network environment, the network connection status is a disconnected state or a weak network state.

[0063] Step S105: Manage user behavior according to the offline behavior management rules in the user behavior management rules.

[0064] Specifically, if the network connection status is a disconnected state or a weak network state, manage user behavior according to the offline behavior management rules in the user behavior management rules.

[0065] Step S106: Send a heartbeat request to the server according to a preset time period.

[0066] Specifically, the client will automatically send a heartbeat request to the server every preset time period. Figure 2 Shows a schematic diagram of the interaction process between the client and the server according to an embodiment of the present application; as Figure 2As shown, in this step, the client sends a heartbeat request to the server according to a preset time period. After receiving the heartbeat request, the server performs corresponding business processing, such as verifying the user login credentials, etc. Specifically, the server returns a second response message in response to the heartbeat request, and the second response message carries a second random value and a second signature.

[0067] Step S107: Verify the second random value and the second signature in the second response message. If the verification of the second random value passes and the verification of the second signature passes, execute step S108; if the verification of the second random value fails or the verification of the second signature fails, execute step S109.

[0068] In an alternative embodiment, step S107 further includes: determining whether the second random value in the second response message is consistent with the second original random value in the heartbeat request; if they are consistent, the verification of the second random value passes; if they are inconsistent, the verification of the second random value fails.

[0069] Specifically, the heartbeat request sent by the client is similar to the user login request, and both can be requests in the form of the Hypertext Transfer Protocol (HTTP). This heartbeat request generally also carries a second original random value, and this second original random value is a one-time random value (Number used once, Nonce). Specifically, in cryptography, Nonce is an arbitrary or non-repeating random value that is only used once, and it plays an important role in the initialization vector and cryptographic hash function in encryption technology, ensuring that verification information is not reused in communication applications of various verification protocols to combat replay attacks.

[0070] Specifically, the server and the client also pre-agree on a second preset encryption algorithm and a second key for use when verifying the second signature. In an alternative embodiment, step S107 further includes: using the second preset encryption algorithm and the second preset key to process the message content of the second response message to generate a second signature to be verified; determining whether the second signature to be verified is consistent with the second signature in the second response message; if they are consistent, the verification of the second signature passes; if they are inconsistent, the verification of the second signature fails.

[0071] Specifically, the second preset encryption algorithm can be the same as the first preset encryption algorithm, or can be set to a different algorithm according to the actual scenario. In this embodiment, the second preset encryption algorithm can be the Advanced Encryption Standard (AES) algorithm. Specifically, the server symmetrically encrypts the second response message using AES and sets the encrypted string as the second signature in the HTTP protocol response header of the second response message; as Figure 2As shown, the client verifies the validity of the second signature according to the specified interface to prevent man-in-the-middle attacks. At the same time, the client can determine whether the current second response message is a replay by verifying the second random value and the second signature in the second response message, thus preventing response replay attacks. Among them, the heartbeat request and the corresponding second response message can be sent through the specified interface, and the specified interface specifically refers to the heartbeat detection interface.

[0072] Step S108: Manage user behavior according to the online behavior management rules in the user behavior management rules.

[0073] Specifically, if the second random value verification passes and the second signature verification passes, it means that the current heartbeat request is valid, indicating that the user's heartbeat monitoring is in a normal state. Then, manage the user behavior according to the online behavior management rules in the user behavior management rules.

[0074] Step S109: Manage user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules.

[0075] Specifically, if the second random value verification fails or the second signature verification fails, it means that the current heartbeat request is invalid, indicating that the user's heartbeat monitoring is in an abnormal state. Then, manage the user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules. Among them, the reason for the abnormal heartbeat monitoring may be that the user modifies the second response message or replays the second response message. Taking the anti-addiction rules in the user behavior management rules as an example, the heartbeat monitoring exception handling rules in the user behavior management rules can specifically be the offline anti-addiction rules to prevent the user from using the client for a long time. For example, the offline anti-addiction rules can stipulate that when the heartbeat monitoring is in an abnormal state, the total duration of the user using the client is still continuously counted. When the total duration exceeds the preset threshold, the user logout operation is automatically performed.

[0076] In an optional implementation manner, the message content of the second response message may further include the updated user behavior management rules. The method further includes: if the second random value verification passes and the second signature verification passes, then use the second preset parsing algorithm to parse the message content of the second response message, and obtain the updated user behavior management rules from the second preset position of the message content of the second response message, so that the client can manage the user behavior according to the updated user behavior management rules.

[0077] Specifically, taking the user behavior management rule as an example of the anti-addiction rule, the heartbeat monitoring exception handling rule in the user behavior management rule can specifically be an offline anti-addiction rule to prevent users from using the client for a long time. For example, the offline anti-addiction rule can stipulate that when the heartbeat monitoring is in an abnormal state, the total duration of the user using the client is still continuously counted. When the total duration exceeds a preset threshold, the user logout operation is automatically performed.

[0078] Step S110: Display the login failure information.

[0079] According to a user management method provided by an embodiment of the present application, by sending a user login request to the server for the server to return a first response message in response to the user login request, the first response message carries a first random value and a first signature; receiving the first response message returned by the server, and verifying the first random value and the first signature in the first response message; if the verification of the first random value passes and the verification of the first signature passes, then perform the login operation, and obtain the user behavior management rule from the message content of the first response message, and manage the user behavior according to the user behavior management rule. This method can effectively identify the situation where the response message is tampered with or maliciously copied by verifying the random value and the signature, effectively prevent man-in-the-middle attacks and replay attacks, and ensure that the user behavior management rule is difficult to be circumvented. Manage the user behavior according to the user behavior management rule, so as to comprehensively realize the effective management of the user behavior and improve the user experience; further, this method sends a heartbeat request for monitoring according to a preset time period, and realizes the user behavior management in a network-disconnected or weak-network environment. By monitoring the network connection status, when the network connection status is a network-disconnected state or a weak-network state, the user behavior is managed according to the offline behavior management rule in the user behavior management rule, so as to realize the offline user behavior management.

[0080] Figure 3 The flowchart shows a user management method according to another embodiment of the present application, which is applicable to the server, such as Figure 3 shown, and the method includes the following steps:

[0081] Step S301: In response to the user login request sent by the client, use the user behavior management rule to construct a first response message, and add a first random value and a first signature to the first response message.

[0082] In this step, in response to the user login request sent by the client, the server needs to return a first response message to the client. In this step, the server can encapsulate the user behavior management rule, the first random value, and the first signature into the first response message at the same time.

[0083] Specifically, the user login request generally carries a first original random value. The server and the client have pre-agreed on a first preset encryption algorithm, a second preset encryption algorithm, a first preset key, and a second preset key, which are used to verify the first signature and the second signature respectively. In an alternative embodiment, step S301 further includes: adding the first original random value in the user login request as the first random value to the first response message; using the first preset encryption algorithm and the first preset key to process the message content of the first response message to generate a first signature, and adding the first signature to the response header of the first response message.

[0084] Step S302: Return the first response message to the client for the client to verify the first random value and the first signature in the first response message.

[0085] Step S303: If the first random value verification passes and the first signature verification passes, perform the login operation, and manage the user behavior according to the user behavior management rules in the message content of the first response message.

[0086] Specifically, after the first random value verification passes and the first signature verification passes, the server performs the login operation, and the client monitors the user behavior according to the user behavior management rules in the message content of the first response message to manage the user behavior.

[0087] In an alternative embodiment, the method further includes steps S304 - S305.

[0088] Step S304: In response to the heartbeat request sent by the client, perform corresponding service processing, construct a second response message, and add a second random value and a second signature to the second response message.

[0089] Specifically, in order to monitor the user's status, the client can send a heartbeat request to the server according to a preset time period. The server responds to the heartbeat request sent by the client, performs corresponding service processing, constructs a second response message, and adds a second random value and a second signature to the second response message. Add the second original random value in the heartbeat request as the second random value to the second response message; use the second preset encryption algorithm and the second preset key to process the message content of the second response message to generate a second signature, and add the second signature to the response header of the second response message.

[0090] In an alternative embodiment, step S304 further includes: if the server contains updated user behavior management rules, use the updated user behavior management rules to construct the second response message.

[0091] Step S305: Return a second response message to the client for the client to verify the second random value and the second signature in the second response message, and manage the user behavior according to the verification result and the user behavior management rules.

[0092] Specifically, if the verification of the second random value passes and the verification of the second signature passes, it indicates that the current heartbeat request is valid, indicating that the user's heartbeat monitoring is in a normal state. Then, manage the user behavior according to the online behavior management rules in the user behavior management rules; if the verification of the second random value fails or the verification of the second signature fails, indicating that the user's heartbeat monitoring is in an abnormal state, then manage the user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules. Among them, the reason for the abnormal heartbeat monitoring may be that the user modifies the second response message or replays the second response message. Taking the anti-addiction rule as an example of the user behavior management rules, the heartbeat monitoring exception handling rule in the user behavior management rules may specifically be an offline anti-addiction rule to prevent the user from using the client for a long time. For example, the offline anti-addiction rule may stipulate that when the heartbeat monitoring is in an abnormal state, continue to count the total duration of the user using the client, and when the total duration exceeds the preset threshold, automatically perform the user logout operation.

[0093] According to a user management method provided by an embodiment of the present application, in response to a user login request sent by a client, a server constructs a first response message by using user behavior management rules, and adds a first random value and a first signature to the first response message; returns the first response message to the client for the client to verify the first random value and the first signature in the first response message. If the verification of the first random value passes and the verification of the first signature passes, perform a login operation, and manage the user behavior according to the user behavior management rules in the message content of the first response message. This method can effectively identify the situation where the response message is tampered with or maliciously copied by encapsulating the random value and the signature by the server, effectively prevent man-in-the-middle attacks and replay attacks, and ensure that the user behavior management rules are difficult to avoid. Manage the user behavior according to the user behavior management rules, so as to comprehensively realize the effective management of the user behavior and improve the user experience; further, this method sends heartbeat requests for monitoring according to a preset time period and realizes the management of user behavior in a network-disconnected or weak-network environment. By monitoring the network connection status, when the network connection status is a network-disconnected state or a weak-network state, manage the user behavior according to the offline behavior management rules in the user behavior management rules, so as to realize the management of offline user behavior.

[0094] Figure 4 The structural block diagram of a user management device according to an embodiment of the present application is shown. The user management device is applied to a client, such as Figure 4As shown in the figure, the device includes: a request module 401, a verification module 402, and a management module 403.

[0095] The request module 401 is configured to send a user login request to the server, so that the server returns a first response message in response to the user login request, and the first response message carries a first random value and a first signature.

[0096] The verification module 402 is configured to receive the first response message returned by the server and verify the first random value and the first signature in the first response message.

[0097] In an optional implementation manner, the verification module 402 is further configured to: determine whether the first random value in the first response message is consistent with the first original random value in the user login request; if they are consistent, the first random value verification passes; if they are inconsistent, the first random value verification fails.

[0098] In an optional implementation manner, the verification module 402 is further configured to: process the message content of the first response message by using a first preset encryption algorithm and a first preset key to generate a first signature to be verified; determine whether the first signature to be verified is consistent with the first signature in the first response message; if they are consistent, the first signature verification passes; if they are inconsistent, the first signature verification fails.

[0099] The management module 403 is configured to, if the first random value verification passes and the first signature verification passes, perform a login operation, obtain a user behavior management rule from the message content of the first response message, and detect the network connection status of the client in real time; if the network connection status is a disconnected state or a weak network state, manage the user behavior according to the offline behavior management rule in the user behavior management rule.

[0100] In an optional implementation manner, the management module 403 is further configured to: display a login failure message if the first random value verification fails or the first signature verification fails.

[0101] In an optional implementation manner, the management module 403 is further configured to: parse the message content of the first response message by using a first preset parsing algorithm and obtain the user behavior management rule from a first preset position of the message content of the first response message.

[0102] The request module 401 is further configured to: if the network connection status is a normal connection status, send a heartbeat request to the server at a preset time period, so that the server returns a second response message in response to the heartbeat request, and the second response message carries a second random value and a second signature.

[0103] The verification module 402 is further configured to: verify the second random value and the second signature in the second response message. The management module 403 is further configured to: if the verification of the second random value passes and the verification of the second signature passes, manage the user behavior according to the online behavior management rule in the user behavior management rule; if the verification of the second random value fails or the verification of the second signature fails, manage the user behavior according to the heartbeat monitoring exception handling rule in the user behavior management rule.

[0104] In an alternative embodiment, the verification module 402 is further configured to: determine whether the second random value in the second response message is consistent with the second original random value in the heartbeat request; if they are consistent, the verification of the second random value passes; if they are inconsistent, the verification of the second random value fails.

[0105] In an alternative embodiment, the verification module 402 is further configured to: process the message content of the second response message by using a second preset encryption algorithm and a second preset key to generate a second signature to be verified; determine whether the second signature to be verified is consistent with the second signature in the second response message; if they are consistent, the verification of the second signature passes; if they are inconsistent, the verification of the second signature fails.

[0106] In an alternative embodiment, the message content of the second response message includes an updated user behavior management rule; the management module 403 is further configured to: if the verification of the second random value passes and the verification of the second signature passes, parse the message content of the second response message by using a second preset parsing algorithm, and obtain the updated user behavior management rule from a second preset position of the message content of the second response message.

[0107] The descriptions of the above modules refer to the corresponding descriptions in the method embodiments and will not be elaborated herein.

[0108] According to a user management device provided by an embodiment of the present application, by verifying the random value and the signature, it is possible to effectively identify the situation where the response message is tampered with or maliciously copied, effectively prevent man-in-the-middle attacks and replay attacks, and ensure that the user behavior management rule is difficult to circumvent. Manage the user behavior according to the user behavior management rule, so as to comprehensively achieve the effective management of the user behavior and improve the user experience; further, this method sends heartbeat requests for monitoring according to a preset time period and realizes the management of user behavior in a disconnected or weak network environment. By monitoring the network connection status, when the network connection status is in a disconnected state or a weak network state, manage the user behavior according to the offline behavior management rule in the user behavior management rule, so as to realize the management of offline user behavior.

[0109] Embodiments of the present application also provide a non-volatile computer storage medium, which stores at least one executable instruction that can execute the user management method in any of the above method embodiments.

[0110] Figure 5 FIG. shows a schematic structural diagram of a computing device according to an embodiment of the present application. Specific embodiments of the present application do not limit the specific implementation of the computing device.

[0111] As Figure 5 shown, the computing device may include: a processor 502, a communication interface 504, a memory 506, and a communication bus 508.

[0112] Among them:

[0113] The processor 502, the communication interface 504, and the memory 506 communicate with each other through the communication bus 508.

[0114] The communication interface 504 is used to communicate with network elements of other devices such as clients or other servers.

[0115] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above user management method embodiments.

[0116] Specifically, the program 510 may include program code, and the program code includes computer operation instructions.

[0117] The processor 502 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. One or more processors included in the computing device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.

[0118] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.

[0119] The program 510 can specifically be used to cause the processor 502 to execute the user management method in any of the above method embodiments. For the specific implementation of each step in the program 510, reference may be made to the corresponding steps and units in the above user management method embodiments, which will not be elaborated herein. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be repeated herein.

[0120] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings provided herein. The structure required to construct such systems will be apparent from the above description. In addition, the embodiments of the present application are not directed to any specific programming language. It should be understood that the content of the embodiments of the present application described herein can be implemented using various programming languages, and the description of a specific language above is for the purpose of disclosing the best mode of the embodiments of the present application.

[0121] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures, and technologies have not been shown in detail so as not to obscure the understanding of this specification.

[0122] Similarly, it should be understood that, in order to streamline the present disclosure and assist in understanding one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed embodiments of the present application require more features than are expressly recited in each claim. Rather, as reflected in the following claims, the inventive aspects lie in less than all the features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate embodiment of the present application.

[0123] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and set in one or more devices different from those of the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub - modules or sub - units or sub - components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0124] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the embodiments of the present application and forms different embodiments. For example, in the following claims, any one of the claimed embodiments can be used in any combination.

[0125] Each component embodiment of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (such as a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the embodiments of the present application can be stored on a computer - readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0126] It should be noted that the above embodiments are illustrative of the embodiments of the present application rather than restrictive thereof, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. Embodiments of the present application can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In the unit claims listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names.

Claims

1. A user management method, comprising: Sending a user login request to a server for the server to return a first response message in response to the user login request, the first response message carrying a first random value and a first signature; Receiving the first response message returned by the server, and verifying the first random value and the first signature in the first response message; if the verification of the first random value passes and the verification of the first signature passes, then perform a login operation, obtain user behavior management rules from the message content of the first response message, and detect the network connection status of the client in real time; If the network connection status is a disconnected state or a weak network state, manage user behavior according to the offline behavior management rules in the user behavior management rules; if the network connection status is a normal connection state, send a heartbeat request to the server at a preset time period for the server to return a second response message in response to the heartbeat request, the second response message carrying a second random value and a second signature; Verify the second random value and the second signature in the second response message; if the verification of the second random value fails or the verification of the second signature fails, manage user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules.

2. The method according to claim 1, wherein The verification of the first random value in the first response message further includes: Determining whether the first random value in the first response message is consistent with the first original random value in the user login request; If they are consistent, the verification of the first random value passes; if they are inconsistent, the verification of the first random value fails.

3. The method according to claim 1, wherein, The verification of the first signature in the first response message further includes: Processing the message content of the first response message using a first preset encryption algorithm and a first preset key to generate a first signature to be verified; Determining whether the first signature to be verified is consistent with the first signature in the first response message; If they are consistent, the verification of the first signature passes; if they are inconsistent, the verification of the first signature fails.

4. The method according to claim 1, wherein, The method further includes: If the verification of the first random value fails or the verification of the first signature fails, display a login failure message.

5. The method according to claim 1, wherein The verification of the second random value in the second response message further includes: Determining whether the second random value in the second response message is consistent with the second original random value in the heartbeat request; If they are consistent, the verification of the second random value passes; if they are inconsistent, the verification of the second random value fails.

6. The method according to claim 1, wherein, The verification of the second signature in the second response message further includes: Processing the message content of the second response message using a second preset encryption algorithm and a second preset key to generate a second signature to be verified; Determining whether the second signature to be verified is consistent with the second signature in the second response message; If they are consistent, the verification of the second signature passes; if they are inconsistent, the verification of the second signature fails.

7. The method according to any one of claims 1-6, wherein The message content of the second response message contains the updated user behavior management rules; the method further includes: If the second random value passes the verification and the second signature passes the verification, use a second preset parsing algorithm to parse the message content of the second response message, and obtain the updated user behavior management rules from a second preset position in the message content of the second response message.

8. A user management device, including: A request module, configured to send a user login request to a server, so that the server returns a first response message in response to the user login request, and the first response message carries a first random value and a first signature; A verification module, configured to receive the first response message returned by the server, and verify the first random value and the first signature in the first response message; A management module, configured to, if the first random value passes the verification and the first signature passes the verification, perform a login operation, obtain user behavior management rules from the message content of the first response message, and detect the network connection status of the client in real time; If the network connection status is a disconnected state or a weak network state, manage user behavior according to the offline behavior management rules in the user behavior management rules; The request module is further configured to: if the network connection status is a normal connection state, send a heartbeat request to the server at a preset time period, so that the server returns a second response message in response to the heartbeat request, and the second response message carries a second random value and a second signature; The verification module is further configured to: verify the second random value and the second signature in the second response message; The management module is further configured to: if the second random value fails to pass the verification or the second signature fails to pass the verification, manage user behavior according to the heartbeat monitoring exception handling rules in the user behavior management rules.

9. A computing device, comprising: A processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations corresponding to the user management method according to any one of claims 1-7.

10. A computer storage medium, in which at least one executable instruction is stored, and the executable instruction causes a processor to execute the operations corresponding to the user management method according to any one of claims 1-7.

11. A computer program product, including at least one executable instruction, and the executable instruction causes a processor to execute the operations corresponding to the user management method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Heartbeat keep-alive method and apparatus for long connection in communication network

    CN105610913A

  • Enterprise network security management cloud service platform system and implementation method thereof

    CN107295010A