Disclosure of Invention
In order to overcome or at least partially solve the above-mentioned problems, embodiments of the present invention provide a predictor based on a blockchain relational database and an implementation method thereof, which can verify external data, so that a library chain can reliably verify a user identity, while ensuring that verification data of all nodes is consistent.
Embodiments of the present invention are implemented as follows:
In a first aspect, an embodiment of the present invention provides a predictor based on a blockchain relational database, including a verification configuration module, a verification request module, a verification writing module, a data matching module, and a data writing module, where:
The verification configuration module is used for acquiring external verification API information, and selecting an external verification API to carry out association verification configuration according to the external verification API information;
The authentication request module is used for acquiring and transmitting authentication data of the user, and generating and transmitting an external authentication request to an external authentication API according to the authentication data of the user;
The verification writing module is used for acquiring verification information of an external verification API and writing verification data in a verification request after verification into a specific database according to the verification information;
the data matching module is used for matching the verification data of the user to be written into the application database with the verification data in the specific database, and generating and sending a matching result;
and the data writing module is used for writing the verification data of the user into the application database according to the matching result to finish data writing.
For the situation that verification data is required to be provided outside the block chain, external verification is performed through the predictor, and then the data is sent to the block chain, so that the accuracy and the effectiveness of the data verification are guaranteed. Firstly, acquiring external verification API information through a verification configuration module, selecting an external verification API according to the external verification API information to carry out association verification configuration, and pre-configuring the external verification API for external verification so as to carry out subsequent identity verification on data to be verified of a user; when a client sends a verification request to the predictor, obtaining and sending verification data of a user through a verification request module, generating and sending an external verification request to an external verification API according to the verification data of the user, verifying the verification data of the user through the external verification API, generating verification information after verification is completed, obtaining the verification information of the external verification API through a verification writing module, and writing the verification data in the verification request after verification into a specific database according to the verification information, wherein the verification information comprises user identity data, an identity verification result, verification data and a data verification result; if the external verification is passed, writing the successful verification data into a specific table in a specific database in the database chain, so that the subsequent user can perform re-verification judgment when writing the same data into the application database, and the accuracy of data verification is ensured; in the process of writing the same data into the application database by a user, matching the verification data of the user to be written into the application database with the verification data in the specific database through a data matching module, generating and sending a matching result, and if the matching result is displayed to pass, writing the verification data of the user into the application database through a data writing module according to the matching result, so as to finish data writing; in the writing process, if the data to be written is matched with the data written in the specific table of the specific database by the predictor, the writing is successful; otherwise the write fails.
The predictor can verify the external data of the blockchain, so that the database chain can reliably verify the identity of the user, and meanwhile, the verification data of all nodes are consistent, and the verification authenticity and accuracy are ensured.
Based on the first aspect, in some embodiments of the present invention, the verification writing module includes a deposit setup sub-module and a deposit writing sub-module, wherein:
The storage establishing sub-module is used for establishing a specific database used for storing external verification data in the block chain relation database and establishing a specific table in the specific database;
And the storage and writing sub-module is used for acquiring verification information of the external verification API and writing verification data in a verification request after verification into a specific table in a specific database according to the verification information.
Based on the first aspect, in some embodiments of the present invention, the above-mentioned verification writing module includes a verification judging sub-module, configured to judge whether verification data of the user passes verification according to the verification information, and if so, write the verification data in the verification request that passes verification into the specific database; if not, generating and sending verification failure prompt information.
Based on the first aspect, in some embodiments of the present invention, the data writing module includes a matching judging sub-module, configured to judge whether data matching is successful according to a matching result, and if so, write verification data of a user into an application database to complete data writing; if not, generating and transmitting the writing failure information.
Based on the first aspect, in some embodiments of the present invention, the authentication information includes authentication information, an authentication result, data authentication information, and a data authentication result.
In a second aspect, an embodiment of the present invention provides a method for implementing a predictor based on a blockchain relational database, including the following steps:
acquiring external verification API information, and selecting an external verification API to perform association verification configuration according to the external verification API information;
acquiring and transmitting authentication data of a user, and generating and transmitting an external authentication request to an external authentication API according to the authentication data of the user;
Acquiring verification information of an external verification API, and writing verification data in a verification request after verification into a specific database according to the verification information;
Matching the verification data of the user to be written into the application database with the verification data in the specific database, and generating and sending a matching result;
and writing the verification data of the user into the application database according to the matching result, and finishing data writing.
For the case that verification data is required to be provided outside the blockchain, external verification is performed first, and then the data is sent to the blockchain, so that the accuracy and the effectiveness of the data verification are guaranteed. Firstly, acquiring external verification API information, selecting an external verification API according to the external verification API information to perform associated verification configuration, and pre-configuring the external verification API for external verification so as to perform subsequent identity verification on data to be verified of a user; when a client sends a verification request to the predictor, obtaining and sending verification data of the user, generating and sending an external verification request to an external verification API according to the verification data of the user, verifying the verification data of the user through the external verification API, generating verification information after the verification is completed, obtaining the verification information of the external verification API, and writing the verification data in the verification request after the verification is completed into a specific database according to the verification information, wherein the verification information comprises user identity data, an identity verification result, verification data and a data verification result; if the external verification is passed, writing the successful verification data into a specific table in a specific database in the database chain, so that the subsequent user can perform re-verification judgment when writing the same data into the application database, and the accuracy of data verification is ensured; in the process of writing the same data into the application database by the user, matching the verification data of the user to be written into the application database with the verification data in the specific database to generate and send a matching result, and if the matching result is displayed to pass, writing the verification data of the user into the application database according to the matching result to finish data writing; in the writing process, if the data to be written is matched with the data written in the specific table of the specific database by the predictor, the writing is successful; otherwise the write fails.
The method can verify the external data of the blockchain, so that the database chain can reliably verify the identity of the user, and simultaneously ensure that the verification data of all nodes are consistent, and ensure the authenticity and accuracy of verification.
Based on the second aspect, in some embodiments of the present invention, the method for obtaining the authentication information of the external authentication API and writing the authentication data in the authentication request after the authentication is completed into the specific database according to the authentication information includes the following steps:
establishing a specific database in the block chain relation database for storing external verification data, and establishing a specific table in the specific database;
and acquiring verification information of the external verification API, and writing verification data in a verification request with verification completed into a specific table in a specific database according to the verification information.
Based on the second aspect, in some embodiments of the present invention, the method for writing verification data in a verification request with verification completed according to the verification information into a specific database includes the following steps:
Judging whether the verification data of the user passes verification according to the verification information, if so, writing the verification data in the verification request passing verification into a specific database; if not, generating and sending verification failure prompt information.
Based on the second aspect, in some embodiments of the present invention, the method for writing the verification data of the user into the application database according to the matching result, and the method for completing data writing includes the following steps:
Judging whether the data matching is successful or not according to the matching result, if so, writing the verification data of the user into an application database, and finishing the data writing; if not, generating and transmitting the writing failure information.
Based on the second aspect, in some embodiments of the invention, the authentication information includes authentication information, authentication results, data authentication information, and data authentication results.
The embodiment of the invention has at least the following advantages or beneficial effects:
The embodiment of the invention provides a predictor based on a blockchain relational database, which acquires external verification API information through a verification configuration module, selects an external verification API according to the external verification API information to carry out association verification configuration, and pre-configures the external verification API for carrying out external verification so as to carry out identity verification on data to be verified of a user; when a client sends a verification request to the predictor, obtaining and sending verification data of the user through a verification request module, generating and sending an external verification request to an external verification API according to the verification data of the user, verifying the verification data of the user through the external verification API, generating verification information after verification is completed, obtaining the verification information of the external verification API through a verification writing module, and writing the verification data in the verification request after verification into a specific database according to the verification information; if the external verification passes, writing the successful verification data to a specific table in a specific database in the library chain; in the process of writing the same data into the application database, the user's verification data to be written into the application database is matched with the verification data in the specific database through the data matching module, a matching result is generated and sent, and if the matching result is displayed to pass, the user's verification data is written into the application database through the data writing module according to the matching result, so that the data writing is completed. For the situation that verification data is required to be provided outside the block chain, external verification is performed through the predictor, and then the data is sent to the block chain, so that the accuracy and the effectiveness of the data verification are guaranteed.
The embodiment of the invention also provides a realization method of the predictor based on the blockchain relational database, which comprises the steps of obtaining external verification API information, selecting the external verification API according to the external verification API information to carry out association verification configuration, and pre-configuring the external verification API for carrying out external verification so as to carry out identity verification on data to be verified of a user; when a client sends a verification request to the predictor, obtaining and sending verification data of the user, generating and sending an external verification request to an external verification API according to the verification data of the user, verifying the verification data of the user through the external verification API, generating verification information after the verification is completed, obtaining the verification information of the external verification API, and writing the verification data in the verification request after the verification is completed into a specific database according to the verification information; if the external verification is passed, writing the successful verification data into a specific table in a specific database in the database chain, so that the subsequent user can perform re-verification judgment when writing the same data into the application database, and the accuracy of data verification is ensured; in the process of writing the same data into the application database by the user, matching the verification data of the user to be written into the application database with the verification data in the specific database, generating and sending a matching result, and if the matching result is displayed to pass, writing the verification data of the user into the application database according to the matching result, so as to finish data writing. The method can verify the external data of the blockchain, so that the database chain can reliably verify the identity of the user, and simultaneously ensure that the verification data of all nodes are consistent, and ensure the authenticity and accuracy of verification.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Examples
As shown in fig. 1, in a first aspect, an embodiment of the present invention provides a predictor based on a blockchain relational database, including an authentication configuration module 100, an authentication request module 200, an authentication writing module 300, a data matching module 400, and a data writing module 500, wherein:
The verification configuration module 100 is configured to obtain external verification API information, and select an external verification API to perform association verification configuration according to the external verification API information;
The authentication request module 200 is configured to obtain and send authentication data of a user, and generate and send an external authentication request to an external authentication API according to the authentication data of the user;
the verification writing module 300 is configured to obtain verification information of an external verification API, and write verification data in a verification request after verification into a specific database according to the verification information;
the data matching module 400 is configured to match verification data of a user to be written into the application database with verification data in a specific database, and generate and send a matching result;
The data writing module 500 is configured to write verification data of the user into the application database according to the matching result, and complete data writing.
For the situation that verification data is required to be provided outside the block chain, external verification is performed through the predictor, and then the data is sent to the block chain, so that the accuracy and the effectiveness of the data verification are guaranteed. Firstly, external verification API information is acquired through a verification configuration module 100, and an external verification API is selected according to the external verification API information to carry out association verification configuration, and the external verification API for external verification is pre-configured so as to carry out subsequent identity verification on data to be verified of a user; when a client sends a verification request to the client, the verification request module 200 is used for acquiring and sending verification data of the user, and generating and sending an external verification request to an external verification API according to the verification data of the user, the external verification API is used for verifying the verification data of the user, after verification is completed, verification information is generated, the verification write module 300 is used for acquiring the verification information of the external verification API, and the verification data in the verification request after verification is completed is written into a specific database according to the verification information, wherein the verification information comprises identity verification information, an identity verification result, data verification information and a data verification result; if the external verification is passed, writing the successful verification data into a specific table in a specific database in the database chain, so that the subsequent user can perform re-verification judgment when writing the same data into the application database, and the accuracy of data verification is ensured; in the process of writing the same data into the application database by the user, the data matching module 400 is used for matching the verification data of the user to be written into the application database with the verification data in the specific database, a matching result is generated and sent, and if the matching result is displayed to pass, the data writing module 500 is used for writing the verification data of the user into the application database according to the matching result, so that the data writing is completed; in the writing process, if the data to be written is matched with the data written in the specific table of the specific database by the predictor, the writing is successful; otherwise the write fails.
The predictor can verify the external data of the blockchain, so that the database chain can reliably verify the identity of the user, and meanwhile, the verification data of all nodes are consistent, and the verification authenticity and accuracy are ensured.
Based on the first aspect, as shown in fig. 1, in some embodiments of the present invention, the verification writing module 300 includes a deposit setup sub-module 310 and a deposit writing sub-module 320, where:
A storage establishment sub-module 310, configured to establish a specific database for storing external verification data in the blockchain relational database, and establish a specific table in the specific database;
the storage writing sub-module 320 is configured to obtain verification information of the external verification API, and write verification data in a verification request after verification is completed into a specific table in a specific database according to the verification information.
In order to facilitate matching between the data in the application database and the data in the specific database when the subsequent user writes the data into the application database, the accuracy of data verification is ensured, and the validity of user identity verification is further ensured. The storage establishing sub-module 310 establishes a specific database for storing external verification data in the blockchain relational database, and establishes a specific table in the specific database, after the specific table is established, the storage writing sub-module 320 acquires the verification information of the external verification API, and the verification data in the verification request after the verification is completed is written into the specific table in the specific database according to the verification information, so as to verify the subsequent written data. The specific database is a database for storing specific verification data of a specific table, and the application database is a database for storing user writing data.
Based on the first aspect, as shown in fig. 1, in some embodiments of the present invention, the above-mentioned verification writing module 300 includes a verification judging sub-module 330 for judging whether verification data of the user passes verification according to the verification information, and if so, writing the verification data in the verification request passing verification into a specific database; if not, generating and sending verification failure prompt information.
When the verification data is written into the specific database, the verification judging sub-module 330 judges whether the verification data of the user passes verification according to the verification result in the verification information, if so, the verification data in the verification request passing verification is written into the specific table in the specific database, and a verification data base is provided for the writing data of the subsequent user; if the verification of the external verification API is not passed, verification failure prompt information is generated and sent to the user, the user is prompted to fail in verification, and verification can be performed again.
Based on the first aspect, as shown in fig. 1, in some embodiments of the present invention, the data writing module 500 includes a matching judging sub-module 510, configured to judge whether the data matching is successful according to the matching result, and if so, write the verification data of the user into the application database to complete the data writing; if not, generating and transmitting the writing failure information.
When writing the data of the user into the application database, judging whether the verification data of the user is matched with the data in the specific database or not through the matching judging sub-module 510 according to the matching result, and if so, writing the verification data of the user into the application database to finish data writing; if the data are not matched, generating and sending writing failure information, and prompting a user to rewrite the data. The user data is written into the application database only after the matching is successful, so that the verification data written by the user is ensured to be verified externally, the data can be successfully written into all nodes, and the verification data of all nodes is ensured to be consistent.
As shown in fig. 2, in a second aspect, an embodiment of the present invention provides a method for implementing a predictor based on a blockchain relational database, including the following steps:
S1, acquiring external verification API information, and selecting an external verification API to perform association verification configuration according to the external verification API information;
s2, acquiring and sending verification data of the user, and generating and sending an external verification request to an external verification API according to the verification data of the user;
S3, acquiring verification information of an external verification API, and writing verification data in a verification request after verification into a specific database according to the verification information;
S4, matching the verification data of the user to be written into the application database with the verification data in the specific database, and generating and sending a matching result;
And S5, writing the verification data of the user into the application database according to the matching result, and finishing data writing.
For the case that verification data is required to be provided outside the blockchain, external verification is performed first, and then the data is sent to the blockchain, so that the accuracy and the effectiveness of the data verification are guaranteed. Firstly, acquiring external verification API information, selecting an external verification API according to the external verification API information to perform associated verification configuration, and pre-configuring the external verification API for external verification so as to perform subsequent identity verification on data to be verified of a user; when a client sends a verification request to the predictor, obtaining and sending verification data of the user, generating and sending an external verification request to an external verification API according to the verification data of the user, verifying the verification data of the user through the external verification API, generating verification information after the verification is completed, obtaining the verification information of the external verification API, and writing the verification data in the verification request after the verification is completed into a specific database according to the verification information, wherein the verification information comprises identity verification information, an identity verification result, data verification information and a data verification result; if the external verification is passed, writing the successful verification data into a specific table in a specific database in the database chain, so that the subsequent user can perform re-verification judgment when writing the same data into the application database, and the accuracy of data verification is ensured; in the process of writing the same data into the application database by the user, matching the verification data of the user to be written into the application database with the verification data in the specific database to generate and send a matching result, and if the matching result is displayed to pass, writing the verification data of the user into the application database according to the matching result to finish data writing; in the writing process, if the data to be written is matched with the data written in the specific table of the specific database by the predictor, the writing is successful; otherwise the write fails.
The method can verify the external data of the blockchain, so that the database chain can reliably verify the identity of the user, and simultaneously ensure that the verification data of all nodes are consistent, and ensure the authenticity and accuracy of verification.
Based on the second aspect, in some embodiments of the present invention, the method for obtaining the authentication information of the external authentication API and writing the authentication data in the authentication request after the authentication is completed into the specific database according to the authentication information includes the following steps:
establishing a specific database in the block chain relation database for storing external verification data, and establishing a specific table in the specific database;
and acquiring verification information of the external verification API, and writing verification data in a verification request with verification completed into a specific table in a specific database according to the verification information.
In order to facilitate matching between the data in the application database and the data in the specific database when the subsequent user writes the data into the application database, the accuracy of data verification is ensured, and the validity of user identity verification is further ensured. Firstly, a specific database used for storing external verification data in a block chain relation database is established, a specific table in the specific database is established, after the establishment of the specific table is completed, verification information of an external verification API is obtained, and verification data in a verification request after the verification is completed are written into the specific table in the specific database according to the verification information so as to verify the subsequently written data. The specific database is a database for storing specific verification data of a specific table, and the application database is a database for storing user writing data.
Based on the second aspect, in some embodiments of the present invention, the method for writing verification data in a verification request with verification completed according to the verification information into a specific database includes the following steps:
Judging whether the verification data of the user passes verification according to the verification information, if so, writing the verification data in the verification request passing verification into a specific database; if not, generating and sending verification failure prompt information.
When the verification data is written into the specific database, judging whether the verification data of the user passes verification according to a verification result in the verification information, if so, writing the verification data in the verification request passing verification into a specific table in the specific database, and providing a verification data foundation for the writing data of the subsequent user; if the verification of the external verification API is not passed, verification failure prompt information is generated and sent to the user, the user is prompted to fail in verification, and verification can be performed again.
Based on the second aspect, in some embodiments of the present invention, the method for writing the verification data of the user into the application database according to the matching result, and the method for completing data writing includes the following steps:
Judging whether the data matching is successful or not according to the matching result, if so, writing the verification data of the user into an application database, and finishing the data writing; if not, generating and transmitting the writing failure information.
When writing the data of the user into the application database, judging whether the verification data of the user is matched with the data in the specific database, if so, writing the verification data of the user into the application database, and finishing data writing; if the data are not matched, generating and sending writing failure information, and prompting a user to rewrite the data. The user data is written into the application database only after the matching is successful, so that the verification data written by the user is ensured to be verified externally, the data can be successfully written into all nodes, and the verification data of all nodes is ensured to be consistent.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.