Disclosure of Invention
The invention aims to provide a reliable automatic financial settlement method and system.
A first aspect of an embodiment of the present invention provides a financial settlement method, applicable to a blockchain node, including:
Receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party; inquiring a transaction credential of the target transaction in a blockchain according to the transaction identifier of the target transaction in response to the settlement request, wherein the transaction credential comprises a fund account identifier and a transaction amount of the first transaction party; generating a payment instruction based on the fund account identification and the transaction amount of the first transaction party;
Conveying the payment instruction to a banking system, and receiving a payment result returned by the banking system; and associating the payment result with the transaction identifier of the target transaction, and writing the associated payment result into a blockchain.
With reference to the first aspect, in some embodiments, the communicating the payment instruction to a banking system and receiving a payment result returned by the banking system includes: generating an HTTP request based on Content-Type or Authorization parameters, wherein the HTTP request contains payment related information, and the payment related information comprises an order number, a payment amount and a payment mode; converting the HTTP request into a character string, wherein the data format of the character string is JSON or XML; and sending the HTTP request to the banking system, waiting for the response of the banking system and returning the payment result.
With reference to the first aspect, in some embodiments, the generating payment instruction based on the fund account identification and the transaction amount of the first transaction party includes: determining a settlement amount according to a preset settlement rule based on the transaction amount; and generating the payment instruction based on the fund account identification of the first transaction party and the settlement amount.
With reference to the first aspect, in some embodiments, the HTTP request is sent to the banking system, and the banking system responds to the first HTTP request and generates a first character string according to an instruction library; the first character string is split and then sent to all users with the blockchain account identifier; receiving the first character string and generating a second character string according to the instruction library; and the banking system receives the second character string and verifies the source data of the second character string according to the second character string, and if the source data accords with the instruction library, the banking system responds and returns the payment result.
With reference to the first aspect, in some embodiments, the target transaction is a passcard transaction, the first transaction party is a buyer or a seller, and the transaction credential of the target transaction further includes a passcard account address and a passcard delivery number of the first transaction party; the settlement process further includes: generating a pass transfer instruction based on the pass account address of the first transaction party and the pass delivery number; the certification transferring instruction is transmitted to a financial institution system, and a certification transferring result returned by the financial institution system is received; and writing the evidence-passing transfer result into a blockchain.
With reference to the first aspect, in some embodiments, before generating the payment instruction and the passcard transfer instruction, the settlement process further includes: the transaction credential is audited to determine the legitimacy of the transaction credential, the payment instruction and the passcard transfer instruction and being generated only if the transaction credential is determined to be legitimate.
With reference to the first aspect, in some embodiments, the settlement process further includes: acquiring a plurality of certificates generated in the settlement process; determining a category of the plurality of credentials; for each of the plurality of credentials, generating an index of the credential based on a category of the credential and a transaction identification of the target transaction; the plurality of credentials are written to the blockchain at respective indexes.
With reference to the first aspect, in some embodiments, receiving a settlement request of a first transaction party, the settlement request including a blockchain account identification of the first transaction party and a transaction identification of a target transaction in which the first transaction party participates, includes: determining an API interface for receiving the settlement request; determining an endpoint based on the API interface, the endpoint for receiving the settlement request, wherein the endpoint parameter includes a blockchain account identification of the first transaction party and a transaction identification of a target transaction; performing identity verification based on a blockchain account identification of the first transaction party, wherein the identity verification process comprises searching related transaction information based on the transaction identification; and returning the payment result to the first transaction party based on the HTTP response mode.
With reference to the first aspect, in some embodiments, obtaining the plurality of credentials generated in the settlement process includes:
inquiring the transaction certificate of a target transaction in a blockchain based on the transaction identifier in the settlement request, and acquiring an inquiry result; all of the credentials associated with the target transaction are determined in a query result. With reference to the first aspect, in some implementations, auditing the transaction credential to determine validity of the transaction credential, the payment instruction and the passable transfer instruction and being generated only if the transaction credential is determined to be valid includes: calculating the transaction certificate based on a hash function, and comparing the transaction certificate with a hash value in the transaction certificate; verifying the signature based on the public key in the transaction certificate and ensuring that the public key is matched with the identity information in the transaction certificate; and verifying whether the payment instruction and the evidence transferring instruction in the transaction evidence accord with system rules and constraint conditions or not according to the payment instruction and the evidence transferring instruction.
A second aspect of an embodiment of the present invention provides a financial settlement system, adapted for blockchain nodes, configured to:
Receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party; inquiring a transaction credential of the target transaction in a blockchain according to the transaction identifier of the target transaction in response to the settlement request, wherein the transaction credential comprises a fund account identifier and a transaction amount of the first transaction party;
generating a payment instruction based on the fund account identification and the transaction amount of the first transaction party; conveying the payment instruction to a banking system, and receiving a payment result returned by the banking system; and associating the payment result with the transaction identifier of the target transaction, and writing the associated payment result into a blockchain.
With reference to the second aspect, in some embodiments, the system is further configured to:
Generating an HTTP request based on Content-Type or Authorization parameters, wherein the HTTP request contains payment related information, and the payment related information comprises an order number, a payment amount and a payment mode; converting the HTTP request into a character string, wherein the data format of the character string is JSON or XML; and sending the HTTP request to the banking system, waiting for the response of the banking system and returning the payment result.
With reference to the second aspect, in some embodiments, the system is further configured to: determining a settlement amount according to a preset settlement rule based on the transaction amount; and generating the payment instruction based on the fund account identification of the first transaction party and the settlement amount.
With reference to the second aspect, in some embodiments, the system is further configured to:
The target transaction is a pass transaction, the first transaction party is a buyer party or a seller party, and the transaction certificate of the target transaction also comprises a pass account address and a pass delivery number of the first transaction party;
the settlement process further includes: generating a pass transfer instruction based on the pass account address of the first transaction party and the pass delivery number; the certification transferring instruction is transmitted to a financial institution system, and a certification transferring result returned by the financial institution system is received; and writing the evidence-passing transfer result into a blockchain.
With reference to the second aspect, in some embodiments, the system is further configured to:
Before generating the payment instruction and the clearance transfer instruction, the settlement process further includes: the transaction credential is audited to determine the legitimacy of the transaction credential, the payment instruction and the passcard transfer instruction and being generated only if the transaction credential is determined to be legitimate.
With reference to the second aspect, in some embodiments, the system is further configured to: the settlement process further includes: acquiring a plurality of certificates generated in the settlement process; determining a category of the plurality of credentials; for each of the plurality of credentials, generating an index of the credential based on a category of the credential and a transaction identification of the target transaction; the plurality of credentials are written to the blockchain at respective indexes.
With reference to the second aspect, in some embodiments, the system is further configured to:
Receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party, and the settlement request comprises the following steps: determining an API interface for receiving the settlement request; determining an endpoint based on the API interface, the endpoint for receiving the settlement request, wherein the endpoint parameter includes a blockchain account identification of the first transaction party and a transaction identification of a target transaction; performing identity verification based on a blockchain account identification of the first transaction party, wherein the identity verification process comprises searching related transaction information based on the transaction identification; and returning the payment result to the first transaction party based on the HTTP response mode.
With reference to the second aspect, in some embodiments, the system is further configured to: acquiring a plurality of credentials generated in the settlement process, including: inquiring the transaction certificate of a target transaction in a blockchain based on the transaction identifier in the settlement request, and acquiring an inquiry result; all of the credentials associated with the target transaction are determined in a query result.
With reference to the second aspect, in some embodiments, the system is further configured to:
Auditing the transaction credential to determine the legitimacy of the transaction credential, the payment instruction and the passcard transfer instruction and being generated only if the transaction credential is determined to be legitimate, comprising: calculating the transaction certificate based on a hash function, and comparing the transaction certificate with a hash value in the transaction certificate; verifying the signature based on the public key in the transaction certificate and ensuring that the public key is matched with the identity information in the transaction certificate; and verifying whether the payment instruction and the evidence transferring instruction in the transaction evidence accord with system rules and constraint conditions or not according to the payment instruction and the evidence transferring instruction.
A third aspect of an embodiment of the present invention provides an electronic device, including:
At least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect of the present invention.
A fourth aspect of the embodiments of the present invention proposes a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as proposed in the first aspect of the embodiments of the present invention.
Compared with the prior art, the embodiment of the invention has at least the following technical effects:
In the scheme, firstly, a settlement request of a first transaction party is received, the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party, then, in response to the settlement request, transaction certificates of the target transaction are inquired in a blockchain according to the transaction identifier of the target transaction, wherein the transaction certificates comprise a fund account identifier of the first transaction party and a transaction amount, then, a payment instruction is generated based on the fund account identifier of the first transaction party and the transaction amount, then, the payment instruction is transmitted to a banking system, a payment result returned by the banking system is received, finally, the payment result is associated with the transaction identifier of the target transaction, and the associated payment result is written into the blockchain. According to the financial settlement method provided by the embodiment of the invention, the automatic settlement can be realized by inquiring the pre-stored transaction certificate and generating the payment instruction based on the content of the transaction certificate, so that the settlement efficiency is improved, and the settlement cost is saved. Meanwhile, due to the fact that the blockchain has the characteristics of decentralization and difficult data tampering, the payment result can be ensured to be stored in a plurality of blockchain nodes in a distributed mode by writing the payment result into the blockchain, and the payment result is difficult to tamper.
Detailed Description
In order to make the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are all embodiments of one path of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
The term "comprising" in the description of the application and the claims and in the above figures and any variants thereof is intended to cover a non-exclusive inclusion. For example, a process, method, or system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed but may optionally include additional steps or elements not listed or inherent to such process, method, article, or apparatus. Furthermore, the terms "first," "second," and "third," etc. are used for distinguishing between different objects and not for describing a particular sequential order.
In this specification, the term "blockchain" may refer to a chain of entities consisting of different entities (e.g., individuals, companies, institutions, governments, etc.), or a data chain of blocks linked in chronological order, depending on the specific context.
Fig. 1 is a flowchart of a financial settlement method according to an embodiment of the present application. The flow may be performed by block link points. The flow may be performed by a financial settlement system implemented in a blockchain node, for example. As shown in fig. 1, the flow includes the following steps.
Step 101, receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party.
Taking a general certificate (e.g., stock, securities, etc.) transaction as an example, the first party may be the buyer or seller of the general certificate.
The settlement request includes a blockchain account identification of the first transaction party and a transaction identification of a target transaction in which the first transaction party participates. Illustratively, the various types of identifiers referred to herein may be represented as fixed-length strings. The first transaction part can initiate a settlement request through the user side. Specifically, the first transaction party can specify the target transaction corresponding to the settlement request, and accordingly, the user terminal can automatically package the blockchain account identifier of the first transaction party and the transaction identifier of the target transaction into the settlement request and upload the settlement request to the blockchain network.
In this embodiment, a transacting party (e.g., a person) may access the blockchain network through the user side (without running a consensus algorithm). Of course, a transacting party (e.g., a company) may also access the blockchain network through a consensus node (i.e., a blockchain node that needs to run a consensus algorithm). In particular, a federation chain can be constructed consisting of at least banks, financial institutions (e.g., dealers) and governments, the members of which require deployment of high-power consensus nodes, other entities (e.g., individuals) having access to a blockchain network of consensus nodes through low-power nodes (common nodes).
In response to the settlement request, the settlement module performs a settlement process. The execution process of the transparent intelligent contract is disclosed, and all transactions are recorded on the blockchain and can be checked at any time, so that the transparency of the transactions is improved.
As an implementation manner, an HTTP request may be generated based on a Content-Type or Authorization parameter, where the HTTP request includes payment related information, where the payment related information includes an order number, a payment amount, and a payment manner, and then the HTTP request is converted into a character string, where a data format of the character string is JSON or XML, and then the HTTP request is sent to the banking system, and waits for the banking system to respond and return the payment result.
Specifically, the HTTP request may be sent to the banking system, which responds to the first HTTP request and generates a first string according to an instruction library; the first character string is split and then sent to all users with the blockchain account identifier; receiving the first character string and generating a second character string according to the instruction library; and the banking system receives the second character string and verifies the source data of the second character string according to the second character string, and if the source data accords with the instruction library, the banking system responds and returns the payment result. In this way, the safety thereof can be further improved.
Step 102, responding to the settlement request, and inquiring a transaction certificate of the target transaction in a blockchain according to the transaction identifier of the target transaction, wherein the transaction certificate comprises the fund account identifier and the transaction amount of the first transaction party.
The transaction credential includes a funds account identification of the first transaction party and a transaction amount. For each transaction facilitated, the financial institution system may upload transaction credentials for the transaction (e.g., as a blockchain node) to the blockchain network. That is, the transaction credentials of the target transaction may be pre-written to the blockchain. In addition, to distinguish between transaction credentials of different transactions, the transaction credentials in the blockchain are associated with a transaction identification. For example, the transaction identification in the transaction voucher may be directly used as the transaction in the blockchain associated with the transaction voucher, and accordingly, the transaction voucher and the transaction identification for the same transaction may be uploaded together to the blockchain network for associated storage. In one possible implementation, the transaction identification and the transaction credential may be composed into a key-value pair and then written into the blockchain, with the transaction identification being as a key and the transaction credential being as a value.
And step 103, generating a payment instruction based on the fund account identification and the transaction amount of the first transaction party.
The payment instructions are used to instruct transfer of the settlement amount from a designated account (e.g., a centralized funds receiving account) to a funds account of a first transaction party (e.g., a seller) or transfer of the settlement funds from a funds account of a first transaction party (e.g., a buyer) to a designated account (e.g., a centralized funds receiving account).
In some embodiments, the settlement module may determine the settlement amount according to preset settlement rules based on the transaction amount. The settlement rules may include calculation rules for related fees (e.g., financial services fees, tax, value added tax, tax stamp, etc.), and the settlement amount may be determined based on the transaction amount and the related fees.
Specifically, as one implementation mode, an API interface for receiving the settlement request may be determined first, then, an endpoint is determined based on the API interface, where the endpoint parameter includes a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction, then, identity verification is performed based on the blockchain account identifier of the first transaction party, the identity verification process includes searching related transaction information based on the transaction identifier, and finally, the payment result is returned to the first transaction party based on an HTTP response mode.
Step 104, the payment instruction is transmitted to a banking system, and a payment result returned by the banking system is received.
Specifically, the payment result may indicate whether the payment was successful, for example, "1" indicates that the payment was successful and "0" indicates that the payment failed. Further, when the payment result indicates that the payment was successful, the payment result may carry payment credentials.
Step 105, associating the payment result with the transaction identifier of the target transaction, and writing the associated payment result into a blockchain.
In the embodiment of the application, on one hand, by inquiring the pre-stored transaction certificate and generating the payment instruction based on the content of the transaction certificate, the automatic settlement can be realized, the settlement efficiency is improved, and the settlement cost is saved. On the other hand, due to the fact that the blockchain has the characteristics of decentralization and difficult data tampering, the payment result can be ensured to be stored in a plurality of blockchain nodes in a distributed mode by writing the payment result into the blockchain, and the payment result is difficult to tamper. That is, the embodiment of the application provides a reliable automatic settlement method based on blockchain.
In some embodiments, the settlement module may associate the payment result with a transaction identification of the target transaction and write the associated payment result to the blockchain. Referring to the foregoing embodiment, the transaction identifier and the payment result may form a key-value pair and then be written into a blockchain, wherein the transaction identifier is a key (key) and the payment result is a value (value). Thus, specific payment results can be queried through the transaction identification.
In some embodiments, the target transaction is a passbook transaction (e.g., a stock or securities transaction), the first party is a buyer or seller, and the transaction credential of the target transaction further includes a passbook account address and a passbook delivery number of the first party. Based on this, as an embodiment, it may further include:
Step 310, generating a pass transfer instruction based on the pass account address and the pass number of the first transaction party.
The pass transfer instruction is configured to instruct transfer of a specified number of passes (i.e., the pass-through number) from a specified account (e.g., a centralized pass-through account) to a pass account of a first transaction party (e.g., a seller), or transfer of a specified number of passes (i.e., the pass-through number) from a pass account of a first transaction party (e.g., a buyer) to a specified account (e.g., a centralized pass-through account).
Step 320, the certification transferring instruction is transmitted to the financial institution system, and the certification transferring result returned by the financial institution system is received.
Specifically, the authenticated transfer result may indicate whether the transfer (delivery) is successful, for example, "1" indicates that the transfer (delivery) is successful and "0" indicates that the transfer (delivery) is failed. Further, when the passcard transfer result indicates that the transfer (delivery) is successful, the passcard transfer result may carry a passcard transfer (delivery) credential.
And 330, writing the certification transfer result into a blockchain.
In some embodiments, the certification transfer outcome may be associated with a transaction identifier of the target transaction and the associated certification transfer outcome written to the blockchain. Referring to the foregoing embodiment, the transaction identifier and the through certificate transfer result may form a key value pair and then be written into a blockchain, where the transaction identifier is a key (key) and the through certificate transfer result is a value (value). Thus, the specific evidence-passing transfer result can be queried through the transaction identifier.
In some embodiments, the transaction credential may be audited to determine the validity of the transaction credential prior to generating the payment instruction and the passable transfer instruction. The payment instructions and the passcard transfer instructions and are only generated when the transaction credential is determined to be legitimate (i.e., pass an audit). In other words, settlement may be terminated when the transaction credential is determined to be illegal (i.e., not approved). In particular, the transaction credential may be checked for its field integrity and whether each field (e.g., transaction amount, number of passes, etc.) meets specifications. Thus, the reliability of the settlement process can be improved, and invalid and incorrect settlement can be avoided.
Specifically, the transaction credential may be calculated based on a hash function and compared with a hash value in the transaction credential; verifying the signature based on the public key in the transaction certificate and ensuring that the public key is matched with the identity information in the transaction certificate; and verifying whether the payment instruction and the evidence transferring instruction in the transaction evidence accord with system rules and constraint conditions or not according to the payment instruction and the evidence transferring instruction.
In some embodiments, a sorted store of related credentials is also included. Specifically, the classified storage flow of credentials includes steps 410 through 430.
Step 410, obtaining a plurality of credentials generated in the settlement process.
Illustratively, the plurality of credentials may include payment credentials, pass transfer (payment) credentials, payment (e.g., financial services, tax) credentials, and the like, or any combination thereof. Inquiring the transaction certificate of a target transaction in a blockchain based on the transaction identification in the settlement request, and acquiring an inquiry result to determine all the certificates related to the target transaction in the inquiry result.
Step 420, determining a category of the plurality of credentials.
The category of each credential may be determined by extracting a particular field (e.g., the first field) of each credential. For example, if the first field of a credential is "pay," then the type of credential is a payment credential. For another example, if the first field of a credential is "security," then the category of the credential is a security-delivery credential. For another example, if the first field of a certain certificate is "tax", the type of the certificate is a tax payment certificate.
Step 430, for each of the plurality of credentials, generating an index of the credential based on the category of the credential and the transaction identification of the target transaction.
Step 440, writing the plurality of credentials to the blockchain in respective indexes.
Specifically, each credential may be associated with its index and the associated credential written to the blockchain. With reference to the foregoing embodiments, the credential and its index may form a key-value pair and then be written to the blockchain, where the index is a key and the credential is a value. Thus, a transaction party can quickly query specific types of credentials for specific transactions (e.g., target transactions) by entering an index.
In some embodiments, this may be performed by invoking a smart contract, and accordingly, the settlement request also includes a contract address of the smart contract for performing the settlement process 220. Advantages of using smart contracts for settlement include: (1) The settlement is automatically executed, so that the settlement efficiency can be improved, and the transaction cost is reduced; (2) The intelligent contract is decentralised and does not depend on any central institution or third party institutions, so that the safety and reliability of settlement are improved; (3) Intelligent contracts are code-based agreements in which conditions and rules that must be satisfied by parties during the settlement process are specified, which can reduce subsequent disputes and disputes; (4) The intelligent contract can be written by using a plurality of programming languages, and can realize various complex logics and functions, thereby improving the flexibility and editability of the settlement process.
In some embodiments, the blockchain node may feed various types of results (e.g., audit results, payment results, credit transfer results, categories of the one or more credentials) back to the user side of the first transaction party (e.g., individual).
The financial settlement method provided by the embodiment of the application comprises the steps of firstly, receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party, then, responding to the settlement request, inquiring a transaction certificate of the target transaction in a blockchain according to the transaction identifier of the target transaction, wherein the transaction certificate comprises a fund account identifier of the first transaction party and a transaction amount, then, generating a payment instruction based on the fund account identifier of the first transaction party and the transaction amount, then, transmitting the payment instruction to a banking system, receiving a payment result returned by the banking system, and finally, associating the payment result with the transaction identifier of the target transaction and writing the associated payment result into the blockchain. According to the financial settlement method provided by the embodiment of the application, the automatic settlement can be realized by inquiring the pre-stored transaction certificate and generating the payment instruction based on the content of the transaction certificate, so that the settlement efficiency is improved, and the settlement cost is saved. Meanwhile, due to the fact that the blockchain has the characteristics of decentralization and difficult data tampering, the payment result can be ensured to be stored in a plurality of blockchain nodes in a distributed mode by writing the payment result into the blockchain, and the payment result is difficult to tamper.
Based on the same inventive concept, the application also provides a financial settlement system, which is applicable to the blockchain node and is configured as follows:
Receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party;
Inquiring a transaction credential of the target transaction in a blockchain according to the transaction identifier of the target transaction in response to the settlement request, wherein the transaction credential comprises a fund account identifier and a transaction amount of the first transaction party;
Generating a payment instruction based on the fund account identification and the transaction amount of the first transaction party;
conveying the payment instruction to a banking system, and receiving a payment result returned by the banking system;
And associating the payment result with the transaction identifier of the target transaction, and writing the associated payment result into a blockchain.
In some implementations, the system is further configured to:
Generating an HTTP request based on Content-Type or Authorization parameters, wherein the HTTP request contains payment related information, and the payment related information comprises an order number, a payment amount and a payment mode;
Converting the HTTP request into a character string, wherein the data format of the character string is JSON or XML;
and sending the HTTP request to the banking system, waiting for the response of the banking system and returning the payment result.
With reference to the second aspect, in some embodiments, the system is further configured to:
Determining a settlement amount according to a preset settlement rule based on the transaction amount;
And generating the payment instruction based on the fund account identification of the first transaction party and the settlement amount.
With reference to the second aspect, in some embodiments, the system is further configured to:
The target transaction is a pass transaction, the first transaction party is a buyer party or a seller party, and the transaction certificate of the target transaction also comprises a pass account address and a pass delivery number of the first transaction party;
the settlement process further includes:
Generating a pass transfer instruction based on the pass account address of the first transaction party and the pass delivery number;
The certification transferring instruction is transmitted to a financial institution system, and a certification transferring result returned by the financial institution system is received;
and writing the evidence-passing transfer result into a blockchain.
With reference to the second aspect, in some embodiments, the system is further configured to:
before generating the payment instruction and the clearance transfer instruction, the settlement process further includes:
the transaction credential is audited to determine the legitimacy of the transaction credential, the payment instruction and the passcard transfer instruction and being generated only if the transaction credential is determined to be legitimate.
In some implementations, the system is further configured to:
the settlement process further includes:
Acquiring a plurality of certificates generated in the settlement process;
determining a category of the plurality of credentials;
for each of the plurality of credentials, generating an index of the credential based on a category of the credential and a transaction identification of the target transaction;
the plurality of credentials are written to the blockchain at respective indexes.
In some implementations, the system is further configured to:
Receiving a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party, and the settlement request comprises the following steps:
Determining an API interface for receiving the settlement request;
determining an endpoint based on the API interface, the endpoint for receiving the settlement request, wherein the endpoint parameter includes a blockchain account identification of the first transaction party and a transaction identification of a target transaction;
performing identity verification based on a blockchain account identification of the first transaction party, wherein the identity verification process comprises searching related transaction information based on the transaction identification;
and returning the payment result to the first transaction party based on the HTTP response mode.
In some implementations, the system is further configured to:
acquiring a plurality of credentials generated in the settlement process, including:
Inquiring the transaction certificate of a target transaction in a blockchain based on the transaction identifier in the settlement request, and acquiring an inquiry result;
all of the credentials associated with the target transaction are determined in a query result.
In some implementations, the system is further configured to:
Auditing the transaction credential to determine the legitimacy of the transaction credential, the payment instruction and the passcard transfer instruction and being generated only if the transaction credential is determined to be legitimate, comprising:
calculating the transaction certificate based on a hash function, and comparing the transaction certificate with a hash value in the transaction certificate;
Verifying the signature based on the public key in the transaction certificate and ensuring that the public key is matched with the identity information in the transaction certificate;
And verifying whether the payment instruction and the evidence transferring instruction in the transaction evidence accord with system rules and constraint conditions or not according to the payment instruction and the evidence transferring instruction.
The financial settlement system provided by the embodiment of the application firstly receives a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party, then, in response to the settlement request, a transaction certificate of the target transaction is queried in a blockchain according to the transaction identifier of the target transaction, wherein the transaction certificate comprises a fund account identifier of the first transaction party and a transaction amount, then, a payment instruction is generated based on the fund account identifier of the first transaction party and the transaction amount, then, the payment instruction is transmitted to a banking system, a payment result returned by the banking system is received, and finally, the payment result is associated with the transaction identifier of the target transaction, and the associated payment result is written into the blockchain. According to the financial settlement system provided by the embodiment of the application, the automatic settlement can be realized by inquiring the pre-stored transaction certificate and generating the payment instruction based on the content of the transaction certificate, so that the settlement efficiency is improved, and the settlement cost is saved. Meanwhile, due to the fact that the blockchain has the characteristics of decentralization and difficult data tampering, the payment result can be ensured to be stored in a plurality of blockchain nodes in a distributed mode by writing the payment result into the blockchain, and the payment result is difficult to tamper.
Based on the same inventive concept, the embodiment of the application also provides an electronic device, which comprises:
At least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a financial settlement method according to embodiments of the application.
The electronic equipment provided by the embodiment of the application firstly receives a settlement request of a first transaction party, wherein the settlement request comprises a blockchain account identifier of the first transaction party and a transaction identifier of a target transaction participated by the first transaction party, then, in response to the settlement request, inquires a transaction certificate of the target transaction in a blockchain according to the transaction identifier of the target transaction, wherein the transaction certificate comprises a fund account identifier of the first transaction party and a transaction amount, then, a payment instruction is generated based on the fund account identifier of the first transaction party and the transaction amount, then, the payment instruction is transmitted to a banking system, a payment result returned by the banking system is received, and finally, the payment result is associated with the transaction identifier of the target transaction, and the associated payment result is written into the blockchain. According to the electronic device provided by the embodiment of the application, the automatic settlement can be realized by inquiring the pre-stored transaction certificate and generating the payment instruction based on the content of the transaction certificate, so that the settlement efficiency is improved, and the settlement cost is saved. Meanwhile, due to the fact that the blockchain has the characteristics of decentralization and difficult data tampering, the payment result can be ensured to be stored in a plurality of blockchain nodes in a distributed mode by writing the payment result into the blockchain, and the payment result is difficult to tamper.
In addition, in order to achieve the above object, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements a financial settlement method of the embodiment of the present application.
The following describes each component of the electronic device in detail:
The processor is a control center of the electronic device, and may be one processor or a collective name of a plurality of processing elements. For example, a processor is one or more central processing units (central processing unit, CPU), but may also be an Application SPECIFIC INTEGRATED Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the invention, such as: one or more microprocessors (DIGITAL SIGNAL processors, DSPs), or one or more field programmable gate arrays (field programmable GATE ARRAY, FPGAs).
In the alternative, the processor may perform various functions of the electronic device by executing or executing software programs stored in memory, and invoking data stored in memory.
The memory is configured to store a software program for executing the scheme of the present invention, and the processor is used to control the execution of the software program, and the specific implementation manner may refer to the above method embodiment, which is not described herein again.
Alternatively, the memory may be read-only memory (ROM) or other type of static storage device that can store static information and instructions, random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-only memory, EEPROM), compact disc read-only memory (compact disc read-only memory) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, without limitation. The memory may be integral with the processor or may exist separately and be coupled to the processor through interface circuitry of the electronic device, as the embodiments of the invention are not limited in detail.
A transceiver for communicating with a network device or with a terminal device.
Alternatively, the transceiver may include a receiver and a transmitter. The receiver is used for realizing the receiving function, and the transmitter is used for realizing the transmitting function.
Alternatively, the transceiver may be integrated with the processor, or may exist separately, and be coupled to the processor through an interface circuit of the router, which is not specifically limited by the embodiment of the present invention.
In addition, the technical effects of the electronic device may refer to the technical effects of the data transmission method described in the foregoing method embodiment, which is not described herein again.
It should be appreciated that the processor in embodiments of the invention may be a central processing unit (central processing unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application Specific Integrated Circuits (ASICs), off-the-shelf programmable gate arrays (field programmable GATE ARRAY, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be appreciated that the memory in embodiments of the present invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an erasable programmable ROM (erasable PROM), an electrically erasable programmable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as external cache memory. By way of example, and not limitation, many forms of random access memory (random access memory, RAM) are available, such as static random access memory (STATIC RAM, SRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (double DATA RATE SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCHLINK DRAM, SLDRAM), and direct memory bus random access memory (direct rambus RAM, DR RAM).
The above embodiments may be implemented in whole or in part by software, hardware (e.g., circuitry), firmware, or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the processes or functions described in accordance with embodiments of the present invention are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more sets of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a solid state disk.
It should be understood that the term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural. In addition, the character "/" herein generally indicates that the associated object is an "or" relationship, but may also indicate an "and/or" relationship, and may be understood by referring to the context.
In the present invention, "at least one" means one or more, and "a plurality" means two or more. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
It should be understood that, in various embodiments of the present invention, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.