Disclosure of Invention
The embodiment of the application provides a service system and a service method based on a blockchain and a chat robot, which can solve the problem that the current chat robot cannot guarantee the safety and transparency of financial transactions.
In a first aspect of the present application, there is provided a blockchain and chat robot-based service system, comprising: the chat robot and the blockchain communicate through an off-center application program interface;
the chat robot is used for acquiring user account information and user request information, wherein the user request information comprises a query request, a transaction request and a message reminding request; the method is also used for replying the request information to generate reply information, and the reply information comprises a query result, funds transfer and message reminding; the blockchain is used for calling a digital certificate corresponding to the reply information according to the reply information to obtain service information corresponding to the reply information, wherein the digital certificate is a hash value of the service information of an organization to which a transaction entity belongs.
By adopting the technical scheme, the chat robot communicates with the blockchain through the decentralizing application program interface, and the chat robot is used for acquiring user account information and user request information; the method is also used for replying the request information to generate reply information; the blockchain is used for retrieving the digital certificate corresponding to the reply information according to the reply information to obtain the service information corresponding to the reply information, and in summary, the blockchain technology is combined with the chat robot technology, and the safety transaction and timestamp record provided by the blockchain system and the mechanism of strong integrity and invariance support of the blockchain are utilized, so that the safety problem of the chat robot for financial transaction is solved, the problem that the current chat robot cannot guarantee the safety and transparency of the financial transaction is solved, and the effect of guaranteeing the safety and transparency of the financial transaction of the current chat robot is achieved.
In one possible implementation, the blockchain is specifically configured to:
obtaining a transaction credential from the certification authority according to the reply message;
according to the transaction certificate, a digital certificate corresponding to the reply information is called from a service mechanism;
and obtaining service information corresponding to the reply information according to the digital certificate corresponding to the reply information.
In one possible implementation, the blockchain is further to:
obtaining a hash value of the service information;
and carrying out data uplink on the hash value.
In one possible implementation, the blockchain is a coalition chain.
In one possible implementation, the chat robot is a transactional chat robot, the transactional chat robot is trained according to a user data set and a robot data set, and the transactional chat robot is used for representing a mapping relationship between the request information and the reply information.
In a second aspect of the present application, there is provided a service method based on a blockchain and chat robot, comprising:
acquiring user account information and user request information, wherein the user request information comprises a query request, a transaction request and a message reminding request;
replying the request information to generate reply information, wherein the reply information comprises a query result, funds transfer and message reminding;
and according to the reply information, calling a digital certificate corresponding to the reply information to obtain service information corresponding to the reply information, wherein the digital certificate is a hash value of the service information of an organization to which the transaction entity belongs.
In one possible implementation manner, the calling the digital certificate corresponding to the reply information according to the reply information to obtain the service information corresponding to the reply information includes:
obtaining a transaction credential from the certification authority according to the reply message;
according to the transaction certificate, a digital certificate corresponding to the reply information is called from a service mechanism;
and obtaining service information corresponding to the reply information according to the digital certificate corresponding to the reply information.
In one possible implementation manner, before the obtaining the user account information and the user request information, the method includes:
obtaining a hash value of the service information;
and carrying out data uplink on the hash value.
In a third aspect of the present application, a training method of a transactional chat robot is provided, including:
training the chat robot according to the user data set and the robot data set to obtain the transaction chat robot, wherein the transaction chat robot is used for representing the mapping relation between the user request information and the reply information.
In one possible implementation, the user data set includes historical user request information and the robot data set includes historical reply information in response to the historical user request information.
It should be understood that the description in this summary is not intended to limit key or critical features of embodiments of the present application, nor is it intended to be used to limit the scope of the present application. Other features of the present application will become apparent from the description that follows.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden on the person of ordinary skill in the art based on the embodiments provided herein, are intended to be within the scope of the present application. Moreover, it should be appreciated that while such a development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as having the benefit of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by those of ordinary skill in the art that the embodiments described herein can be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar terms herein do not denote a limitation of quantity, but rather denote the singular or plural. The terms "comprising," "including," "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means greater than or equal to two. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. The terms "first," "second," "third," and the like, as used herein, are merely distinguishing between similar objects and not representing a particular ordering of objects.
The service system based on the blockchain and the chat robot can be applied to the technical field of financial transactions.
Chat robots are a popular technique that allows websites or users to obtain user information in a conversational manner. In recent years, chat robots have been used to perform financial transactions. However, there are some security issues associated with executing financial transactions based on chat robots. Such as problems associated with security verification, data consistency, system availability, transparency, and the like. Therefore, careful planning is required before the technology of chat robots is adopted on a large scale.
To solve this technical problem, the embodiment of the application provides a service system based on a blockchain and a chat robot. In recent years, blockchain technology has shown its potential to subvert many application areas, particularly in the financial field, due to its inherent advantages in some security aspects. Therefore, the method based on the cooperation of the blockchain technology and the chat robot technology can play a role in safety guarantee and transparency application in the financial transaction process.
Fig. 1 shows a block diagram of a service system based on a blockchain and chat robot in an embodiment of the application. Referring to fig. 1, the service system based on the blockchain and the chat robot in the present embodiment includes:
chat robot 101 and blockchain 102, chat robot 101 communicates with blockchain 102 through a decentralizing application interface. The chat robot 101 obtains user account information and user request information, where the user request information includes a query request, a transaction request, and a message alert request. Then, the chat robot 101 replies to the request information, generating reply information including a query result, a money transfer, and a message reminder. Then, the blockchain 102 invokes the digital certificate corresponding to the reply information according to the reply information to obtain the service information corresponding to the reply information, where the digital certificate is a hash value of the service information of the institution to which the transaction entity belongs.
By adopting the technical scheme, the chat robot communicates with the blockchain through the decentralizing application program interface, and the chat robot is used for acquiring user account information and user request information; the method is also used for replying the request information to generate reply information; the blockchain is used for retrieving the digital certificate corresponding to the reply information according to the reply information to obtain the service information corresponding to the reply information, and in summary, the blockchain technology is combined with the chat robot technology, and the safety transaction and timestamp record provided by the blockchain system and the mechanism of strong integrity and invariance support of the blockchain are utilized, so that the safety problem of the chat robot for financial transaction is solved, the problem that the current chat robot cannot guarantee the safety and transparency of the financial transaction is solved, and the effect of guaranteeing the safety and transparency of the financial transaction of the current chat robot is achieved.
In the present embodiment, chat bot 101 is essentially a Web site (Web) application, but it does not have a mechanism to interact with the blockchain platform. Thus, based on the decentralizing application (Decentralization App, i.e., DApp), an interactive interface is created between chat robot 101 and blockchain 102, i.e., chat robot 101 communicates with blockchain 102 via the decentralizing application interface.
Specifically, the DApp is a Web server configured to expose an application program interface (Application Programming Interface, abbreviated API) to Web applications. And, the DApp is also an interface to the blockchain platform. The Web application uses these APIs to submit user account information and user request information, which is converted to blockchain transactions by the DAPP. The DAPP then uses the blockchain API to submit the transactions (i.e., the reply message corresponding to the user request message), and through the API, investigates blockchain platform related functions (i.e., the service information of the institution to which the transaction entity belongs).
Optionally, chat robots developed by beginner friendly chat robot platform (DialogFlow) agents from google are selected.
In the embodiment of the present application, the chat robot developed by the DialogFlow agent uses a Google powerful natural language understanding (Natural Language Understanding, abbreviated as NLU) background module, and its function is to implement the chat robot 101 to use an input information (i.e. user account information and user request information) as a query, and give a response to the input information (i.e. reply information) as a return based on a machine learning technique of the trained processing data.
Specifically, the chat robot developed by the DialogFlow agent includes three basic elements, namely intent, entity and training. Intent refers to a mapping between a user's query and the agent's response (i.e., a mapping between user account information and user request information as the user's query, and reply information as the agent's response). Each intent looks like a cluster, but where the seemingly different queries map to a single preset output match probability is high. In other words, a user may require the system to initiate a transaction in a number of ways, but the agent should detect that the user is attempting to create a transaction and respond with a single output. Wherein entities in the chat robot developed by the DialogFlow agent are input from a user's natural language.
For example, a query for a transaction (e.g., "send account 1123158964, 1000 units") would have several corresponding entities: account number (1123158964) and amount (1000 units).
Fig. 2 shows a flow chart of chat robot interactions in an embodiment of the application. Referring to fig. 2, the chat robot performs user interaction through a browser, replies according to submitted different user account information and user request information, and generates reply information.
Specifically, in the process of chat robot interaction, a user sends user account information and user request information to a Dapp, and the Dapp receives the user account information and the user request information sent by the user and then sends the user account information and the user request information to a chat robot (chat robot developed by a DialogFlow agent). After receiving user account information and user request information sent by a user through a Web browser, the chat robot carries out intention recognition on the user account information and the user request information, and generates reply information based on entity recognition.
Wherein the chat robot is a transactional chat robot. In the chat robot developed by the DialogFlow agent, training refers to training the chat robot according to a user data set and a robot data set based on machine learning, so as to obtain the transactional chat robot.
Fig. 3 shows a flow chart of a financial transaction of a blockchain and chat robot based service system in an embodiment of the application. Referring to fig. 1 and 3, after the Dapp obtains user account information and user request information input by a user, the Dapp authenticates the identity of the user, i.e. verifies the user account information. If the authentication is passed, the Dapp sends the user account information and the user request information to the chat robot.
Then, the chat robot 101 acquires user account information and user request information. And obtaining reply information corresponding to the user request information through intention recognition, entity recognition and a training completion chat robot model (namely a self-contained training completion model in the transactional chat robot). The query result included in the reply information corresponds to the query request included in the user request information, the fund transfer included in the reply information corresponds to the transaction request included in the user request information, and the message reminding included in the reply information corresponds to the message reminding request included in the user request information.
Chat robot 101 then sends a reply message to blockchain 102 via the Dapp. The blockchain 102 will retrieve the digital certificate corresponding to the reply message, and obtain the service information corresponding to the reply message according to the digital certificate. The service information is the service information corresponding to the reply information that the chat robot 101 is allowed to obtain after the digital certificate corresponding to the reply information is verified according to the digital certificate to which the respective transaction entity belongs. After the Dapp obtains the service information sent by the blockchain 102, it replies to the user with a question (i.e., user request information) related to the user.
In the process of replying to the user by the chat robot 101, the Dapp also simultaneously performs Hash uplink on the data in the interaction process, and stores the data in a service system based on the blockchain and the chat robot.
In summary, according to the service system based on the blockchain and the chat robot in the embodiment of the application, aiming at the safety problem of the chat robot in the financial transaction process, the blockchain technology is applied to the field of the chat robot, so that not only is the combination method of the chat robot based on the blockchain explored, but also the integration flow of the advantages of the combination method based on the blockchain is designed and optimized, the user identity verification flow of the blockchain system is optimized, the safety of the user in the financial transaction in the DAPP is ensured, and the aim of assisting customer service personnel in working is fulfilled, so that the financial transaction service has timeliness, effectiveness and intelligence.
In some embodiments, the blockchain is specifically used to:
based on the reply message, a transaction credential is obtained from the certification authority.
And according to the transaction certificate, the digital certificate corresponding to the reply information is called from the service organization.
And obtaining service information corresponding to the reply information according to the digital certificate corresponding to the reply information.
In the embodiment of the application, the certification authority is a credential issuing system externally connected with a service system based on a blockchain and a chat robot, and the service mechanism is a credential verification system externally connected with the service system based on the blockchain and the chat robot. Based on the double confirmation of the voucher issuing system and the voucher verifying system (namely after the transaction voucher and the digital voucher are obtained), the service system based on the blockchain and the chat robot can only call service information from the mechanism of each entity externally connected with the service system based on the blockchain and the chat robot, and send the service information to the user through the chat robot.
By adopting the technical scheme, the service system based on the blockchain and the chat robot can be ensured to be safer by adopting a double-confirmation mechanism.
In some embodiments, the blockchain is further to:
obtaining a hash value of service information;
and (5) data chaining is carried out on the hash value.
In the embodiment of the application, before interaction, the service system based on the blockchain and the chat robot can dock a plurality of certification authorities, a plurality of service authorities and a plurality of entities belonging to the authorities to form a blockchain-based financial transaction interaction network. And then, carrying out Hash uplink on information of each authentication mechanism, each service mechanism and each entity belonging mechanism, and storing the information in the blockchain, so that a service system based on the blockchain and the chat robot can interact with a user through the chat robot in the service system based on the blockchain and the chat robot at any time according to a request of the user.
By adopting the technical scheme, the block chain and chat robot characteristics are combined with the integrated block chain chat robot, so that the effects of guaranteeing the safety and transparency of financial transactions by using the block chain while flexibly using the chat robot are achieved.
In some embodiments, the blockchain 102 is a coalition chain.
In an embodiment of the present application, the blockchain platform includes a public chain and a federated chain. Because the transaction times per second (Transactions Per Second, abbreviated as TPS) of the public chain is slower and the storage cost is higher, no alliance chain is more suitable as a blockchain system of the chat robot, the alliance chain can be selected as a subsystem of a service system based on the blockchain and the chat robot, and the requirements of the chat robot can be met in terms of safety and TPS.
By adopting the technical scheme, the alliance chain is selected, so that the number of transactions per second in the process of financial transactions of the service system based on the blockchain and the chat robot can be increased, and the storage cost of the service system based on the blockchain and the chat robot can be reduced.
In some embodiments, chat robot 101 is a transactional chat robot that is trained from a user data set and a robot data set, the transactional chat robot being configured to represent a mapping of request information and reply information.
In the embodiment of the application, training in the chat robot developed by the DialogFlow agent enables the chat robot to understand what the user implies and to approach the user in a structured manner.
For example, using machine learning techniques, chat robots developed by DialogFlow agents can use their own language model to enable similar clustered intent and processing entities to be associated with a user's query requests. For another example, a developer of a chat robot developed by a DialogFlow agent may input training data for a particular application as appropriate.
Based on the two aspects, chat robots developed by DialogFlow agents train themselves to process user queries (i.e., user request information) and generate responses (i.e., reply information). Meanwhile, the training model of the chat robot developed by the DialogFlow agent is also dynamically improved, namely, the performance and the reliability of the chat robot developed by the DialogFlow agent can be improved as users increasingly talk with the chat robot developed by the DialogFlow agent.
In an embodiment of the present application, the chat robot developed by the DialogFlow agent is a transactional chat robot (Transactional Chatbot). The DAPP transmits interaction information fed back by the user transaction chat robot by calling a corresponding API with necessary information for interaction with the transaction chat robot. The machine learning model in a transactional chat robot will be trained using two data sets, namely a user data set and a robot data set.
In some embodiments, the user data set includes historical user request information and the robot data set includes historical reply information responsive to the historical user request information.
In the embodiment of the application, the historical user request information is an interactive entity (question) actually sent by the user, and the historical reply information is a sentence (answer) generated by the chat robot in response to the interactive entity actually sent by the user.
Once the user logs in securely (i.e., the user account information is authenticated), the user may submit user request information for a different user interface to the DAPP via the chat bot. These user request messages are passed to the transactional chat robot and processed accordingly.
For example, when the user request information is a query request, the transaction chat robot will respond to the query request, analyze the query request, obtain the responsive service information from the blockchain, and feed back the analyzed query result to the user through the user interface by the DAPP. When the user request information is a transaction request, the transaction chat robot's response is sufficient to create a blockchain (Fabric) transaction. The DAPP then converts the response to a transaction, and then the transaction flow occurs through the connected peers (i.e., the entities to which the transaction entity belongs).
It should be noted that, for simplicity of description, the communication between the systems is shown as a series of combinations of actions for the foregoing embodiments of the systems, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some communication between the systems may take place in other orders or simultaneously, depending on the application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts and modules referred to are not necessarily required in the present application.
The foregoing description of embodiments of the system further describes the embodiments of the method described herein.
Fig. 4 shows a flowchart of a service method based on blockchain and chat robots in an embodiment of the application. Referring to fig. 4, the service method based on the blockchain and the chat robot in the embodiment includes:
step S401: and acquiring user account information and user request information, wherein the user request information comprises a query request, a transaction request and a message reminding request.
Step S402: and replying the request information to generate reply information, wherein the reply information comprises a query result, funds transfer and message reminding.
Step S403: and according to the reply information, calling a digital certificate corresponding to the reply information to obtain service information corresponding to the reply information, wherein the digital certificate is a hash value of the service information of an organization to which the transaction entity belongs.
In some embodiments, step S403 includes: step A1-step A3.
Step A1: and obtaining the transaction certificate from the certification authority according to the reply information.
Step A2: and according to the transaction certificate, the digital certificate corresponding to the reply information is called from a service mechanism.
Step A3: and obtaining service information corresponding to the reply information according to the digital certificate corresponding to the reply information.
In some embodiments, before step S401, further includes: step B1-step B2.
Step B1: and obtaining the hash value of the service information.
Step B2: and carrying out data uplink on the hash value.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the described method may refer to corresponding procedures in the foregoing system embodiments, which are not described herein again.
The foregoing describes embodiments of a service method based on a blockchain and chat robot, and the following further describes embodiments of a training method of a transactional chat robot.
Fig. 5 shows a training method of a transactional chat robot in the embodiment of the present application, referring to fig. 5, the training method of the transactional chat robot in the embodiment includes:
step 501: training the chat robot according to the user data set and the robot data set to obtain the transaction chat robot, wherein the transaction chat robot is used for representing the mapping relation between the user request information and the reply information.
In some embodiments, in step 501, the user data set includes historical user request information and the robot data set includes historical reply information in response to the historical user request information.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the described method may refer to corresponding procedures in the foregoing system embodiments, which are not described herein again.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.