CN113794708B - Login identifier distribution method and device - Google Patents

Login identifier distribution method and device Download PDF

Info

Publication number
CN113794708B
CN113794708B CN202111052184.2A CN202111052184A CN113794708B CN 113794708 B CN113794708 B CN 113794708B CN 202111052184 A CN202111052184 A CN 202111052184A CN 113794708 B CN113794708 B CN 113794708B
Authority
CN
China
Prior art keywords
login
state
client
identification
login identification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111052184.2A
Other languages
Chinese (zh)
Other versions
CN113794708A (en
Inventor
赵鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202111052184.2A priority Critical patent/CN113794708B/en
Publication of CN113794708A publication Critical patent/CN113794708A/en
Application granted granted Critical
Publication of CN113794708B publication Critical patent/CN113794708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a method and a device for distributing login identification, wherein the method comprises the following steps: receiving a login state extension request sent by a client by adopting a preset login state management interface; searching whether a client corresponding to the login state extension request has a login identifier in an effective state at present; the login identification is invalid after the preset validity duration from the generation of the login identification; and if the login identification in the effective state currently exists, distributing the login identification for the client. The influence on the user information safety caused by the fact that the login identification is leaked is avoided, and meanwhile the processing efficiency of the server is effectively improved.

Description

Login identifier distribution method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for allocating login identifiers.
Background
Generally, a client may send access information to a server to retrieve videos, view videos, send video comments, view video comments, and the like. The server side can think that the client side is in an active state under the condition that the server side receives the access information of the client side, and prolongs the valid period of the login identification corresponding to the client side, so that the client side in the active state can keep the logged-in state. However, in this solution, as long as the client sends the access information, the validity period of the login identifier corresponding to the client needs to be processed basically, and when the client accesses the server frequently, a large processing pressure is easily applied to the server. Meanwhile, if the login identification corresponding to the client is carelessly revealed to a third party, the third party can easily access the server side for a long time by adopting the login identification, and the server side is difficult to lose effectiveness, so that the safety risk is caused.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for distributing login identifications, so as to reduce the pressure of a server on the validity period of the login identification. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a method for allocating a login identifier, where the method includes:
receiving a login state extension request sent by a client by adopting a preset login state management interface; the login state extension request is used for requesting to extend the validity duration of the client;
searching whether a client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
and if the login identification in the effective state currently exists, distributing the login identification for the client.
Optionally, the step of searching whether the client corresponding to the login state extension request has a login identifier currently in a valid state includes:
searching whether a client corresponding to the login state extension request has a login identifier with the use duration not greater than the preset validity duration;
if the client has the login identification with the use duration not greater than the preset validity duration, the client has the login identification in the valid state currently;
and if the client does not have the login identification with the use duration not greater than the preset validity duration, the client does not have the login identification in the valid state currently.
Optionally, the valid state comprises an active period state and an extended period state; the active period state is that the interval between the generation time of the login identification and the current time is smaller than a first time interval; the time limit extension period state is that the interval between the generation time of the login identification and the current time is larger than a first time interval and smaller than a second time interval;
if the login identification in the valid state exists, the step of distributing the login identification to the client comprises the following steps:
if the login identification in the active period state exists, distributing the login identification for the client;
and if the login identification is in the state of the time limit extension period, generating a new login identification, and distributing the new login identification for the client.
Optionally, the method further comprises:
after the new login identification is distributed, generating an asynchronous identification invalidation message; the asynchronous identification invalidation message is used for setting the original login to an invalidation state;
detecting whether access information sent by the client is received within a preset delay time; the access information comprises the new login identification;
and if receiving the access information sent by the client, executing the asynchronous identification failure information.
Optionally, the method further comprises:
and if the use time of the login identification exceeds the preset validity time or a login quitting request sent by the client is received, setting the login identification to be in a failure state.
In a second aspect of the present invention, there is also provided an apparatus for allocating a login id, where the apparatus includes:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a login state extension request sent by a client by adopting a preset login state management interface; the login state extension request is used for requesting to extend the validity duration of the client;
the searching module is used for searching whether the client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
and the allocation module is used for allocating the login identification for the client if the login identification in the current effective state exists.
Optionally, the search module includes:
the time length determining submodule is used for searching whether the client corresponding to the login state extension request has a login identifier of which the use time length is not more than the preset validity time length;
the first state determining submodule is used for determining that the client has the login identifier which is currently in the valid state if the client has the login identifier with the use duration not greater than the preset validity duration;
and the second state determining submodule is used for determining that the client does not have the login identifier in the current valid state if the client does not have the login identifier with the use duration not greater than the preset validity duration.
Optionally, the valid state includes an active period state and an extended period state; the active period state is that the interval between the generation time of the login identification and the current time is smaller than a first time interval; the time limit extension state is that the interval between the generation time of the login identification and the current time is greater than a first time interval and less than a second time interval;
the distribution module includes:
the first allocation sub-module is used for allocating the login identification for the client if the login identification is in an active period state;
and the second distribution submodule is used for generating a new login identifier if the client has the login identifier in the time limit extension period state, and distributing the new login identifier for the client.
Optionally, the apparatus further comprises:
the asynchronous message generating module is used for generating an asynchronous identification invalidation message after the new login identification is distributed; the asynchronous identification invalidation message is used for setting the original login to an invalidation state;
the access detection module is used for detecting whether the access information sent by the client is received within a preset delay time; the access information comprises the new login identification;
and the asynchronous execution module is used for executing the asynchronous identification failure information if receiving the access information sent by the client.
Optionally, the apparatus further comprises:
and the state setting module is used for setting the login identification as a failure state if the use time of the login identification exceeds the preset validity time or a login quitting request sent by the client is received.
In another aspect of the present invention, there is also provided a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute any one of the above-mentioned login identity allocation methods.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-mentioned methods for assigning login identities.
According to the login identification allocation method provided by the embodiment of the invention, the login state extension request sent by the client is received by adopting the preset login state management interface, so that the login state related service can be processed for the client under the condition that the client actively requests to extend the logged-in state. Then, identifying whether the client corresponding to the login state extension request has a login identifier in an effective state; and if the login identification is in the valid state, distributing the login identification for the client. Therefore, under the condition that the client has the login identification in the valid state, the login identification in the valid state at present can be continuously distributed, the login identification still remains invalid after the preset validity period from the generation of the login identification is long, the influence on the user information safety caused by the leakage of the login identification is avoided, meanwhile, under the condition that the login identification is in the valid state, the service end does not need to update the validity period of the login identification for the client, the processing pressure of the service end is reduced, and the processing efficiency of the service end is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart illustrating steps of an embodiment of a method for allocating login identifiers according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another embodiment of a method for allocating login id according to the present invention;
FIG. 3 is a diagram illustrating a status of a login id according to an embodiment of the present invention;
fig. 4 is a system block diagram of a method for allocating login identifiers according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating an embodiment of a device for allocating login id according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an electronic device in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
When the client side sends the access information to the server side, the embodiment of the invention does not process the valid period of the login identification corresponding to the client side, and provides a login state management interface to manage the login identification of the client side independently, thereby reducing the processing pressure of the server side. When the client needs to keep the logged state of the client, a logged state extension request can be sent to the logged state management interface, if the client has a logged identifier in an effective state, the current effective logged identifier is directly distributed to the client without updating the effective state of the logged identifier, the logged identifier still remains invalid after the preset validity period from the generation of the logged identifier, and the logged identifier of the client is prevented from being always effective in a validity period extension mode, so that the user information is prevented from being leaked.
Referring to fig. 1, a flowchart of steps of an embodiment of a method for allocating a login identifier according to the present invention is shown, which specifically includes the following steps:
step 101, receiving a login state extension request sent by a client by adopting a preset login state management interface; the login state extension request is used for requesting to extend the validity duration of the client;
in the embodiment of the invention, the server side can be provided with a login state management interface, and the login state management interface manages the generation, the time limit extension, the deletion and other services of the login identification of the client side so as to realize the management of the login state of the client side. When the validity period needs to be extended, the client can send a login state extension request to the login state management interface. And under the condition that the client sends the access information to the server, the access information can be sent to the server without a login state management interface, so that the server can not need to process the validity period of the login identification of the client according to the access information. Therefore, the server can effectively reduce the processing pressure brought by the validity management.
In the embodiment of the invention, the client can provide account information to the server so as to log in the server and acquire the specific functions provided by the server, such as watching videos or articles which can be viewed by a logged-in user, making comments and the like. The server side can generate a login identification for the client side providing correct account information, and stores login state information corresponding to the login identification so as to record the login identification of the client side, the generation time of the login identification, the validity period and other information and obtain the login state of the user. Meanwhile, the server side can return the login identification to the client side, so that the client side can be in a logged-on state within a period of time.
When the client finishes logging in and is in a logged state, the client can send a login state extension request to a login state management interface of the server according to actual needs so as to request to extend the validity duration of the client, so that the server continues to keep the client in the logged state. Therefore, the server side can receive the login state extension request sent by the client side by adopting a preset login state management interface.
In a specific implementation, the client may send a login state extension request to the server in a case that the user performs a specific action. For example, the client may send a login state extension request to the server when the user starts the client. The client may also send a login status extension request to the server while the user views the content provided by the client.
The client may also send a login state extension request to the server in a preset period. The predetermined period may be 1 hour, 10 hours, 1 day, etc., which is not limited in the present invention.
Step 102, searching whether a client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
in the embodiment of the present invention, the server may store a login identifier corresponding to the client. The login identifier may be invalidated after a preset validity period from the generation of the login identifier, so that the login identifier may be in an active state or an invalid state. If the login identifier is still currently within the preset validity duration, the login identifier may be in a valid state, and at this time, the client may continue to be kept in the logged-in state. If the login identifier is not currently in the preset validity duration, the login identifier may be in a failure state, the client cannot be kept in the logged-in state at this time, and the server may consider that the client has logged out and is in the unregistered state.
The preset validity period may be 1 day, 10 days, 30 days, 90 days, and the like, which is not limited in the present invention.
In the embodiment of the invention, in order to avoid that the third party continuously prolongs the effective duration of the login identification after the login identification is leaked to the third party, so that the user information is utilized by the third party for a long time, and the safety of the user information is influenced. After the server side obtains the login state extension request, whether the client side corresponding to the login state extension request has the login identification in the valid state at present can be directly searched, the preset validity duration of the login identification is not changed, and therefore the situation that the user information is utilized by a third party for a long time due to the fact that the user reveals the login identification once is avoided.
In a specific implementation, the login status extension request may be recorded with a login identifier of the client. The server may search, in the login state information stored in the server, login state information matching the login identifier in the login state extension request by using the login identifier in the login state extension request, so as to determine whether the login identifier corresponding to the client is currently in an effective state.
And 103, if the login identification in the current effective state exists, distributing the login identification for the client.
In the embodiment of the present invention, if the client corresponding to the login state extension request has a login identifier currently in an active state, it may be considered that the client may continue to be kept in a logged-in state, and at this time, the login identifier currently in the active state may be directly allocated to the client, without extending the validity period of the login identifier.
In the processing of the present invention, if the client corresponding to the login state extension request does not have a login identifier currently in an active state, it may be considered that the login identifier of the client may be in a disabled state, or the login state information has been deleted. In order to keep the client in the logged state, a new login identifier may be generated according to actual needs, and a new login identifier may be allocated to the client, so as to prolong the validity duration of the logged state of the client.
According to the login identification allocation method provided by the embodiment of the invention, the login state extension request sent by the client is received by adopting the preset login state management interface, so that the login state related business can be processed for the client under the condition that the client actively requests to extend the logged-in state. Then, identifying whether the client corresponding to the login state extension request has a login identifier in an effective state; and if the login identification is in the effective state, distributing the login identification for the client. Therefore, under the condition that the client has the login identification in the valid state, the login identification in the valid state at present can be continuously distributed, and the login identification still remains invalid after the preset validity period from the generation of the login identification is long, so that the influence on the user information safety caused by the leakage of the login identification is avoided, and meanwhile, the processing efficiency of the server is effectively improved.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a method for allocating a login id according to the present invention is shown, which may specifically include the following steps:
step 201, receiving a login state extension request sent by a client by using a preset login state management interface; the login state extension request is used for requesting to extend the validity duration of the client;
in the embodiment of the invention, the server can be provided with a preset login state management interface, and the login state management interface manages the generation, the time limit extension, the deletion and other services of the login identification of the client so as to realize the management of the login state of the client. The client can provide account information for the server to log in at the server to acquire the specific function provided by the server. The server side can generate a login identification for the client side providing correct account information, and stores login state information corresponding to the login identification so as to record the login identification of the client side, the generation time of the login identification, the validity period and other information and obtain the login state of the user. Meanwhile, the server side can return the login identification to the client side, so that the client side can be in a logged-on state within a period of time.
When the client finishes logging in and is in a logged state, the client can send a login state extension request to a login state management interface of the server according to actual needs so as to request to extend the validity duration of the client, so that the server continues to keep the client in the logged state. Therefore, the server side can receive the login state extension request sent by the client side by adopting a preset login state management interface.
Step 202, searching whether a client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
in the embodiment of the present invention, the server may store a login identifier corresponding to the client. The login identifier may be invalidated after a preset validity period from the generation of the login identifier, so that the login identifier may be in an active state or an invalid state. If the login identifier is still in the preset validity duration, the login identifier may be in a valid state, and the client may continue to be in the logged-on state at this time. If the login identifier is not currently in the preset validity duration, the login identifier may be in a failure state, the client cannot be kept in the logged-in state at this time, and the server may consider that the client has logged out and is in the unregistered state.
The preset validity period may be 1 day, 10 days, 30 days, 90 days, and the like, which is not limited in the present invention.
In the embodiment of the invention, in order to avoid that the third party continuously prolongs the effective duration of the login identification after the login identification is leaked to the third party, so that the user information is utilized by the third party for a long time, and the safety of the user information is influenced. After the server side obtains the login state extension request, whether the client side corresponding to the login state extension request has the login identification in the valid state at present can be directly searched, the preset validity duration of the login identification is not changed, and therefore the situation that the user information is utilized by a third party for a long time due to the fact that the user reveals the login identification once is avoided.
In a specific implementation, the login status extension request may be recorded with a login identifier of the client. The server may search, by using the login identifier in the login state extension request, login state information matched with the login identifier in the login state extension request from login state information stored in the server, so as to determine whether the login identifier corresponding to the client is currently in an effective state.
In an embodiment of the present invention, the step of searching whether the client corresponding to the login status extension request has a login identifier currently in a valid status includes:
s11, searching whether the client corresponding to the login state extension request has a login identifier with the use duration not greater than the preset validity duration;
in the embodiment of the present invention, the usage duration of the login identifier may be a duration between the generation time of the login identifier and the current time. The server may find whether the client corresponding to the login state extension request has a login identifier whose usage duration is not greater than the preset validity duration, so as to determine whether the login identifier is still in a valid state.
In a specific implementation, the server may search login state information matched with the login identifier in the login state extension request from login state information stored in the server, and determine the generation time of the login identifier based on the login state information, so that the use duration of the login identifier may be determined according to a duration from the generation time of the login identifier to the current time.
In a specific implementation, the server may set a login state manager, and the login state manager may store login state information corresponding to all login identifiers in an effective state. The server can automatically remove the login state information corresponding to the login identifier from the login state manager after the use duration of the login identifier reaches the preset validity duration. Therefore, the server can determine whether the client corresponding to the login state extension request has a login identifier with the use duration not greater than the preset validity duration according to whether the login state information corresponding to the login identifier can be found in the login state manager.
S12, if the client has the login identification with the use duration not greater than the preset validity duration, the client has the login identification in the valid state at present;
in the embodiment of the present invention, if the client has a login identifier whose usage duration is not greater than the preset validity duration, the login identifier corresponding to the client may still be considered to be in a valid state, and at this time, the client may continue to be kept in the logged-in state.
S13, if the client does not have the login identification with the use duration not greater than the preset validity duration, the client does not have the login identification in the valid state currently.
In the embodiment of the present invention, if the client does not have a login identifier whose usage duration is not greater than the preset validity duration, it may be considered that the login identifier corresponding to the client may be in a failure state, at this time, the client may not be kept in a logged-in state, and the server may consider that the client has logged out and is in an unregistered state.
Step 203, if the login identification is in an active period state, distributing the login identification for the client;
in the embodiment of the invention, in order to avoid that the client can acquire a new login identifier after the login identifier is in a failure state, the client needs to be in a login exit state first and then logs in again to acquire the new login identifier, and bad experience is brought to the user. The valid status of the login id may be further divided into an active period status and an extended period status.
Specifically, the active period state is that an interval between the generation time of the login identifier and the current time is smaller than a first time interval; the time limit extension state is that the interval between the generation time of the login identification and the current time is larger than a first time interval and smaller than a second time interval.
If the interval between the generation time of the login identification and the current time reaches the second time interval, the service time of the client at the moment can be considered to be the same as the preset validity time, and the login identification does not keep the valid state any more.
Under the condition that the use time of the login identification is obviously shorter than the preset validity period, at the moment, the interval between the generation time of the login identification and the current time is shorter than the first time interval, the login identification can continue to provide a login state with a longer time for the client, and the login identification can be considered to be in an active period. Under the condition that the use time of the login identifier is close to the preset validity duration, the login identifier can continue to provide a logged-in state with a short time for the client, the interval between the generation time of the login identifier and the current time is larger than the first time interval and smaller than the second time interval, the login identifier can be considered to be in a time-limit extended-period state, and at the moment, the server needs to prepare to extend the valid time of the logged-in state of the client.
Therefore, after determining that the client corresponding to the login state extension request has the login identifier currently in the valid state, the server may further determine that the valid state is the active period state or the time limit extension period state, so as to determine whether further processing needs to be performed on the login identifier of the client.
The duration of the active period state and the duration of the extended period state may be determined according to actual needs, which is not limited in the present invention.
Fig. 3 is a schematic diagram illustrating a status of a login id according to an embodiment of the present invention. The login identification may have a validity period of 90 days. The login identification can be in an active period state within 0-60 days. The login identification can be in a state of a prolonged period within 61-90 days. After 90 days, the login identification is in a failure state.
In the embodiment of the present invention, if the login identifier is in the active period state, it may be considered that the login identifier may continue to provide the client with the logged-in state for a long time. At this time, the login identifier does not need to be processed, the login identifier in the active period state at present can be directly allocated, and the client can continue to keep the logged-in state for a long time.
Optionally, if the server confirms that the login identifier of the client is in the active period state, it may be considered that the client may continue to maintain the logged-in state for a long time even though the login identifier currently in the active period state is not returned at this time. In this case, if the server determines that the login identifier of the client is in the active period state, the server may directly ignore the login state extension request without allocating the login identifier to the client. Thereby further reducing the processing pressure of the server side.
And 204, if the login identification is in the state of the extended period of the time limit, generating a new login identification, and distributing the new login identification for the client.
In the embodiment of the present invention, if the login identifier is in the extended term state, it may be considered that the login identifier may continue to provide the client with the logged-in state for a shorter time, and at this time, the client is prevented from entering the logged-out state. A new login identification may be generated and assigned to the client. Because the new login identification has a new effective period, the client can access the server by adopting the new login identification after obtaining the new login identification. After the server generates a new login identification, the original login identification can be set to be in a failure state, so that the original login identification fails in advance. So that extension of the logged-in state can be achieved. And the login identification is replaced, so that the login identification of the user is prevented from being leaked to a third party, and the third party can use the login identification for a long time.
In one embodiment of the invention, the method further comprises:
the method further comprises the following steps:
s21, after the new login identification is distributed, an asynchronous identification invalidation message is generated; the asynchronous identification invalidation message is used for setting the original login to an invalidation state;
in the embodiment of the present invention, the client may not obtain a new login identifier in time due to network fluctuation and other reasons, and if the server sets the original login identifier to the disabled state after generating the new login identifier, the user is likely to log out. Therefore, after the server allocates the new login identification, the server may temporarily set the original login identification to the disabled state, but generate an asynchronous identification disable message to wait for the subsequent setting of the original login identification to the disabled state.
S22, detecting whether the access information sent by the client is received within a preset delay time; the access information comprises the new login identification;
in this embodiment of the present invention, the asynchronous identifier invalidation information may be executed at the latest after a preset delay time after the server allocates the new login identifier. Within a preset delay time, the server can detect whether the client accesses the server by adopting the access information containing the new login identification.
If the access information containing the new login identification sent by the client is received, the client can be considered to have received the new login identification. If the access information containing the new login identification sent by the client is not received, the client can be considered to still not receive the new login identification.
After the preset delay time, in order to avoid the risk that the login identification is still utilized by a third party due to the fact that the original login identification and the new login identification are effective simultaneously for a long time, the original login identification can be set to be in a failure state no matter whether the access information sent by the client is received or not.
And S23, if the access information sent by the client is received, executing the asynchronous identification invalidation information.
In the embodiment of the present invention, if the access information sent by the client is received, it may be considered that the client has received the new login identifier, and at this time, the asynchronous identifier invalidation information may be directly executed without continuing to wait, and the original login identifier is set to the invalidation state, and meanwhile, the logged-in state of the client may continue to be maintained.
In a specific implementation, fig. 4 is a system block diagram of a method for allocating login identifiers according to an embodiment of the present invention. Which includes a login status manager 401, a message handler 402, and an invalidation information storage space 403. The login state manager 401 is configured to store a login identifier in an effective state, and generate and allocate the login identifier. The message processor 402 is configured to process the asynchronous identification invalidation message. The failure information storage space 403 is used for storing the login identifier in a failure state and the failure reason thereof.
The login status manager 401 may generate an asynchronous identity invalidation message after assigning the new login identity to the client and send it to the message processor 402. Within a preset delay time, after detecting that the access information sent by the client is received or the preset delay time is reached, the message processor 402 may move the original login identifier stored by the login state manager 401 to the failure information storage space 403.
In an embodiment of the invention, the method further comprises:
and S31, if the service time of the login identification exceeds the preset validity period or a login quitting request sent by the client is received, setting the login identification to be in a failure state.
In the embodiment of the present invention, if the usage duration of the login identifier exceeds the preset validity duration, at this time, the login identifier may not be used continuously, and the login identifier may be set to be in a failure state. If a log-out request sent by the client is received, the client is considered to actively request the server to set the login identification to be in a failure state, and at this time, the login identification needs to be set to be in the failure state no matter whether the use duration of the login identification is still within the preset validity duration.
In specific implementation, fig. 4 is a system block diagram of a method for allocating a login identifier according to an embodiment of the present invention. If the use duration of the login identifier exceeds the preset validity duration or a login logout request sent by the client is received, the login state manager 401 does not need to send an asynchronous identifier invalidation message, and can directly move the login identifier to the invalidation information storage space 403.
According to the login identification allocation method provided by the embodiment of the invention, the login state extension request sent by the client is received by adopting the preset login state management interface, so that the login state related business can be processed for the client under the condition that the client actively requests to extend the logged-in state. Then, identifying whether the client corresponding to the login state extension request has a login identifier in an effective state; if the login identification in the active period state exists, distributing the login identification for the client; and if the login identification is in the state of the time limit extension period, generating a new login identification, and distributing the new login identification for the client. Therefore, the influence on the user information safety caused by the fact that the login identification is leaked can be avoided, meanwhile, the active client side can be kept in the logged-in state stably, and the processing efficiency of the server side is effectively improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a structure of an embodiment of an apparatus for allocating a login identifier according to the present invention is shown, and the apparatus specifically includes the following modules:
a receiving module 501, configured to receive a login state extension request sent by a client by using a preset login state management interface;
a searching module 502, configured to search whether a client corresponding to the login state extension request has a login identifier currently in an effective state; the login identification is invalid after the preset validity duration from the generation of the login identification;
an allocating module 503, configured to allocate the login identifier to the client if the login identifier currently in an effective state exists.
In an embodiment of the present invention, the lookup module includes:
the time length determining submodule is used for searching whether the client corresponding to the login state extension request has a login identifier of which the use time length is not more than the preset validity time length;
the first state determining submodule is used for determining that the client has the login identifier which is currently in the valid state if the client has the login identifier with the use duration not greater than the preset validity duration;
and the second state determining submodule is used for determining that the client does not have the login identifier in the current valid state if the client does not have the login identifier with the use duration not greater than the preset validity duration.
In one embodiment of the present invention, the valid state includes an active period state and an extended period state;
the distribution module comprises:
the first allocating submodule is used for allocating the login identification for the client if the login identification is in an active period state;
and the second distribution submodule is used for generating a new login identifier if the client has the login identifier in the time limit extension period state, and distributing the new login identifier for the client.
In one embodiment of the invention, the apparatus further comprises:
the asynchronous message generating module is used for generating asynchronous identification failure messages after the new login identification is distributed; the asynchronous identification invalidation message is used for setting the original login to an invalidation state;
the access detection module is used for detecting whether the access information sent by the client is received within a preset delay time; the access information comprises the new login identification;
and the asynchronous execution module is used for executing the asynchronous identification failure information if receiving the access information sent by the client.
In one embodiment of the invention, the apparatus further comprises:
and the state setting module is used for setting the login identification to be in a failure state if the use time of the login identification exceeds the preset validity time or a login logout request sent by the client is received.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
receiving a login state extension request sent by a client by adopting a preset login state management interface;
searching whether a client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
and if the login identification in the effective state currently exists, distributing the login identification for the client.
Optionally, the step of searching whether the client corresponding to the login state extension request has a login identifier currently in a valid state includes:
searching whether a client corresponding to the login state extension request has a login identifier with the use duration not greater than the preset validity duration;
if the client has the login identification with the use duration not greater than the preset validity duration, the client has the login identification in the valid state at present;
and if the client does not have the login identification with the use duration not greater than the preset validity duration, the client does not have the login identification in the valid state currently.
Optionally, the valid state comprises an active period state and an extended period state;
if the login identification in the valid state exists, the step of distributing the login identification to the client comprises the following steps:
if the login identification in the active period state exists, distributing the login identification for the client;
and if the login identification is in the state of the time limit extension period, generating a new login identification, and distributing the new login identification for the client.
Optionally, the method further comprises:
after the new login identification is distributed, generating an asynchronous identification invalidation message; the asynchronous identification invalidation message is used for setting the original login to an invalidation state;
detecting whether access information sent by the client is received within a preset delay time; the access information comprises the new login identification;
and if receiving the access information sent by the client, executing the asynchronous identification failure information.
Optionally, the method further comprises:
and if the use time of the login identification exceeds the preset validity time or a login quitting request sent by the client is received, setting the login identification to be in a failure state.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, there is further provided a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the method for allocating login identities described in any one of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for assigning login identities as described in any of the above embodiments.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for distributing login identification is characterized in that the method comprises the following steps:
adopting a login state management interface to receive a login state extension request sent by a client; the login state extension request is used for requesting to extend the validity duration of the client;
searching whether a client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
and if the login identification in the effective state currently exists, distributing the login identification for the client.
2. The method according to claim 1, wherein the step of searching whether the client corresponding to the login status extension request has a login identifier currently in a valid status comprises:
searching whether a client corresponding to the login state extension request has a login identifier with the use duration not greater than the preset validity duration;
if the client has the login identification with the use duration not greater than the preset validity duration, the client has the login identification in the valid state currently;
and if the client does not have the login identification with the use duration not greater than the preset validity duration, the client does not have the login identification in the valid state currently.
3. The method of claim 1, wherein the valid state comprises an active period state and an extended period state; the active period state is that the interval between the generation time of the login identification and the current time is smaller than a first time interval; the time limit extension period state is that the interval between the generation time of the login identification and the current time is larger than a first time interval and smaller than a second time interval;
if the login identification in the valid state exists, the step of distributing the login identification to the client comprises the following steps:
if the login identification in the active period state exists, distributing the login identification for the client;
and if the client has the login identification in the state of the time limit extension period, generating a new login identification, and distributing the new login identification for the client.
4. The method of claim 3, further comprising:
after the new login identification is distributed, generating an asynchronous identification invalidation message; the asynchronous identification invalidation message is used for setting the original login identification to be in an invalidation state;
detecting whether access information sent by the client is received within a preset delay time; the access information comprises the new login identification;
and if receiving the access information sent by the client, executing the asynchronous identification invalidation information.
5. The method of claim 1, further comprising:
and if the use time of the login identification exceeds the preset validity time or a login quitting request sent by the client is received, setting the login identification to be in a failure state.
6. An apparatus for assigning login identification, the apparatus comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a login state extension request sent by a client by adopting a preset login state management interface; the login state extension request is used for requesting to extend the validity duration of the client;
the searching module is used for searching whether the client corresponding to the login state extension request has a login identifier in an effective state currently; the login identification is invalid after the preset validity duration from the generation of the login identification;
and the allocation module is used for allocating the login identification for the client if the login identification in the current effective state exists.
7. The apparatus of claim 6, wherein the lookup module comprises:
the time length determining submodule is used for searching whether the client corresponding to the login state extension request has a login identifier of which the use time length is not more than the preset validity time length;
the first state determining submodule is used for determining that the client has the login identifier which is currently in the valid state if the client has the login identifier with the use duration not greater than the preset validity duration;
and the second state determining submodule is used for determining that the client does not have the login identification which is in the valid state currently if the client does not have the login identification of which the using time length is not more than the preset validity period time length.
8. The apparatus of claim 6, wherein the valid state comprises an active period state and an extended period state; the active period state is that the interval between the generation time of the login identification and the current time is smaller than a first time interval; the time limit extension state is that the interval between the generation time of the login identification and the current time is greater than a first time interval and less than a second time interval;
the distribution module includes:
the first allocation sub-module is used for allocating the login identification for the client if the login identification is in an active period state;
and the second distribution submodule is used for generating a new login identifier if the client has the login identifier in the time limit extension period state, and distributing the new login identifier for the client.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202111052184.2A 2021-09-08 2021-09-08 Login identifier distribution method and device Active CN113794708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111052184.2A CN113794708B (en) 2021-09-08 2021-09-08 Login identifier distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111052184.2A CN113794708B (en) 2021-09-08 2021-09-08 Login identifier distribution method and device

Publications (2)

Publication Number Publication Date
CN113794708A CN113794708A (en) 2021-12-14
CN113794708B true CN113794708B (en) 2023-04-07

Family

ID=79182769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111052184.2A Active CN113794708B (en) 2021-09-08 2021-09-08 Login identifier distribution method and device

Country Status (1)

Country Link
CN (1) CN113794708B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109547422B (en) * 2018-11-09 2021-06-25 福建天泉教育科技有限公司 Method and terminal for automatically renewing login state
CN109802941A (en) * 2018-12-14 2019-05-24 平安科技(深圳)有限公司 A kind of login validation method, device, storage medium and server
CN110166529A (en) * 2019-04-16 2019-08-23 平安普惠企业管理有限公司 It keeps logging in state method, apparatus, equipment and storage medium
US11271947B2 (en) * 2019-07-24 2022-03-08 The Toronto-Dominion Bank Systems and methods for authenticating data access requests
CN111181941B (en) * 2019-12-23 2022-07-05 杭州安恒信息技术股份有限公司 Page login method, system and related device
CN112836204A (en) * 2021-02-03 2021-05-25 中国人民财产保险股份有限公司 Token updating method and device
CN112953951B (en) * 2021-03-02 2022-04-12 浪潮云信息技术股份公司 User login verification and security detection method and system based on domestic CPU

Also Published As

Publication number Publication date
CN113794708A (en) 2021-12-14

Similar Documents

Publication Publication Date Title
WO2020233059A1 (en) Login processing method based on data processing and related apparatus
CN112087644B (en) Pull stream request processing method, device and system, electronic equipment and storage medium
CN111585867A (en) Message processing method and device, electronic equipment and readable storage medium
CN108494755B (en) Method and device for transmitting Application Programming Interface (API) request
CN111046310A (en) Page processing method, device, server and computer readable storage medium
CN109213604B (en) Data source management method and device
CN109150745B (en) Message processing method and device
CN112134954A (en) Service request processing method and device, electronic equipment and storage medium
CN111367672A (en) Data caching method and device, electronic equipment and computer storage medium
CA2550879A1 (en) License distribution in a packet data network
CN110430070B (en) Service state analysis method, device, server, data analysis equipment and medium
CN110311975B (en) Data request processing method and device
CN113794708B (en) Login identifier distribution method and device
CN111556109B (en) Request processing method and device, electronic equipment and storage medium
KR101845195B1 (en) Multiple Resource Subscriptions Association Method in an M2M system
CN111556125B (en) Access request distribution method, load balancing equipment and electronic equipment
CN113067803A (en) Resource isolation system, request processing method and request processing device
CN112084501A (en) Malicious program detection method and device, electronic device and storage medium
KR20200046315A (en) Method for Subscription Expiration Management and M2M System applying the same
CN111522649B (en) Distributed task allocation method, device and system
CN110113187B (en) Configuration updating method and device, configuration server and configuration system
CN110875831B (en) Method and device for monitoring network quality
CN112860432A (en) Process management method, device and server
CN111917787A (en) Request detection method and device, electronic equipment and computer-readable storage medium
CN113472831A (en) Service access method, device, gateway equipment and storage medium

Legal Events

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