A request duplication processing method and system based on distributed web system

By using the current time recorded by the client and the time ordered list of the REDIS server for verification in the distributed web system, the problem of repeated requests caused by malicious packet capture is solved and the data security and accuracy of deduplication processing are ensured.

CN118646752BActive Publication Date: 2024-10-29CHENGDU TIENON TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411090035.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-10-29
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

The problem of repeated requests caused by malicious packet capture in distributed web systems makes it impossible for the server to effectively determine whether the current request is a duplicate of a request that is older. This makes it impossible to ensure the security of client data and is easily leaked.

Method used

By recording the client's current time when a business request is generated, and using a time-ordered list for storage and verification in the REDIS server, historical requests are prevented from being forged into new requests, thereby simplifying the deduplication judgment logic and ensuring that the server responds to repeated requests. Process effectively.

Benefits of technology

It effectively avoids repeated processing of malicious packet capture requests, ensures the security of client data, avoids the server's response to repeated requests, and improves data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646752B_ABST
    Figure CN118646752B_ABST
Patent Text Reader

Abstract

The present invention provides a request repetition processing method and system based on a distributed web system, which relates to the field of system management technology. The method specifically comprises the following steps: S1: randomly generating a key string according to a user account; S2: uploading the key string to a corresponding key storage area in a REDIS server for data storage, and at the same time, returning the key string to a corresponding client for data storage; S3: when receiving a business request uploaded by a user through a client, judging whether the business request meets the condition of request authority validity according to the key string, and if so, proceeding to step S4; S4: judging whether the current marked time string meets the condition of request time validity according to the marked time string at the tail, and if so, proceeding to step S5; S5: uploading the current marked time string to a corresponding time ordered list in a REDIS server for orderly data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of system management, and in particular to a request duplication processing method and system based on a distributed web system. Background Art

[0002] In distributed web systems, malicious packet capture of requests uploaded by clients often occurs. When malicious packet capture requests occur, the server will receive repeated requests for the same request uploaded by multiple clients. Since the request data is the same, the server will respond to the same request data submitted by multiple clients, which can easily lead to data leakage.

[0003] At present, for repeated requests for the same request uploaded by multiple clients, the request data of each request can only be judged based on the request data recorded by the back-end. If the request data is judged to be the same, it means that this request is a repeated request, and the request is then deduplicated. However, the distributed web system receives a lot of request data at the same time, resulting in the back-end generally being able to store only request data within a certain period of time, making it impossible for the server to judge whether the request data of the current request is a duplicate of the request data of a request that was made a long time ago. As a result, the server cannot effectively process repeated requests for the same request uploaded by multiple clients, cannot guarantee the security of client data, and is prone to leakage. Summary of the invention

[0004] The purpose of the present invention is to provide a request duplication processing method and system based on a distributed web system. The request duplication processing method mainly filters the duplicate requests generated by the client's historical requests through the client's current time recorded when the business request is generated. By verifying the validity of the request time, it can prevent the historical requests from being forged into new requests, thereby bypassing the deduplication logic.

[0005] In order to solve the above technical problems, the present invention adopts the following solutions:

[0006] A method for processing repeated requests based on a distributed web system, the method specifically comprising the following steps:

[0007] S1: Receive a login request uploaded by the user through the client. When the user successfully logs in to the corresponding user account according to the login request, a key string is randomly generated according to the user account;

[0008] S2: upload the key string to the corresponding key storage area in the REDIS server for data storage, and at the same time, return the key string to the corresponding client for data storage;

[0009] The REDIS server also includes a time ordered list corresponding to the user account, and the time ordered list is used to mark the time string and add it to the end of the list in sequence and store it in chronological order;

[0010] S3: When receiving a service request uploaded by the user through the client, obtain the key string from the corresponding key storage area in the REDIS server according to the service request, and determine whether the service request meets the conditions for the validity of the request permission according to the key string. If so, go to step S4;

[0011] S4: extract the corresponding current marked time string from the business request, obtain the marked time string at the end from the time ordered list corresponding to the user account in the REDIS server according to the business request, and judge whether the current marked time string meets the condition of request time validity according to the marked time string at the end, if so, go to step S5;

[0012] S5: Upload the current marked time string to the corresponding time ordered list in the REDIS server for orderly data storage, that is, add the current marked time string to the end of the corresponding time ordered list.

[0013] Furthermore, the service request is generated by the client according to the corresponding request message, and while generating the service request, the client records the time according to its own clock, obtains the current marked time string corresponding to the service request, and adds the current marked time string to the corresponding service request.

[0014] Furthermore, the business request is composed of a request header and a request body, the request header includes a current mark time character string and a corresponding first check value, and the request body includes a request message character string.

[0015] Furthermore, the first verification value is generated by the client according to the stored current marking time character string, current key character string and request message character string, and the specific process is:

[0016] The client concatenates the current mark time string, the current key string, and the request message string in a preset concatenation order, encrypts the concatenated result through the sha256 algorithm, and then obtains the first check value through base64 encoding.

[0017] Furthermore, the step S3 specifically includes the following steps:

[0018] S31: when receiving a service request uploaded by a user through a client, extracting a current marking time character string and a corresponding first check value from a request header of the service request, and then extracting a request message character string from a request body of the service request;

[0019] S32: Obtain a key string from a corresponding key storage area in the REDIS server according to the request message string;

[0020] S33: The current mark time string extracted from the request header of the business request, the key string obtained from the corresponding key storage area in the REDIS server, and the request message string extracted from the request body of the business request are spliced ​​in a preset splicing order, and the spliced ​​result is encrypted by the sha256 algorithm, and then processed by base64 encoding to obtain a second check value;

[0021] S34: Compare the first check value extracted from the request header of the business request with the second check value. If the two are the same, it means that the business request meets the conditions for the validity of the request authority, and go to step S4.

[0022] Furthermore, the request message string includes a user identification code, and the user identification code corresponds one-to-one to the user account. The corresponding key storage area and time ordered list can be obtained from the REDIS server through the user identification code in the request message string.

[0023] Furthermore, in S4, the specific process of judging whether the current marked time string satisfies the condition of request time validity according to the marked time string at the end is as follows:

[0024] When the value of the mark time string at the end obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is empty, it means that the current mark time string meets the condition of the request time validity;

[0025] When the value of the marked time string at the tail obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is not empty, and the value of the current marked time string is greater than the value of the marked time string at the tail, it means that the current marked time string meets the conditions for the validity of the requested time.

[0026] Furthermore, a step S6 is included, and the step S6 is specifically:

[0027] S6: After uploading the current marking time string to the corresponding time ordered list in the REDIS server for orderly data storage, the business request corresponding to the current marking time string is processed.

[0028] Furthermore, the preset splicing order is a preset string splicing method, wherein the mark time string, the key string and the request message string represent three different types of strings, and the preset splicing order is a preset string splicing method of the three different types of strings, namely the mark time string, the key string and the request message string.

[0029] A request duplication processing system based on a distributed web system, comprising:

[0030] Key generation module: receives the login request uploaded by the user through the client, and when the user successfully logs in to the corresponding user account according to the login request, a key string is randomly generated according to the user account;

[0031] Key storage module: uploads the key string to the corresponding key storage area in the REDIS server for data storage, and returns the key string to the corresponding client for data storage;

[0032] Request permission validity judgment module: When receiving a business request uploaded by a user through the client, the key string is obtained from the corresponding key storage area in the REDIS server according to the business request, and the key string is used to judge whether the business request meets the conditions for request permission validity;

[0033] Request time validity judgment module: extract the corresponding current marked time string from the business request, obtain the marked time string at the end from the time ordered list corresponding to the user account in the REDIS server according to the business request, and judge whether the current marked time string meets the request time validity condition according to the marked time string at the end;

[0034] Time ordered list update module: upload the current marked time string to the corresponding time ordered list in the REDIS server for orderly data storage, that is, add the current marked time string to the end of the corresponding time ordered list.

[0035] Beneficial effects of the present invention:

[0036] The present invention provides a request duplication processing method and system based on a distributed web system. The request duplication processing method mainly filters the duplicate requests generated by the client's historical requests through the client's current time recorded when the business request is generated. The historical requests can be prevented from being forged into new requests by verifying the validity of the request time, thereby bypassing the deduplication logic. Not only can the deduplication judgment logic be simplified to solve the duplicate request problem, but also based on the time, it can be judged whether the request data of the current request of the server is the duplicate of the request data of the request with a longer time. The method can effectively process the duplicate requests uploaded by multiple clients about the same request, ensure the security of the client data, and perform request duplication processing on the requests that are maliciously captured, so as to avoid the server responding to them. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The figure is a flow chart of a request repetition processing method based on a distributed web system in Embodiment 1 of the present invention.

[0038] Figure 2 This is an interactive schematic diagram of a request repetition processing method based on a distributed web system in Embodiment 1 of the present invention. DETAILED DESCRIPTION

[0039] 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 only part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. 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.

[0040] The relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.

[0041] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0042] Additionally, descriptions of well-known structures, functions, and configurations may be omitted for clarity and conciseness.One of ordinary skill in the art will recognize that various changes and modifications may be made to the examples described herein without departing from the spirit and scope of the present disclosure.

[0043] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.

[0044] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0045] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments:

[0046] Example 1

[0047] In distributed web systems, malicious packet capture of requests uploaded by clients often occurs. When malicious packet capture requests occur, the server will receive repeated requests for the same request uploaded by multiple clients. Since the request data is the same, the server will respond to the same request data submitted by multiple clients, which can easily lead to data leakage.

[0048] At present, for repeated requests for the same request uploaded by multiple clients, the request data of each request can only be judged based on the request data recorded by the back-end. If the request data is judged to be the same, it means that this request is a repeated request, and the request is then deduplicated. However, the distributed web system receives a lot of request data at the same time, resulting in the back-end generally being able to store only request data within a certain period of time, making it impossible for the server to judge whether the request data of the current request is a duplicate of the request data of a request that was made a long time ago. As a result, the server cannot effectively process repeated requests for the same request uploaded by multiple clients, cannot guarantee the security of client data, and is prone to leakage.

[0049] Therefore, the present invention provides a request duplicate processing method and system based on a distributed web system. The request duplicate processing method mainly filters the duplicate requests generated by the client's historical requests through the client's current time recorded when the business request is generated. By verifying the validity of the request time, it can prevent the historical requests from being forged into new requests, thereby bypassing the deduplication logic.

[0050] Specifically, Figure 1 , Figure 2 As shown, a request duplication processing method based on a distributed web system, the method specifically comprises the following steps:

[0051] S1: Receive a login request uploaded by the user through the client. When the user successfully logs in to the corresponding user account according to the login request, a key string is randomly generated according to the user account;

[0052] S2: upload the key string to the corresponding key storage area in the REDIS server for data storage, and at the same time, return the key string to the corresponding client for data storage;

[0053] The REDIS server also includes a time ordered list corresponding to the user account, and the time ordered list is used to mark the time string and add it to the end of the list in sequence and store it in chronological order;

[0054] S3: When receiving a service request uploaded by the user through the client, obtain the key string from the corresponding key storage area in the REDIS server according to the service request, and determine whether the service request meets the conditions for the validity of the request permission according to the key string. If so, go to step S4;

[0055] S4: extract the corresponding current marked time string from the business request, obtain the marked time string at the end from the time ordered list corresponding to the user account in the REDIS server according to the business request, and judge whether the current marked time string meets the condition of request time validity according to the marked time string at the end, if so, go to step S5;

[0056] S5: Upload the current marked time string to the corresponding time ordered list in the REDIS server for orderly data storage, that is, add the current marked time string to the end of the corresponding time ordered list.

[0057] Preferably, the service request is generated by the client according to the corresponding request message, and while generating the service request, the client records the time according to its own clock, obtains the current marked time string corresponding to the service request, and adds the current marked time string to the corresponding service request.

[0058] Preferably, the business request is composed of a request header and a request body, the request header includes a current marking time character string and a corresponding first check value, and the request body includes a request message character string.

[0059] Preferably, the first verification value is generated by the client according to the stored current marking time character string, current key character string and request message character string, and the specific process is:

[0060] The client concatenates the current mark time string, the current key string, and the request message string in a preset concatenation order, encrypts the concatenated result through the sha256 algorithm, and then obtains the first check value through base64 encoding.

[0061] Preferably, the step S3 specifically includes the following steps:

[0062] S31: when receiving a service request uploaded by a user through a client, extracting a current marking time character string and a corresponding first check value from a request header of the service request, and then extracting a request message character string from a request body of the service request;

[0063] S32: Obtain a key string from a corresponding key storage area in the REDIS server according to the request message string;

[0064] S33: The current mark time string extracted from the request header of the business request, the key string obtained from the corresponding key storage area in the REDIS server, and the request message string extracted from the request body of the business request are spliced ​​in a preset splicing order, and the spliced ​​result is encrypted by the sha256 algorithm, and then processed by base64 encoding to obtain a second check value;

[0065] S34: Compare the first check value extracted from the request header of the business request with the second check value. If the two are the same, it means that the business request meets the conditions for the validity of the request authority, and go to step S4.

[0066] Preferably, the request message string includes a user identification code, and the user identification code corresponds one-to-one to the user account. The corresponding key storage area and time-ordered list can be obtained from the REDIS server through the user identification code in the request message string.

[0067] Preferably, in S4, the specific process of judging whether the current marked time string satisfies the condition of request time validity according to the marked time string at the tail is as follows:

[0068] When the value of the mark time string at the end obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is empty, it means that the current mark time string meets the condition of the request time validity;

[0069] When the value of the marked time string at the tail obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is not empty, and the value of the current marked time string is greater than the value of the marked time string at the tail, it means that the current marked time string meets the conditions for the validity of the requested time.

[0070] Preferably, a step S6 is further included, and the step S6 is specifically:

[0071] S6: After uploading the current marking time string to the corresponding time ordered list in the REDIS server for orderly data storage, the business request corresponding to the current marking time string is processed.

[0072] Preferably, the preset splicing order is a preset string splicing method, wherein the mark time string, the key string and the request message string represent three different types of strings, and the preset splicing order is a preset string splicing method of the three different types of strings, namely the mark time string, the key string and the request message string.

[0073] Based on the above principles, the present invention is further described:

[0074] In order to solve the problem that a server receives duplicate requests for the same request uploaded by multiple clients due to malicious packet capture in a distributed web system, the present invention designs a request duplication processing method for a distributed web system, wherein the request duplication processing method mainly filters duplicate requests generated by historical requests of the client through the current time of the client recorded when the service request is generated. The client time is recorded according to the client's own clock when the client generates the service request, so that the deduplication processing method of the present invention does not need to consider the time difference between the web system browser client and the server.

[0075] In order to determine whether a request is repeatedly sent according to the time when the client generates the request, the present invention adds the client time to the corresponding business request, sends the current client time to the server through the business request, and the server stores the corresponding request data. Moreover, after the server processes the request, the server stores the current client time in the corresponding REDIS server, and stores the time corresponding to the same user account in order in the REDIS server, so as to facilitate the subsequent judgment of the validity of the request through the time ordered list.

[0076] Specifically, in order to facilitate the subsequent judgment of the validity of the request through a time-ordered list, a time-ordered list corresponding to the user is provided in the REDIS server. The time-ordered list is used to mark the time string and add it to the end of the list in sequence to achieve storage in chronological order, which means that the latest marked time string is at the end of the time-ordered list, so that the server can extract the client time of the last business request and compare the client time of the last business request with the current client time. If the client time of the last business request at the end is empty, it means that the client has no last business request, that is, the business request submitted by the current client is not a repeated business request; if the client time of the last business request at the end is not empty and the client time of the last business request is less than the current client time, it means that the last business request and the current business request are not repeated requests.

[0077] Through the above repeated judgment, the validity of the business request initiated by the client can be judged. However, this method only judges the validity of the business request. In order to ensure that the server effectively processes the client's business request, the present invention also adds a judgment on the validity of the client's permissions.

[0078] like Figure 2 As shown, when a user logs in to an account, a login request will be sent to the server through the client. When the user account successfully logs in through the login request, the server will randomly generate a key string, which is used to verify the client's authority. Therefore, the key string will be synchronized to the client and the REDIS server for storage, and the key string will be stored in the key storage area corresponding to the user account in the REDIS server. In this embodiment, the key string is a unique verification code for the user account. Different user accounts generally have different verification codes, and the key string in the client is very easy to be tampered with. Therefore, in order to prevent the user account from being stolen, the validity of the authority of the client is judged by the current key string in the current client.

[0079] Specifically, the mark time string, the current key string, and the request message string are spliced ​​in a preset splicing order in the client, and the spliced ​​result is encrypted by the sha256 algorithm, and then processed by base64 encoding to obtain a first verification value, and the first verification value and the mark time string are added to the http request header of the business request, so that the business request containing the first verification value, the mark time string and the request message is sent to the server. The method of sending the first verification value to the server for verification can prevent the key string from existing in the transmission process, thereby preventing the key string from being maliciously obtained.

[0080] Then, in the server, the marked time string, the key string obtained from the key storage area corresponding to the user in the REDIS server, and the request message string extracted from the request body of the business request are spliced ​​in a preset splicing order, and the spliced ​​result is encrypted by the sha256 algorithm, and then processed by base64 encoding to obtain a second verification value. Then, it is determined whether the first verification value and the second verification value are similar. If they are similar, it means that the key string and the current key string in the current client are the same key string. Therefore, the client has the validity of the authority, and the time string at the end can be called from the time ordered list corresponding to the user account in the REDIS server, so that the server can deduplicate the business request to ensure the accuracy and security of the business request.

[0081] Example 2

[0082] A request duplication processing system based on a distributed web system, comprising:

[0083] Key generation module: receives the login request uploaded by the user through the client, and when the user successfully logs in to the corresponding user account according to the login request, a key string is randomly generated according to the user account;

[0084] Key storage module: uploads the key string to the corresponding key storage area in the REDIS server for data storage, and returns the key string to the corresponding client for data storage;

[0085] Request permission validity judgment module: When receiving a business request uploaded by a user through the client, the key string is obtained from the corresponding key storage area in the REDIS server according to the business request, and the key string is used to judge whether the business request meets the conditions for request permission validity;

[0086] Request time validity judgment module: extract the corresponding current marked time string from the business request, obtain the marked time string at the end from the time ordered list corresponding to the user account in the REDIS server according to the business request, and judge whether the current marked time string meets the request time validity condition according to the marked time string at the end;

[0087] Time ordered list update module: upload the current marked time string to the corresponding time ordered list in the REDIS server for orderly data storage, that is, add the current marked time string to the end of the corresponding time ordered list.

[0088] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. According to the technical essence of the present invention, within the spirit and principles of the present invention, any simple modification, equivalent replacement and improvement made to the above embodiment still falls within the protection scope of the technical solution of the present invention.

Claims

1. A request duplication processing method based on a distributed web system, characterized in that: The method specifically comprises the following steps: S1: Receive a login request uploaded by the user through the client. When the user successfully logs in to the corresponding user account according to the login request, a key string is randomly generated according to the user account; S2: upload the key string to the corresponding key storage area in the REDIS server for data storage, and at the same time, return the key string to the corresponding client for data storage; The REDIS server also includes a time ordered list corresponding to the user account, and the time ordered list is used to mark the time string and add it to the end of the list in sequence and store it in chronological order; S3: When receiving a service request uploaded by the user through the client, obtain the key string from the corresponding key storage area in the REDIS server according to the service request, and determine whether the service request meets the conditions for the validity of the request permission according to the key string. If so, go to step S4; S4: extract the corresponding current marked time string from the business request, obtain the marked time string at the end from the time ordered list corresponding to the user account in the REDIS server according to the business request, and judge whether the current marked time string meets the request time validity condition according to the marked time string at the end, if so, go to step S5; the request time validity is used to prevent the historical request with a long time from being forged as a new request; In S4, the specific process of judging whether the current marked time string meets the condition of request time validity according to the marked time string at the end is as follows: When the value of the mark time string at the end obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is empty, it means that the current mark time string meets the condition of the request time validity; When the value of the mark time string at the end obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is not empty, and the value of the current mark time string is greater than the value of the mark time string at the end, it means that the current mark time string meets the condition of the request time validity; S5: Upload the current marked time string to the corresponding time ordered list in the REDIS server for orderly data storage, that is, add the current marked time string to the end of the corresponding time ordered list.

2. A request duplication processing method based on a distributed web system according to claim 1, characterized in that: The service request is generated by the client according to the corresponding request message, and while generating the service request, the client records the time according to its own clock, obtains the current marked time string corresponding to the service request, and adds the current marked time string to the corresponding service request.

3. A request duplication processing method based on a distributed web system according to claim 1, characterized in that: The service request is composed of a request header and a request body. The request header includes a current marking time character string and a corresponding first check value, and the request body includes a request message character string.

4. A request duplication processing method based on a distributed web system according to claim 3, characterized in that: The first verification value is generated by the client according to the stored current marking time string, current key string and request message string, and the specific process is: The client concatenates the current mark time string, the current key string, and the request message string in a preset concatenation order, encrypts the concatenated result through the sha256 algorithm, and then obtains the first check value through base64 encoding.

5. A request duplication processing method based on a distributed web system according to claim 4, characterized in that: The step S3 specifically includes the following steps: S31: when receiving a service request uploaded by a user through a client, extracting a current marking time character string and a corresponding first check value from a request header of the service request, and then extracting a request message character string from a request body of the service request; S32: Obtain a key string from a corresponding key storage area in the REDIS server according to the request message string; S33: The current mark time string extracted from the request header of the business request, the key string obtained from the corresponding key storage area in the REDIS server, and the request message string extracted from the request body of the business request are spliced ​​in a preset splicing order, and the spliced ​​result is encrypted by the sha256 algorithm, and then processed by base64 encoding to obtain a second check value; S34: Compare the first check value extracted from the request header of the business request with the second check value. If the two are the same, it means that the business request meets the conditions for the validity of the request authority, and go to step S4.

6. A request duplication processing method based on a distributed web system according to claim 5, characterized in that: The request message string includes a user identification code, and the user identification code corresponds one-to-one to the user account. The corresponding key storage area and time ordered list can be obtained from the REDIS server through the user identification code in the request message string.

7. A request duplication processing method based on a distributed web system according to claim 1, characterized in that: The invention further comprises a step S6, wherein the step S6 is specifically: S6: After uploading the current marking time string to the corresponding time ordered list in the REDIS server for orderly data storage, the business request corresponding to the current marking time string is processed.

8. A request duplication processing method based on a distributed web system according to claim 4, characterized in that: The preset splicing order is a preset string splicing method, wherein the mark time string, the key string and the request message string represent three different types of strings, and the preset splicing order is a preset string splicing method of the three different types of strings, namely the mark time string, the key string and the request message string.

9. A request duplication processing system based on a distributed web system, characterized in that: include: Key generation module: receives the login request uploaded by the user through the client, and when the user successfully logs in to the corresponding user account according to the login request, a key string is randomly generated according to the user account; Key storage module: uploads the key string to the corresponding key storage area in the REDIS server for data storage, and returns the key string to the corresponding client for data storage; Request permission validity judgment module: When receiving a business request uploaded by a user through the client, the key string is obtained from the corresponding key storage area in the REDIS server according to the business request, and the key string is used to judge whether the business request meets the conditions for request permission validity; Request time validity judgment module: extract the corresponding current marked time string from the business request, obtain the marked time string at the end from the time ordered list corresponding to the user account in the REDIS server according to the business request, and judge whether the current marked time string meets the request time validity condition according to the marked time string at the end; the request time validity is used to prevent the historical request with a long time from being forged as a new request; The specific process of judging whether the current marked time string meets the conditions of the request time validity according to the marked time string at the end is as follows: When the value of the mark time string at the end obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is empty, it means that the current mark time string meets the condition of the request time validity; When the value of the mark time string at the end obtained from the time ordered list corresponding to the user account in the REDIS server according to the business request is not empty, and the value of the current mark time string is greater than the value of the mark time string at the end, it means that the current mark time string meets the condition of the request time validity; Time ordered list update module: upload the current marked time string to the corresponding time ordered list in the REDIS server for orderly data storage, that is, add the current marked time string to the end of the corresponding time ordered list.

Citation Information

Patent Citations

  • Single sign-on method of web service

    CN103139200A

  • Method, device, computer device and storage medium for intercepting duplicate requests

    CN109040209A