Access control method, device, electronic device and readable storage medium

By generating encrypted random tokens and setting delay processing time according to access frequency, the IP address disabling problem caused by overfrequency access is solved, and the processing of overfrequency access is realized, which simplifies user operations and improves user experience.

CN116112210BActive Publication Date: 2025-03-04CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211548599.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-03-04
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

In the prior art, the user's IP address that is accessed overfrequency is disabled, resulting in the user having to change the IP address again when necessary, which is cumbersome and affects the user experience.

Method used

By obtaining the IP address of the target access request sent by the client and its access frequency, if the frequency is greater than the target threshold, the target delay processing time is generated, and an encrypted random token is generated based on this time and access request to determine the waiting time of the token. When the waiting time is greater than the delay processing time, the encrypted random token is called for access request processing.

Benefits of technology

By increasing the access time cost of overfrequency access, the impact of overfrequency access is eliminated, and users need to change their IP addresses to access again, simplifying the operation process and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112210B_ABST
    Figure CN116112210B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide an access control method, device, electronic device and storage medium, including: obtaining an IP address of an accessing user according to a target access request sent by a client, obtaining an access frequency of the IP address, generating a target delay processing time for the target access request according to the access frequency when the access frequency is greater than a target threshold, generating an encrypted random token according to the target delay processing time and the target access request, determining a waiting time for the encrypted random token, and calling the target access request for access according to the encrypted random token when the waiting time is greater than the target delay processing time; by delaying the IP address that is accessed too frequently, the access frequency of the problem IP address is reduced, the impact of over-frequent access is eliminated, and the problem that the user needs to change the IP address again to access again is avoided, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communication technology, and in particular relates to an access control method, device, electronic equipment and readable storage medium. Background Art

[0002] Some malicious attackers often use the server to generate legitimate requests for corresponding network applications, thereby continuously accessing the corresponding network applications to consume the performance of the website server in order to attack the website, causing the website server to crash, and normal users are unable to use the website server.

[0003] To solve this problem, the current practice is to obtain the IP addresses of users who access network applications within a period of time. When it is detected that the number of visits from some of the IP addresses is greater than the set threshold, these IP addresses are considered to be over-accessing, and these IP addresses are banned from accessing these network applications again. However, this will cause users to change their IP addresses when necessary to access again, which is cumbersome and affects the user experience. Summary of the invention

[0004] The present invention provides an access control method, device, electronic device and readable storage medium to solve the problem in the prior art that the IP address of a user who accesses too frequently is disabled, resulting in the user having to change the IP address again when necessary, which is cumbersome to operate and affects the user experience.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, the present invention provides an access control method, the method comprising:

[0007] Obtain the IP address of the access user according to the target access request sent by the client;

[0008] Obtaining the access frequency of the IP address;

[0009] In a case where the access frequency is greater than a target threshold, generating a target delay processing time for the target access request according to the access frequency;

[0010] generating a cryptographically random token according to the target delayed processing time and the target access request;

[0011] Determining a waiting time for the encrypted random token;

[0012] In a case where the waiting time is greater than the target delayed processing time, the target access request is called for access according to the encrypted random token.

[0013] Optionally, generating an encrypted random token according to the target delayed processing time and the target access request includes:

[0014] When it is detected that the target delayed processing time is greater than 0, the encrypted random token is generated according to the target access request, and the encrypted random token is stored together with the target delayed processing time and the target access request.

[0015] Optionally, after generating a cryptographically random token according to the target delayed processing time and the target access request, the method further includes:

[0016] Return the target waiting page carrying the encrypted random token to the client;

[0017] After the target waiting page waits for a preset time period for a target, receiving a transfer link request carrying the encrypted random token;

[0018] The encrypted random token is called according to the transit link request.

[0019] Optionally, determining the waiting time of the encrypted random token includes:

[0020] Obtaining a first time of the target access request and a second time of the transit link request;

[0021] The waiting time of the encrypted random token is determined according to the first time and the second time.

[0022] Optionally, when the waiting time is greater than the target delay processing time, calling the target access request for access according to the encrypted random token includes:

[0023] When the waiting time is greater than the target delay processing time, adjusting the target delay processing time to 0;

[0024] The target access request is invoked to access the target according to the encrypted random token.

[0025] Optionally, when the access frequency is greater than a target threshold, generating a target delay processing time for the target access request according to the access frequency includes:

[0026] When the access frequency is greater than a target threshold, generating a random verification code;

[0027] When it is detected that the verification code is verified successfully, generating a first delay processing time for the target access request according to the access frequency;

[0028] In the case where it is detected that the verification code verification fails, generating a second delay processing time for the target access request according to the access frequency;

[0029] A target delayed processing time is generated for the target access request according to the first delayed processing time and the second delayed processing time.

[0030] Optionally, the verification code includes any one or combination of the following: a digital verification code, a text verification code, a picture verification code, and a voice verification code.

[0031] In a second aspect, the present invention provides an access control device, the device comprising:

[0032] The first acquisition module is used to obtain the IP address of the access user according to the target access request sent by the client;

[0033] A second acquisition module is used to acquire the access frequency of the IP address;

[0034] A first generating module, configured to generate a target delay processing time for the target access request according to the access frequency when the access frequency is greater than a target threshold;

[0035] A second generating module, used to generate an encrypted random token according to the target delayed processing time and the target access request;

[0036] A determination module, used to determine the waiting time of the encrypted random token;

[0037] A calling module is used to call the target access request for access according to the encrypted random token when the waiting time is greater than the target delay processing time.

[0038] In a third aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned access control method when executing the program.

[0039] In a fourth aspect, the present invention provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above-mentioned access control method.

[0040] In an embodiment of the present invention, the IP address of the accessing user is obtained according to the target access request sent by the client, and the access frequency of the IP address is obtained. When the access frequency is greater than the target threshold, it is determined that the IP address needs to be delayed, so a target delay processing time is generated for the target access request according to the access frequency, and then an encrypted random token is generated according to the target delay processing time and the target access request, so that the token is used to implement delayed processing of access requests for IP addresses that are accessed too frequently, eliminating the impact of excessive access, and determining the waiting time of the encrypted random token. When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token. By increasing the access time cost of the IP address that is accessed too frequently, the impact of excessive access is eliminated, and the problem that the blocked user needs to change the IP address again before accessing again, which causes difficult and cumbersome operation, is avoided, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 This is one of the step flow charts of an access control method provided by an embodiment of the present invention;

[0043] Figure 2 This is a second step flow chart of an access control method provided by an embodiment of the present invention;

[0044] Figure 3 This is a step flow chart of an access control method provided by an embodiment of the present invention;

[0045] Figure 4 This is a fourth step flow chart of an access control method provided by an embodiment of the present invention;

[0046] Figure 5 is a structural diagram of an access control device provided by an embodiment of the present invention;

[0047] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Figure 1 This is one of the step flow charts of an access control method provided by an embodiment of the present invention. Figure 1 As shown, the method may include:

[0050] Step 101: Obtain the IP address of the access user according to the target access request sent by the client.

[0051] In the embodiment of the present invention, the target access request is an access initiated by a user from a client, where the client refers to a program corresponding to a server that provides local services to a client, such as a web page or an APP, etc. When the server receives the target access request, the information carried by the request can be obtained, including at least one of the following: the IP address of the user requesting the access, the purpose of the access request, that is, the resource requested to be accessed, and the time of the access request, etc., which are not specifically limited in the present invention.

[0052] Specifically, the steps of obtaining the IP address of the access user based on the target access request sent by the client include:

[0053] Receive a target access request sent by a client;

[0054] Obtain the IP address of the access user, the requested access resource, and the access time based on the target access request.

[0055] Step 102, obtaining the access frequency of the IP address.

[0056] The access frequency of an IP address in an embodiment of the present invention is calculated by obtaining the number of accesses of the IP address within a set time. Specifically, all IP address access records within a set time period are stored on the server side. All access records of the same IP address are searched in the IP address access record according to the accessed IP address, and an access count is returned. Then, the access frequency of the IP address is calculated based on the access count and the set time.

[0057] It should be noted that in the embodiment of the present invention, the access frequency of the IP address is judged, so the IP address access record is continuously updated with the change of time. At a certain moment, the access frequency of the IP address is greater than the target threshold, but after a period of time, when the IP address is accessed again, its access frequency may be less than the target threshold.

[0058] Step 103: When the access frequency is greater than the target threshold, a target delay processing time is generated for the target access request according to the access frequency.

[0059] The target threshold of the embodiment of the present invention can be determined by previous experience or by the server's daily monitoring of the number of IP address accesses, or can be set according to the server's tolerance, and the present invention does not make any specific limitation here.

[0060] In the embodiment of the present invention, when an accessed IP address is obtained, the IP address is first judged to see whether the access frequency is greater than the target threshold. When it is detected that the access frequency of the IP address exceeds the target threshold, it is judged that the IP address has been over-frequently accessed at this time, and a delay time is set for the access request of this IP address. For example, the server stores a total of 10,000 IP addresses that access the server within 2 hours. According to the accessed IP address, all access records of the same IP address are searched in the access record of this IP address, and the returned value is 1,000 times. Then, the access frequency of this IP address is 500 times / hour. If the set target threshold is 499 times / hour, the access frequency of the IP address exceeds the target threshold, which is an over-frequent access. A delay time is set for the access request of this IP address. If the set target threshold is 501 times / hour, the access frequency of the IP address does not exceed the target threshold, which is a normal access.

[0061] In addition, when it is detected that the accessed IP address is over-frequently accessed, different delay times can be generated according to the access frequency. The greater the access frequency, the longer the delay time. For example, the target threshold is set to 500 times / hour. When the access frequency is calculated to be 501 times / hour, the target delay processing time is set to 5 minutes. When the access frequency is calculated to be 510 times / hour, the target delay processing time is set to 1 hour. By increasing the delay time for requesting access, the number of IP accesses that are over-frequently accessed within a certain period of time is reduced, thereby better eliminating the impact of over-frequent access.

[0062] Step 104: Generate an encrypted random token according to the target delayed processing time and the target access request.

[0063] In the embodiment of the present invention, when it is determined that a target access request needs to be delayed, an encrypted token is set for this access request, and the token is saved together with the target access request and the generated target delay processing time. The target access request is then called through the token and it is determined whether the delay time has passed. Therefore, after the target delay processing time is generated, an encrypted random token is generated based on the target delay processing time and the target access request. The specific steps include: when it is detected that the target delay processing time is greater than 0, an encrypted random token is generated based on the target access request.

[0064] Then the target delayed processing time, target access request and encrypted random token are combined and saved.

[0065] Step 105, determining the waiting time of the encrypted random token.

[0066] The embodiment of the present invention delays the processing of over-frequently accessed target access requests by generating an encrypted random token. Therefore, to determine whether the target access request has passed the target delay processing time, it is necessary to first determine the waiting time of the encrypted random token, and then determine whether the waiting time is greater than the target delay processing time based on the waiting time of the encrypted random token.

[0067] It should be noted that the waiting time of the encrypted random token can be obtained by obtaining the time information of the target access request and the time information of the transit link request. The specific implementation steps include:

[0068] Get the first time of the target access request and the second time of the transit link request.

[0069] A waiting time for the encrypted random token is determined based on the first time and the second time.

[0070] Step 106: When the waiting time is greater than the target delay processing time, the target access request is called according to the encrypted random token for access.

[0071] In the embodiment of the present invention, the waiting time of the encrypted random token is verified to determine whether the delayed processing time has been passed. When it is detected that the waiting time of the encrypted random token is greater than the target delayed processing time, the verification is passed. Because the encrypted random token is associated with the target access request, the corresponding target access request link is obtained through the encrypted random token at this time, and the client is returned and jumps to the initial request link to continue processing.

[0072] In an embodiment of the present invention, the IP address of the accessing user is obtained according to the target access request sent by the client, and the access frequency of the IP address is obtained. When the access frequency is greater than the target threshold, it is determined that the IP address needs to be delayed, so a target delay processing time is generated for the target access request according to the access frequency, and then an encrypted random token is generated according to the target delay processing time and the target access request, so that the token is used to implement delayed processing of access requests for IP addresses that are accessed too frequently, eliminating the impact of excessive access, and determining the waiting time of the encrypted random token. When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token. By increasing the access time cost of the IP address that is accessed too frequently, the impact of excessive access is eliminated, and the problem that the blocked user needs to change the IP address again before accessing again, which causes difficult and cumbersome operation, is avoided, thereby improving the user experience.

[0073] Figure 2 This is a second step flow chart of an access control method provided by an embodiment of the present invention. Figure 2 As shown, the method may include:

[0074] Step 201, returning the target waiting page carrying the encrypted random token to the client.

[0075] In the embodiment of the present invention, there will be a waiting time between generating a token and determining whether the delay time has passed based on the token. Therefore, after the token is generated, a target waiting page carrying the token is returned to prompt the user to wait and state the reason for waiting to avoid anxiety caused by the user's lack of understanding of the situation.

[0076] Step 202, receiving a forwarding link request carrying an encrypted random token after the target waiting page waits for a preset time period.

[0077] In the embodiment of the present invention, the target waiting interface will jump to the transit link carrying the token after a preset time period. A countdown display interface can be set on the target waiting interface according to the preset time period to remind the user of the waiting time, so as to facilitate the user to arrange time according to this information.

[0078] It should be noted that, in general, the preset time period is not greater than the target delay processing time, and because the target delay processing time will increase with the increase of access frequency, in general, the preset time is set to be consistent with or slightly less than the target delay processing time generated when the user access frequency is just excessive. For example, the target threshold is set to 49 times / minute, when the user access frequency is 50 times / minute, which is judged as excessive, and the target delay processing time is set to 5 minutes, then the preset time period is set to 5 minutes or less.

[0079] Step 203, calling the encrypted random token according to the transit link request.

[0080] In an embodiment of the present invention, the server receives a transit link request carrying a token. At this time, the encrypted random token can be called according to the transit link request. At this time, the encrypted random token can be used to determine whether the waiting time is greater than the target delay processing time, and then determine whether to control the target access request through the token for access.

[0081] In an embodiment of the present invention, the IP address of the accessing user is obtained according to the target access request sent by the client, and the access frequency of the IP address is obtained. When the access frequency is greater than the target threshold, it is determined that the IP address needs to be delayed, so a target delay processing time is generated for the target access request according to the access frequency, and then an encrypted random token is generated according to the target delay processing time and the target access request, so that the token is used to implement delayed processing of access requests for IP addresses that are accessed too frequently, eliminating the impact of excessive access, and determining the waiting time of the encrypted random token. When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token. By increasing the access time cost of the IP address that is accessed too frequently, the impact of excessive access is eliminated, and the problem that the blocked user needs to change the IP address again before accessing again, which causes difficult and cumbersome operation, is avoided, thereby improving the user experience.

[0082] Figure 3 A third step flow chart of an access control method provided by an embodiment of the present invention is as follows: Figure 3 As shown, the method may include:

[0083] Step 301: When the waiting time is greater than the target delay processing time, the target delay processing time is adjusted to 0.

[0084] In an embodiment of the present invention, after the target waiting page carrying the token jumps to the transit link, the waiting time of the encrypted random token is calculated by obtaining the first time of the target access request and the second time of the transit link request, and then the relationship between the waiting time and the target delay processing time is judged. When it is detected that the waiting time is greater than the target delay processing time, it is proved that the target access request can end this delay processing. At this time, the target delay processing time must be adjusted to 0 so that it can be accessed.

[0085] In addition, the target preset time period set in the target waiting interface can also be used as the waiting time for the encrypted random token, because after the encrypted random token is generated, it returns to the target waiting page, and jumps to the transit link after the target preset time period, so the waiting time is the target preset time period.

[0086] Step 302: Call the target access request to access according to the encrypted random token.

[0087] In the embodiment of the present invention, when it is determined that the waiting time is greater than the target delay processing time, the target delay processing time is adjusted to 0, and then the target access request is called through an encrypted random token for access.

[0088] It should be noted that if the waiting time is less than the target delay processing time, it means that the waiting time is less than the set target delay processing time. At this time, it is necessary to monitor the waiting time of the token in real time until it is detected that the waiting time is greater than the target delay processing time. Then set the target delay processing time to 0, and then call the target access request for access based on the encrypted random token.

[0089] In an embodiment of the present invention, the IP address of the accessing user is obtained according to the target access request sent by the client, and the access frequency of the IP address is obtained. When the access frequency is greater than the target threshold, it is determined that the IP address needs to be delayed, so a target delay processing time is generated for the target access request according to the access frequency, and then an encrypted random token is generated according to the target delay processing time and the target access request, so that the token is used to implement delayed processing of access requests for IP addresses that are accessed too frequently, eliminating the impact of excessive access, and determining the waiting time of the encrypted random token. When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token. By increasing the access time cost of the IP address that is accessed too frequently, the impact of excessive access is eliminated, and the problem that the blocked user needs to change the IP address again before accessing again, which causes difficult and cumbersome operation, is avoided, thereby improving the user experience.

[0090] Figure 4 A fourth step flow chart of an access control method provided by an embodiment of the present invention is as follows: Figure 4 As shown, the method may include:

[0091] Step 401: When the access frequency is greater than the target threshold, a random verification code is generated.

[0092] In the embodiment of the present invention, in order to distinguish between normal user access and malicious access using computer programs, when it is detected that the access frequency of the IP address exceeds the target threshold, it is determined that the user IP of the access request at this time is an over-frequency access, and it is necessary to delay the processing of the target access request. A randomly generated verification code can be set, and the user enters the verification code to prove that it is a real person operating at this time, and users who really need it will cooperate with the verification, and users who really need to access are also screened out.

[0093] It should be noted that the verification code can be set in a variety of forms, specifically, the verification code includes any one or combination of the following: digital verification code, text verification code, picture verification code, voice verification code. In addition, according to the development of technology, new verification methods can also be applied to the present invention, and the present invention does not make specific limitations here.

[0094] Step 402: when it is detected that the verification code is verified successfully, a first delay processing time is generated for the target access request according to the access frequency.

[0095] In the embodiment of the present invention, a verification code is generated to distinguish between normal user access and malicious access using computer programs. Then, when it is detected that the verification code verification is passed, it proves that a real person is accessing at this time. Considering that some users do need to visit the server multiple times for some reasons, when setting the target delay processing time, the delay time of these verified user IPs is set to be shorter than the delay time set without any verification means. However, the delay processing time is still set accordingly according to the frequency of access. The higher the access frequency, the longer the delay time. These delay times set through verification are called first delay processing times, that is, the first delay processing time is generated according to the access frequency.

[0096] For example, the verification code set is a digital verification code, and the result of "7+5" is entered into the verification box. After entering "12", it is prompted that the verification is passed, and then the corresponding first delay processing time is generated according to the access frequency this time. For example, the access frequency this time is 50 times / minute. The delay time is set to 5 minutes without verification. When it is detected that the verification is passed, the first delay processing time is set to 3 minutes.

[0097] Step 403: when it is detected that the verification code fails, a second delay processing time is generated for the target access request according to the access frequency.

[0098] In the embodiment of the present invention, a verification code is generated to distinguish between normal user access and malicious access using computer programs. Then, when it is detected that the verification code verification fails, it is determined that the computer program is accessing the server at this time, which is a malicious access. In order to curb this type of access, when setting the target delay processing time, the delay time of these user IPs that fail the verification is set to be shorter or longer than the delay time set when no verification means are used. In addition, the delay processing time is set accordingly according to the frequency of access. The higher the access frequency, the longer the delay time. These delay times set by verification are called second delay processing times, that is, the second delay processing time is generated according to the access frequency.

[0099] For example, the verification code is a digital verification code, and the result of "7+5" is entered into the verification box. After entering "10", it prompts that the verification failed, or if no input information is detected after a set period of time (30 seconds), the verification will also be judged as failed, and then the corresponding second delay processing time is generated according to the access frequency this time. For example, the access frequency this time is 50 times / minute, and the delay time is set to 5 minutes without verification. In the case of verification failure, the second delay processing time is set to 10 minutes. Reduce the number of malicious visits to eliminate the impact of excessive access.

[0100] Step 404: Generate a target delayed processing time for the target access request according to the first delayed processing time and the second delayed processing time.

[0101] In the embodiment of the present invention, the first delay processing time is the target delay processing time set when the verification code verification passes, and the second delay processing time is the target delay processing time set when the verification code verification fails. Different delay processing times are set according to different access situations. This can better judge malicious access, provide convenience for users with normal access, and improve user experience.

[0102] In an embodiment of the present invention, the IP address of the accessing user is obtained according to the target access request sent by the client, and the access frequency of the IP address is obtained. When the access frequency is greater than the target threshold, it is determined that the IP address needs to be delayed, so a target delay processing time is generated for the target access request according to the access frequency, and then an encrypted random token is generated according to the target delay processing time and the target access request, so that the token is used to implement delayed processing of access requests for IP addresses that are accessed too frequently, eliminating the impact of excessive access, and determining the waiting time of the encrypted random token. When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token. By increasing the access time cost of the IP address that is accessed too frequently, the impact of excessive access is eliminated, and the problem that the blocked user needs to change the IP address again before accessing again, which causes difficult and cumbersome operation, is avoided, thereby improving the user experience.

[0103] Figure 5 An embodiment of the present invention provides a structural diagram of an access control device, which may include:

[0104] The first acquisition module 501 is used to acquire the IP address of the access user according to the target access request sent by the client.

[0105] The second acquisition module 502 is used to acquire the access frequency of the IP address.

[0106] The first generating module 503 is configured to generate a target delay processing time for a target access request according to the access frequency when the access frequency is greater than a target threshold.

[0107] The second generating module 504 is used to generate an encrypted random token according to the target delayed processing time and the target access request.

[0108] The determination module 505 is used to determine the waiting time of the encrypted random token.

[0109] The calling module 506 is used to call the target access request for access according to the encrypted random token when the waiting time is greater than the target delay processing time.

[0110] Optionally, the second generating module further includes:

[0111] The first generating submodule is used to generate an encrypted random token according to a target access request when it is detected that the target delayed processing time is greater than 0, and the encrypted random token is stored together with the target delayed processing time and the target access request.

[0112] The return submodule is used to return the target waiting page carrying the encrypted random token to the client.

[0113] The receiving submodule is used to receive a transfer link request carrying an encrypted random token after the target waiting page waits for a preset time period.

[0114] The calling submodule is used to call the encrypted random token based on the transit link request.

[0115] Optionally, the determination module further includes:

[0116] The acquisition submodule is used to obtain the first time of the target access request and the second time of the transit link request.

[0117] The determination submodule is used to determine the waiting time of the encrypted random token according to the first time and the second time.

[0118] Optionally, the calling module further includes:

[0119] The adjustment submodule is used to adjust the target delay processing time to 0 when the waiting time is greater than the target delay processing time.

[0120] The calling submodule is used to call the target access request for access according to the encrypted random token.

[0121] Optionally, the first generating module further includes:

[0122] The second generating submodule is used to generate a random verification code when the access frequency is greater than the target threshold.

[0123] The third generating submodule is used to generate a first delay processing time for the target access request according to the access frequency when it is detected that the verification code verification is passed.

[0124] The fourth generating submodule is used to generate a second delay processing time for the target access request according to the access frequency when detecting that the verification code verification fails.

[0125] The fifth generating submodule is used to generate a target delayed processing time for the target access request according to the first delayed processing time and the second delayed processing time.

[0126] Optionally, the verification code includes any one or combination of the following: a digital verification code, a text verification code, a picture verification code, or a voice verification code.

[0127] In an embodiment of the present invention, the IP address of the accessing user is obtained according to the target access request sent by the client, and the access frequency of the IP address is obtained. When the access frequency is greater than the target threshold, it is determined that the IP address needs to be delayed, so a target delay processing time is generated for the target access request according to the access frequency, and then an encrypted random token is generated according to the target delay processing time and the target access request, so that the token is used to implement delayed processing of access requests for IP addresses that are accessed too frequently, eliminating the impact of excessive access, and determining the waiting time of the encrypted random token. When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token. By increasing the access time cost of the IP address that is accessed too frequently, the impact of excessive access is eliminated, and the problem that the blocked user needs to change the IP address again before accessing again, which causes difficult and cumbersome operation, is avoided, thereby improving the user experience.

[0128] The present invention also provides an electronic device, Figure 6 is a structural block diagram of an electronic device provided by an embodiment of the present invention, see Figure 6 , including a processor 601, a memory 602, and a computer program 6021 stored in the memory and executable on the processor, wherein when the processor executes the program, the following steps of the access control method are implemented:

[0129] Get the IP address of the access user based on the target access request sent by the client.

[0130] Get the access frequency of the IP address.

[0131] When the access frequency is greater than the target threshold, a target delay processing time is generated for the target access request according to the access frequency.

[0132] Generates a cryptographically random token based on the target latency processing time and the target access request.

[0133] Determines the wait time for a cryptographically random token.

[0134] When the waiting time is greater than the target delay processing time, the target access request is called for access according to the encrypted random token.

[0135] The present invention also provides a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the access control method of the aforementioned embodiment.

[0136] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0137] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other equipment. According to the above description, it is obvious that the structure required for constructing such a system is. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific language is for disclosing the best mode of the present invention.

[0138] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0139] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.

[0140] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0141] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0142] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0144] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0145] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0146] It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.

Claims

1. An access control method, characterized in that: The method comprises: Obtain the IP address of the access user according to the target access request sent by the client; Obtaining the access frequency of the IP address; In a case where the access frequency is greater than a target threshold, generating a target delay processing time for the target access request according to the access frequency; generating a cryptographically random token according to the target delayed processing time and the target access request; Determining a waiting time for the encrypted random token; In a case where the waiting time is greater than the target delayed processing time, the target access request is called for access according to the encrypted random token.

2. The method according to claim 1, characterized in that Generating a cryptographic random token according to the target delayed processing time and the target access request comprises: When it is detected that the target delayed processing time is greater than 0, the encrypted random token is generated according to the target access request, and the encrypted random token is stored together with the target delayed processing time and the target access request.

3. The method according to claim 1, characterized in that After generating a cryptographically random token according to the target delayed processing time and the target access request, the method further includes: Return the target waiting page carrying the encrypted random token to the client; After the target waiting page waits for a preset time period for a target, receiving a transfer link request carrying the encrypted random token; The encrypted random token is called according to the transit link request.

4. The method according to claim 3, characterized in that Determining the waiting time of the encrypted random token includes: Obtaining a first time of the target access request and a second time of the transit link request; The waiting time of the encrypted random token is determined according to the first time and the second time.

5. The method according to claim 1, characterized in that In the case where the waiting time is greater than the target delay processing time, calling the target access request for access according to the encrypted random token includes: When the waiting time is greater than the target delay processing time, adjusting the target delay processing time to 0; The target access request is invoked to access the target according to the encrypted random token.

6. The method according to claim 1, characterized in that: When the access frequency is greater than the target threshold, generating a target delay processing time for the target access request according to the access frequency includes: When the access frequency is greater than a target threshold, generating a random verification code; When it is detected that the verification code is verified successfully, generating a first delay processing time for the target access request according to the access frequency; In the case where it is detected that the verification code verification fails, generating a second delay processing time for the target access request according to the access frequency; A target delayed processing time is generated for the target access request according to the first delayed processing time and the second delayed processing time.

7. The method according to claim 6, characterized in that: The verification code includes any one or combination of the following: a digital verification code, a text verification code, a picture verification code, and a voice verification code.

8. An access control device, characterized in that: The device comprises: The first acquisition module is used to obtain the IP address of the access user according to the target access request sent by the client; A second acquisition module is used to acquire the access frequency of the IP address; A first generating module, configured to generate a target delay processing time for the target access request according to the access frequency when the access frequency is greater than a target threshold; A second generating module, used to generate an encrypted random token according to the target delayed processing time and the target access request; A determination module, used to determine the waiting time of the encrypted random token; A calling module is used to call the target access request for access according to the encrypted random token when the waiting time is greater than the target delay processing time.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the access control method according to any one of claims 1 to 7 when executing the program.

10. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the access control method described in one or more of claims 1-7.

Citation Information

Patent Citations

  • Flow monitoring method and device, computer device and storage medium

    CN109194584A

  • HTTP request detection method and device, computer device and storage medium

    CN112468460A