A method and device for preventing duplicate data submission
By encrypting and storing end-user data in memory, and using the MD5 algorithm for block encryption, the problem of duplicate data submission on the terminal page is solved, achieving fast and efficient interception and storage of duplicate data, and simplifying the solution to prevent duplicate data submission.
Patent Information
- Application Number
- CN202110168065.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-07
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-02-07
AI Technical Summary
The concurrent and repeated submission of the same invalid data on the terminal page within a short period of time leads to data redundancy and program abnormalities. Existing solutions are complex to implement and prone to failure due to the influence of network and terminal device performance and user habits.
By encrypting the data submitted by end users, using the MD5 encryption algorithm to encrypt the request data in blocks, and checking whether there is duplicate encrypted data in memory storage, the system performs corresponding operations based on the judgment result to prevent duplicate data submission.
It achieves fast and effective prevention of duplicate data submission, has high processing efficiency and is not prone to failure, and simplifies the implementation process of the solution.
Smart Images

Figure CN112861151B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method and device for preventing duplicate data submission. Background Art
[0002] When a terminal page submits data to a server, it is easy to submit the same invalid data repeatedly in a short period of time, resulting in redundant storage data and program abnormalities. At present, the general solution adopts front-end processing to disable the button after submission. This solution is affected by the performance of the network and terminal equipment and the user's usage habits. It is complicated to implement and easy to disable. The present invention provides a method and device for preventing duplicate data submission, which effectively solves the problem of complex implementation and easy to disable in the existing technical solution. Summary of the invention
[0003] The present invention provides a method and device for preventing duplicate data submission, which effectively solves the problem of duplicate data submitted by terminal users by judging the encrypted data obtained through encryption processing, so that the solution is executed quickly, has high processing efficiency, is simple and is not prone to failure.
[0004] The present invention provides a method for preventing duplicate data submission, comprising:
[0005] receiving data submitted by end users;
[0006] Obtaining the user ID of the terminal user;
[0007] Requesting a URL according to the user ID to obtain request data;
[0008] Encrypting the request data to obtain encrypted data;
[0009] Determine whether the encrypted data has the same encrypted data stored in the memory storage, and obtain the encrypted data determination result;
[0010] Perform corresponding operations based on the judgment result of the encrypted data; when the same encrypted data does not exist in the memory storage, the data submitted by the terminal user is not duplicate data, the encrypted data is stored, and the data submitted by the terminal user is allowed to pass; when the same encrypted data exists in the memory storage, the data submitted by the terminal user is duplicate data, the data submitted by the terminal user is intercepted and processed, and at the same time, the encrypted data is not stored.
[0011] Furthermore, the process of encrypting the request data to obtain the encrypted data includes:
[0012] Grouping the request data to obtain first request sub-data, second request sub-data and third request sub-data;
[0013] Performing data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm to obtain first encrypted sub-data, second encrypted sub-data and third encrypted sub-data;
[0014] Encrypted data is obtained according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0015] Furthermore, the process of determining whether the encrypted data has the same encrypted data stored in the memory storage and obtaining the encrypted data determination result comprises the following steps:
[0016] Extract the encrypted data stored in the memory in sequence as reference data for comparison;
[0017] Compare and judge the encrypted data with the comparison reference data to obtain an encrypted data judgment result;
[0018] When the encrypted data is compared with the comparison reference data to obtain the encrypted data judgment result, it is obtained according to the following formula:
[0019]
[0020]
[0021] In the above formula, g i represents the comparison set between the encrypted data and the i-th comparison reference data, Ω represents the entire data set, and C u (A) represents the complement of the encrypted data on the whole set, A represents the encrypted data set, A j represents the jth element in the encrypted data set, B i represents the i-th comparison reference data set, B ik represents the kth element of the ith comparison reference data set, g l represents the size of the minimum set in the comparison set between the encrypted data and the i-th comparison reference data, G l represents the minimum set of comparisons between the encrypted data and the i-th comparison reference data, represents an empty set, H represents the encrypted data judgment result, X represents that the same encrypted data does not exist in the memory storage, and Y represents that the same encrypted data exists in the memory storage.
[0022] Furthermore, the process of performing corresponding operation processing according to the encrypted data judgment result includes:
[0023] Determining whether the data submitted by the terminal user is duplicate data according to the encrypted data judgment result;
[0024] Whether to perform encrypted data storage and data interception is determined according to whether the data submitted by the terminal user is duplicate data.
[0025] Furthermore, the process of performing data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm includes:
[0026] S1, performing a first-layer MD5 operation on the first request sub-data, the second request sub-data and the third request sub-data respectively to generate a first-layer encrypted first request sub-data, a first-layer encrypted second request sub-data and a first-layer encrypted third request sub-data;
[0027] S2, using the binary data to perform a bitwise XOR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data, and the first-layer encrypted third request sub-data, to generate the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data, and the second-layer encrypted third request sub-data;
[0028] S3. Repeat steps S1 and S2 in sequence by using the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data until the number of rounds of MD5 operation reaches the preset number of rounds, and obtain the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0029] The present invention provides a device for preventing duplicate data submission, comprising: a data receiving module, a user ID acquisition module, a request combination module, an encryption processing module, a comparison and judgment module, a data interception module and a memory storage module;
[0030] The data receiving module is used to receive data submitted by the terminal user;
[0031] The user ID acquisition module is used to acquire the user ID of the terminal user;
[0032] The request association module is used to request the URL according to the user ID of the terminal user to obtain request data;
[0033] The encryption processing module is used to encrypt the request data and obtain encrypted data;
[0034] The comparison and judgment module is used to compare the encrypted data in the memory storage module to determine whether the same encrypted data is stored, and obtain an encrypted data judgment result;
[0035] The data interception module is used to intercept the data received by the data receiving module according to the encrypted data judgment result;
[0036] The memory storage module is used to store the encrypted data obtained in the encryption processing module according to the encrypted data judgment result.
[0037] Furthermore, the encryption processing module includes: a grouping unit, an encryption unit and a result unit;
[0038] The grouping unit is used to group the request data into first request sub-data, second request sub-data and third request sub-data;
[0039] The encryption unit is used to perform data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm to obtain the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data;
[0040] The result unit is used to obtain encrypted data according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0041] Furthermore, the comparison and judgment module includes: an extraction unit, a comparison unit and a judgment unit;
[0042] The extraction unit is used to extract the encrypted data stored in the memory in sequence as comparison reference data;
[0043] The comparison unit is used to compare the encrypted data with the comparison reference data;
[0044] The judgment unit is used to obtain the encrypted data judgment result according to the comparison result of the comparison unit.
[0045] Further, the data interception module includes an analysis unit and an interception unit;
[0046] The analysis unit is used to analyze the encrypted data judgment result and determine whether the data submitted by the terminal user is duplicate data;
[0047] The interception unit is used to intercept the data submitted by the terminal user when the data submitted by the terminal user is duplicate data;
[0048] The memory storage module includes an analysis unit and a storage unit;
[0049] The analysis unit is used to analyze the encrypted data judgment result and determine whether the data submitted by the terminal user is duplicate data;
[0050] The storage unit is used to store the encrypted data when the data submitted by the terminal user is not duplicate data.
[0051] Further, the encryption unit includes: a first encryption unit, a second encryption unit and a circulation unit;
[0052] The first encryption unit is used to perform a first-layer MD5 operation on the first request sub-data, the second request sub-data and the third request sub-data respectively to generate first-layer encrypted first request sub-data, first-layer encrypted second request sub-data and first-layer encrypted third request sub-data;
[0053] The second encryption unit performs a bitwise exclusive OR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data using the binary data to generate the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data;
[0054] The loop unit is used to repeatedly execute steps S1 and S2 on the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data until the number of rounds of MD5 operation reaches a preset number of rounds, thereby obtaining the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0055] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0056] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0058] Figure 1 A flowchart of a method for preventing duplicate data submission according to the present invention;
[0059] Figure 2 A schematic diagram of a method for preventing duplicate data submission according to the present invention;
[0060] Figure 3 A schematic diagram of the result of a device for preventing duplicate data submission according to the present invention. DETAILED DESCRIPTION
[0061] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0062] like Figure 1 and Figure 2 As shown, an embodiment of the present invention provides a method for preventing duplicate data submission, including:
[0063] receiving data submitted by end users;
[0064] Obtaining the user ID of the terminal user;
[0065] Requesting a URL according to the user ID to obtain request data;
[0066] Encrypting the request data to obtain encrypted data;
[0067] Determine whether the encrypted data has the same encrypted data stored in the memory storage, and obtain the encrypted data determination result;
[0068] Perform corresponding operations based on the judgment result of the encrypted data; when the same encrypted data does not exist in the memory storage, the data submitted by the terminal user is not duplicate data, the encrypted data is stored, and the data submitted by the terminal user is allowed to pass; when the same encrypted data exists in the memory storage, the data submitted by the terminal user is duplicate data, the data submitted by the terminal user is intercepted and processed, and at the same time, the encrypted data is not stored.
[0069] In the above technical solution, after data submission, first, the data submitted by the terminal user is received; then, the user ID of the terminal user is obtained; then, the URL is requested according to the user ID to obtain the request data; then, the request data is encrypted to obtain the encrypted data; then, for the encrypted data, it is determined whether the same encrypted data is stored in the memory storage to obtain the encrypted data judgment result; finally, the corresponding operation is processed according to the encrypted data judgment result; when the same encrypted data does not exist in the memory storage, the data submitted by the terminal user is not duplicate data, the encrypted data is stored, and the data submitted by the terminal user is allowed to pass; when the same encrypted data exists in the memory storage, the data submitted by the terminal user is duplicate data, the data submitted by the terminal user is intercepted and processed, and at the same time, the encrypted data is not stored. The above technical solution determines whether the data submitted by the terminal user is duplicate data by determining whether the same encrypted data is stored in the memory storage for the encrypted data, and effectively intercepts the duplicate data submitted by the terminal user, so that only the non-duplicate data submitted by the terminal user can pass. The above technical solution is not only fast in execution speed and high in processing efficiency, but also simple and not easy to fail.
[0070] In one embodiment of the present invention, the process of encrypting the request data to obtain the encrypted data includes:
[0071] Grouping the request data to obtain first request sub-data, second request sub-data and third request sub-data;
[0072] Performing data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm to obtain first encrypted sub-data, second encrypted sub-data and third encrypted sub-data;
[0073] Encrypted data is obtained according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0074] In the above technical solution, when encrypting the request data to obtain the encrypted data, the request data is first grouped to obtain the first request sub-data, the second request sub-data and the third request sub-data; then the first request sub-data, the second request sub-data and the third request sub-data are encrypted by the MD5 encryption algorithm to obtain the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data; and then the encrypted data is obtained according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data. The above technical solution effectively improves the efficiency of the encryption processing by grouping the request data into the first request sub-data, the second request sub-data and the third request sub-data, and then encrypting them by the MD5 encryption algorithm, thereby reducing the time consumption of the encryption processing. In addition, the encryption by the MD5 encryption algorithm is not easy to be tampered with and has a fast calculation speed.
[0075] In one embodiment of the present invention, the process of determining whether the encrypted data has the same encrypted data stored in the memory storage and obtaining the encrypted data determination result comprises the following steps:
[0076] Extract the encrypted data stored in the memory in sequence as reference data for comparison;
[0077] Compare and judge the encrypted data with the comparison reference data to obtain an encrypted data judgment result;
[0078] When the encrypted data is compared with the comparison reference data to obtain the encrypted data judgment result, it is obtained according to the following formula:
[0079]
[0080]
[0081] In the above formula, g i represents the comparison set between the encrypted data and the i-th comparison reference data, Ω represents the entire data set, and C u (A) represents the complement of the encrypted data on the whole set, A represents the encrypted data set, Aj represents the jth element in the encrypted data set, B i represents the i-th comparison reference data set, B ik represents the kth element of the ith comparison reference data set, g l represents the size of the minimum set in the comparison set between the encrypted data and the i-th comparison reference data, G l represents the minimum set of comparisons between the encrypted data and the i-th comparison reference data, represents an empty set, H represents the encrypted data judgment result, X represents that the same encrypted data does not exist in the memory storage, and Y represents that the same encrypted data exists in the memory storage.
[0082] In the above technical solution, when determining whether the same encrypted data is stored in the memory storage for encrypted data and obtaining the encrypted data judgment result, the encrypted data already stored in the memory storage is extracted in sequence and used as comparison reference data for comparison and judgment with the encrypted data, thereby obtaining the encrypted data judgment result. The above technical solution can effectively avoid the phenomenon of incomplete comparison when comparing the encrypted data with the comparison parameter data, resulting in some encrypted data in the memory storage being compared multiple times as comparison reference data or not being compared as comparison parameter data at all, thereby improving the efficiency of comparison and judgment and the accuracy of the encrypted data judgment result.
[0083] In one embodiment of the present invention, the process of performing corresponding operation processing according to the encrypted data judgment result includes:
[0084] Determining whether the data submitted by the terminal user is duplicate data according to the encrypted data judgment result;
[0085] Whether to perform encrypted data storage and data interception is determined according to whether the data submitted by the terminal user is duplicate data.
[0086] In the above technical solution, when performing corresponding operation processing according to the encrypted data judgment result, first determine whether the data submitted by the terminal user is duplicate data according to the encrypted data judgment result; then decide whether to store the encrypted data and whether to intercept the data according to whether the data submitted by the terminal user is duplicate data. When the data submitted by the terminal user is not duplicate data, the encrypted data is stored, but the data submitted by the terminal user is not intercepted. When the data submitted by the terminal user is duplicate data, the data submitted by the terminal user is intercepted, but the encrypted data is not stored. The above technical solution allows the data submitted by the terminal user to pass only when it is determined not to be duplicate data, otherwise it will be intercepted, which effectively solves the problem of duplicate data submission.
[0087] In one embodiment of the present invention, the process of performing data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm includes:
[0088] S1, performing a first-layer MD5 operation on the first request sub-data, the second request sub-data and the third request sub-data respectively to generate a first-layer encrypted first request sub-data, a first-layer encrypted second request sub-data and a first-layer encrypted third request sub-data;
[0089] S2, using the binary data to perform a bitwise XOR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data, and the first-layer encrypted third request sub-data, to generate the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data, and the second-layer encrypted third request sub-data;
[0090] S3. Repeat steps S1 and S2 in sequence by using the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data until the number of rounds of MD5 operation reaches the preset number of rounds, and obtain the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0091] In the above technical solution, when the first request sub-data, the second request sub-data and the third request sub-data are encrypted by the MD5 encryption algorithm, first, S1 is performed, and the first layer of MD5 operation is performed on the first request sub-data, the second request sub-data and the third request sub-data respectively to generate the first layer of encrypted first request sub-data, the first layer of encrypted second request sub-data and the first layer of encrypted third request sub-data; then, S2 is performed, and the first layer of encrypted first request sub-data, the first layer of encrypted second request sub-data and the first layer of encrypted third request sub-data are bitwise XORed using binary data to generate the second layer of encrypted first request sub-data, the second layer of encrypted second request sub-data and the second layer of encrypted third request sub-data; finally, steps S1 and S2 are repeated until the number of rounds of MD5 operation reaches the preset rounds, and the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data are obtained. The above technical solution can be encrypted according to the preset rounds, thereby improving the encryption effect and making the security performance higher.
[0092] like Figure 3 As shown, a device for preventing duplicate data submission provided by the present invention includes: a data receiving module, a user ID acquisition module, a request combination module, an encryption processing module, a comparison and judgment module, a data interception module and a memory storage module;
[0093] The data receiving module is used to receive data submitted by the terminal user;
[0094] The user ID acquisition module is used to acquire the user ID of the terminal user;
[0095] The request association module is used to request the URL according to the user ID of the terminal user to obtain request data;
[0096] The encryption processing module is used to encrypt the request data and obtain encrypted data;
[0097] The comparison and judgment module is used to compare the encrypted data in the memory storage module to determine whether the same encrypted data is stored, and obtain an encrypted data judgment result;
[0098] The data interception module is used to intercept the data received by the data receiving module according to the encrypted data judgment result;
[0099] The memory storage module is used to store the encrypted data obtained in the encryption processing module according to the encrypted data judgment result.
[0100] In the above technical scheme, the device for preventing duplicate data submission is provided with a data receiving module, a user ID acquisition module, a request combination module, an encryption processing module, a comparison judgment module, a data interception module and a memory storage module. The data submitted by the terminal user is received by the data receiving module; the user ID of the terminal user is obtained by the user ID acquisition module; the URL is requested by the request combination module according to the user ID of the terminal user to obtain the request data; the request data is encrypted by the encryption processing module and the encrypted data is obtained; the encrypted data is compared and judged by the comparison judgment module in the memory storage module to determine whether the same encrypted data is stored, and the encrypted data judgment result is obtained; the data interception module intercepts the data received by the data receiving module according to the encrypted data judgment result; the memory storage module stores the encrypted data obtained in the encryption processing module according to the encrypted data judgment result. The above technical scheme determines whether the encrypted data is stored in the memory storage by the comparison judgment module, and then determines whether the data submitted by the terminal user is duplicate data, effectively intercepts the duplicate data submitted by the terminal user, so that only the non-duplicate data submitted by the terminal user can pass. The above technical scheme is not only fast in execution speed and high in processing efficiency, but also simple and not easy to fail.
[0101] The encryption processing module in one embodiment provided by the present invention includes: a grouping unit, an encryption unit and a result unit;
[0102] The grouping unit is used to group the request data into first request sub-data, second request sub-data and third request sub-data;
[0103] The encryption unit is used to perform data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm to obtain the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data;
[0104] The result unit is used to obtain encrypted data according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0105] In the above technical solution, a grouping unit, an encryption unit and a result unit are provided in the encryption processing module. The grouping unit is used to divide the request data into the first request sub-data, the second request sub-data and the third request sub-data, and then the MD5 encryption algorithm is used to perform data encryption processing on the first request sub-data, the second request sub-data and the third request sub-data, thereby obtaining the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data, and finally the result unit obtains the encrypted data according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data. The above technical solution divides the request data into three parts by the grouping unit, and then enables the encryption unit to encrypt the first request sub-data, the second request sub-data and the third request sub-data at the same time, thereby speeding up the encryption processing speed and saving time consumption. Moreover, the encryption by the MD5 encryption algorithm is not easy to be tampered with and has a fast calculation speed.
[0106] In one embodiment provided by the present invention, the comparison and judgment module includes: an extraction unit, a comparison unit and a judgment unit;
[0107] The extraction unit is used to extract the encrypted data stored in the memory in sequence as comparison reference data;
[0108] The comparison unit is used to compare the encrypted data with the comparison reference data;
[0109] The judgment unit is used to obtain the judgment result of the encrypted data according to the comparison situation of the comparison unit. In the above technical solution, an extraction unit, a comparison unit and a judgment unit are set in the comparison judgment module. The encrypted data stored in the memory storage module are extracted in sequence by the extraction unit, and then the extracted encrypted data is used as the comparison reference data. The encrypted data is compared with the comparison reference data by the comparison unit, and then the judgment unit obtains the judgment result of the encrypted data according to the comparison situation of the comparison unit. The above technical solution extracts the encrypted data stored in the memory storage module in sequence by the extraction unit, and compares it with the encrypted data, and then obtains the judgment result of the encrypted data according to the comparison situation, which can effectively avoid the incomplete comparison phenomenon when the encrypted data is compared with the comparison parameter data, resulting in some encrypted data in the memory storage module being compared as the comparison reference data for multiple times or not participating in the comparison as the comparison parameter data once, thereby improving the efficiency of comparison judgment and improving the accuracy of the encrypted data judgment result.
[0110] In one embodiment provided by the present invention, the data interception module includes an analysis unit and an interception unit;
[0111] The analysis unit is used to analyze the encrypted data judgment result and determine whether the data submitted by the terminal user is duplicate data;
[0112] The interception unit is used to intercept the data submitted by the terminal user when the data submitted by the terminal user is duplicate data;
[0113] The memory storage module includes an analysis unit and a storage unit;
[0114] The analysis unit is used to analyze the encrypted data judgment result and determine whether the data submitted by the terminal user is duplicate data;
[0115] The storage unit is used to store the encrypted data when the data submitted by the terminal user is not duplicate data.
[0116] In the above technical solution, an analysis unit is provided in both the data interception module and the memory storage module, and the analysis unit analyzes the encrypted data judgment result to determine whether the data submitted by the terminal user is duplicate data, and then intercepts the data submitted by the terminal user or stores the encrypted data according to whether the data submitted by the terminal user is duplicate data. Through the above technical solution, the data submitted by the terminal user can be passed and the corresponding encrypted data can be stored only when the data submitted by the terminal user is not duplicated, which effectively solves the problem of the terminal user submitting duplicate data.
[0117] In one embodiment provided by the present invention, the encryption unit comprises: a first encryption unit, a second encryption unit and a circulation unit;
[0118] The first encryption unit is used to perform a first-layer MD5 operation on the first request sub-data, the second request sub-data and the third request sub-data respectively to generate first-layer encrypted first request sub-data, first-layer encrypted second request sub-data and first-layer encrypted third request sub-data;
[0119] The second encryption unit performs a bitwise exclusive OR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data using the binary data to generate the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data;
[0120] The loop unit is used to repeatedly execute steps S1 and S2 on the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data until the number of rounds of MD5 operation reaches a preset number of rounds, thereby obtaining the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data.
[0121] In the above technical solution, the encryption unit includes a first encryption unit, a second encryption unit and a loop unit. The first encryption unit performs a first-layer MD5 operation on the first request sub-data, the second request sub-data and the third request sub-data to obtain the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data; the second encryption unit uses binary data to perform a bitwise XOR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data to generate the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data; the loop unit makes the first encryption unit and the second encryption unit repeatedly execute until the number of rounds of MD5 operation reaches a preset number of rounds, and obtains the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data. The above technical solution uses the loop unit to perform a preset number of rounds, thereby realizing an encryption method with randomness, better encryption effect and higher security.
[0122] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for preventing duplicate data submission, characterized in that: include: receiving data submitted by end users; Obtaining the user ID of the terminal user; Requesting a URL according to the user ID to obtain request data; The request data is encrypted to obtain encrypted data, including: grouping the request data to obtain first request sub-data, second request sub-data and third request sub-data; encrypting the first request sub-data, the second request sub-data and the third request sub-data through the MD5 encryption algorithm to obtain first encrypted sub-data, second encrypted sub-data and third encrypted sub-data; obtaining encrypted data according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data; wherein, encrypting the first request sub-data, the second request sub-data and the third request sub-data through the MD5 encryption algorithm includes: S1, performing a first layer encryption on the first request sub-data, the second request sub-data and the third request sub-data, respectively. MD5 operation is performed to generate the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data; S2, using binary data to perform a bitwise XOR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data to generate the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data; S3, using the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data, repeatedly performing steps S1 and S2 in sequence until the number of rounds of MD5 operation reaches a preset number of rounds, and the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data are obtained; Determine whether the encrypted data has the same encrypted data stored in the memory storage, and obtain the encrypted data determination result; Perform corresponding operations based on the judgment result of the encrypted data; when the same encrypted data does not exist in the memory storage, the data submitted by the terminal user is not duplicate data, the encrypted data is stored, and the data submitted by the terminal user is allowed to pass; when the same encrypted data exists in the memory storage, the data submitted by the terminal user is duplicate data, the data submitted by the terminal user is intercepted and processed, and at the same time, the encrypted data is not stored.
2. The method for preventing duplicate data submission according to claim 1, characterized in that: The process of determining whether the encrypted data has the same encrypted data stored in the memory storage and obtaining the encrypted data determination result comprises the following steps: Extract the encrypted data stored in the memory in sequence as comparison reference data; Compare and judge the encrypted data with the comparison reference data to obtain an encrypted data judgment result; When the encrypted data is compared with the comparison reference data to obtain the encrypted data judgment result, it is obtained according to the following formula: In the above formula, represents the comparison set between the encrypted data and the i-th comparison reference data, Represents the entire data set, represents the complement of the encrypted data on the whole set, represents an encrypted dataset, represents the jth element in the encrypted data set, represents the i-th comparison reference data set, represents the kth element of the ith comparison reference data set, represents the size of the minimum set in the comparison set between the encrypted data and the i-th comparison reference data, represents the minimum set of comparisons between the encrypted data and the i-th comparison reference data, represents the empty set, Indicates the result of encryption data judgment. Indicates that the same encrypted data does not exist in the memory storage. Indicates that the same encrypted data exists in the memory storage.
3. The method for preventing duplicate data submission according to claim 1, characterized in that: The process of performing corresponding operation processing according to the encrypted data judgment result includes: Determining whether the data submitted by the terminal user is duplicate data according to the encrypted data judgment result; Whether to perform encrypted data storage and data interception is determined according to whether the data submitted by the terminal user is duplicate data.
4. A device for preventing duplicate data submission, characterized in that: include: Data receiving module, user ID acquisition module, request association module, encryption processing module, comparison and judgment module, data interception module and memory storage module; The data receiving module is used to receive data submitted by the terminal user; The user ID acquisition module is used to acquire the user ID of the terminal user; The request association module is used to request the URL according to the user ID of the terminal user to obtain request data; The encryption processing module is used to encrypt the request data and obtain the encrypted data, and includes: a grouping unit, an encryption unit and a result unit; the grouping unit is used to group the request data into first request sub-data, second request sub-data and third request sub-data; the encryption unit is used to encrypt the first request sub-data, the second request sub-data and the third request sub-data by using the MD5 encryption algorithm to obtain the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data; the result unit is used to obtain the encrypted data according to the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data; wherein the encryption unit includes: a first encryption unit, a second encryption unit and a loop unit; the first encryption unit is used to encrypt the first request sub-data, the second request sub-data and the third request sub-data respectively. The request sub-data and the third request sub-data are subjected to a first-layer MD5 operation to generate a first-layer encrypted first request sub-data, a first-layer encrypted second request sub-data and a first-layer encrypted third request sub-data; the second encryption unit uses binary data to perform a bitwise XOR operation on the first-layer encrypted first request sub-data, the first-layer encrypted second request sub-data and the first-layer encrypted third request sub-data to generate a second-layer encrypted first request sub-data, a second-layer encrypted second request sub-data and a second-layer encrypted third request sub-data; the loop unit is used to repeatedly perform steps S1 and S2 on the second-layer encrypted first request sub-data, the second-layer encrypted second request sub-data and the second-layer encrypted third request sub-data until the number of rounds of MD5 operation reaches a preset number of rounds, thereby obtaining the first encrypted sub-data, the second encrypted sub-data and the third encrypted sub-data; The comparison and judgment module is used to compare the encrypted data in the memory storage module to determine whether the same encrypted data is stored, and obtain an encrypted data judgment result; The data interception module is used to intercept the data received by the data receiving module according to the encrypted data judgment result; The memory storage module is used to store the encrypted data obtained in the encryption processing module according to the encrypted data judgment result.
5. The device for preventing duplicate data submission according to claim 4, characterized in that: The comparison and judgment module includes: an extraction unit, a comparison unit and a judgment unit; The extraction unit is used to extract the encrypted data stored in the memory in sequence as comparison reference data; The comparison unit is used to compare the encrypted data with the comparison reference data; The judgment unit is used to obtain the encrypted data judgment result according to the comparison result of the comparison unit.
6. The device for preventing duplicate data submission according to claim 4, characterized in that: The data interception module includes an analysis unit and an interception unit; The analysis unit is used to analyze the encrypted data judgment result and determine whether the data submitted by the terminal user is duplicate data; The interception unit is used to intercept the data submitted by the terminal user when the data submitted by the terminal user is duplicate data; The memory storage module comprises: a storage unit; The storage unit is used to store the encrypted data when the data submitted by the terminal user is not duplicate data.
