Authentication authentication method and system, electronic equipment and storage medium

By employing Darcy's Law algorithm for dual encryption of authentication tokens, the method enhances web page authentication security, addressing vulnerabilities in single-key token systems and improving overall data protection.

CN120320982APending Publication Date: 2025-07-15CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510389612.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

In the existing web page authentication methods, the secret key obtained by token is generated single and easy to crack, which poses high risks, resulting in insufficient data security and authentication strength.

Method used

Darcy's law algorithm is used to encrypt the preset identification code, build a preset database, and find identity information from it by decrypting the data, combining the preset expiration time and dual encryption mechanism to improve the security of authentication and authentication.

Benefits of technology

Through the dual encryption and expiration time mechanism, the security of data encryption and the strength of authentication and authentication are significantly improved, and the ability to resist attacks is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120320982A_ABST
    Figure CN120320982A_ABST
Patent Text Reader

Abstract

The invention discloses an authentication method and system, electronic equipment and a storage medium. The method comprises the following steps: acquiring preset request data initiated by a front end; wherein the preset request data comprises encrypted data generated by carrying out encryption processing on a preset identification code by a rear end; performing decryption processing on the preset request data to obtain decrypted data; wherein the decryption processing corresponds to the encryption processing; processing the decrypted data through a Darcy law algorithm to obtain target index data; when it is determined that preset identity information is searched from a preset database according to the target index data, it is determined that authentication succeeds; wherein the preset database is constructed through the Darcy law algorithm according to the preset identification code. According to the embodiment of the invention, the security of data encryption can be effectively improved, so that the strength and security of authentication are effectively improved. The method can be widely applied to the field of network technology and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network technology and security, and particularly to an authentication method, system, electronic device, and storage medium. Background Art

[0002] With the popularization of the Internet and the interactive Internet, the modern Internet user coefficient has reached an all-time high. Nowadays, web browsing carries more personal information of users, and once leaked, it will cause significant losses of property and personal information. In related technologies, the web authentication method mainly adopts the method of carrying user tokens. However, currently, the secret key generation for token acquisition is single and easy to crack, with certain risks.

[0003] In summary, the technical problems existing in related technologies need to be improved. Summary of the Invention

[0004] The main objective of the embodiments of this application is to propose an authentication method, system, electronic device, and storage medium, which can effectively improve the security of data encryption, thereby effectively improving the strength and security of authentication.

[0005] To achieve the above objective, on the one hand, the embodiments of this application propose an authentication method, and the method includes the following steps:

[0006] Obtain preset request data initiated by the front end; wherein, the preset request data includes encrypted data generated by the back end through encrypting a preset identification code;

[0007] Perform decryption processing on the preset request data to obtain decrypted data; wherein, the decryption processing corresponds to the encryption processing;

[0008] Process the decrypted data through the Darcy's law algorithm to obtain target index data;

[0009] When it is determined that preset identity information is found from a preset database according to the target index data, it is determined that the authentication is successful; wherein, the preset database is constructed through the Darcy's law algorithm according to the preset identification code.

[0010] In some embodiments, before performing the step of obtaining the preset request data initiated by the front end, the method further includes:

[0011] When it is determined that the preset verification is passed, randomly generate a preset identification code; wherein, the preset identification code includes a unique identification code;

[0012] Encrypt the unique identification code through a preset token authentication algorithm to obtain the encrypted data;

[0013] Return the encrypted data to the front end.

[0014] In some embodiments, after performing the step of randomly generating a preset identification code when it is determined that the preset verification passes, the method further includes:

[0015] Calculate first seepage flow rate data according to the unique identification code through the Darcy's law algorithm;

[0016] Construct preset index data according to the first seepage flow rate data and the unique identification code;

[0017] Construct key-value pair data according to the preset index data and the corresponding user information data, and store it in the preset database.

[0018] In some embodiments, after performing the step of constructing key-value pair data according to the preset index data and the corresponding user information data and storing it in the preset database, the method further includes:

[0019] Determine a preset expiration time according to the expiration date data of the unique identification code;

[0020] Set the expiration time parameter corresponding to the key-value pair data according to the preset expiration time.

[0021] In some embodiments, the step of calculating first seepage flow rate data according to the unique identification code through the Darcy's law algorithm includes:

[0022] Split the unique identification code through a preset data division rule to obtain seepage condition parameters; wherein, the seepage condition parameters include horizontal plane height data, soil height data, permeability coefficient, and seepage cross-sectional area;

[0023] Calculate the first seepage flow rate data according to the seepage condition parameters through the Darcy's law algorithm.

[0024] In some embodiments, the step of decrypting the preset request data to obtain decrypted data includes:

[0025] Extract a preset token string from the preset request data;

[0026] When it is determined that the preset token string passes the verification, parse the preset token string to obtain the decrypted data; wherein, the decrypted data includes the preset identification code.

[0027] In some embodiments, the step of processing the decrypted data through the Darcy's law algorithm to obtain target index data includes:

[0028] Calculate the second seepage flow rate data according to the preset identification code through the Darcy's law algorithm;

[0029] Construct the target index data according to the preset identification code and the second seepage flow rate data.

[0030] To achieve the above object, another aspect of the embodiments of the present application proposes an authentication system, the system includes:

[0031] A first module, configured to obtain preset request data initiated by the front end; wherein, the preset request data includes encrypted data generated by encrypting a preset identification code by the back end;

[0032] A second module, configured to perform decryption processing on the preset request data to obtain decryption data; wherein, the decryption processing corresponds to the encryption processing;

[0033] A third module, configured to process the decryption data through the Darcy's law algorithm to obtain target index data;

[0034] A fourth module, configured to determine that the authentication is successful when it is determined that preset identity information is found from a preset database according to the target index data; wherein, the preset database is constructed according to the preset identification code through the Darcy's law algorithm.

[0035] To achieve the above object, another aspect of the embodiments of the present application proposes an electronic device, the electronic device includes:

[0036] At least one processor;

[0037] At least one memory, configured to store at least one program;

[0038] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0039] To achieve the above object, another aspect of the embodiments of the present application proposes a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above method is implemented.

[0040] The embodiments of the present application at least include the following beneficial effects: The present application provides an authentication method, system, electronic device, and storage medium. This solution obtains preset request data initiated by the front end and decrypts the preset request data to obtain decrypted data. Among them, the preset request data includes encrypted data generated by the back end through encrypting a preset identification code, and the decryption process corresponds to the encryption process. Then, the embodiments of the present invention process the decrypted data through Darcy's law algorithm to obtain target index data. Furthermore, when it is determined that the preset identity information is found from the preset database according to the target index data, it is determined that the authentication is successful, improving the security of the authentication. Among them, the preset database in the embodiments of the present invention is constructed through Darcy's law algorithm based on the preset identification code. It is easy to understand that the embodiments of the present invention improve the security of the authentication through the method of encrypting the preset identification code by the back end. At the same time, the embodiments of the present invention process the preset identification code through Darcy's law algorithm to construct the preset database, that is, through the method of secondary encryption by Darcy's law algorithm, further improving the security of encryption and enhancing the anti-attack ability. Correspondingly, in the authentication process, the preset request data is decrypted, and the corresponding target index data is determined through Darcy's law algorithm, and the authentication is performed by searching for the preset identity information from the preset database, effectively improving the security of data encryption, and further effectively improving the strength and security of the authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a flowchart of the authentication method provided by the embodiments of the present invention;

[0042] Figure 2 is a flowchart of generating encrypted data provided by the embodiments of the present invention;

[0043] Figure 3 is a flowchart of constructing a preset database provided by the embodiments of the present invention;

[0044] Figure 4 is a flowchart of setting an expiration time parameter provided by the embodiments of the present invention;

[0045] Figure 5 is a flowchart of calculating the first seepage flow rate data through Darcy's law algorithm according to a unique identification code provided by the embodiments of the present invention;

[0046] Figure 6 is a schematic diagram of the liquid seepage principle provided by the embodiments of the present invention;

[0047] Figure 7 is a flowchart of decrypting the preset request data to obtain decrypted data provided by the embodiments of the present invention;

[0048] Figure 8It is a flowchart for processing decrypted data through Darcy's law algorithm to obtain target index data provided by an embodiment of the present invention;

[0049] Figure 9 It is a basic schematic diagram of authentication provided by an embodiment of the present invention;

[0050] Figure 10 It is a schematic structural diagram of an authentication system provided by an embodiment of the present invention;

[0051] Figure 11 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0053] It can be understood that the terms "first", "second", etc. used in the present application can be used in this document to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information can also be called the second information, and similarly, the second information can also be called the first information. Depending on the context, as used herein, the words "if", "when" can be interpreted as "when...", "when...", or "in response to determining".

[0054] The terms "at least one", "multiple", "each", "any one", etc. used in the present application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any one refers to any one of the multiple.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field 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.

[0056] Before elaborating on the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first explained, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0057] Darcy's law: Darcy's law describes the law of the linear relationship between the seepage velocity of water in saturated soil and the hydraulic gradient, also known as the linear seepage law.

[0058] JWT (Json Web Token): It is an open specification based on Json. This specification allows the use of JWT to transmit secure and reliable information between users and servers. Its two major usage scenarios are authentication and data. Correspondingly, during use, the server generates a token according to the specification and issues it to the client. At this time, when the client requests the server, it can carry the token to prove its identity information.

[0059] With the popularization of the Internet and the interactive Internet, the modern Internet user coefficient has reached an all-time high. Nowadays, web browsing carries more personal information of users. Once leaked, it will cause significant losses of property and personal information. In related technologies, the web authentication method mainly uses the method of carrying the user token. However, currently, the generation of the secret key for token acquisition is single and easy to crack, with certain risks.

[0060] In view of this, the embodiments of the present application provide an authentication method, system, electronic device, and storage medium. This solution obtains the preset request data initiated by the front end and decrypts the preset request data to obtain decrypted data. Among them, the preset request data includes the encrypted data generated by the back end through encrypting the preset identification code, and the decryption process corresponds to the encryption process. Then, the embodiments of the present invention process the decrypted data through the Darcy's law algorithm to obtain the target index data. Furthermore, when it is determined that the preset identity information is found from the preset database according to the target index data, it is determined that the authentication is successful, effectively improving the security of data encryption, and thus effectively improving the strength and security of authentication.

[0061] The authentication method provided by the embodiments of the present application relates to the fields of network technology and security. The authentication method provided by the embodiments of the present application can be applied to a terminal, can also be applied to a server, or can be software running on a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto; the server side can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application implementing the authentication method, etc., but is not limited to the above forms.

[0062] The present application can be used in many general or specific computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet-type devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0063] It should be noted that in each specific implementation manner of the present application, when it comes to relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiments of the present application need to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained through methods such as pop-up windows or jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data for the normal operation of the embodiments of the present application will be obtained.

[0064] Figure 1 is an optional flowchart of the authentication method provided by the embodiments of the present application. Figure 1The method in can include but is not limited to steps S110 to S140.

[0065] Step S110: Obtain preset request data initiated by the front end. Among them, the preset request data includes encrypted data generated by the back end through encrypting a preset identification code.

[0066] Step S120: Decrypt the preset request data to obtain decrypted data. Among them, the decryption process corresponds to the encryption process.

[0067] Step S130: Process the decrypted data through the Darcy's law algorithm to obtain target index data.

[0068] Step S140: When it is determined that preset identity information is found from the preset database according to the target index data, it is determined that the authentication is successful. Among them, the preset database is constructed through the Darcy's law algorithm according to the preset identification code.

[0069] During the operation of this specific embodiment, the embodiment of the present invention first obtains the preset request data initiated by the front end. Specifically, the preset request data in the embodiment of the present invention refers to a request sent by the front end (such as the browser of the client) to the back-end server for requesting a specific operation or resource. Correspondingly, the preset request data in the embodiment of the present invention includes the encrypted data generated by the back end through encrypting the preset identification code. Among them, the preset identification code in the embodiment of the present invention refers to the identification code used for authentication. Correspondingly, the embodiment of the present invention first generates encrypted data by encrypting the preset identification code, and then sends the encrypted data to the front end so that when the front end initiates the preset request data, it carries the corresponding encrypted data for identity verification, which improves the security of authentication. Then, the embodiment of the present invention decrypts the preset request data to obtain the decrypted data. Specifically, the embodiment of the present invention decrypts the obtained request data through the decryption process corresponding to the encryption process performed by the back end, so as to obtain the decrypted data in advance. Further, the embodiment of the present invention processes the decrypted data through the Darcy's law algorithm to obtain the target index data, and then determines whether the preset identity information can be found from the preset database according to the target index data. When it is determined that the preset identity information can be found from the preset database according to the target index data, it is determined that the authentication is successful. Specifically, the preset database in the embodiment of the present invention is constructed through the Darcy's law algorithm based on the preset identification code, that is, the preset identification code is encrypted through the Darcy's law algorithm to construct the preset database. Correspondingly, the embodiment of the present invention processes the decrypted data through the Darcy's law algorithm to construct the target index data, that is, the index data of the preset database, and indexes in the preset database according to the target index data to determine whether the preset database stores the preset identity information corresponding to the user. Among them, when it is determined that the corresponding preset identity information is found according to the target index data, it means that the user has the request permission, that is, the authentication is successful. The embodiment of the present invention encrypts the preset identification code and performs secondary encryption through the Darcy's law algorithm, effectively increasing the intensity of data encryption, being able to effectively improve the security of data encryption, and further effectively improving the intensity and security of authentication.

[0070] Refer to Figure 2 , in some embodiments of the present invention, before performing the operation of obtaining the preset request data initiated by the front end, the authentication method provided by the embodiment of the present invention further includes but is not limited to the following steps:

[0071] Step S210: When it is determined that the preset verification is passed, randomly generate a preset identification code. Among them, the preset identification code includes a unique identification code.

[0072] Step S220: Encrypt the unique identification code through the preset token authentication algorithm to obtain the encrypted data.

[0073] Step S230: Return the encrypted data to the front end.

[0074] In this specific embodiment, when determining that the preset verification is passed, the embodiment of the present invention randomly generates a preset identification code. Specifically, the preset verification in the embodiment of the present invention refers to the user's identity authority verification, such as login verification. Correspondingly, the preset identification code in the embodiment of the present invention includes a unique identification code (UUID). For example, when the login verification is passed, the embodiment of the present invention generates a corresponding random token for the user through the unique identification code (UUID). Then, the embodiment of the present invention encrypts the unique identification code through a preset token authentication algorithm to obtain encrypted data, and returns the encrypted data to the front end. Specifically, the preset token authentication algorithm in the embodiment of the present invention refers to a token-based identity authentication mechanism, such as a JWT (JSON Web Token) algorithm, a SAML (Security Assertion Markup Language) algorithm, and an OAuth 2.0 algorithm. For example, the embodiment of the present invention encrypts the unique identification code through the JWT algorithm, uses the generated random token (unique identification code) as the payload of the JWT data to generate a JWT string (i.e., encrypted data), and returns it to the front end. Correspondingly, after the front end obtains the encrypted data, it carries the JWT string in the request data header each time it initiates a request, such as carrying the JWT string in the Authorization field in the request header, for identity authentication.

[0075] Reference Figure 3 In some embodiments of the present invention, after determining that the preset verification is passed and randomly generating a preset identification code, the authentication method provided by the embodiment of the present invention also includes but is not limited to the following steps:

[0076] Step S310: Calculate first seepage volume data using Darcy's law algorithm according to the unique identification code.

[0077] Step S320: constructing preset index data according to the first seepage volume data and the unique identification code.

[0078] Step S330: construct key-value pair data according to the preset index data and the corresponding user information data, and store them in the preset database.

[0079] In this specific embodiment, in the embodiment of the present invention, first, the first seepage flow rate data is calculated according to the unique identification code through the Darcy's law algorithm. Specifically, the Darcy's law algorithm in the embodiment of the present invention refers to the law that describes the flow law of fluid in porous media, where the seepage velocity of the fluid in the porous media is proportional to the hydraulic gradient and related to the permeability coefficient. Correspondingly, in the embodiment of the present invention, by using the unique identification code as a relevant parameter of the Darcy's law algorithm and calculating the first seepage flow rate data, the unique identification code is encrypted, thereby improving the intensity and security of data encryption. Next, the embodiment of the present invention constructs the preset index data according to the first seepage flow rate data and the unique identification code, and then constructs the key-value pair data according to the preset index data and the corresponding user information data and stores it in the preset database. Specifically, the embodiment of the present invention combines the encrypted first seepage flow rate data and the unique identification code to generate the corresponding preset index data. For example, the embodiment of the present invention calculates the first seepage flow rate data and the unique identification code according to the preset calculation rule to obtain the preset index data. Or, the embodiment of the present invention splices the first seepage flow rate data and the unique identification code to obtain a complete key, that is, the preset index data. Finally, the embodiment of the present invention uses the user information of this user as the data value (value) of the key-value pair, and uses the preset index data as the key value (key) of the key-value pair, and stores it in the preset database (such as the Redis database), thereby constructing the preset database. It is easy to understand that in the embodiment of the present invention, by generating the preset index data with the Darcy's law algorithm and then constructing the preset database, the unique identification code can be encrypted twice. In the authentication process, not only the data in the front-end request needs to be decrypted, but also the Darcy's law verification needs to be performed, so that through the double-encryption method, the intensity and security of authentication are effectively improved.

[0080] Referring to Figure 4 , in some embodiments of the present invention, after performing the construction of the key-value pair data according to the preset index data and the corresponding user information data and storing it in the preset database, the authentication method provided by the present invention example further includes but is not limited to the following steps:

[0081] Step S410: Determine the preset expiration time according to the validity period data of the unique identification code.

[0082] Step S420: Set the expiration time parameter corresponding to the key-value pair data according to the preset expiration time.

[0083] In this specific embodiment, the embodiment of the present invention first determines a preset expiration time according to the validity period data of the unique identifier, and then sets the expiration time parameter corresponding to the key-value pair data according to the preset expiration time. Specifically, in the embodiment of the present invention, the validity period data refers to the time period during which the unique identifier is accepted as valid in the system. When the validity period is exceeded, the unique identifier (such as a token) will no longer be accepted by the system, and the user needs to obtain a new unique identifier again. Correspondingly, the embodiment of the present invention determines the validity period of the key-value pair data according to the validity period data of the unique identifier, that is, determines the corresponding preset expiration time. Then, the embodiment of the present invention uses this preset expiration time as the expiration time parameter of the corresponding key-value pair data (preset index data and the corresponding user information data) in the preset database. That is, when the time exceeds this preset expiration time, the key-value pair data will become invalid. At this time, when searching for user information data through the corresponding preset index data, the authentication will fail. By setting the expiration time parameter of the key-value pair data, the embodiment of the present invention can effectively improve the security of authentication. At the same time, the expiration time parameter of the key-value pair data in the embodiment of the present invention corresponds to the validity period data of the unique identifier, that is, the validity periods of the dual-verification data are consistent, thereby improving the stability and reliability of authentication, and further improving the overall security of the system and the user experience.

[0084] Referring to Figure 5 , in some embodiments of the present invention, the first seepage flow rate data is calculated by the Darcy's law algorithm according to the unique identifier, including but not limited to the following steps:

[0085] Step S510: Split the unique identifier according to a preset data partitioning rule to obtain seepage condition parameters. Among them, the seepage condition parameters include the horizontal plane height data, the soil height data, the permeability coefficient, and the seepage cross-sectional area.

[0086] Step S520: Calculate the first seepage flow rate data according to the seepage condition parameters by the Darcy's law algorithm.

[0087] In this specific embodiment, the embodiment of the present invention first splits the unique identification code through a preset data partitioning rule to obtain seepage condition parameters. Specifically, the seepage condition parameters in the embodiment of the present invention include horizontal plane height data, soil height data, permeability coefficient, and seepage cross-sectional area. Correspondingly, the preset data partitioning rule in the embodiment of the present invention refers to a rule for partitioning the unique identification code that is custom-set in advance. For example, in the embodiment of the present invention, the 3rd and 4th bit data in the unique identification code are used as the horizontal plane height data, the 5th bit data is used as the soil height data, the 6th bit data is used as the permeability coefficient, and the 7th bit data is used as the seepage cross-sectional area, so as to realize the splitting of the unique identification code and obtain various seepage condition parameters required by the Darcy's law algorithm. Further, the embodiment of the present invention calculates the first seepage flow rate data through the Darcy's law algorithm according to the seepage condition parameters. Specifically, as Figure 6 shown, Figure 6 is a schematic diagram of the principle of Darcy's law provided by the embodiment of the present invention. Correspondingly, the calculation formula of the Darcy's law algorithm in the embodiment of the present invention is as shown in the following formula (1):

[0088]

[0089] Among them, in the formula, Q represents the seepage flow rate, k represents the permeability coefficient, A represents the seepage cross-sectional area, that is, the cross-sectional area of the soil, Δh represents the height from the upper water level to the lower water level, that is, the horizontal plane height data, l represents the soil height data, and i represents the hydraulic gradient, that is, the hydraulic gradient ratio.

[0090] Correspondingly, the embodiment of the present invention substitutes the various seepage condition parameters obtained by dividing the unique identification code into the calculation formula of the Darcy's law algorithm, thereby calculating the first seepage flow rate data, so as to perform secondary encryption on the payload part JWT through the Darcy's law algorithm, increase the encryption strength of the payload part, and make the user information more secure.

[0091] Referring to Figure 7 , in some embodiments of the present invention, the preset request data is decrypted to obtain decryption data, including but not limited to the following steps:

[0092] Step S610: Extract a preset token string from the preset request data.

[0093] Step S620: When it is determined that the preset token string passes the verification, the preset token string is parsed to obtain decryption data. Among them, the decryption data includes a preset identification code.

[0094] In this specific embodiment, the embodiment of the present invention first extracts a preset token character from the preset request data and verifies the preset token string. When it is determined that the preset token string passes the verification, the preset token string is parsed to obtain decryption data. Specifically, an interceptor is set at the backend in the embodiment of the present invention. Whenever the preset request data sent by the frontend is received, the preset token string is first extracted from the preset request data for verification. For example, the embodiment of the present invention checks whether the request header contains the Authorization field through the interceptor, and extracts the JWT string (preset token string) from the Authorization field to verify its validity, such as whether the token has expired or the signature is valid. Correspondingly, when it is determined that the preset token string passes the verification, the embodiment of the present invention parses the random part token (token) in the payload of the preset token string, that is, the preset identification code. Correspondingly, the embodiment of the present invention obtains the generated UUID through the random part token, and performs calculations and splicing through Darcy's law to generate a complete key.

[0095] Referring to Figure 8 , in some embodiments of the present invention, the decryption data is processed by the Darcy's law algorithm to obtain target index data, including but not limited to the following steps:

[0096] Step S710: Calculate the second seepage flow rate data according to the preset identification code through the Darcy's law algorithm.

[0097] Step S720: Construct target index data according to the preset identification code and the second seepage flow rate data.

[0098] In this specific embodiment, the embodiment of the present invention first calculates the second seepage flow rate data according to the preset identification code through the Darcy's law algorithm. Specifically, after parsing the decrypted data containing the preset identification code, the embodiment of the present invention also divides the preset identification code according to the preset data division rule to determine the corresponding seepage condition parameters. Then, the embodiment of the present invention substitutes the seepage condition parameters determined by the preset identification code into the corresponding Darcy's law calculation formula, such as the above formula (1), so as to calculate the second seepage flow rate data. Further, the embodiment of the present invention constructs the target index data according to the preset identification code and the second seepage flow rate data. Specifically, the target index data in the embodiment of the present invention refers to the index data corresponding to the preset identification code, such as a key (key). For example, the embodiment of the present invention splices the second seepage flow rate data calculated through the Darcy's law algorithm with the preset identification code to generate a complete key, that is, constructs the target index data. Correspondingly, the embodiment of the present invention obtains user information in the preset database (Redis database) through the generated key. When it is determined that the user information corresponding to the key can be obtained, it means that the user has logged in, that is, the authentication is passed.

[0099] Next, in combination with a specific authentication application example, the solution of the embodiment of the present invention will be introduced and described in detail:

[0100] Exemplarily, refer to Figure 9 , Figure 9This is the basic schematic diagram of the authentication and authorization provided by the embodiments of the present invention. Specifically, in the embodiments of the present invention, after the login verification is passed, a corresponding random token is generated for the corresponding user through UUID, and this token is used as part of the key. At the same time, the embodiments of the present invention intercept the middle numeric characters of the UUID for calculation to generate seepage condition parameters, and calculate the corresponding seepage flow value through the Darcy's law algorithm. Then, the embodiments of the present invention splice the calculated seepage flow value with the random token to obtain a complete key. Correspondingly, the embodiments of the present invention use the corresponding user information as the value, store it in the Redis database, and set an expiration time. Among them, the expiration time set in the embodiments of the present invention corresponds to the time when the user login fails. In addition, the embodiments of the present invention use the generated random token as the payload part of the JWT to generate a JWT string and return it to the front end. Correspondingly, after the front end obtains the JWT string, each time a request is initiated, the JWT string is carried in the Authorization field in the request header. Further, the embodiments of the present invention define an interceptor at the back end. When each front end request is received, the embodiments of the present invention first take out the JWT string from the Authorization field in the request header and verify it. Correspondingly, when it is determined that the verification passes, the embodiments of the present invention parse the JWT string to obtain the random part token in the payload. Then, the embodiments of the present invention obtain the generated UUID through this random part token, and then calculate and splice through Darcy's law to obtain a complete key. Finally, the embodiments of the present invention query from the Redis database according to the generated complete key to determine whether the user information corresponding to the key can be obtained, that is, whether there is corresponding user information in the Redis database. When it is determined that the corresponding user information is obtained, it means that the user has logged in, that is, the authentication and authorization passes.

[0101] For example, after the login verification is passed in the embodiment of the present invention, a random UUID is generated, assumed to be 123456789. Then, in the embodiment of the present invention, the 3rd and 4th digits of the number are used as the height of the horizontal plane, the 5th digit of the number is used as the height of the soil, the 6th digit is used as the permeability coefficient k, and the 7th digit is used as the seepage cross-sectional area A. According to Darcy's law Q = 6 * 7 * (34 ÷ 5), after calculation and rounding, the seepage flow rate is obtained as 286. Then, the embodiment of the present invention splices the obtained seepage flow rate with the randomly generated number to obtain 123456789286, and uses it as the key of redis. At the same time, the embodiment of the present invention stores the user data as the value of Redis in the Reids database and sets the expiration time to the validity period of the token. In addition, the embodiment of the present invention encrypts the randomly generated number 123456789 through JWT and returns it to the front end, and the front end carries this encrypted string every time it requests the background. Further, the embodiment of the present invention decrypts the encrypted string carried by the front end through JWT to obtain 123456789, calculates and splices it through Darcy's law to obtain the complete key. Finally, the embodiment of the present invention searches in the Redis database according to the obtained key. When it is determined that the corresponding user information can be found, it means that the user has logged in.

[0102] It is easy to understand that in the embodiment of the present invention, the conditions for liquid seepage are generated according to the randomly generated number, the corresponding seepage coefficient, seepage cross-sectional area, and hydraulic gradient are obtained, the partial encrypted key is obtained according to the calculated seepage flow rate value, and then spliced with the randomly generated number to obtain the complete key, and the user's login data is obtained. According to the number of digits of the randomly generated number, the method of seepage flow rate combined with fluid mechanics is selected to realize the double encryption of the authentication data. Correspondingly, in the embodiment of the present invention, the complete key is obtained through double encryption, which is not easily obtained by external brute force, improving the overall security. In addition, the embodiment of the present invention alleviates the low security problem of only one encryption in traditional payload encryption, greatly expands the flexibility of data encryption, enables each key to be encrypted according to the randomly generated number, improves the security of encryption, and enhances the anti-attack ability. And, the algorithm of the embodiment of the present invention can be separately extracted as a tool class, meeting the requirements of low coupling in actual development. The algorithm calculation is efficient, and without affecting the overall operation efficiency of the code, it improves the overall strength of encryption and further guarantees the data security.

[0103] Please refer to Figure 10 , the embodiment of the present application also provides an authentication system, which can implement the above authentication method. The system includes:

[0104] The first module 810 is used to obtain the preset request data initiated by the front end. Among them, the preset request data includes the encrypted data generated by the backend through encrypting the preset identification code.

[0105] A second module 820, configured to decrypt preset request data to obtain decrypted data. Among them, the decryption process corresponds to the encryption process.

[0106] A third module 830, configured to process the decrypted data through Darcy's law algorithm to obtain target index data.

[0107] A fourth module 840, configured to determine that the authentication is successful when it is determined that preset identity information is found from a preset database according to the target index data. Among them, the preset database is constructed through Darcy's law algorithm according to a preset identification code.

[0108] It can be understood that the content in the above method embodiments is applicable to the present system embodiment. The functions specifically implemented by the present system embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0109] An embodiment of the present application further provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above authentication method is implemented. The electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.

[0110] It can be understood that the content in the above method embodiments is applicable to the present device embodiment. The functions specifically implemented by the present device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0111] Please refer to Figure 11 , Figure 11 which illustrates the hardware structure of an electronic device according to another embodiment. The electronic device includes:

[0112] A processor 910, which can be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;

[0113] The memory 920 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 920 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 920 and are called by the processor 910 to execute the authentication method of the embodiments of this application;

[0114] The input / output interface 930 is used to implement information input and output;

[0115] The communication interface 940 is used to implement communication and interaction between this device and other devices. It can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.);

[0116] The bus 950 transmits information between the various components of the device (such as the processor 910, the memory 920, the input / output interface 930, and the communication interface 940);

[0117] Among them, the processor 910, the memory 920, the input / output interface 930, and the communication interface 940 are communicatively connected to each other inside the device through the bus 950.

[0118] The embodiments of this application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above authentication method is implemented.

[0119] It can be understood that the content in the above method embodiments is applicable to the embodiments of this storage medium. The functions specifically implemented by the embodiments of this storage medium are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0120] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely disposed relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0121] The embodiments described in the embodiments of the present application are to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0122] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.

[0123] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0124] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.

[0125] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0126] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects and indicates that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Here, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item) of the following" or a similar expression refers to any combination of these items, including any combination of a single item or multiple items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0127] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in an electrical, mechanical, or other form.

[0128] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units. That is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0129] In addition, in each embodiment of this application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0130] If an integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The foregoing storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0131] The preferred embodiments of the embodiments of this application have been described above with reference to the accompanying drawings. This does not limit the scope of the rights of the embodiments of this application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of this application shall fall within the scope of the rights of the embodiments of this application.

Claims

1. An authentication method, characterized in that, The method includes the following steps: Obtain preset request data initiated by the front end; wherein, the preset request data includes encrypted data generated by the back end through encrypting a preset identification code; Perform decryption processing on the preset request data to obtain decrypted data; wherein, the decryption processing corresponds to the encryption processing; Process the decrypted data through the Darcy's law algorithm to obtain target index data; When it is determined that preset identity information is found from a preset database according to the target index data, determine that the authentication is successful; wherein, the preset database is constructed through the Darcy's law algorithm according to the preset identification code.

2. The method according to claim 1, characterized in that, Before executing the step of obtaining the preset request data initiated by the front end, the method further includes: When it is determined that preset verification is passed, randomly generate a preset identification code; wherein, the preset identification code includes a unique identification code; Encrypt the unique identification code through a preset token authentication algorithm to obtain the encrypted data; Return the encrypted data to the front end.

3. The method according to claim 2, wherein After executing the step of when it is determined that preset verification is passed and randomly generating a preset identification code, the method further includes: Calculate first seepage flow rate data through the Darcy's law algorithm according to the unique identification code; Construct preset index data according to the first seepage flow rate data and the unique identification code; Construct key-value pair data according to the preset index data and corresponding user information data, and store it in the preset database.

4. The method according to claim 3, wherein After executing the step of constructing key-value pair data according to the preset index data and corresponding user information data and storing it in the preset database, the method further includes: Determine a preset expiration time according to the expiration date data of the unique identification code; Set an expiration time parameter corresponding to the key-value pair data according to the preset expiration time.

5. The method according to claim 3, wherein The step of calculating first seepage flow rate data through the Darcy's law algorithm according to the unique identification code includes: Split the unique identification code through a preset data partitioning rule to obtain seepage condition parameters; wherein, the seepage condition parameters include horizontal plane height data, soil height data, permeability coefficient, and seepage cross-sectional area; Calculate the first seepage flow rate data through the Darcy's law algorithm according to the seepage condition parameters.

6. The method according to claim 1, characterized in that, The step of performing decryption processing on the preset request data to obtain decrypted data includes: Extract a preset token string from the preset request data; When it is determined that the preset token string is verified to be passed, parse the preset token string to obtain the decrypted data; wherein, the decrypted data includes the preset identification code.

7. The method according to claim 6, wherein The step of processing the decrypted data through the Darcy's law algorithm to obtain target index data includes: Calculate second seepage flow rate data through the Darcy's law algorithm according to the preset identification code; Construct the target index data according to the preset identification code and the second seepage flow rate data.

8. An authentication system, characterized in that, The system includes: A first module, configured to obtain preset request data initiated by the front end; wherein, the preset request data includes encrypted data generated by the back end through encrypting a preset identification code; A second module, configured to decrypt the preset request data to obtain decrypted data; wherein, the decryption process corresponds to the encryption process; A third module, configured to process the decrypted data through the Darcy's law algorithm to obtain target index data; A fourth module, configured to determine that the authentication is successful when it is determined that preset identity information is found from a preset database according to the target index data; wherein, the preset database is constructed by the Darcy's law algorithm according to the preset identification code.

9. An electronic device, characterized in that, Comprising: At least one processor; At least one memory, configured to store at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.