A data processing method, device, apparatus, and storage medium
By generating encrypted credential information based on client identifier and time identifier, and combining first-level and second-level encryption algorithms, the problem of poor anti-fraud effect in existing technologies is solved, and more efficient protection against abnormal requests is achieved.
Patent Information
- Application Number
- CN202111128416.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-09-26
AI Technical Summary
Existing technologies are ineffective at preventing fraudulent requests, are easily cracked, and are costly to implement.
By generating encrypted credential information based on client identifier and time identifier, and combining it with first-level and second-level encryption algorithms, predictive information is generated. The requested operation is only executed when the encrypted credential information matches the predictive information.
It effectively prevents access by abnormal requests, achieves good anti-scraping effect, and reduces the risk of being cracked.
Smart Images

Figure CN113806710B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and relates to but is not limited to a data processing method, device, equipment and storage medium. BACKGROUND
[0002] With the development of Internet technology, it is of great significance for the server to identify abnormal requests and effectively process abnormal requests.
[0003] To identify abnormal requests, the related art generally determines abnormal requests based on the access frequency of the requests. For example, the server determines that the access frequency of a client is greater than or equal to a frequency threshold, determines that the client is an abnormal client (also referred to as a brush), and stores the identifier of the client in a brush pool. To process abnormal requests, the related art generally rejects requests initiated by clients corresponding to identifiers included in the brush pool by formulating a brush prevention strategy. For example, the server receives a request, judges whether the client identifier in the request exists in the brush pool, and if the client identifier exists in the brush pool, the server rejects the request, and if the client identifier does not exist in the brush pool, the server performs corresponding actions based on the request.
[0004] For the above solution, the frequency threshold can be cracked by trial, and the brush prevention strategy can be cracked by reducing the access frequency of the brush and replacing the client identifier of the brush, so the brush prevention effect is poor. SUMMARY
[0005] The present application provides a data processing method and device, equipment and storage medium, which can effectively prevent abnormal access and has a good brush prevention effect.
[0006] The technical solution of the present application is implemented as follows:
[0007] The present application provides a data processing method, which comprises:
[0008] receiving a first request sent by a client;
[0009] obtaining verification information, the verification information comprising encrypted credential information;
[0010] generating prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request;
[0011] in a case where the encrypted credential information matches the prediction information, performing an operation corresponding to the first request.
[0012] The present application provides a data processing device, which comprises:
[0013] receive a first request sent by a client;
[0014] obtain verification information, the verification information comprising encrypted credential information;
[0015] generate prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request;
[0016] execute an operation corresponding to the first request in a case where the encrypted credential information matches the prediction information.
[0017] The application further provides an electronic device, comprising a memory and a processor, the memory storing a computer program capable of running on the processor, and the processor implements the above data processing method when executing the program.
[0018] The application further provides a storage medium storing a computer program, which implements the above data processing method when executed by a processor.
[0019] The data processing method, device, equipment and storage medium provided by the application comprise: receiving a first request sent by a client; obtaining verification information, the verification information comprising encrypted credential information; generating prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request; and executing an operation corresponding to the first request in a case where the encrypted credential information matches the prediction information. According to the data processing scheme provided by the application, the operation corresponding to the first request is executed only in a case where the encrypted credential information matches the prediction information, which can effectively prevent abnormal requests from being accessed. Since the encrypted credential information is encrypted based on the identifier of the client, it is not easy to be cracked, and therefore, the application has good anti-brushing effect. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 An optional structural schematic diagram of the data processing system provided by the application;
[0021] Figure 2 An optional flow schematic diagram of the data processing method provided by the application;
[0022] Figure 3 An optional flow schematic diagram of the data processing method provided by the application;
[0023] Figure 4 An optional flow schematic diagram of the data processing method provided by the application;
[0024] Figure 5An optional flow diagram of the data processing method provided by the embodiment of the present application is shown in FIG. 1.
[0025] Figure 6 An optional flow diagram of the data processing method provided by the embodiment of the present application is shown in FIG. 1.
[0026] Figure 7 An optional flow diagram of the data processing method provided by the embodiment of the present application is shown in FIG. 1.
[0027] Figure 8 An optional structure diagram of the data processing device provided by the embodiment of the present application is shown in FIG. 2.
[0028] Figure 9 An optional structure diagram of the electronic device provided by the embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0029] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will further describe the specific technical solutions of the application with reference to the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but not to limit the scope of the present application.
[0030] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subset of all possible embodiments, and can be combined with each other without conflict.
[0031] In the following description, the terms "first\second\third" are only used to distinguish different objects, and do not represent a specific order of the objects, and do not have a sequence limitation. It can be understood that "first\second\third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0033] The embodiments of the present application can provide data processing methods and devices, equipment and storage media. In practical applications, the data processing method can be realized by a data processing device, and each functional entity in the data processing device can be realized by hardware resources of an electronic device (such as a server device, or simply a server), such as processor and other computing resources, communication resources (such as those used to support various communication modes such as optical cable and cellular communication).
[0034] The data processing method provided in the embodiments of the present application is applied to a data processing system, and the data processing system includes a server and at least one client.
[0035] The client sends a first request to the server; the server receives the first request sent by the client; verification information is obtained, the verification information including encrypted credential information; prediction information is generated based on at least one identifier of the client and a first time identifier corresponding to the first request; and an operation corresponding to the first request is performed in a case where the encrypted credential information matches the prediction information.
[0036] As an example, the structure of the data processing system can be as shown in Figure 1 , including a client 10 and a server 20.
[0037] In an example, as shown in Figure 1 , the client 10 and the server 20 can interact through a network 30.
[0038] Here, the client 10 is configured to send a first request to the server 20, and the server 20 is configured to receive the first request sent by the client 10 and perform obtaining verification information, the verification information including encrypted credential information; generating prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request; and performing an operation corresponding to the first request in a case where the encrypted credential information matches the prediction information.
[0039] Next, the embodiments of the data processing method and device, equipment and storage medium provided in the embodiments of the present application will be described in conjunction with the schematic diagram of the data processing system shown in Figure 1 .
[0040] The embodiments of the present application provide a data processing method, which is applied to a data processing device, and the data processing device can be deployed on an electronic device as a server.
[0041] Figure 2 A flowchart of an optional data processing method is shown, and the data processing method provided in the embodiments of the present application is used to process various requests, and the first request is taken as an example for detailed description.
[0042] The data processing method can include but is not limited to Figure 2 the following S201 to S204 shown in .
[0043] S201, the server receives the first request sent by the client.
[0044] The first request is any request.
[0045] In a possible implementation, the client directly sends the first request to the server, and the server directly receives the first request sent by the client.
[0046] In another possible implementation, the client sends the first request to a first device (a device other than the client and the server), the first device receives the first request and forwards the first request to the server, and the server receives the first request forwarded by the first device. The first device can be one or more, and is configured according to actual requirements.
[0047] S202, the server obtains verification information.
[0048] The verification information includes encrypted credential information, and the content included in the verification information is not uniquely limited in the embodiments of the application, and can be configured according to actual requirements. In an example, the verification information can further include a first validity period; in another example, the verification information can further include a check identifier; and in still another example, the verification information can further include the first validity period and the check identifier.
[0049] In a possible implementation, the server obtains the verification information from user data (Cookie) of the client.
[0050] In another possible implementation, the server generates the verification information. For example, when the verification information in the Cookie is empty, the server generates the verification information.
[0051] Optionally, the server can issue the generated verification information to the Cookie of the client.
[0052] S203, the server generates prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request.
[0053] The at least one identifier of the client is used to point to the client. The number and type of the at least one identifier of the client are not specifically limited in the embodiments of the application, and can be configured according to actual requirements. For example, the at least one identifier of the client can be three client identifiers, which are respectively: an Internet Protocol (IP) address of the client, a Personal identification number (PIN) of a user of the client, and a Universally Unique Identifier (UUID) code of the client.
[0054] In an example, the first time identifier is used to indicate a time when the first request is received. Embodiments of the present application do not limit the form of the first time identifier, which can be configured according to actual needs. For example, the first time identifier can be a timestamp of receiving the first request.
[0055] The server obtains second credential information based on the at least one identifier of the client and the first time identifier corresponding to the first request, and generates prediction information based on the second credential information.
[0056] In S204, the server executes an operation corresponding to the first request in a case where the encrypted credential information matches the prediction information.
[0057] The server obtains the encrypted credential information from the verification information, and determines whether the encrypted credential information matches the prediction information. If the server determines that the encrypted credential information matches the prediction information, the server executes an operation corresponding to the first request.
[0058] It should be noted that if the server determines that the encrypted credential information does not match the prediction information, the first request is discarded, i.e., the operation corresponding to the first request is not executed.
[0059] The data processing method provided by the embodiments of the present application includes: receiving a first request sent by a client, obtaining verification information, the verification information including encrypted credential information; generating prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request; and executing an operation corresponding to the first request in a case where the encrypted credential information matches the prediction information. Through the data processing scheme provided by the embodiments of the present application, the operation corresponding to the first request is executed only in the case where the encrypted credential information matches the prediction information, which can effectively prevent abnormal requests from being accessed. Since the encrypted credential information is encrypted based on the identifier of the client, it is not easy to be cracked, and therefore has good anti-brushing effect.
[0060] The execution processes of S203 and S204 are briefly described below, which can include but are not limited to the following implementation mode 1 or implementation mode 2.
[0061] Implementation mode 1: for a scenario in which the verification information includes first credential information encrypted in one level.
[0062] Implementation mode 2: for a scenario in which the verification information includes first credential information encrypted in two levels.
[0063] In implementation mode 1, the server generates the prediction information based on the at least one identifier of the client and the first time identifier corresponding to the first request, which can include but is not limited to Figure 3 S301 to S303.
[0064] S301, the service end obtains at least one identifier of the client from the client.
[0065] In a possible implementation, the service end obtains the at least one identifier from user data (Cookie) of the client.
[0066] In another possible implementation, the service end receives the at least one identifier sent by the client. The at least one identifier can be sent by the client in the first request or can be sent by the client independently of the first request.
[0067] S302, the service end calculates the at least one identifier of the client and the first time identifier to obtain second credential information.
[0068] Embodiments of the present application do not limit the specific combination mode, and can be configured according to actual needs.
[0069] In a possible implementation, the service end can place the at least one identifier and the first time identifier together to obtain the second credential information; that is, the at least one identifier is used as the first A bits of the second credential, and the first time identifier is used as the last B bits of the second credential.
[0070] In another possible implementation, the service end can perform first calculation on the at least one identifier and the first time identifier to obtain the second credential information. For example, the first calculation can be addition calculation.
[0071] S303, the service end performs first-level encryption on the second credential information by using a first algorithm to obtain the prediction information.
[0072] Embodiments of the present application do not specifically limit the type of the first algorithm, and the first algorithm can be configured according to actual needs. For example, the first algorithm can be a message digest (Message Digest Algorithm 5, MD5) algorithm or a secure hash (Secure Hash Algorithm, SHA) algorithm.
[0073] Correspondingly, the implementation of S204, in which the service end executes the operation corresponding to the first request in the case where the encrypted credential information matches the prediction information, can include:
[0074] The service end obtains the first-level encrypted credential information from the verification information, and judges whether the first-level encrypted credential information matches the prediction information. If the service end determines that the first-level encrypted credential information matches the prediction information, the operation corresponding to the first request is executed.
[0075] It should be noted that if the server determines that the first-level encrypted credential information does not match the predicted information, the first request is discarded, that is, the operation corresponding to the first request is not performed.
[0076] Next, the implementation process of S301 in which the server obtains at least one identifier of the client will be described, which can include but is not limited to the following mode 1 or mode 2.
[0077] Mode 1: For the case where the verification information does not include the first validity period, the server directly obtains at least one identifier of the client.
[0078] Mode 2: For the case where the verification information includes the first validity period, the server obtains at least one identifier of the client if the first validity period is valid.
[0079] The implementation process of mode 2 can include but is not limited to the following S301A to S301B.
[0080] S301A: The server obtains the first validity period from the verification information.
[0081] The first validity period is used to represent the validity time of the first-level encrypted first credential information.
[0082] The server obtains the first validity period representing the validity time of the first-level encrypted first credential information from the verification information.
[0083] S301B: The server determines whether the validity time of the first-level encrypted first credential information has expired based on the first validity period.
[0084] The server determines the relationship between the validity time representing the first-level encrypted first credential information and the current time. If the current time is included in the validity time, it is determined that the validity period has not expired. If the current time is not included in the validity time, it is determined that the validity period has expired.
[0085] Correspondingly, the implementation of S301 can include:
[0086] The server obtains at least one identifier of the client if it is determined that the validity time of the first-level encrypted first credential information has not expired.
[0087] Next, the process of S302 in which the server calculates the second credential information based on at least one identifier of the client and the first time identifier will be described.
[0088] In the case where the verification information further includes a check identifier, the server calculates the second credential information based on at least one identifier of the client and the first time identifier can include:
[0089] Under the indication of the check identifier, at least one identifier of the client and the first time identifier are calculated to obtain second credential information. The check identifier is used to indicate the calculation manner of the at least one identifier and the first time identifier. For example, the check identifier can be used to indicate the type of the first calculation, and the check identifier can also be used to indicate the type of the identifier participating in the first calculation.
[0090] In the embodiment 2, the implementation of S203 that the server generates the prediction information based on the at least one identifier of the client and the first time identifier corresponding to the first request can include but is not limited to Figure 4 S401 to S405.
[0091] S401, the server obtains at least one identifier of the client from the client.
[0092] The implementation process of S401 can refer to the specific implementation of S301 that the server obtains at least one identifier of the client from the client, and details are not repeated here.
[0093] S402, the server calculates the at least one identifier of the client and the first time identifier to obtain second credential information.
[0094] The implementation process of S402 can refer to the specific implementation of S302 that the server calculates the at least one identifier of the client and the first time identifier to obtain second credential information, and details are not repeated here.
[0095] S403, the server uses a first algorithm to perform one-level encryption on the second credential information to obtain one-level encrypted second credential information.
[0096] The implementation process of S403 can refer to the specific implementation of S303 that the server uses a first algorithm to perform one-level encryption on the second credential information to obtain the prediction information, and the difference from S303 is that, in S303, the obtained is the prediction information, and in S403, the obtained is the one-level encrypted second credential information, not the prediction information.
[0097] S404, the server obtains at least one second algorithm.
[0098] The second algorithm is an encryption algorithm in an algorithm pool, and the number and type of the second algorithm are not specifically limited in the embodiments of the application, and can be configured according to actual needs. For example, the second algorithm can be one or more.
[0099] The service end performs hash calculation on the second credential information of the first encryption to obtain at least one algorithm identifier; for each algorithm identifier in the at least one algorithm identifier, an algorithm corresponding to the algorithm identifier in the algorithm pool is determined as a second algorithm; thereby, at least one second algorithm is obtained.
[0100] S405, the service end performs second encryption on the second credential information of the first encryption by using the at least one second algorithm to obtain the prediction information.
[0101] The second encryption is used for encrypting the second credential information of the first encryption, and the number (or the number of layers) of the second encryption is not limited in the embodiments of the application, and can be configured according to actual needs. For example, the number of the second encryption can be configured as m, and m is an integer greater than zero.
[0102] It can be understood that if the at least one second algorithm is one second algorithm, the service end can perform m times of the same second encryption on the second credential information of the first encryption by using one second algorithm to obtain the prediction information.
[0103] Correspondingly, the implementation of the service end performing the operation corresponding to the first request in the case that the encrypted credential information matches the prediction information can include:
[0104] The service end performs the operation corresponding to the first request in the case that the second encrypted credential information matches the prediction information.
[0105] The data processing method provided by the embodiments of the application can also update the second algorithm to obtain the second encrypted credential information updated dynamically by using the second algorithm updated dynamically.
[0106] The service end updates the second algorithm in the case that the first condition is met.
[0107] The embodiments of the application do not limit the specific content of the first condition, and the first condition can be configured according to actual needs. For example, the first condition can include a preset time period, or detecting that a second validity period representing the validity time of the second encrypted credential information is expired.
[0108] The updating process can include but is not limited to Figure 5 S501 to S503.
[0109] S501, the service end performs hash calculation on the second credential information of the first encryption to obtain at least one new algorithm identifier.
[0110] S502, the server determines, for each of the at least one new algorithm identifier, a new algorithm in the algorithm pool corresponding to the new algorithm identifier as a new second algorithm, to obtain at least one new second algorithm.
[0111] S503, the server sends the at least one new second algorithm to the client.
[0112] Optionally, the server can also send the first-level encrypted first credential information to the client.
[0113] Correspondingly, the client receives the at least one new second algorithm, and generates new second-level encrypted first credential information from the first-level encrypted first credential information according to the at least one new second algorithm.
[0114] Correspondingly, S404, the server obtains at least one second algorithm, which can be implemented as: obtaining the at least one new second algorithm, and replacing the at least one second algorithm with the at least one new second algorithm. Thus, new prediction information is generated according to the at least one new second algorithm.
[0115] The data processing method provided by the embodiments of the application can include but is not limited to the following steps in the case of satisfying the second condition: Figure 6 S601-S603 shown.
[0116] The embodiments of the application do not limit the specific content of the second condition, which can be configured according to actual needs. For example, the second condition can include but is not limited to the following cases:
[0117] Case one, the verification information is empty;
[0118] Case two, the first validity period expires;
[0119] Case three, the second validity period expires;
[0120] Case four, the encrypted credential information does not match the prediction information.
[0121] S601, the server generates first credential information based on at least one identifier of the client and a first time identifier corresponding to the first request.
[0122] The specific implementation process of S601 can refer to S301, the server obtains at least one identifier of the client; S302, the server calculates the at least one identifier of the client and the first time identifier to obtain the description of the second credential information. Here, it will not be repeated.
[0123] It should be noted that the difference between S601 and S301 and S302 is that S601 obtains the first credential information, and S302 obtains the second credential information.
[0124] S602, the server uses a first algorithm to perform one-level encryption on the first credential information to obtain the one-level encrypted first credential information.
[0125] The specific implementation process of S602 can refer to the description of S303 that the server uses a first algorithm to perform one-level encryption on the second credential information to obtain the prediction information. Here, it will not be repeated.
[0126] It should be noted that the difference between S602 and S303 is that S602 obtains the one-level encrypted first credential information, and S303 obtains the prediction information.
[0127] S603, the server obtains the verification information based on the one-level encrypted first credential information.
[0128] The server determines the one-level encrypted first credential information as the verification information, or determines the one-level encrypted first credential information and the first validity period as the verification information, or determines the one-level encrypted first credential information, the first validity period and the check identifier as the verification information.
[0129] Optionally, on the basis of S603, the server can also send the one-level encrypted first credential information and a second algorithm to the client, so that the client encrypts the one-level encrypted first credential information according to the second algorithm to obtain the two-level encrypted first credential information. Correspondingly, the verification information can also include the two-level encrypted first credential information, or the two-level encrypted first credential information and the second validity period.
[0130] Optionally, the server can issue the verification information to the Cookie of the client, so that the next time the server can directly obtain the verification information from the Cookie of the client.
[0131] It should be noted that the verification information can also be dynamically updated, and the first time identifier can be updated to realize dynamic updating of the verification information.
[0132] Next, the data processing method provided by the embodiments of the present application will be described through a specific application scenario.
[0133] For the problem of brush prevention, the implementation scheme of the related art can include: preventing brush through IP, PIN, UUID and the combination dimension thereof. First, a key is selected from the IP, PIN, UUID and the like, the access frequency limit of the current key is set to max, the server records the access frequency count of the current key in a certain time interval, when the count>max, the user request is directly rejected, and the key is put into the brush pool, and the effective period is set, and the request of the key is rejected within the effective period.
[0134] However, the implementation scheme of the related art is easy to be probed out of the set brush prevention dimension (IP, PIN or UUID) and the brush prevention frequency (max), so that after obtaining the brush prevention dimension and the brush prevention frequency, the abnormal access (brush access) can be continued by setting an access frequency lower than max, using a large IP pool, PIN pool or UUID pool, and changing a PIN pool, IP pool or UUID pool after a period of time, so that the brush prevention effect is poor.
[0135] In addition, the implementation scheme of the related art needs to record the key, access frequency, access times and the like by means of an external storage medium, and the implementation cost is high.
[0136] The data processing method provided by the embodiment of the application can effectively prevent abnormal request access only when the encrypted credential information matches the predicted information, and the operation corresponding to the first request is executed, the encrypted credential information is encrypted based on the identification of the client and is not easy to be cracked, so that the brush prevention effect is good.
[0137] In order to facilitate understanding, some technical terms are simply explained.
[0138] Message Digest (Message Digest Algorithm 5, MD5) algorithm: a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission.
[0139] User data (Cookie) on the client: some websites store data (usually encrypted) on the client to identify users, and temporarily or permanently save information on the client.
[0140] The data processing process provided by the embodiment of the application can include but is not limited to Figure 7 The steps 1 to 12 shown.
[0141] Step 1, the server receives a first request.
[0142] Step 2, the server obtains the first encrypted credential information (tk1) and the second encrypted credential information (tk2) from the cookie, and checks whether tk1 and tk2 are empty.
[0143] If the server determines that tk1 and tk2 are empty, steps 3 and 4 are executed; if the server determines that tk1 and tk2 are not empty, step 5 is executed.
[0144] Step 3, the server generates tk1 based on the first algorithm, generates tk based on tk1, and writes tk into the cookie of the client; then obtains the second algorithm F from the algorithm pool according to the hash value of tk1, and sends the second algorithm F to the client.
[0145] For example, tk1 can be obtained according to formula 1 below; the validity period of tk1 timeZone can be obtained according to formula 2 below; tk can be obtained according to formula 3 below.
[0146] tk1 = MD5(IP + PIN + UUID + slat) Formula 1;
[0147] Wherein, tk1 represents encrypted credential information; MD5 represents the first algorithm; IP represents the IP address of the client, PIN represents the PIN code of the client, UUID represents the UUID code of the client, and slat represents the custom salt value.
[0148] timeZone = math.floor(currentTimeMillis / T2) Formula 2;
[0149] Wherein, timeZone represents the validity period of tk1, math.floor represents the maximum integer less than the parameter currentTimeMillis / T2; currentTimeMillis represents the current timestamp, and T2 represents a preset empirical value.
[0150] tk = tk1.timeZone.checkCode Formula 3;
[0151] Wherein, tk represents verification information, tk1 represents encrypted credential information; timeZone represents the validity period of tk1; checkCode represents a check identifier; for example, after converting the decimal checkCode to binary, a 3-bit binary number is obtained, if the first bit of the binary number is 1, it indicates that the client identifier for generating tk1 includes the IP address of the client, if the second bit of the binary number is 1, it indicates that the client identifier for generating tk1 includes the UUID code of the client, and if the second bit of the binary number is 1, it indicates that the client identifier for generating tk1 includes the PIN of the client.
[0152] The algorithm pool can be expressed as the following formula 4.
[0153] funList = [f1(tk1, t), f2(tk1, t), …, fn(tk1, t)] Formula 4;
[0154] Wherein, funList represents the algorithm pool, and the length of funList is n.
[0155] Define the encryption algorithm pool funPool, define the encryption times m, so that each item in funPool is randomly selected from m second algorithms F in funList. According to the mathematical permutation and combination, the length of funPool is n m Since the encryption algorithm is randomly selected, it is difficult to be cracked by a brush.
[0156] Exemplarily, the remainder of dividing the hash value of tk1 by m can be taken as the subscript of the second algorithm F, and then the algorithm corresponding to the subscript in the algorithm pool is obtained as the second algorithm F.
[0157] Optionally, the server can package tk1 and the second algorithm into a JS (Javascript) file and issue it to the client.
[0158] Step 4, the client executes the second algorithm to generate tk2, which can generate TK (part of the verification information) based on tk2, and write TK into Cookie according to the following.
[0159] Exemplarily, tk2 can be obtained according to the following formula 5, the validity period timeZone1 of tk2 can be obtained according to the following formula 6, and TK can be obtained according to the following formula 7.
[0160] tk2 = F(tk1) Formula 5;
[0161] Wherein, tk2 represents the first credential information of the second encryption, F represents the second algorithm, and tk1 represents the first credential information of the first encryption.
[0162] timeZone1 = math.floor(currentTimeMillis() / T1 Formula 6;
[0163] Wherein, timeZone1 represents the validity period of tk2, math.floor represents the maximum integer less than the parameter, currentTimeMillis / T2, currentTimeMillis represents the current timestamp, and T1 represents a preset empirical value.
[0164] TK = tk2.timeZone1 Formula 7;
[0165] Wherein, TK represents the obtained information, tk2 represents the first credential information of the second encryption, and timeZone1 represents the validity period of tk2.
[0166] It should be noted that after step 4 is executed, step 2 is executed next.
[0167] Step 5, the server parses tk to obtain tk1, checkcode, and timeZone.
[0168] Step 6, the server checks whether timeZone is expired.
[0169] If the server determines that timeZone is expired, step 3 is executed, and if the server determines that timeZone is not expired, the following step 7 is executed.
[0170] Step 7, the server obtains IP, PIN, and UUID from the cookie of the client, and generates check_tk1 according to IP, PIN, and UUID.
[0171] For example, the server can generate check_tk1 according to the following formula 8.
[0172] check_tk1 = MD5(IP + PIN + UUID + slat) Formula 8;
[0173] Wherein, check_tk1 (equivalent to prediction information) represents the first prediction information, MD5 represents the first algorithm, IP represents the IP address of the client, PIN represents the PIN code of the client, UUID represents the UUID code of the client, and slat represents the custom salt value.
[0174] Step 8, the server checks whether tk1 and check_tk1 match.
[0175] If the server determines that tk1 and check_tk1 match, the following step 8 is executed, and if the server determines that tk1 and check_tk1 do not match, the above step 3 is executed.
[0176] Step 9, the server obtains the second algorithm F from the hash value of tk1 to calculate check_tk2.
[0177] For example, the subscript of the second algorithm F can be obtained according to the following formula 9, the second algorithm F can be obtained according to the following formula 10, and check_tk2 (equivalent to prediction information) can be obtained according to the following formula 11.
[0178] idx = hash(tk1) % L Equation 9
[0179] wherein idx represents the index of the second algorithm F, hash represents a hash algorithm, and %L represents the remainder after division by L.
[0180] F = funPool[idx] Equation 10
[0181] wherein F represents the second algorithm, funPool represents an algorithm pool array, and idx represents the index of the second algorithm F in the funPool.
[0182] check_tk2 = F(tk1) Equation 11
[0183] wherein check_tk2 represents the second prediction information, F represents the second algorithm, and tk1 represents the first credential information after first encryption.
[0184] Step 10, the server checks whether tk2 and check_tk2 match.
[0185] If the server determines that tk2 and check_tk2 match, step 11 is performed; if the server determines that tk2 and check_tk2 do not match, step 3 is performed.
[0186] Step 11, the server performs an operation corresponding to the first request; and updates the second algorithm F used to generate tk2.
[0187] For example, the server issues a page corresponding to the first request.
[0188] The server can periodically update the second algorithm F.
[0189] Step 12, the client obtains a page corresponding to the first request, generates tk2 according to the second algorithm F, sets an expiration date of tk2, generates TK based on tk2 and the expiration date of tk2, and writes TK into a cookie.
[0190] The client receives a page corresponding to the first request issued by the server, and generates tk2 according to the second algorithm F at regular time intervals. The implementation of generating tk2 according to the second algorithm F can refer to the specific implementation process of step 4, which will not be described here.
[0191] To implement the data processing method provided in the embodiments of the present application, a data processing apparatus in the embodiments of the present application is described below with reference to the structure schematic diagram of the data processing apparatus shown in FIG. 1. Figure 8
[0192] As shown in FIG. 1, the data processing apparatus includes a processor 10, a memory 20, and a communication interface 30. Figure 8 As shown, the data processing apparatus 80 comprises a receiving unit 801, an obtaining unit 802, a processing unit 803 and an executing unit 804. Wherein:
[0193] The receiving unit 801 is configured to receive a first request sent by a client;
[0194] The obtaining unit 802 is configured to obtain verification information, wherein the verification information comprises encrypted credential information;
[0195] The processing unit 803 is configured to generate prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request;
[0196] The executing unit 804 is configured to execute an operation corresponding to the first request in a case where the encrypted credential information matches the prediction information.
[0197] In some embodiments, the processing unit 803 is further configured to, in a case where the verification information comprises first credential information encrypted at a first level:
[0198] Obtain at least one identifier of the client;
[0199] Calculate the at least one identifier of the client and the first time identifier to obtain second credential information;
[0200] Encrypt the second credential information at a first level by using a first algorithm to obtain the prediction information;
[0201] Correspondingly, the executing unit 804 is further configured to, in a case where the first credential information encrypted at the first level matches the prediction information,
[0202] execute the operation corresponding to the first request.
[0203] In some embodiments, the data processing apparatus 80 further comprises a determining unit,
[0204] The determining unit is configured to, in a case where the verification information further comprises a first validity period, obtain the verification information comprising encrypted credential information before the obtaining unit 802 obtains the verification information;
[0205] Obtain the first validity period from the verification information, wherein the first validity period is used to represent a valid time of the first credential information encrypted at the first level;
[0206] Judge whether the valid time of the first credential information encrypted at the first level is expired based on the first validity period;
[0207] The obtaining unit 802 is further configured to, in a case where it is determined that the validity time of the first credential information of the primary encryption is not expired, perform the obtaining of the at least one identifier of the client.
[0208] In some embodiments, in a case where the verification information further comprises a verification identifier, the processing unit 803 is configured to,
[0209] and further configured to, under the indication of the verification identifier, calculate the at least one identifier of the client and the first time identifier to obtain second credential information; the verification identifier is used to indicate a calculation manner of the at least one identifier and the first time identifier.
[0210] In some embodiments, in a case where the verification information comprises the first credential information of the secondary encryption, the processing unit 803 is configured to,
[0211] and further configured to obtain, from the client, the at least one identifier of the client.
[0212] and further configured to calculate the at least one identifier of the client and the first time identifier to obtain second credential information.
[0213] perform primary encryption on the second credential information by using a first algorithm to obtain the first credential information of the primary encryption.
[0214] obtain at least one second algorithm.
[0215] perform secondary encryption on the first credential information of the primary encryption by using the at least one second algorithm to obtain the prediction information.
[0216] The performing unit 804 is further configured to
[0217] in a case where the first credential information of the secondary encryption matches the prediction information, perform an operation corresponding to the first request.
[0218] In some embodiments, the data processing apparatus 80 can further comprise an updating unit,
[0219] configured to perform a hash calculation on the first credential information of the primary encryption to obtain at least one new algorithm identifier.
[0220] for each new algorithm identifier in the at least one new algorithm identifier, determine a new algorithm corresponding to the new algorithm identifier in an algorithm pool as a new second algorithm to obtain at least one new second algorithm.
[0221] send the at least one new second algorithm and the first credential information of the primary encryption to the client, so that the client encrypts the first credential information of the primary encryption according to the at least one new second algorithm to generate new first credential information of the secondary encryption.
[0222] The processing unit 803 is further configured to obtain the at least one new second algorithm, and replace the at least one second algorithm with the at least one new second algorithm.
[0223] In some embodiments, the obtaining unit 802 generates first credential information based on at least one identifier of the client and a first time identifier corresponding to the first request, in a case where a second condition is met.
[0224] The first algorithm is used to perform primary encryption on the first credential information, to obtain the primary encrypted first credential information.
[0225] The verification information is obtained based on the primary encrypted first credential information.
[0226] It should be noted that the data processing apparatus provided in the embodiments of the present application includes various units included therein, and can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a micro processing unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0227] The above description of the device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0228] It should be noted that, in the embodiments of the present application, if the above-mentioned data processing method is realized in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various program code storage media. Thus, the embodiments of the present application are not limited to any specific hardware and software combination.
[0229] In a third aspect, an electronic device is provided, which includes a memory and a processor, the memory stores a computer program executable on the processor, and the processor implements the steps of the data processing method provided in the above embodiments when executing the program.
[0230] The following will be described in combination with Figure 9 the structural diagram of the electronic device 90 shown in the figure.
[0231] In an example, as Figure 9 shown, the electronic device 90 includes a processor 901, at least one communication bus 902, a user interface 903, at least one external communication interface 904, and a memory 905. The communication bus 902 is configured to realize the connection and communication between the components. The user interface 903 can include a display screen, and the external communication interface 904 can include a standard wired interface and a wireless interface.
[0232] The memory 905 is configured to store instructions and applications executable by the processor 901, and can also cache data to be processed by the processor 901 and modules in the electronic device (for example, image data, audio data, voice communication data, and video communication data) that have been processed or are to be processed. It can be implemented by FLASH or Random Access Memory (RAM).
[0233] In a fourth aspect, an electronic device is provided, which includes a memory and a processor, the memory stores a computer program executable on the processor, and the processor implements the steps of the data processing method provided in the above embodiments when executing the program.
[0234] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0235] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0236] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0237] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0238] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0239] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0240] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program performs the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes a mobile storage device, a read only memory (ROM), a magnetic disc or an optical disc, and various storage medium capable of storing program codes.
[0241] Alternatively, the integrated units of the present application can be stored in a computer readable storage medium if they are realized in the form of software function modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software product, and the computer software product is stored in a storage medium, includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes a mobile storage device, a ROM, a magnetic disc or an optical disc, and various storage medium capable of storing program codes.
[0242] The above is only the implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data processing method, characterized in that, The method includes: Receive the first request sent by the client; Obtain verification information, which includes encrypted credential information; Based on at least one identifier of the client and a first time identifier corresponding to the first request, prediction information is generated; If the encrypted credential information matches the prediction information, the operation corresponding to the first request is executed; The verification information includes first credential information encrypted at level two, and the generation of prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request includes: Obtain at least one identifier of the client from the client; The second credential information is obtained by calculating at least one identifier of the client and the first time identifier; The second credential information is encrypted using the first algorithm to obtain the first-level encrypted second credential information. Obtain at least one second algorithm; The predicted information is obtained by performing secondary encryption on the first-level encrypted second credential information using at least one second algorithm; If the first condition is met, perform a hash calculation on the second credential information of the first-level encryption to obtain at least one new algorithm identifier; For each new algorithm identifier in the at least one new algorithm identifier, the new algorithm in the algorithm pool corresponding to the new algorithm identifier is determined as a new second algorithm, thus obtaining at least one new second algorithm; The at least one new second algorithm and the first-level encrypted first credential information are sent to the client, so that the client encrypts the first-level encrypted first credential information according to the at least one new second algorithm to generate a new second-level encrypted first credential information. Obtain the at least one new second algorithm and replace the at least one second algorithm with the at least one new second algorithm.
2. The method according to claim 1, characterized in that, The verification information includes first-level encrypted first credential information. The generation of prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request includes: Obtain at least one identifier of the client; The second credential information is obtained by calculating at least one identifier of the client and the first time identifier; The second credential information is encrypted using the first algorithm to obtain the predicted information; When the encrypted credential information matches the prediction information, the operation corresponding to the first request is executed, including: If the first credential information of the first-level encryption matches the prediction information, the operation corresponding to the first request is executed.
3. The method according to claim 2, characterized in that, The verification information further includes: a first validity period, prior to obtaining at least one identifier of the client; the method further includes: The first validity period is obtained from the verification information; the first validity period is used to characterize the validity period of the first-level encrypted first credential information; Based on the first validity period, determine whether the validity period of the first-level encrypted first credential information has expired; Obtaining at least one identifier of the client includes: If it is determined that the validity period of the first credential information of the first-level encryption has not expired, the step of obtaining at least one identifier of the client is performed.
4. The method according to claim 2, characterized in that, The verification information further includes: a verification identifier, wherein the calculation of at least one identifier of the client and the first time identifier to obtain second credential information includes: Under the instruction of the verification identifier, at least one identifier of the client and the first time identifier are calculated to obtain second credential information; the verification identifier is used to indicate the calculation method of the at least one identifier and the first time identifier.
5. The method according to claim 1, characterized in that, When the encrypted credential information matches the prediction information, the operation corresponding to the first request is executed, including: If the first credential information of the secondary encryption matches the prediction information, the operation corresponding to the first request is executed.
6. The method according to any one of claims 1 to 5, characterized in that, Under the condition that the second condition is met, obtaining the verification information includes: First credential information is generated based on at least one identifier of the client and a first time identifier corresponding to the first request; The first credential information is encrypted using a first algorithm to obtain the first credential information with first-level encryption. The verification information is obtained based on the first credential information obtained from the first-level encryption.
7. A data processing apparatus, characterized in that, The device includes: The receiving unit is used to receive the first request sent by the client; An obtaining unit is used to obtain verification information, the verification information including encrypted credential information; The processing unit is configured to generate prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request; An execution unit is configured to execute the operation corresponding to the first request if the encrypted credential information matches the prediction information. The verification information includes first credential information with secondary encryption. The step of generating prediction information based on at least one identifier of the client and a first time identifier corresponding to the first request includes: obtaining at least one identifier of the client from the client; calculating second credential information by combining the at least one identifier of the client and the first time identifier; performing primary encryption on the second credential information using a first algorithm to obtain primary encrypted second credential information; obtaining at least one second algorithm; performing secondary encryption on the primary encrypted second credential information using the at least one second algorithm to obtain the prediction information; performing hash calculation on the primary encrypted second credential information under a first condition to obtain at least one new algorithm identifier; for each new algorithm identifier in the at least one new algorithm identifier, determining the new algorithm corresponding to the new algorithm identifier in the algorithm pool as a new second algorithm to obtain at least one new second algorithm; sending the at least one new second algorithm and the primary encrypted first credential information to the client, so that the client encrypts the primary encrypted first credential information according to the at least one new second algorithm to generate new secondary encrypted first credential information; obtaining the at least one new second algorithm and replacing the at least one second algorithm with the at least one new second algorithm.
8. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the program to implement the data processing method of any one of claims 1 to 7.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Digital signature verification method, system and device and computer readable storage medium
CN109728914A
Access certificate verification method and device, computer equipment and storage medium
CN109992976A
Resource sharing method, resource access method, electronic equipment and computer readable storage medium
CN112613070A