Access request processing method, device, equipment and storage medium

By comparing the user logo and the mapping data of the user logo and access address in the request, combined with the judgment of the number of access number thresholds, the accurate interception of the access request is realized, the problem of the interview of important user access, and the improvement of the website's system Stability and the flexibility of access limit.

CN114422228BActive Publication Date: 2025-01-28CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210041042.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2025-01-28
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

The prior art cannot guarantee normal access to important users when the website network bandwidth is full, and the current limiting technology is highly invasive and has poor flexibility.

Method used

By obtaining the current user logo and target access address in the access request, the target mapping data is formed, and it is compared with the pre -mapping cache data. If the target mapping data is authorized to access the user in the cache data; if the number is not there is less than the threshold, the access is also authorized; when the number of access reaches or exceeds the threshold, intercept the access request.

Benefits of technology

The interception accuracy of the access request is improved to ensure that important users can access the target access address without restrictions, while ensuring the system stability of the website.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114422228B_ABST
    Figure CN114422228B_ABST
Patent Text Reader

Abstract

The present invention discloses an access request processing method, device, equipment and storage medium. The method comprises: obtaining an access request; the access request comprises a current user identifier and a target access address; forming target mapping data according to the current user identifier and the target access address; if the target mapping data is in the pre-stored mapping cache data, authorizing the current user to access the target access address; wherein the pre-stored mapping cache data comprises mapping data of the user identifier and the access address. It can avoid that when the current user is an important user, the current user is intercepted when the access conditions are not met. On the basis that the interception layer intercepts the access request of the non-important user that does not meet the access conditions, it can not only ensure the system stability of the target access address, but also ensure that the important users of the target access address can access the target access address without restriction, realize the flexibly configured access current limiting, and improve the interception accuracy of the access request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of mobile Internet, and in particular to an access request processing method, device, equipment and storage medium. Background Art

[0002] With the development of network technology, more and more users access related websites through the Internet to obtain the required information. When users visit a website, they need to access it through the access route corresponding to the network address of the website server. The network bandwidth of the access route corresponding to each network address is limited. When a large number of users visit the same website at the same time, it is easy to cause the network bandwidth of the website to be full, resulting in the website crashing when another user visits the same website. Exemplarily, a streaming media platform website established by an enterprise, such as an online learning platform website, has video courseware on the website for employees within the enterprise to learn and improve their professional abilities. The network bandwidth of the website is limited, and the video courseware occupies a large bandwidth. When a large number of employees visit the website at the same time to learn video courseware, it is easy to cause the network bandwidth to be full, resulting in the website crashing when other employees visit the website again.

[0003] In the prior art, the current limiting technology can be used to perform indiscriminate current limiting control on the user's access request. After the network bandwidth is fully occupied, the user's access request can be intercepted, thereby ensuring the system stability of the website. For example, the current limiting technology in the prior art can directly implant a current limiting control program in the application code to intercept the access request after the network bandwidth of the website is fully occupied. Alternatively, the access request can be intercepted based on the Internet Protocol Address (IP address) of the access request.

[0004] When a website has important users, users can access the website without being restricted by network bandwidth and IP addresses. When the website's network bandwidth is fully occupied, when the current limiting technology that directly implants the current limiting control program in the application code performs indiscriminate current limiting control on the user's access request, it is impossible to guarantee that important users can access the website normally, and the current limiting technology needs to invade the application code, and the flexibility and portability are relatively poor. Alternatively, when the access request is intercepted according to the IP address, the IP address is different when the user uses different terminals to access the same website, and it is impossible to guarantee that important users can access the website normally. For example, when the streaming media platform website established by the enterprise sets the enterprise leaders as important users, when the network bandwidth of the website is fully occupied, the current limiting technology is used to cause the enterprise leaders to be unable to access the website normally. Summary of the invention

[0005] The embodiments of the present invention provide an access request processing method, apparatus, device and storage medium to improve the interception accuracy of access requests while ensuring the system stability of the network.

[0006] In a first aspect, an embodiment of the present invention provides an access request processing method, comprising:

[0007] Obtaining an access request; the access request includes a current user identifier and a target access address;

[0008] forming target mapping data according to the current user identifier and the target access address;

[0009] If the target mapping data is in the pre-stored mapping cache data, the current user is authorized to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address.

[0010] Optionally, if the target mapping data is in the pre-stored mapping cache data, when authorizing the current user to access the target access address, the method further includes:

[0011] If the target mapping data is not in the pre-stored mapping cache data, when the current access quantity of the target access address is less than an access threshold, the current user is authorized to access the target access address.

[0012] Optionally, when the current access quantity of the target access address is less than the access threshold, authorizing the current user to access the target access address further includes:

[0013] When the current access quantity of the target access address is greater than or equal to the access threshold, the current user is intercepted from accessing the target access address.

[0014] Optionally, when intercepting the current user's access to the target access address, the method further includes:

[0015] A reminder signal is generated based on the preset information and fed back to the user terminal.

[0016] Optionally, if the target mapping data is in the pre-stored mapping cache data, before authorizing the current user to access the target access address, the method further includes:

[0017] Cache user identification data and access address data in the target application database;

[0018] The pre-stored mapping cache data is formed according to the user identification data and the access address data.

[0019] Optionally, forming the pre-stored mapping cache data according to the user identification data and the access address data includes:

[0020] The user identification data and the access address data are configured as the pre-stored mapping cache data according to the access permission.

[0021] Optionally, after forming the pre-stored mapping cache data according to the user identification data and the access address data, the method further includes:

[0022] If the user identification data and the access address data in the target application database are updated, the updated user identification data and the access address data are synchronously cached.

[0023] Optionally, when the current access quantity of the target access address is less than the access threshold, before authorizing the current user to access the target access address, the method further includes:

[0024] Get the current access count of the target access address.

[0025] Optionally, when the current access quantity of the target access address is less than the access threshold, after authorizing the current user to access the target access address, the method further includes:

[0026] Update the current access number of the target access address by adding 1.

[0027] Optionally, after obtaining the current access quantity of the target access address, the method further includes:

[0028] If the access user of the target access address ends the access, the current access number of the target access address is updated minus 1.

[0029] In a second aspect, an embodiment of the present invention further provides an access request processing device, including:

[0030] An acquisition module, used to acquire an access request; the access request includes a current user identifier and a target access address;

[0031] A mapping data forming module, used for forming target mapping data according to the current user identifier and the target access address;

[0032] The processing module is used to authorize the current user to access the target access address if the target mapping data is in the pre-stored mapping cache data; wherein the pre-stored mapping cache data includes the mapping data of the user identification and the access address.

[0033] Optionally, the access request processing device further includes:

[0034] A cache module, used for caching user identification data and access address data in a target application database;

[0035] The cache data forming module is used to form the pre-stored mapping cache data according to the user identification data and the access address data.

[0036] Optionally, the cache module includes a Redis cache server.

[0037] In a third aspect, an embodiment of the present invention further provides a server, the server comprising:

[0038] one or more processors;

[0039] A storage device for storing one or more programs;

[0040] When the one or more programs are executed by the one or more processors, the one or more processors implement the access request processing method as described above.

[0041] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the access request processing method as described above.

[0042] The technical solution of the embodiment of the present invention determines the target mapping data of the current user identifier and the target access address through an access request, and then compares the target mapping data with the pre-stored mapping cache data. If the target mapping data is in the pre-stored mapping cache data, the current user is authorized to access the target access address. This can avoid the situation where the network bandwidth of the current user at the target access address is fully occupied when the current user is an important user, or the current user is intercepted when the IP address of the current user changes. On the basis of the interception layer intercepting the access requests of non-important users that do not meet the access conditions, not only can the system stability of the target access address be guaranteed, but also it can ensure that the important users of the target access address can access the target access address without restriction, thereby realizing flexibly configured access flow limiting and improving the interception accuracy of access requests. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of a method for processing an access request provided by an embodiment of the present invention;

[0044] Figure 2 A flowchart of another access request processing method provided by an embodiment of the present invention;

[0045] Figure 3 A flowchart of another access request processing method provided by an embodiment of the present invention;

[0046] Figure 4 A flowchart of another access request processing method provided by an embodiment of the present invention;

[0047] Figure 5A flowchart of another access request processing method provided by an embodiment of the present invention;

[0048] Figure 6 A schematic diagram of the structure of an access request processing device provided by an embodiment of the present invention;

[0049] Figure 7 A schematic diagram of the structure of another access request processing device provided by an embodiment of the present invention;

[0050] Figure 8 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0052] Figure 1 This is a flowchart of an access request processing method provided by an embodiment of the present invention. This embodiment is applicable to the case where a user accesses a website and the website has important users. The method can be executed by an access request processing device, which can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a server or a terminal device. Typical terminal devices include mobile terminals, specifically mobile phones, computers or tablet computers, etc. Figure 1 As shown, the method may specifically include:

[0053] S110, obtaining an access request; the access request includes a current user identifier and a target access address;

[0054] Among them, the access request can be a request signal sent by a user when accessing a website. The access request may include a user identifier that sends the access request, which is used as the current user identifier that sends the access request to determine the sender of the access request. Exemplarily, the current user identifier may include the user's identification number (identification, ID), also known as a serial number or account number, which is a unique code of the user in the website to be accessed. The access request also includes a target access address, which corresponds to the network address of the website to be accessed. After the current user sends the access request, the interception layer between the user terminal and the server corresponding to the target access address can first obtain the access request, and determine the current user identifier and the target access address that send the access request based on the access request. Among them, the interception layer has an interception function, and when the access request does not meet the access conditions, the interception layer can intercept the access request.

[0055] S120, forming target mapping data according to the current user identifier and the target access address;

[0056] After determining the current user identifier and the target access address in the access request, the interception layer can establish a mapping relationship between the current user identifier and the target access address to form target mapping data. Exemplarily, the interception layer can establish a corresponding relationship between the current user identifier and the target access address. Through the target mapping data, the access user and the target website of the access request can be determined.

[0057] S130: If the target mapping data is in the pre-stored mapping cache data, authorize the current user to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address.

[0058] Among them, the pre-stored mapping cache data may include multiple groups of pre-set mapping data of user identifiers and access addresses, and each group of mapping data of user identifiers and access addresses can represent the access rights between the user corresponding to the user identifier and the access address. Exemplarily, when a user identifier has a corresponding relationship with an access address, the user corresponding to the user identifier is an important user of the access address, that is, the user corresponding to the user identifier can access the access address without being restricted by network bandwidth and IP address. The same user identifier can have a mapping relationship with one or more access addresses, or the same access address can have a mapping relationship with one or more user identifiers. The pre-stored mapping cache data can be stored in a cache server of the interception layer. Exemplarily, the cache server can be a Redis cache server. The Redis cache server supports master-slave synchronization and has the characteristics of fast reading and writing speeds, which ensures the performance of the current user sending access requests to the target access address.

[0059] After determining the target mapping data, the interception layer can compare the target mapping data with the mapping data of each group of user identifiers and access addresses in the pre-stored mapping cache data. If the target mapping data is different from the mapping data of a group of user identifiers and access addresses in the pre-stored mapping cache data, and the access conditions of the access request cannot meet the access conditions pre-set by the interception layer, the interception layer intercepts the access request. If the target mapping data is the same as the mapping data of a group of user identifiers and access addresses in the pre-stored mapping cache data, it can be determined that the target mapping data is in the pre-stored mapping cache data, that is, the current user is an important user of the target access address. At this time, the current user is directly authorized to access the target access address, that is, the interception layer can send the access request to the target server corresponding to the target access address, thereby avoiding the current user from being intercepted when the network bandwidth of the target access address is fully occupied or the IP address of the current user changes. On the basis of intercepting the access request of non-important users that does not meet the access conditions, the interception layer can not only ensure the system stability of the target access address, but also ensure that the important users of the target access address can access the target access address without restriction, thereby improving the interception accuracy of the access request.

[0060] It should be noted that the interception layer can use high-performance Hyper Text Transfer Protocol (HTTP) and reverse proxy server NGINX, and implement interception logic through the lightweight and compact LUA scripting language. It can achieve purposeful interception according to interception requirements, and at the same time avoid affecting the network bandwidth of the target access address, which is conducive to ensuring the system stability of the target access address.

[0061] The technical solution of this embodiment determines the target mapping data of the current user identifier and the target access address through an access request, and then compares the target mapping data with the pre-stored mapping cache data. If the target mapping data is in the pre-stored mapping cache data, the current user is authorized to access the target access address. This can avoid the situation where the network bandwidth of the current user at the target access address is fully occupied when the current user is an important user, or the current user is intercepted when the IP address of the current user changes. On the basis of the interception layer intercepting the access requests of non-important users that do not meet the access conditions, not only can the system stability of the target access address be guaranteed, but also it can ensure that the important users of the target access address can access the target access address without restriction, thereby realizing flexibly configurable access flow limiting and improving the interception accuracy of access requests.

[0062] Figure 2 Flow chart of another access request processing method provided by an embodiment of the present invention. Based on the above embodiment, this embodiment further optimizes the above access request processing method. Figure 2 As shown, the method of this embodiment specifically includes:

[0063] S210, obtaining an access request; the access request includes a current user identifier and a target access address;

[0064] S220, forming target mapping data according to the current user identifier and the target access address;

[0065] S230: If the target mapping data is in the pre-stored mapping cache data, authorize the current user to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address.

[0066] S240: If the target mapping data is not in the pre-stored mapping cache data, and when the current access quantity of the target access address is less than the access threshold, authorize the current user to access the target access address.

[0067] Among them, after determining the target mapping data, the interception layer can compare the target mapping data with the mapping data of each group of user identifiers and access addresses in the pre-stored mapping cache data. If the target mapping data is different from a group of user identifiers and access address mapping data in the pre-stored mapping cache data, it can be determined that the target mapping data is not in the pre-stored mapping cache data, that is, the current user is not an important user of the target access address. At this time, it can be judged whether the access request meets the access condition based on the access condition of the target access address. The access condition can be used to characterize the occupancy rate of the network bandwidth of the target access address. Exemplarily, the access threshold can be used to characterize whether the network bandwidth is occupied. When the number of online users of the target access address is greater than or equal to the access threshold, the network bandwidth of the target access address is occupied; when the number of online users of the target access address is less than the access threshold, the network bandwidth of the target access address is not occupied. When the current user is not an important user of the target access address, the current user can be authorized to access the target access address when the current number of accesses to the target access address is less than the access threshold, that is, when the network bandwidth of the target access address is not fully occupied. This allows the interception layer to make interception judgments on non-important users, and ensure that the current user can access the target access address normally while ensuring the system stability of the target access address.

[0068] It should be noted that the above-mentioned judgment and interception process can also be implemented by using a high-performance Hyper Text Transfer Protocol (HTTP) and a reverse proxy server NGINX at the interception layer and by using a lightweight and compact LUA scripting language.

[0069] On the basis of the above technical solution, when the current access number of the target access address is less than the access threshold, when the current user is authorized to access the target access address, it also includes:

[0070] When the current access quantity of the target access address is greater than or equal to the access threshold, the current user is intercepted from accessing the target access address.

[0071] Among them, when the current user is not an important user of the target access address, and the access request is judged whether it meets the access conditions based on the current access number of the target access address and the access threshold, when the current access number of the target access address is greater than or equal to the access threshold, the network bandwidth of the target access address is fully occupied, and the current user can be intercepted from accessing the target access address, which can ensure the system stability of the target access address. At the same time, when the current user is an important user, the current user can directly access the target access address without being screened by the access conditions, which can not only ensure the system stability of the target access address, but also improve the interception accuracy of the access request.

[0072] Exemplarily, when intercepting the current user's access to the target access address, it also includes:

[0073] A reminder signal is generated based on the preset information and fed back to the user terminal.

[0074] Among them, the preset information may be pre-set interception prompt information. Exemplarily, the form of the preset information may include multiple, for example, the form of the preset information may be text interception prompt information or image interception prompt information. When intercepting the access request of the current user to access the target access address, the preset information can be converted into a reminder signal, so that the reminder signal can be fed back to the user terminal, so that the user terminal can confirm that the access request is intercepted according to the reminder signal, and send the access request again or stop accessing the target access address according to the reminder signal. Exemplarily, the reminder signal can be displayed as a friendly interception reminder page on the user terminal.

[0075] Figure 3 Flow chart of another access request processing method provided by an embodiment of the present invention. Based on the above embodiment, this embodiment further optimizes the above access request processing method. Figure 3 As shown, the method of this embodiment specifically includes:

[0076] S310, obtaining an access request; the access request includes a current user identifier and a target access address;

[0077] S320, forming target mapping data according to the current user identifier and the target access address;

[0078] S330, caching user identification data and access address data in the target application database;

[0079] The target application database may be a database in an application server corresponding to the target access address. The target application database stores user identification data and access address data. After determining the target mapping data, the cache server in the interception layer may cache the user identification data and access address data in the target application database, so as to facilitate the convenience and speed of the subsequent interception layer in using the user identification data and access address data.

[0080] S340: Form pre-stored mapping cache data according to the user identification data and the access address data.

[0081] The user identification data and access address data in the target application database have various forms. Exemplarily, the user identification data and the access address data can be independent data. After the cache server in the interception layer caches the user identification data and the access address data, a mapping relationship can be established between the user identification data and the access address data to form pre-stored mapping cache data.

[0082] Exemplarily, forming pre-stored mapping cache data according to user identification data and access address data includes:

[0083] The user identification data and the access address data are configured as pre-stored mapping cache data according to the access rights.

[0084] Wherein, when establishing the mapping relationship between the user identification data and the access address data, the mapping relationship between the user identification data and the access address data can be established according to the access permission configuration to form the pre-stored mapping cache data. Exemplarily, when a user corresponding to a user identification data is an important user of an access address corresponding to an access address data, the user corresponding to the user identification data has the access permission to access the access address corresponding to the access address data without being restricted by the access condition, at which time the corresponding relationship between the user identification data and the access address data can be established to form the pre-stored mapping cache data.

[0085] In other embodiments, when the application server of the access address directly configures the user identification data and access address data in the target application database according to the access rights to form pairing data through a mapping relationship, the cache server in the interception layer can directly obtain the user identification data and access address data with the mapping relationship. At this time, the cache server in the interception layer can directly use the user identification data and access address data with the mapping relationship as pre-stored mapping cache data, which can simplify the process of the interception layer obtaining the pre-stored mapping cache data, which is beneficial to improving the convenience and speed of the interception layer in using the user identification data and access address data, and at the same time is beneficial to improving the speed of responding to access requests.

[0086] S350: If the target mapping data is in the pre-stored mapping cache data, authorize the current user to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address.

[0087] On the basis of the above technical solutions, after forming the pre-stored mapping cache data according to the user identification data and the access address data, it also includes:

[0088] If the user identification data and access address data in the target application database are updated, the updated user identification data and access address data are synchronously cached.

[0089] Among them, the user identification data and access address data in the target application database can be updated according to the user's access permission configuration, and after the update, they are synchronously cached to the cache server of the interception layer, so that the pre-stored mapping cache data formed by the cache server in the interception layer according to the user identification data and the access address data matches the updated access permission configuration, thereby ensuring the interception accuracy of the access request. Exemplarily, when a user is updated from a non-important user of an access address to an important user, the user identification data and the corresponding access address data of the user can be added to the target application database, and then the updated user identification data and access address data are synchronously cached, so that the pre-stored mapping cache data formed by the updated user identification data and access address data includes the mapping data of the user and the access address corresponding to the updated important user, thereby ensuring the matching of the pre-stored mapping cache data with the access permission configuration, thereby ensuring the interception accuracy of the access request.

[0090] Figure 4 Flow chart of another access request processing method provided by an embodiment of the present invention. Based on the above embodiment, this embodiment further optimizes the above access request processing method. Figure 4 As shown, the method of this embodiment specifically includes:

[0091] S410, obtaining an access request; the access request includes a current user identifier and a target access address;

[0092] S420, forming target mapping data according to the current user identifier and the target access address;

[0093] S430: If the target mapping data is in the pre-stored mapping cache data, authorize the current user to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address.

[0094] S440: If the target mapping data is not in the pre-stored mapping cache data, obtain the current access number of the target access address.

[0095] Among them, after determining the target mapping data, the interception layer can compare the target mapping data with the mapping data of each group of user identifiers and access addresses in the pre-stored mapping cache data. If the target mapping data is different from the mapping data of a group of user identifiers and access addresses in the pre-stored mapping cache data, it can be determined that the target mapping data is not in the pre-stored mapping cache data, that is, the current user is not an important user of the target access address. At this time, it can be judged whether the access request meets the access condition according to the access condition of the target access address, and the current user is authorized to access the target access address when the access request meets the access condition, or the current user is intercepted from accessing the target access address when the access request does not meet the access condition. When the access condition uses the number of online users of the target access address and the size of the access threshold to characterize whether the network bandwidth is occupied, before judging the size of the number of online users of the target access address and the access threshold, the current access number of the target access address can be obtained first, so as to facilitate the subsequent comparison of the number of online users of the target access address and the size of the access threshold.

[0096] S450: When the current access quantity of the target access address is less than the access threshold, authorize the current user to access the target access address.

[0097] On the basis of the above technical solutions, when the current access number of the target access address is less than the access threshold, after authorizing the current user to access the target access address, the method further includes:

[0098] Update the current access count of the target access address plus 1.

[0099] Among them, when the current access number of the target access address is less than the access threshold and the current user is authorized to access the target access address, the current user accesses the target access address, so that the current access number of the target access address is increased by 1, and then the current access number of the target access address is updated, so that when processing new access requests subsequently, judgment can be made based on the updated current access number, thereby ensuring the real-time processing of access requests.

[0100] On the basis of the above technical solution, after obtaining the current access number of the target access address, it also includes:

[0101] If the access user of the target access address ends the access, the current access count of the target access address is updated minus 1.

[0102] Among them, after obtaining the current number of visits to the target access address, the current number of visits to the target access address can be monitored in real time. If one user in the current number of visits ends, the current number of visits to the target access address can be updated minus 1, so that the current number of visits to the target access address is updated in real time.

[0103] It should be noted that when each access user ends, the current access number of the target access address decreases by 1. If multiple access users end, the current access number of the target access address decreases adaptively according to the number of access users.

[0104] Figure 5 A flowchart of another access request processing method provided by an embodiment of the present invention. This embodiment can be based on the above embodiment to further illustrate the specific process of the access request processing method.

[0105] The method may specifically include:

[0106] Obtain an access request; the access request includes a current user identifier and a target access address; then read the current user identifier and the target access address in the access request, and establish a mapping relationship based on the current user identifier and the target access address to form target mapping data. Then determine whether the target mapping data is in the pre-stored mapping cache data. Before determining whether the target mapping data is in the pre-stored mapping cache data, the user identifier data and the access address data in the target application database can be cached, and then the pre-stored mapping cache data is formed based on the user identifier data and the access address data. When determining whether the target mapping data is in the pre-stored mapping cache data, if the target mapping data is in the pre-stored mapping cache data, authorize the current user to access the target access address; if the target mapping data is not in the pre-stored mapping cache data, obtain the current access number and access threshold of the target access address, and then determine the size of the current access number and access threshold of the target access address. If the current access number of the target access address is less than the access threshold, authorize the current user to access the target access address. If the current access number of the target access address is greater than or equal to the access threshold, intercept the current user from accessing the target access address. After the current user is authorized to access the target access address, the current access number of the target access address is updated, and the current access number of the target access address is increased by 1. If the access user of the target access address ends the access, the current access number of the target access address is updated, and the current access number of the target access address is reduced by 1.

[0107] It should be noted that when the user identification data and access address data in the target application database are updated, the updated user identification data and access address data can be synchronously cached to the cache server of the interception layer.

[0108] Figure 6 The schematic diagram of the structure of an access request processing device provided by an embodiment of the present invention is applicable to the case where a user accesses a website and the website has important users. The access request processing device provided by an embodiment of the present invention can be integrated into an interception layer and can execute the access request processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0109] The device specifically includes an acquisition module 610, a mapping data forming module 620 and a processing module 630, wherein:

[0110] The acquisition module 610 is used to obtain an access request; the access request includes a current user identifier and a target access address; the mapping data formation module 620 is used to form target mapping data based on the current user identifier and the target access address; the processing module 630 is used to authorize the current user to access the target access address if the target mapping data is in the pre-stored mapping cache data; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address.

[0111] The access request processing device provided in the embodiment of the present invention can execute the access request processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] Based on the above technical solution, the processing module can also be used to authorize the current user to access the target access address if the target mapping data is not in the pre-stored mapping cache data and the current access number of the target access address is less than the access threshold.

[0113] On the basis of the above technical solutions, the processing module can also be used to intercept the current user's access to the target access address when the current access number of the target access address is greater than or equal to the access threshold.

[0114] Based on the above technical solutions, the processing module is further used to obtain the current access number of the target access address before the current access number of the target access address is compared with the access threshold. The processing module is used to update the current access number of the target access address plus 1 after authorizing the current user to access the target access address. The processing module is also used to update the current access number of the target access address minus 1 if the access user of the target access address ends access.

[0115] On the basis of the above technical solutions, the access request processing device further includes:

[0116] A cache module, used for caching user identification data and access address data in a target application database;

[0117] The cache data forming module is used to form pre-stored mapping cache data according to the user identification data and the access address data.

[0118] Exemplarily, the cache module includes a cache server, and exemplary, the cache module includes a Redis cache server. The cache data forming module can be integrated into the cache server at the same time, and the cache server caches the user identification data and access address data in the target application database; and then forms the pre-stored mapping cache data according to the user identification data and the access address data. Exemplarily, the cache server can be used to configure the user identification data and the access address data as pre-stored mapping cache data according to the access rights.

[0119] Figure 7 FIG. 1 is a schematic diagram of the structure of another access request processing device provided by an embodiment of the present invention. Figure 7 As shown, the processing module can use the Nginx server to implement the logical processing of the access request. When processing the access request, after the access request processing device obtains the access request of the user terminal, the Nginx server first compares the current user identifier and the target access address in the access request with the pre-stored mapping cache data in the cache server. If the target mapping data is in the pre-stored mapping cache data, the current user is authorized to access the target access address, that is, the Nginx server sends the access request to the target application server. If the target mapping data is not in the pre-stored mapping cache data, the Nginx server obtains the current access number in the target application server, and then determines the size of the current access number in the target application server and the pre-set access threshold. If the current access number of the target access address is less than the access threshold, the current user is authorized to access the target access address, and the Nginx server sends the access request to the target application server. If the current access number of the target access address is greater than or equal to the access threshold, the current user is intercepted from accessing the target access address, and the Nginx server forms a trapezoidal signal to feedback to the user terminal. When the Nginx server sends the access request to the target application server, the Nginx server automatically updates the current access number of the target application server plus 1. When the user accessing the target access address ends, the Nginx server updates the current access count of the target access address minus 1.

[0120] In addition, the cache server obtains the user identification data and the access address data from the target application database. When the target application database updates the user identification data and the access address data, the cache server can synchronously update the user identification data and the access address data.

[0121] Figure 8 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. Figure 8 A block diagram of an exemplary device 412 suitable for use in implementing embodiments of the present invention is shown. Figure 8 The device 412 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0122] like Figure 8 As shown, the device 412 is in the form of a general purpose device. The components of the device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that connects different system components (including the storage device 428 and the processor 416).

[0123] Bus 418 represents one or more of several types of bus structures, including a storage device bus or storage device controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Subversive Alliance (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0124] Device 412 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 412, including volatile and non-volatile media, removable and non-removable media.

[0125] Storage device 428 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. Device 412 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 434 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk, such as a read-only optical disk (Compact Disc Read-Only Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 418 via one or more data medium interfaces. The storage device 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0126] A program / utility 440 having a set (at least one) of program modules 442 may be stored, for example, in storage device 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 442 generally perform the functions and / or methods of the embodiments described herein.

[0127] The device 412 may also communicate with one or more external devices 414 (e.g., a keyboard, a pointing terminal, a display 424, etc.), one or more terminals that enable a user to interact with the device 412, and / or any terminal that enables the device 412 to communicate with one or more other computing terminals (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 422. Furthermore, the device 412 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 420. Figure 8 As shown, the network adapter 420 communicates with other modules of the device 412 via the bus 418. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the device 412, including but not limited to: microcode, terminal drivers, redundant processors, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

[0128] The processor 416 executes various functional applications and data processing by running the program stored in the storage device 428, for example, implementing the access request processing method provided in the embodiment of the present invention, which includes:

[0129] Get access request; the access request includes current user ID and target access address;

[0130] forming target mapping data according to the current user identifier and the target access address;

[0131] If the target mapping data is in the pre-stored mapping cache data, the current user is authorized to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identification and the access address.

[0132] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the access request processing method provided by the embodiment of the present invention is implemented. The method includes:

[0133] Get access request; the access request includes current user ID and target access address;

[0134] forming target mapping data according to the current user identifier and the target access address;

[0135] If the target mapping data is in the pre-stored mapping cache data, the current user is authorized to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identification and the access address.

[0136] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0137] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0138] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

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

[0140] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for processing access requests, used in application scenarios where users access websites; characterized in that: include: Obtaining an access request; the access request includes a current user identifier and a target access address; forming target mapping data according to the current user identifier and the target access address; wherein the target mapping data is mapping relationship data between the current user identifier and the target access address; If the target mapping data is in the pre-stored mapping cache data, authorize the current user to access the target access address; wherein the pre-stored mapping cache data includes mapping data of the user identifier and the access address; If the target mapping data is in the pre-stored mapping cache data, before authorizing the current user to access the target access address, the method further includes: Cache user identification data and access address data in the target application database; The pre-stored mapping cache data is formed according to the user identification data and the access address data.

2. The method according to claim 1, characterized in that If the target mapping data is in the pre-stored mapping cache data, when the current user is authorized to access the target access address, the method further includes: If the target mapping data is not in the pre-stored mapping cache data, when the current access quantity of the target access address is less than an access threshold, the current user is authorized to access the target access address.

3. The method according to claim 2, characterized in that When the current access quantity of the target access address is less than the access threshold, authorizing the current user to access the target access address, further comprising: When the current access quantity of the target access address is greater than or equal to the access threshold, the current user is intercepted from accessing the target access address.

4. The method according to claim 1, characterized in that: When intercepting the current user from accessing the target access address, it also includes: A reminder signal is generated based on the preset information and fed back to the user terminal.

5. The method according to claim 1, characterized in that Forming the pre-stored mapping cache data according to the user identification data and the access address data includes: The user identification data and the access address data are configured as the pre-stored mapping cache data according to the access permission.

6. The method according to claim 1, characterized in that After forming the pre-stored mapping cache data according to the user identification data and the access address data, the method further includes: If the user identification data and the access address data in the target application database are updated, the updated user identification data and the access address data are synchronously cached.

7. The method according to claim 2, characterized in that When the current access quantity of the target access address is less than the access threshold, before authorizing the current user to access the target access address, the method further includes: Get the current access count of the target access address.

8. The method according to claim 7, characterized in that When the current access quantity of the target access address is less than the access threshold, after authorizing the current user to access the target access address, the method further includes: Update the current access number of the target access address by adding 1.

9. The method according to claim 7, characterized in that: After obtaining the current access quantity of the target access address, the method further includes: If the access user of the target access address ends the access, the current access number of the target access address is updated minus 1.

10. An access request processing device, used in an application scenario where a user accesses a website; characterized in that: include: An acquisition module, used to acquire an access request; the access request includes a current user identifier and a target access address; A mapping data forming module, used to form target mapping data according to the current user identifier and the target access address; wherein the target mapping data is mapping relationship data between the current user identifier and the target access address; A processing module, used for authorizing the current user to access the target access address if the target mapping data is in the pre-stored mapping cache data; wherein the pre-stored mapping cache data includes mapping data of the user identification and the access address; A cache module, used for caching user identification data and access address data in a target application database; The cache data forming module is used to form pre-stored mapping cache data according to the user identification data and the access address data.

11. The access request processing device according to claim 10, characterized in that: Also includes: A cache module, used for caching user identification data and access address data in a target application database; The cache data forming module is used to form the pre-stored mapping cache data according to the user identification data and the access address data.

12. The access request processing device according to claim 11, characterized in that: The cache module includes a Redis cache server.

13. A device, characterized in that The device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the access request processing method as described in any one of claims 1 to 9.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the access request processing method as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • System access permission granting method and device, server and storage medium

    CN111698228A