Data authentication method, terminal equipment and computer readable storage medium

By introducing query engines and authentication devices into the big data system, lightweight authentication and authentication methods are implemented, solving the problem of unauthorized access to sensitive data in the big data system, reducing development costs and improving system security. and performance.

CN118709206AInactive Publication Date: 2024-09-27SHENZHEN XIAOYING INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411178397.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The lack of strict authentication and authorization mechanisms in big data systems results in sensitive data being accessed by unauthorized users. The existing Kerberos+LDAP and sentry methods are complex and costly to deploy.

Method used

By introducing a query engine and an authentication device, the client user's query request is converted into a data format that meets the requirements of the authentication device. The authentication device performs identity verification and authority verification based on the authority policy, providing lightweight authentication and authentication methods. Simplify the deployment process.

Benefits of technology

It reduces development costs, improves system security, performance and scalability, ensures data security and user experience, and reduces the risk of unauthorized access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709206A
    Figure CN118709206A
Patent Text Reader

Abstract

The invention is applicable to the technical field of big data authority authentication, and provides a data authentication method, terminal equipment and a computer readable storage medium, and the method comprises the following steps: a query engine obtains a query request of a client user; the query engine generates an authentication request conforming to the data format of the authentication device according to the query request; and the authentication device performs authority authentication on the query request of the user according to the authentication request. According to the method, a lightweight authentication and authentication mode can be provided, and the development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of data authentication, and in particular, relates to a data authentication method, a terminal device, and a computer-readable storage medium. Background Art

[0002] Big data systems store a large amount of sensitive data such as personal information and business secrets. Without strict authentication and authorization mechanisms, these data may be accessed by unauthorized users, causing serious security problems.

[0003] In the related technology, Kerberos+LDAP authentication method and Sentry method are used for permission identification, but the authentication and authorization methods are complicated and cumbersome to deploy, require more system resources, and have high development costs. Summary of the invention

[0004] The embodiments of the present application provide a data authentication method, system, and computer-readable storage medium method and device, which can provide a lightweight authentication and authorization method and reduce development costs.

[0005] In a first aspect, an embodiment of the present application provides a data authentication method, including: The query engine obtains the query request of the client user; The query engine generates an authentication request in a data format that conforms to the authentication device according to the query request; The authentication device performs authority authentication on the user's query request according to the authentication request.

[0006] In the embodiment of the present application, the client user initiates a query to the query engine by inputting query conditions or requests. The query engine, as the core component of data retrieval, is responsible for receiving and processing the user's query request. In order to ensure the legality of the user's query operation, the query engine needs to convert the user's query request into a data format that meets the requirements of the authentication device. The authentication device authenticates the user's authority according to the authentication request based on the internally set authority policy and rules. It is equivalent to introducing a query engine, and the query engine can generate an authentication request based on different query requests input by the user, and send the authentication request to the authentication device for authentication. The deployment method is simple, and the authentication work of the user's query request can be completed by only configuring the query engine and the authentication device. The above method can provide a lightweight authentication and authentication method to reduce development costs.

[0007] In a possible implementation manner of the first aspect, the query engine includes a first query plug-in and at least one second query plug-in, each second query plug-in corresponds to a query language; the query engine generates an authentication request in a data format that complies with the authentication device according to the query request, including: The first query plug-in identifies the query language corresponding to the query request; The first query plug-in determines a target plug-in from at least one second query plug-in according to a query language corresponding to the query request, and sends the query request to the target plug-in; The target plug-in generates an authentication request in a data format that complies with the authentication device according to the query request.

[0008] In an embodiment of the present application, the query language is identified by the first query plug-in, and the system can support multiple query languages, thereby improving the compatibility and flexibility of the system. The first query plug-in can select the most appropriate target plug-in according to the query language and query type, thereby optimizing the query processing efficiency. By using multiple specialized query plug-ins, it can be ensured that each type of query can be professionally processed, thereby improving the accuracy and efficiency of the query. The authentication request generated by the target plug-in follows a standard format, which facilitates the authentication device to perform authority identification and improves the accuracy and consistency of the authentication process.

[0009] In a possible implementation manner of the first aspect, the target plug-in generates, according to the query request, an authentication request in a data format that complies with the authentication device, including: The target plug-in identifies the query information contained in the query request; The target plug-in generates an authentication request in a data format that complies with the authentication device according to the query information.

[0010] In the embodiment of the present application, through accurate identification and efficient processing of target plug-ins, this process improves the security, performance and scalability of the system, while simplifying the system integration work.

[0011] In a possible implementation of the first aspect, the authentication device performs authority authentication on the query request of the user according to the authentication request, including: The authentication device authenticates the user according to the authentication request; If the user's identity verification is successful, the authentication device will perform authority authentication on the user's query request.

[0012] In the embodiment of the present application, by introducing an authentication device into the system to perform identity authentication and authority identification, the security, reliability and user experience of the system can be significantly improved, while ensuring the rational use of system resources and the security of data.

[0013] In a possible implementation manner of the first aspect, the authentication device performs identity authentication on the user according to the authentication request, including: The authentication device extracts the user's first encrypted password and first user account according to the authentication request; The authentication device decrypts the first encrypted password to obtain the decrypted first user password; The authentication device performs identity authentication on the user according to the first user password and the first user account.

[0014] In the embodiments of the present application, encryption, decryption and identity authentication ensure that only users with valid accounts and passwords can access system resources, thereby improving system security and user experience.

[0015] In a possible implementation of the first aspect, the authentication device performs identity authentication on the user according to the first user password and the first user account, including: The authentication device detects whether there is a first target user account among the plurality of second user accounts stored in the first database, wherein the first target user account matches the first user account; If the first target user account exists among the plurality of second user accounts stored in the first database, determining whether the first user password is the same as the second user password corresponding to the first target user account in the first database; If the first user password is the same as the second user password, the authentication device successfully verifies the user's identity information.

[0016] In the embodiment of the present application, by ensuring that the user account exists and the password is correct, the system can effectively prevent unauthorized access, and the password is encrypted during storage and transmission, reducing the risk of data leakage.

[0017] In a possible implementation of the first aspect, the authentication device performs authority authentication on the query request of the user, including: The authentication device parses the query request to obtain the name of the first data table that the user needs to query; The authentication device detects whether there is a second target user account among the plurality of third user accounts stored in the second database, wherein the second target user account matches the first user account; If the second target user account exists among the plurality of third user accounts stored in the second database, determining whether the first data table name is the same as the second data table name corresponding to the second target user account in the second database; If the name of the first data table is the same as the name of the second data table, the authentication device passes the authority authentication of the user.

[0018] In the embodiments of the present application, it is ensured that only users with appropriate permissions can access specific data tables, thereby protecting the integrity of the data and reducing the risk of data leakage and unauthorized access by verifying user accounts and data table permissions.

[0019] In a possible implementation manner of the first aspect, the method further includes: After the authentication device passes the authorization authentication of the user, the authentication device returns the authorization authentication result to the target plug-in; The target plug-in sends the authentication result of the permission to the first query plug-in; After receiving the authentication result indicating that the permission is passed, the first query plug-in executes the query request input by the user to obtain query information corresponding to the query request of the user.

[0020] In the embodiment of the present application, by ensuring that users can execute queries only after obtaining permission, data security and user experience are guaranteed while maintaining efficient operation of the system.

[0021] In a second aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a data authority authentication method as described in any one of the above-mentioned first aspects is implemented.

[0022] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements a data authority authentication method as described in any one of the first aspects above.

[0023] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the data authority authentication methods described in the first aspect.

[0024] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0026] Figure 1 It is a flowchart of a data authentication method provided by an embodiment of the present application; Figure 2 This is a flowchart of obtaining an authentication request provided by an embodiment of the present application; Figure 3 It is a flowchart of the permission authentication provided by an embodiment of the present application; Figure 4 It is a flowchart of identity authentication provided by an embodiment of the present application; Figure 5 It is a structural diagram of a data authentication method provided by an embodiment of the present application; Figure 6 It is a structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0029] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0030] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0031] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0032] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0033] Big data systems store a large amount of sensitive data such as personal information and business secrets. Without strict authentication and authorization mechanisms, these data may be accessed by unauthorized users, causing serious security problems.

[0034] In the related technologies, Kerberos+LDAP and Sentry are used for authorization authentication. However, Kerberos requires multiple machines to deploy multiple role services (such as Krb5Kdc, KAdmin, Krb5Client), and each role service has a lot of configuration information to be configured. At the same time, a metadata database needs to be configured for Kerberos. LDAP is an information retrieval service with a directory structure deployed on the server. After the installation and configuration are completed, the account information needs to be imported. The above authentication and authorization methods are complex and cumbersome to deploy, require more system resources, and have high development costs.

[0035] In order to solve the problems existing in the above-mentioned related technologies, the embodiment of the present application provides a data authentication method. In the present application, the client user initiates a query to the query engine by inputting query conditions or requests. The query engine, as the core component of data retrieval, is responsible for receiving and processing the user's query request. In order to ensure the legality of the user's query operation, the query engine needs to convert the user's query request into a data format that meets the requirements of the authentication device. The authentication device identifies the user's authority according to the authentication request based on the internally set authority policy and rules. It is equivalent to introducing a query engine, and the query engine can generate an authentication request based on different query requests input by the user, and send the authentication request to the authentication device for authentication. The deployment method is simple, and the authentication work of the user's query request can be completed by only configuring the query engine and the authentication device. The above method can provide a lightweight authentication and authentication method to reduce development costs.

[0036] The authentication method of the present application is applied to an authentication terminal, which includes a query engine and an authentication device. Figure 1 , is a flow chart of a data authentication method provided in an embodiment of the present application. As an example but not a limitation, the method may include the following steps: S101, the query engine obtains a query request from a client user.

[0037] In the embodiment of the present application, the query engine is a tool for processing and executing data queries. For example, query engines such as Hive and Spark allow users to use Hive to query data stored in the Hadoop file system. Hive can convert HQL statements into MapReduce tasks and then execute these tasks on the Hadoop cluster. In addition to Hive, there may be other query engines, such as Spark, presto, etc., which can also be used as part of the query terminal.

[0038] When users need to obtain information from a big data system, they send a query request to the query engine through client software (such as a browser, command line tool, or third-party application). This query request usually contains one or more query statements, which define the data type, conditions, and range that the user wants to retrieve. For example, when a user uses a query engine that contains plug-ins such as Hive, Spark, and Presto, a SQL query request will be sent to the query engine. The parameters included in the request include the SQL to be executed, the user account, and the password.

[0039] S102: The query engine generates an authentication request in a data format that complies with the authentication device according to the query request.

[0040] In the embodiments of the present application, the authentication device refers to a security system or component that verifies the identity and authority of a user to determine whether the user has the right to access specific resources or perform specific operations. The authentication device is a key component in the information security system, which ensures that only properly authenticated users can obtain access rights.

[0041] When the query engine receives a query request from a client, it needs to ensure that the request meets the requirements of the authentication device, which means that the request needs to contain enough information so that the authentication device can verify the user's identity and authority. To do this, the query engine generates an authentication request that conforms to a specific data format, which is usually defined by the authentication device.

[0042] In one embodiment, the query engine includes a first query plug-in and at least one second query plug-in, each second query plug-in corresponds to a query language; see Figure 2 , is a flow chart of obtaining an authentication request provided in an embodiment of the present application, such as Figure 2 As shown, step S102 includes: S201: A first query plug-in identifies a query language corresponding to a query request.

[0043] In the implementation of this application, the first query plug-in is one of the core components of the query engine, and its main function is to identify the query language corresponding to the query request. In other words, when a user or application submits a query request, the first query plug-in needs to understand which query language the request is written in. Different query languages ​​have their own unique grammatical rules, such as Hive, Spark or Presto. Among them, Hive provides a SQL-like query language called HiveQL (HQL), which allows users to use SQL-like syntax to query data stored in the Hadoop file system; Spark provides a variety of programming interfaces, including Spark SQL, for processing structured data; Presto is an open source distributed SQL query engine for fast analysis of large-scale data sets, etc.

[0044] Specifically, when a query request arrives at the query engine, the first query plug-in first parses the request. This step includes extracting key information from the query string, such as query keywords, table names, field names, conditions, etc. The extracted information is then sent to the syntax analyzer for further processing. The syntax analyzer will determine whether the request conforms to the syntax structure of a certain query language based on the syntax rules of different query languages. After the syntax analysis is completed, the first query plug-in will determine the query language used by the query request based on the analysis results. This usually involves comparing the degree of matching between the query string and the syntax rules of various query languages.

[0045] S202: The first query plug-in determines a target plug-in from at least one second query plug-in according to a query language corresponding to the query request, and sends the query request to the target plug-in.

[0046] In the embodiment of the present application, the second query plug-in refers to a software component used to extend or enhance the functionality of a big data processing framework, and the second query plug-in can provide an API interface, etc., which can be connected to other databases for interaction. Each plug-in has its specific functions and roles. For example, the Hive plug-in is a variety of tools or libraries used to extend the functionality of Hive, which can provide support for HiveQL, so that users can query data using SQL-like syntax; allow Hive to connect to different data sources, such as relational databases, NoSQL databases, etc.; support different types of file formats, such as Parquet, ORC, etc., to improve the efficiency of data storage and query, etc. The park plug-in refers to various components used to extend the functionality of Apache Spark, which can provide SQL support so that users can use SQL to query data in Spark; provide an R language interface so that users can use R language for data analysis, etc. The Presto plug-in refers to various components used to extend the functionality of the Presto SQL query engine, which can provide connectivity to different data sources, such as Hive, Cassandra, MySQL, etc.; provide execution engine optimization for specific hardware or cloud services, etc.

[0047] Exemplarily, the first query plug-in recognizes that the user's query statement is a HiveQL type query language. The first query plug-in selects a Hive plug-in (target plug-in) corresponding to the HiveQL type query language from the second query plug-ins such as the Hive plug-in, the park plug-in, and the Presto plug-in, and sends the HiveQL type query language to the target plug-in, so that the target plug-in is responsible for the next step of operation.

[0048] In the above method, the query language is identified by the first plug-in and sent to the extended second query plug-in. This processing flow can improve the scalability, flexibility and performance of the system while reducing user complexity and improving user experience.

[0049] S203, the target plug-in generates an authentication request in a data format that complies with the authentication device according to the query request.

[0050] In the embodiment of the present application, in the query request processing flow, after receiving the query request, the target plug-in will generate an authentication request that complies with a specific data format according to the requirements of the authentication device in the system.

[0051] In one embodiment, step S203 includes: The target plug-in identifies the query information contained in the query request; the target plug-in generates an authentication request in a data format that complies with the authentication device according to the query information.

[0052] In an embodiment of the present application, the target plug-in needs to parse the query request and extract the specific query information. Based on the parsed query information, the target plug-in analyzes the security permissions required to execute the query, which may involve authentication requirements such as the sensitivity of the data involved in the query, the user's role (user identity) and permissions. Finally, the target plug-in constructs a request that meets the requirements of the authentication device based on the authentication requirements. This request usually contains information required for authentication, such as user identity information, requested resource information, and operation type.

[0053] In the above method, the target plug-in plays an important role, not only processing the query request, but also ensuring the security of the query operation. In this way, the system can protect sensitive data from being accessed by unauthorized users, while ensuring that the query operation of legitimate users can proceed smoothly.

[0054] S103, the authentication device performs authority authentication on the user's query request according to the authentication request.

[0055] In the examples of this application, see Figure 3 , is a flowchart of the permission identification proposed in the embodiment of the present application, such as Figure 3 As shown, the implementation of step S103 may be: S301, the authentication device performs identity authentication on the user according to the authentication request.

[0056] In the embodiment of the present application, the authentication device receives an authentication request sent by the target plug-in, which contains information for verifying the user's identity. The authentication device uses the registered user identity information to compare with the identity data in the request to verify the user's identity. This process may include checking the user name and password, verifying the digital signature, comparing biometric data, etc.

[0057] In one embodiment, see Figure 4 , is a flow chart of identity authentication provided in the embodiment of the present application, such as Figure 4 As shown, step S301 includes: S401, the authentication device extracts a first encrypted password and a first user account of a user according to an authentication request.

[0058] In an embodiment of the present application, the authentication device receives an authentication request from a target plug-in, which can be transmitted via an HTTP request communication protocol. The authentication device checks the request header and looks for identity verification information, such as a token or cookie. If the request contains a token, the authentication device parses the token to obtain user identity information. If the request contains a cookie, the authentication device parses the cookie to obtain user identity information.

[0059] The authentication device extracts the first user account from the parsed data, which is usually a unique identifier of the user, such as a user name or email address (first user account). At the same time, if the request contains an encrypted password, such as an encrypted password transmitted via HTTPS, the authentication device will extract the encrypted password (first encrypted password).

[0060] S402: The authentication device decrypts the first encrypted password to obtain the decrypted first user password.

[0061] In the embodiment of the present application, the authentication device determines the applicable decryption algorithm according to the encryption algorithm (such as AES, DES, RSA, etc.) of the encrypted password. The authentication device uses the decryption key stored in the secure storage medium (such as the hardware security module HSM, database, etc.) to decrypt the encrypted password. The authentication device uses the determined decryption algorithm and the obtained decryption key to perform a decryption operation on the encrypted password to obtain the user's original password (first user password). The decrypted result is the user's plain text password.

[0062] It should be noted that the decryption key is confidential and only the authentication device has access to it. During the decryption process, if any exceptions are encountered (such as incorrect decryption key, unsupported encryption algorithm, etc.), the authentication device needs to properly handle these exceptions and return the corresponding error response.

[0063] S403, the authentication device performs identity authentication on the user according to the first user password and the first user account.

[0064] In the embodiment of the present application, the authentication device compares the decrypted user password with the password stored in the database to verify the identity of the user. The specific implementation method can be: The authentication device detects whether there is a first target user account among multiple second user accounts stored in the first database, wherein the first target user account matches the first user account; if the first target user account exists among multiple second user accounts stored in the first database, it is determined whether the first user password is the same as the second user password corresponding to the first target user account in the first database; if the first user password is the same as the second user password, the authentication device successfully verifies the user's identity information.

[0065] In the embodiment of the present application, the process of verifying the user's identity by the authentication device includes two main steps: finding the user account and verifying the password. The following is a detailed explanation and implementation of this process: 1) Find the target user account: The authentication device first needs to query multiple second user accounts stored in the first database to determine whether there is a first target user account that matches the first user account; this involves performing a database query operation, such as using a SQL statement query, in which the first user account is one of the query conditions.

[0066] 2) Determine whether the passwords are the same: If the first target user account exists in the first database, the authentication device then needs to determine whether the first user password is the same as the second user password corresponding to the first target user account in the first database, which also involves performing a database query operation to obtain the second user password. In actual operation, the user's password is usually not stored in plain text in the database, but in the form of a hash value. Therefore, the authentication device needs to hash the previous password provided by the user, and then compare the obtained hash value with the hash value stored in the database.

[0067] 3) Identity verification passed If the first user password is the same as the second user password (i.e., the hash values ​​match), the authentication device considers that the user's identity information has been verified. At this time, the authentication device may generate an authorization token (such as JWT) or sessionID for subsequent requests, and then provide the user with a successful authentication response.

[0068] 4) Identity verification failed If the first user password is different from the second user password, or the first target user account cannot be found in the database, the authentication device considers that the user's identity information verification fails, and the authentication device will provide the user with corresponding error information, such as prompting the user that the password is wrong or the account does not exist.

[0069] In the above method, through effective database query and password comparison, the user identity is verified securely and quickly, while the overall performance of the system and user experience are improved.

[0070] S302: If the user's identity verification is successful, the authentication device performs an authority authentication on the user's query request.

[0071] In the embodiment of the present application, after the user identity verification is passed, the authentication device will further perform authority authentication on the user's query request, and the specific implementation method thereof may be: The authentication device detects whether there is a second target user account among multiple third user accounts stored in the second database, wherein the second target user account matches the first user account; if the second target user account exists among the multiple third user accounts stored in the second database, it is determined whether the first data table name is the same as the second data table name corresponding to the second target user account in the second database; if the first data table name is the same as the second data table name, the authentication device passes the user's authority authentication.

[0072] In the embodiment of the present application, the process of authority identification involves searching and matching user accounts in multiple databases, and comparing data table names to determine the user's authority. The following is a detailed analysis, implementation method or steps of this process: 1) User account search The authentication device queries multiple third user accounts stored in a second database (which may be a role database or a permission database). During the search process, the authentication device uses the account information provided by the user (the first user account) to compare with the account information stored in the database to determine whether there is a matching second target user account.

[0073] 2) Comparison of database table names The authentication device parses the query language in the authentication request to obtain the resource information that the user wants to query, such as data table information (first data table name), field name, etc.

[0074] In the above user account search process, if a matching second target user account is found, the authentication device retrieves the second data table name associated with the second target user account from the second database, and compares the data table name requested by the user (the first data table name) with the second data table name obtained from the database.

[0075] 3) Permission identification results If the first data table name is the same as the second data table name, the authentication device considers that the user's authority authentication is passed. If the data table names are different, the authentication device rejects the user's request and returns a corresponding error message or a prompt of insufficient authority.

[0076] In the above method, fine-grained control of user access rights is achieved by comparing data table names. The system can ensure that only users with corresponding permissions can access specific data tables, thereby protecting the security and integrity of the data.

[0077] In one embodiment, the data authentication method further includes: After the authentication device passes the user's authority authentication, the authentication device returns the authentication result of the authority passing to the target plug-in; the target plug-in sends the authentication result of the authority passing to the first query plug-in; after receiving the authentication result of the authority passing, the first query plug-in executes the query request input by the user to obtain the query information corresponding to the user's query request.

[0078] In an embodiment of the present application, if the user's authority is authenticated, the authentication device will generate a signal or return a response confirming that the authority is passed, and this response is sent back to the target plug-in, which is usually the logic module responsible for processing user requests. The target plug-in receives the response of the authority passing and forwards this response to the first query plug-in, which is the module responsible for executing the actual query operation. The first query plug-in receives the signal of the authority passing, and after confirming that the user has the authority to execute the query, the first query plug-in begins to execute the query request submitted by the user, which involves interaction with a database or other data storage system to retrieve data that meets the user's query conditions.

[0079] After the first query plug-in processes the query, it obtains the corresponding query results, which are usually formatted into data in a certain format, such as JSON, XML or simple text, and then sent back to the target plug-in or directly returned to the user.

[0080] Figure 5 is a structural diagram of a data authentication method provided by an embodiment of the present application, such as Figure 5 As shown, the present application provides a big data authority service, which includes a query engine and an authentication device. The steps of using the query engine and the authentication device to perform data authentication are as follows: 1) The user sends a query request to the query engine When using query engines such as Hive, Spark, and Presto, users will initiate SQL query requests to the engines. The parameters included in the request are the SQL to be executed, user account, and password.

[0081] 2) The query engine generates an authentication request ① After receiving the SQL query request, the first query plug-in in the query engine will select the second query plug-in according to the query language and execute the query process. In this process, the logic of the plug-in will be executed and the parameters will be passed to the second query plug-in: the SQL to be executed, the user account and password; ②The second query plug-in will construct an HTTP authentication request, which includes the SQL to be executed, the user account and password.

[0082] 3) The query engine sends an authentication request to the authentication device The query plug-in in the query engine sends the generated authentication request to the big data permission service to request authentication.

[0083] 4) The authentication device authenticates the authentication request ① Identity verification Through the user's account (first user account) and password (first user password), check whether the user exists in the account information database (first database) and whether the password is correct. If the verification is successful, the next step of permission authentication logic is performed, otherwise the information that the identity authentication fails is returned; ②Authorization Identification After the identity authentication is passed, the SQL authority authentication is performed according to the authentication request interpretation. First, the SQL is parsed to parse out the data table (the name of the first data table) contained in the SQL. Through the user account and the parsed table, the authority information library (the second database) is queried to see whether the user account has the authority to query the first data table. If it has the authority, the information of successful authentication is returned, otherwise the information of failed authentication is returned.

[0084] ③The authentication device returns the authority identification result to the query engine If the user's authority is authenticated, the authentication device returns the result to the second query plug-in in the query engine, and the second query plug-in sends the result to the first query plug-in. After receiving the result, the first query plug-in executes the query task to obtain the query information and sends the query information to the user.

[0085] In this application, by configuring the second query plug-in in the query engine, and constructing an HTTP request (authentication request) through the second query plug-in to interact with the big data permission service, the big data permission service performs user identity authentication and permission identification based on the HTTP request. In the above method, only one server is selected, and the configuration is simple, providing a lightweight authentication and authorization method, and reducing development costs. It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0086] Figure 6 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 6 As shown, the terminal device 6 of this embodiment includes: at least one processor 60 ( Figure 6 Only one is shown in the figure) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on at least one processor 60, and when the processor 60 executes the computer program 62, the steps in any of the above-mentioned data authentication method embodiments are implemented.

[0087] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 6 It is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0088] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0089] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store an operating system, an application program, a boot loader, data, and other programs, such as program codes of a computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.

[0090] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0091] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0092] If the 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 present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0093] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0094] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0095] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0097] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A data authentication method, characterized in that: The method is applied to an authentication terminal, the authentication terminal includes a query engine and an authentication device, and the method includes: The query engine obtains a query request from a client user; The query engine generates an authentication request in a data format that conforms to the authentication device according to the query request; The authentication device performs authority authentication on the user's query request according to the authentication request.

2. The data authentication method according to claim 1, characterized in that: The query engine includes a first query plug-in and at least one second query plug-in, each of the second query plug-ins corresponds to a query language; The query engine generates an authentication request in a data format that conforms to the authentication device according to the query request, including: The first query plug-in identifies a query language corresponding to the query request; The first query plug-in determines a target plug-in from at least one of the second query plug-ins according to the query language corresponding to the query request, and sends the query request to the target plug-in; The target plug-in generates an authentication request in a data format that complies with the authentication device according to the query request.

3. The data authentication method according to claim 2, characterized in that: The target plug-in generates an authentication request in a data format that conforms to the authentication device according to the query request, including: The target plug-in identifies the query information included in the query request; The target plug-in generates an authentication request in a data format that complies with the authentication device according to the query information.

4. The data authentication method according to claim 1, characterized in that: The authentication device performs authority authentication on the query request of the user according to the authentication request, including: The authentication device performs identity authentication on the user according to the authentication request; If the identity verification of the user is successful, the authentication device performs authority authentication on the query request of the user.

5. The data authentication method according to claim 4, characterized in that: The authentication device performs identity authentication on the user according to the authentication request, including: The authentication device extracts the first encrypted password and the first user account of the user according to the authentication request; The authentication device decrypts the first encrypted password to obtain the decrypted first user password; The authentication device performs identity authentication on the user according to the first user password and the first user account.

6. The data authentication method according to claim 5, characterized in that: The authentication device performs identity authentication on the user according to the first user password and the first user account, including: The authentication device detects whether a first target user account exists among a plurality of second user accounts stored in the first database, wherein the first target user account matches the first user account; If there is a first target user account among the multiple second user accounts stored in the first database, determining whether the first user password is the same as the second user password corresponding to the first target user account in the first database; If the first user password is the same as the second user password, the authentication device successfully verifies the user's identity information.

7. The data authentication method according to claim 4, characterized in that: The authentication device performs authority authentication on the user's query request, including: The authentication device parses the query request to obtain the name of the first data table that the user needs to query; The authentication device detects whether there is a second target user account among the plurality of third user accounts stored in the second database, wherein the second target user account matches the first user account; If there is a second target user account among the plurality of third user accounts stored in the second database, determining whether the first data table name is the same as the second data table name corresponding to the second target user account in the second database; If the first data table name is the same as the second data table name, the authentication device passes the authority authentication of the user.

8. The data authentication method according to claim 2, characterized in that: The method further comprises: After the authentication device authenticates the user's authority, the authentication device returns the authentication result of the authority to the target plug-in; The target plug-in sends the authentication result of the permission to the first query plug-in; After receiving the authentication result indicating that the permission is passed, the first query plug-in executes the query request input by the user to obtain query information corresponding to the query request of the user.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

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

Citation Information

Patent Citations

  • Data query method and device and electronic equipment

    CN108108439A

  • Data processing method and device

    CN109992596A

  • Data query method and data query system

    CN113239069A