Disclosure of Invention
In order to overcome the above problems or at least partially solve the above problems, embodiments of the present invention provide a block chain relational database-based talker and an implementation method thereof, which can verify external data, so that a library chain can reliably verify a user identity, and at the same time, ensure that verification data of all nodes are consistent.
The embodiment of the invention is realized by the following steps:
in a first aspect, an embodiment of the present invention provides a prediction machine based on a block chain relational database, including a verification configuration module, a verification request module, a verification write module, a data matching module, and a data write module, where:
the verification configuration module is used for acquiring external verification API information and selecting an external verification API to carry out associated verification configuration according to the external verification API information;
the verification request module 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 verification writing module is used for acquiring verification information of the external verification API and writing verification data in the 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 condition that verification data needs to be provided outside the block chain, the prediction machine is used for conducting external verification firstly, and then sending the data to the block chain, and therefore accuracy and effectiveness of data verification are guaranteed. Firstly, obtaining external verification API information through a verification configuration module, selecting an external verification API according to the external verification API information to carry out associated verification configuration, and configuring the external verification API for external verification in advance so as to carry out identity verification on data to be verified of a user in the following process; when a client sends a verification request to the dialer, the verification request module acquires and sends verification data of a user, an external verification request is generated and sent to an external verification API according to the verification data of the user, the verification data of the user is verified through the external verification API, verification information is generated after verification is completed, the verification information of the external verification API is acquired through a verification writing-in module, the verification data in the verification request which is completed through verification is written into a specific database according to the verification information, and 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 library chain so as to carry out verification judgment again when a subsequent user writes the same data into the application database, thereby ensuring the accuracy of data verification; in the process that the user writes the same data into the application database, the verification data of the user to be written into the application database is matched with the verification data in the specific database through the data matching module to generate and send a matching result, and if the matching result is displayed to be passed, the verification data of the user is written into the application database through the data writing module 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 by the prediction machine in the specific table of the specific database, the writing is successful; otherwise the write fails.
The prediction machine can verify external data of the block chain, so that the library chain can reliably verify the identity of the user, and meanwhile, the verification data of all nodes are ensured to be 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 establishing submodule and a deposit writing submodule, where:
the storage establishing submodule is used for establishing a specific database used for storing external verification data in the block chain relational database and establishing a specific table in the specific database;
and the storage writing-in submodule is used for acquiring the verification information of the external verification API and writing the verification data in the 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 verification writing module includes a verification judgment sub-module, configured to judge whether the verification data of the user passes verification according to the verification information, and if yes, write the verification data in the verification request that passes verification into the specific database; and 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 judgment 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; and if not, generating and sending write 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 prediction machine based on a blockchain relational database, including the following steps:
obtaining external verification API information, and selecting an external verification API to perform associated verification configuration according to the external verification API information;
acquiring and sending verification data of a user, and generating and sending an external verification request to an external verification API according to the verification data of the user;
acquiring verification information of an external verification API, and writing verification data in a verification request which is verified 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 to finish data writing.
For the condition that verification data needs to be provided outside the block chain, external verification is firstly carried out, and then the data is sent to the block chain, so that the accuracy and the validity of data verification are ensured. Firstly, obtaining external verification API information, selecting an external verification API according to the external verification API information to carry out associated verification configuration, and configuring the external verification API for external verification in advance so as to carry out identity verification on data to be verified of a user in the following process; when a client sends a verification request to the dialer, 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 finished, obtaining the verification information of the external verification API, writing the verification data in the verification request after the verification is finished 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 library chain so as to carry out verification judgment again when a subsequent user writes the same data into the application database, thereby ensuring the accuracy of data verification; in the process that the user writes the same data into the application database, 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 be passed, 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 by the prediction machine in the specific table of the specific database, the writing is successful; otherwise the write fails.
The method can verify the external data of the block chain, so that the library chain can reliably verify the identity of the user, and simultaneously, the verification data of all nodes are ensured to be consistent, and the verification authenticity and the verification accuracy are ensured.
Based on the second aspect, in some embodiments of the present invention, the above method for obtaining the verification information of the external verification API, and writing the verification data in the verification request with verification completed into the specific database according to the verification information includes the following steps:
establishing a specific database used for storing external verification data in a block chain relational database, and establishing a specific table in the specific database;
and acquiring the verification information of the external verification API, and writing the verification data in the verification request after verification 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 the verification data in the verification request with verification completed according to the verification information into the specific database includes the following steps:
judging whether the verification data of the user passes the verification according to the verification information, and if so, writing the verification data in the verification request passing the verification into a specific database; and 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 includes the following steps:
judging whether the data matching is successful according to the matching result, if so, writing the verification data of the user into an application database, and finishing the data writing; and if not, generating and sending write failure information.
Based on the second aspect, in some embodiments of the invention, the authentication information includes authentication information, an authentication result, data authentication information, and a data authentication result.
The embodiment of the invention at least has the following advantages or beneficial effects:
the embodiment of the invention provides a block chain relation database-based prediction machine, which obtains external verification API information through a verification configuration module, selects an external verification API according to the external verification API information to carry out associated verification configuration, and pre-configures the external verification API for external verification so as to carry out identity verification on data to be verified of a user in the following process; when a client sends a verification request to the prediction machine, the verification request module acquires and sends verification data of a user, an external verification request is generated and sent to an external verification API according to the verification data of the user, the verification data of the user is verified through the external verification API, verification information is generated after verification is completed, the verification information of the external verification API is acquired through a verification writing-in module, and the verification data in the verification request after verification is completed is written into a specific database according to the verification information; if the external verification passes, writing the successful verification data into a specific table in a specific database in the library chain; and in the process that the user writes the same data into the application database, matching the verification data of the user to be written into the application database with the verification data in the specific database through the data matching module to generate and send a matching result, and if the matching result is displayed to be passed, writing the verification data of the user into the application database through the data writing module according to the matching result to finish data writing. For the condition that verification data needs to be provided outside the block chain, the prediction machine is used for conducting external verification firstly, and then sending the data to the block chain, and therefore accuracy and effectiveness of data verification are guaranteed.
The embodiment of the invention also provides a realization method of the prediction machine based on the block chain relational database, which comprises the steps of obtaining the external verification API information, selecting the external verification API according to the external verification API information to carry out associated verification configuration, and configuring the external verification API for external verification in advance so as to carry out identity verification on the data to be verified of the user in the following process; when a client sends a verification request to the prediction machine, obtaining and sending verification data of a 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 finished, obtaining the verification information of the external verification API, and writing the verification data in the verification request after the verification is finished 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 library chain so as to carry out verification judgment again when a subsequent user writes the same data into the application database, thereby ensuring the accuracy of data verification; and in the process that the user writes the same data into the application database, 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 be passed, writing the verification data of the user into the application database according to the matching result to finish data writing. The method can verify the external data of the block chain, so that the library chain can reliably verify the identity of the user, and simultaneously, the verification data of all nodes are ensured to be consistent, and the verification authenticity and the verification accuracy are ensured.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of 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 present invention, 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical 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 prediction machine based on a blockchain relational database, including a verification configuration module 100, a verification request module 200, a verification write module 300, a data matching module 400, and a data write module 500, where:
the verification configuration module 100 is configured to obtain external verification API information, and select an external verification API according to the external verification API information to perform associated verification configuration;
the verification request module 200 is configured to acquire and send verification data of a user, and generate and send an external verification request to an external verification API according to the verification data of the user;
a verification write-in module 300, configured to obtain verification information of an external verification API, and write verification data in a verification request that is completed by verification into a specific database according to the verification information;
the data matching module 400 is configured to match the verification data of the user to be written into the application database with the verification data in the specific database, and generate and send a matching result;
and a data writing module 500, configured to write the verification data of the user into the application database according to the matching result, so as to complete data writing.
For the condition that verification data needs to be provided outside the block chain, the prediction machine is used for conducting external verification firstly, and then sending the data to the block chain, and therefore accuracy and effectiveness of data verification are guaranteed. Firstly, obtaining external verification API information through a verification configuration module 100, selecting an external verification API according to the external verification API information to carry out associated verification configuration, and configuring the external verification API for external verification in advance so as to carry out identity verification on data to be verified of a user in the following process; when a client sends a verification request to the dialer, the verification request module 200 acquires and sends verification data of a user, generates and sends an external verification request to an external verification API according to the verification data of the user, verifies the verification data of the user through the external verification API, generates verification information after the verification is finished, acquires the verification information of the external verification API through the verification writing module 300, and writes the verification data in the verification request after the verification is finished 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 library chain so as to carry out verification judgment again when a subsequent user writes the same data into the application database, thereby ensuring the accuracy of data verification; in the process that the user writes the same data into the application database, the data matching module 400 matches 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 be passed, the data writing module 500 writes the verification data of the user into the application database according to the matching result to complete data writing; in the writing process, if the data to be written is matched with the data written by the prediction machine in the specific table of the specific database, the writing is successful; otherwise the write fails.
The prediction machine can verify external data of the block chain, so that the library chain can reliably verify the identity of the user, and meanwhile, the verification data of all nodes are ensured to be 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 write module 300 includes a deposit establishing submodule 310 and a deposit write submodule 320, where:
the storage establishing sub-module 310 is configured to establish a specific database for storing the external verification data in the blockchain relational database, and establish a specific table in the specific database;
the storage write-in sub-module 320 is configured to obtain the verification information of the external verification API, and write the verification data in the verification request after verification into a specific table in a specific database according to the verification information.
In order to facilitate the matching of the subsequent user with the data in the specific database when writing the data into the application database, the accuracy of data verification is ensured, and the validity of user identity verification is further ensured. The specific database for storing the external verification data in the block chain relational database is established through the storage establishing sub-module 310, and the specific table in the specific database is established, after the specific table is established, the verification information of the external verification API is acquired through the storage writing sub-module 320, 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 storing specific verification data of a specific table, and the application database is a database storing user-written data.
Based on the first aspect, as shown in fig. 1, in some embodiments of the present invention, the verification writing module 300 includes a verification judging sub-module 330, configured to judge whether the 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 a specific database; and if not, generating and sending verification failure prompt information.
When the verification data is written into the specific database, the verification judgment sub-module 330 judges whether the verification data of the user passes the verification according to the verification result in the verification information, if so, the verification data in the verification request passing the verification is written into a specific table in the specific database, so as to provide a verification data basis for the subsequent data written by the user; if the verification fails through the verification of the external verification API, generating and sending verification failure prompt information to the user, prompting the user that the verification fails, and carrying out the verification 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 judgment sub-module 510, configured to judge whether data matching is successful according to a matching result, and if yes, write verification data of a user into an application database to complete data writing; and if not, generating and sending write failure information.
When the user data is written into the application database, the matching judgment sub-module 510 judges whether the verification data of the user is matched with the data in the specific database according to the matching result, and if the verification data of the user is matched with the data in the specific database, the verification data of the user is written into the application database to complete data writing; and if not, generating and sending write failure information to prompt the user to rewrite the data. Only after the matching is successful, the data of the user is written into the application database, so that the verification data written by the user is ensured to be verified externally, meanwhile, the data can be successfully written into all the nodes, and the verification data of all the nodes are 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 prediction machine based on a blockchain relational database, including the following steps:
s1, obtaining external verification API information, and selecting an external verification API to carry out associated verification configuration according to the external verification API information;
s2, acquiring and sending the 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, obtaining the verification information of the external verification API, and writing the verification data in the 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, 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 condition that verification data needs to be provided outside the block chain, external verification is firstly carried out, and then the data is sent to the block chain, so that the accuracy and the validity of data verification are ensured. Firstly, obtaining external verification API information, selecting an external verification API according to the external verification API information to carry out associated verification configuration, and configuring the external verification API for external verification in advance so as to carry out identity verification on data to be verified of a user in the following process; when a client sends a verification request to the dialer, 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 finished, obtaining the verification information of the external verification API, writing the verification data in the verification request after the verification is finished 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 library chain so as to carry out verification judgment again when a subsequent user writes the same data into the application database, thereby ensuring the accuracy of data verification; in the process that the user writes the same data into the application database, 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 be passed, 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 by the prediction machine in the specific table of the specific database, the writing is successful; otherwise the write fails.
The method can verify the external data of the block chain, so that the library chain can reliably verify the identity of the user, and simultaneously, the verification data of all nodes are ensured to be consistent, and the verification authenticity and the verification accuracy are ensured.
Based on the second aspect, in some embodiments of the present invention, the above method for obtaining the verification information of the external verification API, and writing the verification data in the verification request with verification completed into the specific database according to the verification information includes the following steps:
establishing a specific database used for storing external verification data in a block chain relational database, and establishing a specific table in the specific database;
and acquiring the verification information of the external verification API, and writing the verification data in the verification request after verification into a specific table in a specific database according to the verification information.
In order to facilitate the matching of the subsequent user with the data in the specific database when writing 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 relational database is established, a specific table in the specific database is established, after the specific table is established, verification information of an external verification API is obtained, and verification data in a verification request after verification is completed is written into the specific table in the specific database according to the verification information so as to verify subsequent written data. The specific database is a database storing specific verification data of a specific table, and the application database is a database storing user-written data.
Based on the second aspect, in some embodiments of the present invention, the method for writing the verification data in the verification request with verification completed according to the verification information into the specific database includes the following steps:
judging whether the verification data of the user passes the verification according to the verification information, and if so, writing the verification data in the verification request passing the verification into a specific database; and if not, generating and sending verification failure prompt information.
When the verification data is written into the specific database, whether the verification data of the user passes the verification is judged according to the verification result in the verification information, if the verification data passes the verification result, the verification data in the verification request passing the verification is written into a specific table in the specific database, and a verification data basis is provided for the subsequent data written by the user; if the verification fails through the verification of the external verification API, generating and sending verification failure prompt information to the user, prompting the user that the verification fails, and carrying out the verification 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 includes the following steps:
judging whether the data matching is successful according to the matching result, if so, writing the verification data of the user into an application database, and finishing the data writing; and if not, generating and sending write failure information.
When the data of the user is written into the application database, judging whether the verification data of the user is matched with the data in the specific database or not, if so, writing the verification data of the user into the application database, and finishing data writing; and if not, generating and sending write failure information to prompt the user to rewrite the data. Only after the matching is successful, the data of the user is written into the application database, so that the verification data written by the user is ensured to be verified externally, meanwhile, the data can be successfully written into all the nodes, and the verification data of all the nodes are ensured to be consistent.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement 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 present 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 attributes 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.