CN114398376A - Data processing method and device and readable storage medium - Google Patents

Data processing method and device and readable storage medium Download PDF

Info

Publication number
CN114398376A
CN114398376A CN202210065015.0A CN202210065015A CN114398376A CN 114398376 A CN114398376 A CN 114398376A CN 202210065015 A CN202210065015 A CN 202210065015A CN 114398376 A CN114398376 A CN 114398376A
Authority
CN
China
Prior art keywords
asset
account
message
output
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210065015.0A
Other languages
Chinese (zh)
Inventor
李欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210065015.0A priority Critical patent/CN114398376A/en
Publication of CN114398376A publication Critical patent/CN114398376A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the application discloses a data processing method, data processing equipment and a readable storage medium, and belongs to the field of computers, wherein the method comprises the following steps: storing the business bill information of the target transaction business into an account bill record table; acquiring account assets belonging to a sending account address, acquiring historical output information used for representing the source of the account assets from an asset output record table, and switching the historical output information into an asset used state; setting a transaction state corresponding to the business bill message as a transacted state; generating a target input message according to the updated historical output message and the updated business bill message, and storing the target input message in an asset input record table; and generating a target output message according to the updated service bill message, the asset transfer amount and the received account address, and storing the target output message in an asset output record table. By adopting the method and the device, the storage pressure of the database can be reduced, and meanwhile, the reliability of service accounting can be improved.

Description

Data processing method and device and readable storage medium
The present application is a divisional application of a chinese patent application filed on 09.09.09.2020, having application number 2020109433155 and having application name "a data processing method, apparatus and readable storage medium", the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, device, and readable storage medium.
Background
The digital asset billing system comprises a distributed system, that is, one way to bill the digital asset is to bill in a distributed storage manner. In distributed storage, an account database is typically employed to record asset information under an account name, while an additional digital asset database is employed to record specific information of the digital asset (e.g., record the account to which the digital asset belongs); if the digital asset database is used for recording the specific information of the digital assets, the digital asset database can also record the information of the attribution change of the digital assets, the state change pipelining information of the digital assets, the derivative pipelining information of the digital assets and other related information, as the number of the digital assets increases, the data recorded by the digital asset database also increases, and huge and complex data bring great pressure to the digital asset database. However, if the digital asset database is not used for recording the digital assets, it is likely that one digital asset is repeatedly referenced, resulting in low reliability of distributed transaction accounting.
Disclosure of Invention
The embodiment of the application provides a data processing method, data processing equipment and a readable storage medium, which can reduce the storage pressure of a database and improve the reliability of business accounting.
An embodiment of the present application provides a data processing method, including:
storing the business bill information of the target transaction business into an account bill record table; the target transaction service comprises a sending account address, an asset transfer amount and a receiving account address; the account bill record table has an incidence relation with the asset output record table and the asset input record table;
acquiring account assets belonging to a sending account address, acquiring historical output information for representing asset sources of the account assets from an asset output record table, and switching the historical output information from an asset unused state to an asset used state to obtain updated historical output information;
setting a transaction state corresponding to the business bill information in the bill record table as a transaction state to obtain an updated business bill information;
generating a target input message aiming at the target transaction service according to the updated historical output message and the updated service bill message, and storing the target input message into an asset input record table;
generating a target output message aiming at the target transaction service according to the updated service bill message, the asset transfer amount and the received account address, and storing the target output message into an asset output record table; the targeted output message has an asset unused status.
An embodiment of the present application provides a data processing apparatus, including:
the bill storage module is used for storing the business bill information of the target transaction business into an bill record table; the target transaction service comprises a sending account address, an asset transfer amount and a receiving account address; the account bill record table has an incidence relation with the asset output record table and the asset input record table;
the asset acquisition module is used for acquiring the account assets belonging to the sending account address;
the state switching module is used for acquiring historical output information for representing the asset source of the account asset from the asset output record table, and switching the historical output information from the unused state of the asset to the used state of the asset to obtain updated historical output information;
the transaction state setting module is used for setting the transaction state corresponding to the business bill information in the bill record table to be a transacted state, and obtaining the updated business bill information;
the input record generating module is used for generating a target input message aiming at the target transaction service according to the updated historical output message and the updated service bill message and storing the target input message into an asset input record table;
the output record generating module is used for generating a target output message aiming at the target transaction service according to the updated service bill message, the asset transfer amount and the received account address, and storing the target output message into an asset output record table; the targeted output message has an asset unused status.
Wherein, bill storage module includes:
the number acquisition unit is used for acquiring a transaction number used for representing the target transaction service and generating a bill number of the target service according to the transaction number;
the transaction type obtaining unit is used for obtaining the transaction service type of the target transaction service;
and the bill storage unit is used for generating a business bill message of the target transaction business according to the transaction number, the target business bill number, the asset transfer amount and the transaction business type, and storing the business bill message to the bill record table.
Wherein, the asset acquisition module includes:
the data acquisition unit is used for acquiring a first account database to which the sending account address belongs; the first account database comprises a mapping relation between an account address and an asset; the account address comprises a sending account address;
and the asset acquisition unit is used for acquiring assets which have a mapping relation with the sending account address in the first account database, and taking the assets which have the mapping relation with the sending account address as the account assets belonging to the sending account address.
The business bill number is generated according to the transaction number of the transaction business, and one business bill number corresponds to an output message in the asset output record table;
the input record generation module comprises:
the bill number acquisition unit is used for acquiring a historical service bill number corresponding to the updated historical output message and a target service bill number corresponding to the updated service bill message;
a history sequence number obtaining unit, configured to obtain, in the asset output record table, a history sequence number to which the updated history output message belongs; the historical sequence number is used for representing the index position of the updated historical output message in the asset output record table;
and the input record generating unit is used for generating a target input message aiming at the target transaction service according to the historical service bill number, the target service bill number and the historical serial number.
Wherein, output record generation module includes:
the target number acquiring unit is used for acquiring a target service bill number corresponding to the updated service bill message;
the incremental sequence number generating unit is used for generating an incremental sequence number in the asset output record table;
and the output record generating unit is used for generating a target output message aiming at the target transaction service according to the target service bill number, the incremental serial number, the receiving account address and the asset transfer amount.
Wherein, output record generation unit includes:
the construction rule obtaining subunit is used for obtaining an asset construction rule corresponding to the target transaction service; the asset construction rule is used for defining the construction standard of the asset transfer amount;
the asset construction subunit is used for constructing a target asset corresponding to the asset transfer amount according to the asset construction information corresponding to the asset transfer amount if the asset construction standard of the asset transfer amount is a real-time construction standard;
and the output record generating subunit is used for generating a target output message aiming at the target transaction service according to the target service bill number, the incremental serial number, the receiving account address and the asset information of the target asset.
Wherein, the device still includes:
the construction information acquisition module is used for acquiring asset construction information corresponding to the asset transfer amount if the asset construction standard of the asset transfer amount is a delay construction standard;
and the target output message generation module is used for generating a target output message aiming at the target transaction service according to the target service bill number, the incremental serial number, the received account address and the asset construction information.
Wherein, the device still includes:
and the target asset construction module is used for acquiring a target output message in the asset output record table if the asset construction standard of the asset transfer amount is a delay construction standard, and constructing the target asset corresponding to the asset transfer amount according to the asset construction information in the target output message.
Wherein, the device still includes:
the database acquisition module is used for acquiring a first account database to which the sending account address belongs and a second account database to which the receiving account address belongs; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises a sending account address; the second account database comprises a mapping relation between a second account address and the assets, and the second account address comprises a receiving account address;
the asset state setting module is used for setting the asset state of the account asset to be a used state in the first account database;
and the mapping relation adding module is used for creating a mapping relation between the receiving account address and the target asset and adding the mapping relation between the receiving account address and the target asset into the second account database.
Wherein, the device still includes:
the difference amount acquisition module is used for acquiring the difference asset yield between the total asset amount corresponding to the account asset and the asset transfer amount;
the auxiliary record generating module is used for generating an auxiliary output message aiming at the target transaction business according to the updated business bill message, the difference asset yield and the sending account address, and storing the auxiliary output message to an asset output record table; the dependent outgoing message has an asset unused status.
Wherein, the device still includes:
the differential asset acquisition module is used for acquiring differential assets corresponding to the differential asset output according to the auxiliary output message;
the first database acquisition module is used for acquiring a first account database to which the sending account address belongs; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises a sending account address;
the relation adding module is used for creating a mapping relation between the sending account address and the difference assets and adding the mapping relation between the sending account address and the difference assets to the first account database;
and the state setting module is used for setting the asset state of the differential asset to be an available state in the first account database.
Wherein, the device still includes:
the system comprises a to-be-migrated record acquisition module, a to-be-migrated record generation module and a to-be-migrated record generation module, wherein the to-be-migrated record acquisition module is used for acquiring an output message to be migrated in an asset output record table in a heartbeat cycle; the message to be migrated has an asset used status;
and the record migration module is used for migrating the output message to be migrated, and the input message and the service bill message which are associated with the output message to be migrated to the historical database.
Wherein, the device still includes:
the time range acquisition module is used for acquiring an internal migration time range;
the information acquisition module is used for acquiring the asset transfer amount and the receiving account address contained in the target output message if the recording timestamp of the target output message belongs to the internal transfer time range;
the updating record storage module is used for respectively taking the receiving account address as an updating sending account address and an updating receiving account address, generating an updating service bill message, an updating input message and an updating output message according to the updating sending account address, the asset transfer amount and the updating receiving account address, and storing the updating output message into an asset output record table, the updating service bill message into an account bill record table and the updating input message into an asset input record table; the update output message has an asset unused status;
the asset state switching module is used for switching the target output message from an asset unused state to an asset used state and determining the target output message with the asset used state as an output message to be migrated;
and the message migration module is used for migrating the output message to be migrated, and the input message and the service bill message which are associated with the output message to be migrated to the historical database.
An aspect of an embodiment of the present application provides a computer device, including: a processor and a memory;
the memory stores a computer program that, when executed by the processor, causes the processor to perform the method in the embodiments of the present application.
An aspect of the embodiments of the present application provides a computer-readable storage medium, in which a computer program is stored, where the computer program includes program instructions, and the program instructions, when executed by a processor, perform the method in the embodiments of the present application.
In one aspect of the application, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided by one aspect of the embodiments of the present application.
In the embodiment of the application, for a target transaction service, a service bill message is recorded through an account bill record table, information related to an asset source initiating an account address in the target transaction service is recorded through an asset input record table, information such as a receiving account address and an asset transfer amount in the target transaction service is recorded through an asset output record table, and the asset input record table, the asset output record table and the account bill record table have an association relationship; therefore, for the target transaction service, the asset source of the initiating account address in the target transaction service can be known through the asset input record table, and the destination (receiving account address) of the asset in the target transaction service can be known through the asset output record table, so that the complete asset transfer process is reserved, and the asset transfer path is clearer; and in the asset input record table, the account asset of the initiating account address is switched from the unused state of the asset to the used state, and in the case that the asset is recorded to be in the used state, the asset cannot be referred again, so that the condition of reusing the asset can be controlled. In summary, the method and the device can keep a complete asset transfer process through the account list record table, the asset input record table and the asset output record table, so that an asset transfer path is clearer, the assets can be prevented from being reused in the asset transfer process, the reliability of service accounting can be improved, the process does not depend on digital asset data stored in a digital asset database any more, and therefore the storage pressure of the database can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a diagram of a network architecture provided by an embodiment of the present application;
fig. 2a is a representation of a UTXO data structure provided by an embodiment of the present application;
FIG. 2b is a schematic diagram of accounting for a transfer scenario provided by an embodiment of the application;
FIG. 3 is a schematic view of a scenario provided by an embodiment of the present application;
fig. 4 is a schematic flowchart of a data processing method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of data migration provided by an embodiment of the present application;
FIG. 6 is a flow chart illustrating an asynchronous compensation operation provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in 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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
Referring to fig. 1, fig. 1 is a diagram of a network architecture according to an embodiment of the present disclosure. As shown in fig. 1, the network architecture may include a service server 1000 and a user terminal cluster, which may include one or more user terminals, where the number of user terminals is not limited. As shown in fig. 1, the plurality of user terminals may include a user terminal 100a, a user terminal 100b, a user terminal 100c, …, a user terminal 100 n; as shown in fig. 1, the user terminal 100a, the user terminal 100b, the user terminals 100c, …, and the user terminal 100n may be respectively in network connection with the service server 1000, so that each user terminal may perform data interaction with the service server 1000 through the network connection.
It is understood that each user terminal shown in fig. 1 may be installed with a target application, and when the target application runs in each user terminal, data interaction may be performed between the target application and the service server 1000 shown in fig. 1, respectively, so that the service server 1000 may receive service data from each user terminal. The target application may include an application having a function of displaying data information such as text, images, audio, and video. For example, the application may be a service class application (e.g., an asset service application) that may be used for a user to transact asset related business (e.g., asset transfers, asset storage). The service server 1000 in the present application may obtain service data according to the applications, for example, the service data may be related information of a transaction service (for example, the transaction service is a transfer service, and the transaction service information includes a payee address, an asset transfer amount, and a payer address);
subsequently, the transaction server 1000 may inquire from the asset billing system whether asset a under the payer name has validity (if asset a under the payer name has an asset unused state, asset a under the payer name may be considered to have validity), and if asset a under the payer name has validity, asset a under the payer name may be transferred under the payee name and relevant information of the transaction may be recorded in the asset billing system (at this time, asset a under the payer name already has an asset used state, asset a under the payer name cannot be used any more).
In the embodiment of the present application, one user terminal may be selected from a plurality of user terminals as a target user terminal, and the user terminal may include: smart terminals carrying multimedia data processing functions (e.g., video data playing function, music data playing function), such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart television, a smart speaker, a desktop computer, and a smart watch, but are not limited thereto. For example, the user terminal 100a shown in fig. 1 may be used as the target user terminal in the embodiment of the present application, and the target application may be integrated in the target user terminal, and at this time, the target user terminal may perform data interaction with the service server 1000 through the target application.
For example, when a user uses a target application (such as an asset service application) in a user terminal, the user clicks an asset transfer control in the asset service application, the user terminal can generate and display an asset transfer information filling interface according to the trigger action for the asset transfer control, and the user can fill asset transfer information (for example, information such as a password of the user, an account of a payee, an asset transfer amount, and the like) in the asset transfer information filling interface; then, the user terminal may send the asset transfer information to a service server, and the service server may query from the asset billing system whether the asset under the user name has an asset unused state, and if the asset under the user name has the asset unused state, the service server may transfer the asset under the user name and record the related asset transfer information of the user in the asset billing system.
Optionally, it is understood that the network architecture may include a plurality of service servers, one user terminal may be connected to one service server, and each service server may obtain service data (e.g., information related to a transaction service) in the user terminal connected to the service server, verify validity of the service data, execute a relevant service action (e.g., a transfer service, a payment service, etc.) in the service data when the service data has validity, and perform accounting processing on the service data.
Optionally, it may be understood that the user terminal may also obtain service data (e.g., information related to a transaction), verify validity of the service data, execute a relevant service action (e.g., a transfer service, a payment service, etc.) in the service data when the service data has validity, and perform accounting processing on the service data.
It is understood that the method provided by the embodiment of the present application can be executed by a computer device, including but not limited to a user terminal or a service server. The service server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and an artificial intelligence platform.
The user terminal and the service server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
It will be appreciated that the assets referred to above in figure 1 may refer to digital assets, the asset service application may refer to a digital asset service application, and the asset billing system may refer to a digital asset billing system.
In the embodiment of the present application, data related to a user (such as the above-mentioned data related to the transaction service), such as user information and user data, is acquired and processed after the authority granted by the user is acquired. That is, when embodiments of the present application are applied to a specific product or technology, user permission or consent needs to be obtained, and the collection, use, and handling of relevant data needs to comply with relevant laws and regulations and standards of relevant countries and regions.
The scheme provided by the embodiment of the application is directed to a digital asset accounting system with distributed storage.
The scheme provided by the application is that in a digital asset system with distributed storage, a distributed Transaction of a digital asset accounting service is realized by using an Unspent Transaction Output (UTXO) data structure.
A large business system is often composed of several subsystems, which in turn have separate databases. Often a business process needs to be performed by multiple subsystems together, and these operations may need to be performed in one transaction. At this time, transaction support supporting across databases is realized on the top of the database in a specific way, namely distributed transaction.
To facilitate understanding of the distributed transaction, the following description will take as an example a scenario in which a transaction service, for which only one digital asset (i.e., digital asset 1) is involved, is account a2 in which one digital asset 1 is transferred to account a1 without change. The distributed transaction of the transaction service involves 3 databases, namely the database to which the account a1 belongs, the database to which the digital asset 1 belongs, and the database to which the account a2 belongs, and the sequence of sub-transactions for the transaction service can be as follows:
1. in the database where account a1 resides, transaction TX1 is executed: a record of the digital asset 1 held by the locked account a 1;
2. in the database where the billing is located, transaction TX2 is executed: changing the billing state into payment (assuming that the billing record is added first and then the distributed transaction is started, so as to avoid 'dropping' the bill);
3. in the database where the digital asset 1 is located, a transaction TX3 is executed: change the attribution of the digital asset 1 from account a1 to account a 2;
4. in the database where account a1 resides, transaction TX4 is executed: change the record of digital asset 1 of account a1 from locked to used;
5. in the database where the billing is located, transaction TX5 is executed: changing the bill recording state to the successful payment; the distributed transaction is designed with the billed state as the final result of the transaction;
6. in the database where account a2 resides, transaction TX6 is executed: add a record of digital asset 1 for account a 2; the sub-transaction may be independent of the distributed transaction, i.e., "asynchronous posting.
Through the above 6 sub-transactions, the accounting transaction of the transaction service of transferring one digital asset 1 to account a2 from account a1 can be completed.
A UTXO is a data structure containing transaction data and execution code that can be understood as an encrypted digital asset that a warehouse or an address has received but has not yet been spent. The characteristics that the UTXO possesses include, but are not limited to, the following 6 characteristics:
(1) each UTXO records a payment transaction;
(2) each UTXO consists of a set of inputs (inputs) and a set of outputs (outputs);
(3) according to different transaction types, Input and Output can be null; however, when the transaction type is a payment transaction type or a transfer transaction type, Input and Output must not be null;
(4) each Input must come from an Output, and the elements do not change;
(5) an Output can only be referenced by an Input;
(6) the sum of all Input amounts equals the sum of Output amounts.
According to the above 6 characteristics of the UTXO and the database transaction of the digital asset, the data of a UTXO data structure is stored in one database, that is, the UTXO is partitioned according to the billing dimension of the transaction service, and the Input data, the Output data, and the billing of the UTXO are stored in the same database.
For ease of understanding, please refer to fig. 2a, and fig. 2a is a representation of a UTXO data structure provided by an embodiment of the present application. As shown in fig. 2a, the UTXO data structure includes three record tables, which are an account record table, an Input table, and an Output table. The three record tables are in the same database, and the Input (Input) and the Output (Output) of the same business bill number need to be recorded in one Input table and one Output table respectively.
Wherein, the Input table may record asset source information of payers in a transaction (for example, asset source information under the name of account a 1; the Output table may record asset transfer information of payers in a transaction (for example, recording assets under the name of account a2), each Input needs to refer to an Output (asset source), for example, account a transfers digital asset 3 to account a1, this transaction generates an Output (records digital asset 3 to account a1), account a1 transfers digital asset 3 to account a2, then for account a1, the Input of the transaction is the source of digital asset 3 of account a1, that is, for account a transfers digital asset 3 to account a1, the historical Output generated by the history transaction of account a1, that is, for account a1 transfers digital asset 3 to account a2, account a is referenced to transfer digital asset 3 to account a1, a historical output generated by the historical transaction service.
For ease of understanding, the data recorded in the account record table, the Input table, and the Output table in the UTXO data structure will be described below, respectively:
statement of account statement:
the account record table contains transaction numbers of transaction services, the transaction numbers can be transmitted when an external system calls an accounting system, and the transaction numbers can be used as bases for judging whether transactions are repeated or not.
The bill record table also comprises a business bill number of the transaction business, and the business bill number can be derived from the transaction number, so that the bill database obtained by using the transaction number is the same as the bill database obtained by using the business bill number.
The account record also includes a transaction type of transaction, which may be used to determine whether the input and output are empty. Wherein, if the transaction type is transfer type, payment type, etc., the input and output can not be null, and an asset source (input) of a payer and a payee (output) to which the asset is transferred must be provided; if the transaction type is a deposit type, the input can be null, but the output cannot be null (the output is the amount of the asset deposited by the deposit account); if the transaction is of the cash-out type, the input may not be null (input is an asset under the name of the cash-out account), but the output may be null.
The account record table also includes a total transaction amount that can be used to account for the sum of the amounts in the Input table or the Output table.
Output table description:
the Output table contains the service bill number corresponding to the service bill number in the bill record table. That is, for a transaction service, a service bill number may be generated according to the transaction number of the transaction service, the service bill number may be stored in the bill record table and also stored in the Output table, and the service bill number in the Output table may be set as an external key association, so that the Output table and the bill record table may be associated through the service bill number.
The Output table also contains serial numbers, which can be the identifications of numbers, self-increment sequences, character strings, etc., and the serial numbers and the service bill numbers together form a unique index of the Output message corresponding to the transaction service. The sequence number may be a row sequence number of the Output message recorded in the Output table.
The Output table also contains a payee account number, and the payee account number corresponds to the account address of the payee in the transaction.
The Output table also contains elements of the digital assets, and the element information of the digital assets is recorded according to the asset construction rules of the accounting system, for example, if the asset construction rules are real-time construction rules, the digital asset expression can be recorded in the accounting; and if the asset construction rule is a delay construction rule, necessary information required for generating the digital asset can be recorded in the accounting. The digital asset expression can be a digital form of the digital asset and can be used as a carrier of the digital asset in a software system and interaction; both parties to the transaction, whether it is a value transfer or a value exchange, need to verify the expression and accept the value of the digital asset corresponding to the verified expression. The digital asset expression generally contains information including, but not limited to, ID, issuer, attribution, etc., and the issuer's private key signature.
The Output table also contains the spent service bill number, which may refer to the service bill number of Output where the asset transfer has occurred, for example, account a transfers digital asset 3 to account a1, the transaction service generates an Output (records digital asset 3 under the name of account a1), account a1 transfers digital asset 3 to account a2, the digital asset 3 of account a1 has been transferred, and account a transfers digital asset 3 to account a1, the service bill number corresponding to the Output generated by the transaction service, which is transferred by account a, will be used as the spent service bill number.
Input table states:
the Input table contains a business bill number corresponding to the business bill number in the bill record table. That is to say, for a transaction service, a service bill number may be generated according to the transaction number of the transaction service, the service bill number may be stored in the bill record table and also stored in the Input table, and the service bill number in the Input table may be set as an external key association, so that the Input table and the bill record table may be associated with each other by the service bill number.
The Input table also contains the service bill number of the historical output, which can be the source of the property of the payer in the transaction service because one Input needs to refer to one output in the UTXO data structure. The business bill number of the historical output may also be stored in the Input table.
The Input table further includes the serial numbers of the history outputs, and in order to record the reference relationship between one Input and one output, the serial numbers of the history outputs may also be recorded in the Input table. Therefore, a unique index of the historical output is formed by the service bill number of the historical output and the serial number of the historical output.
The Input table also contains elements of the historical output, where an element may refer to information recorded by the historical output, such as attribution of the historical output (e.g., payer of the current transaction), digital asset elements, etc.
For ease of understanding, please refer to fig. 2b together, and fig. 2b is a schematic diagram of accounting of a transfer scenario provided by an embodiment of the present application. As shown in fig. 2b, for the transaction of account a1 transferring a digital asset 1 to account a2, the relevant information of the transaction is stored in the bill record table, the Input table and the Output table.
As shown in fig. 2b, if "account a1 transfers to account a 2a digital asset 1" the transaction number of the transaction is "011", the transaction number "011" is stored in the account record table; a service bill number "yewu _ b" can be derived from the transaction number "011", and the service bill number "yewu _ b" is also stored in the bill record table; the transaction type of the transaction service of "account a1 transfers to account a 2a digital asset 1" is a transfer type, and the transaction type is also stored in the account record table as a transfer type; at the same time, the total transaction amount is also stored in the invoice record table as digital asset 1.
As shown in fig. 2b, the information about the payer in the transaction "account a1 transfers to account a 2a digital asset 1", i.e. the source information of the digital asset 1 held by account a1 (historical output corresponding to account a1) is stored in the Input table. The Input table may store a service bill number "yewu _ b" corresponding to the current transaction service ("account a1 transfers to account a2 for one digital asset 1"), and may also store a historical service bill number "yewu _ a" corresponding to the historical output, where the historical service bill number "yewu _ a" may be understood as: historical transaction service "account M transfers to account a1 a service billing number corresponding to digital asset 1"; meanwhile, the sequence number of the history Output in the Output table can be acquired as "34", and the sequence number "34" can be stored in the Input table together; meanwhile, information about historical outputs (e.g., account a1 and digital asset 1 held by account a1) may also be stored in the Input table.
As shown in fig. 2b, the Output table stores the related information of the payee in the transaction "account a1 transfers to account a 2a digital asset 1", i.e. adds a record that account a2 holds digital asset 1 (new Output corresponding to account a 2).
The Output table may store the service bill number "yewu _ b" corresponding to the current transaction service ("account a1 transfers to account a2 for one digital asset 1"), and store the newly generated serial number "40"; here, the serial number "40" may be understood that there are 39 Output in the Output table, and the serial number of the new Output corresponding to the account a2 in the Output table is 40; at the same time, the Outpput table may store the account number of the payee (Account A2) and record the elements of the digital asset 1. Meanwhile, after account a1 is transferred to account a2 for digital asset 1, account a1 no longer has digital asset 1, and the historical service bill number "yewu _ a" in the historical output can be set to the used state to represent that the historical output (digital asset 1 held by account a1) has been spent.
As shown in fig. 2b, after account a2 holds digital asset 1, account a2 transfers digital asset 1 to account A3, and for the new transaction, "account a2 transfers digital asset 1 to account A3", the information related to the new transaction is also stored in the bill record table, the Input table, and the Output table.
As shown in fig. 2b, "account a2 transfers to account A3 a digital asset 1" the transaction number of this new transaction is "015", this transaction number "015" will be stored in the invoice record table; a service bill number "yewu _ r" can be derived from the transaction number "015", and the service bill number "yewu _ b" is also stored in the bill record table; the transaction type of the transaction service of "account a1 transfers to account a 2a digital asset 1" is a transfer type, and the transaction type is also stored in the account record table as a transfer type; at the same time, the total transaction amount is also stored in the invoice record table as digital asset 1.
As shown in fig. 2b, the information about the payer in the transaction "account a2 transfers to account A3 a digital asset 1", i.e. the source information of the digital asset 1 held by account a2, is stored in the Input table (the historical output corresponding to account a2, i.e. the output generated by the transaction "account a1 transfers to account a 2a digital asset 1"). That is, the Input table references the information in the output generated by the transaction "Account A1 transfers to Account A2 a digital asset 1" as described above.
The Input table may store a service bill number "yewu _ r" corresponding to the current transaction service ("account a2 transfers to account A3 for one digital asset 1"), and may also store a historical service bill number "yewu _ b" corresponding to the historical output, where the historical service bill number "yewu _ b" is a service bill number corresponding to the output generated by the transaction service "account a1 transfers to account a2 for one digital asset 1"; meanwhile, the sequence number of the history Output in the Output table can be acquired as "40", and the sequence number "40" can be stored in the Input table together; meanwhile, information about historical outputs (e.g., account a2 and digital asset 1 held by account a2) may also be stored in the Input table.
As shown in fig. 2b, the Output table stores the related information of the payee in the transaction "account a2 transfers to account A3 a digital asset 1", i.e. adds a record that account A3 holds digital asset 1 (new Output corresponding to account A3). The Output table may store a service bill number "yewu _ r" corresponding to the current transaction service ("account a2 transfers to account A3 for one digital asset 1"), and store a newly generated serial number "45"; here, the serial number "45" may be understood that 44 outputs exist in the Output table, and the serial number of the new Output corresponding to the account a3 in the Output table is 45.
At the same time, the Outpput table may store the account number of the payee (Account A3) and record the elements of the digital asset 1. Meanwhile, since the account a2 no longer has digital asset 1 after account a2 is transferred to account A3 for digital asset 1, the historical service bill number "yewu _ b" in the output generated by "account a1 is transferred to account a2 for digital asset 1" can be set to the used state to represent that the output (digital asset 1 held by account a2) has been spent.
It should be appreciated that in the newly generated output, the business bill number "yewu _ r" has not yet been spent, has an unused state, and can be used for subsequent references to the Input table. If this output is subsequently referenced (account a3 transfers to another account for a digital asset 1), the service bill number "yewu _ r" in this output will also be set to the used state, and when the state is the used state, this output cannot be referenced again.
For easy understanding, please refer to fig. 3, and fig. 3 is a schematic view of a scenario provided by an embodiment of the present application. The service server shown in fig. 3 may be the service server 1000 shown in fig. 1, and the user terminal a1 shown in fig. 3 may be any user terminal selected from the user terminal cluster in the embodiment corresponding to fig. 1, for example, the user terminal may be the user terminal 100 b; the user terminal a2 shown in fig. 3 may be any user terminal selected from the user terminal cluster of the embodiment shown in fig. 1, for example, the user terminal may be the user terminal 100 a.
The transaction service transfers a digital asset 2 to the account a2 for the account a1, and if the value of the digital asset 1 under the name of the account a1 is greater than the value of the digital asset 2, a digital asset 3 (a difference digital asset between the digital asset 1 and the digital asset 2) is generated, and the transaction service scenario is a change scenario.
As shown in fig. 3, account a1 may initiate an asset transfer request (transfer a digital asset 2 to account a2) to a service server through a user terminal a1, and after receiving the asset transfer request, the service server may query the digital asset accounting system whether the asset under account a1 (digital asset 1) is valid, and if the digital asset 1 under account a1 has an asset used state, it may determine that the digital asset 1 under account a1 is not valid; if the digital asset 1 under the account a1 has an asset unused status, it can be determined that the digital asset 1 under the account a1 has validity.
When digital asset 1 under account a1 is valid, digital asset 2 may be added under account a2 and digital asset 3 may be added under account a 1. At the same time, the business server can switch the digital asset 1 under account a1 in the digital asset billing system from the asset unused state to the asset used state, so that it is no longer valid, and thus in the subsequent flow, the digital asset 1 under account a1 is not allowed to be used again. It should be appreciated that the service server may record service information related to the transaction service (account a1 transfers a digital asset 2 to account a2) in the digital asset billing system.
The digital asset billing system includes a database in which an account a1 is located, a database in which the account a2 is located, and a UTXO database (including an Input table, an invoice record table, and an Output table), and a specific flow for a service server to record, in the digital asset billing system, related service information of the transaction service (transferring one digital asset 2 from the account a1 to the account a2) may include the following 3 steps:
1. in the database where account a1 resides, transaction TX1 is executed: locking the digital asset 1 record held by account a 1;
2. acquiring a history output corresponding to the digital asset 1 held by the account a1 (asset source information of the digital asset 1 of the account a1), acquiring an account record table to which the history output belongs, and executing an transaction TX2 in a database in which the account record table to which the history output belongs: updating the "billed service billing number" in the Output table, it should be understood that updating the "billed service billing number" in the Output table herein may refer to switching the historical Output from the asset unused state to the asset used state. That is, the digital asset 1 under the name of the account a1 is switched from the asset unused state to the asset used state, so that it is no longer valid.
3. In the database where this account record table is located, a transaction TX3 is executed: and setting the transaction state corresponding to the service bill message (including the information of the transaction number, the service bill number, the transaction type being the transfer type and the like corresponding to the transaction service) corresponding to the transaction service as a transacted state (a transfer success state), and recording UTXO data.
Wherein, the UTXO data includes data (service bill number, serial number and related elements of the historical output) related to the historical output (asset source information of the digital asset 1) stored in the Input table; storing the related data (the service bill number corresponding to the transaction service, the newly generated serial number 1, the account number of the account A2 and the elements of the digital asset 2) of the new Output1 (the digital asset 2 is added to the account A2) generated by the transaction service into an Output table; the data (the service bill number corresponding to the transaction service, the newly generated serial number 2, the account number of the account a1, and the elements of the digital asset 3) related to the new Output2 (the digital asset 3 is added to the account a1) generated by the transaction service is stored in the Output table.
If the asset construction rule corresponding to the digital asset accounting system is a rule for constructing assets in real time, before recording UTXO data, constructing digital assets 2 and 3, and after the construction is completed, respectively recording the information of the digital assets 2 and 3 in an Output table; if the asset construction rule corresponding to the digital asset accounting system is a rule for constructing the asset in a delayed manner, necessary information required for generating the digital asset can be recorded in the process of recording the UTXO data.
It should be appreciated that to shorten the sub-transaction sequence of the distributed transaction, the present application may utilize the digital asset 2 and digital asset 3 related information recorded in the UTXO database to asynchronously process the related sub-transactions of both digital asset 2 and digital asset 3. Namely, the above steps 1 to 3 complete the distributed transaction, and the following steps will perform asynchronous compensation processing:
4. and (5) asynchronous compensation processing.
a. If the digital assets 2 and 3 belong to delayed construction (the elements of the digital assets recorded in the Output table are necessary information for constructing the digital assets), the digital assets 2 and 3 can be generated according to the necessary information of construction recorded in the Output table.
b. In the database where account a1 resides, the digital asset 1 record for account a1 is changed from locked to used and inserted into the digital asset 3 record for account a1, setting the status of digital asset 3 to available.
c. In the database where account a2 resides, the digital asset 2 record for account a2 is added.
It should be appreciated that in a distributed storage digital asset accounting system, using the UTXO data structure, the entire asset transfer process can be preserved using the UTXO data structure without using a separate database of digital assets, making the asset transfer path clearer and reducing the data required by the separate digital asset database; and in the UTXO database in the digital asset accounting system, the account asset (e.g., digital asset 1) of the payer (e.g., account a1) is switched from an unused state to a used state of the asset, which is not re-referenced in the event that the asset is recorded as a used state, so that the reuse of the asset can be controlled.
Further, please refer to fig. 4, where fig. 4 is a schematic flowchart of a data processing method according to an embodiment of the present application. The method may be executed by a user terminal (e.g., the user terminal shown in fig. 1 and fig. 3) or a service server (e.g., the service server 1000 shown in fig. 1), or may be executed by both the user terminal and the service server (e.g., the service server 1000 in the embodiment corresponding to fig. 1). For ease of understanding, the present embodiment is described by taking the method as an example, where the method is executed by the service server. Wherein, the data processing method at least comprises the following steps S101-S105:
step S101, storing a service bill message of a target transaction service into an account bill record table; the target transaction service comprises a sending account address, an asset transfer amount and a receiving account address; the account sheet record table has an association relation with the asset output record table and the asset input record table.
In this application, the asset may refer to a digital asset, the invoice record table may correspond to the invoice record table of the UTXO database shown in the embodiment corresponding to fig. 2a, the asset Input record table may correspond to the Input table of the UTXO database shown in the embodiment corresponding to fig. 2a, and the asset Output record table may correspond to the Output table of the UTXO database shown in the embodiment corresponding to fig. 2 a.
Each transaction service has a transaction number, a service bill number of the transaction service can be generated according to the transaction number, and a target service bill number can be generated according to the transaction number of the target transaction service. The transaction number of the target transaction service and the bill number of the target transaction service can be obtained, and the transaction service type (such as transfer type, payment type, storage type, withdrawal type and the like) to which the target transaction service belongs can also be obtained; and generating a business bill message of the target transaction business according to the transaction number, the target business bill number, the asset transfer amount and the transaction business type, and storing the business bill message into an bill record table.
Step S102, account assets belonging to the sending account address are obtained, historical output information used for representing asset sources of the account assets is obtained from the asset output record table, the historical output information is switched from an asset unused state to an asset used state, and the updated historical output information is obtained.
In the application, a first account database to which the sending account address belongs can be acquired; wherein, the first account database comprises the mapping relation between the account address and the asset; the account address includes the sending account address; subsequently, the asset having the mapping relationship with the sending account address may be acquired in the first account database, and the asset having the mapping relationship with the sending account address may be taken as the account asset belonging to the sending account address.
It should be understood that the sending account address may correspond to the account address of account a1 in the embodiment described above in connection with fig. 3, that the account asset may refer to digital asset 1 under the name of account a1, and that obtaining the account asset belonging to the sending account address may refer to step 1 in the embodiment shown in fig. 3: in the database where account a1 resides, transaction TX1 is executed: the digital asset 1 record held by the account a1 is locked.
Further, historical output information used for representing the asset source of the account asset can be obtained from the asset output record table, and the historical output information is switched from the asset unused state to the asset used state, so that updated historical output information is obtained.
It should be understood that this step may correspond to step 2 in the embodiment corresponding to fig. 3: acquiring historical Output (asset source information of digital asset 1 of account a1) corresponding to digital asset 1 held by account a1 from an Output table, acquiring an account record table to which the historical Output belongs, and executing an transaction TX2 in a database in which the account record table to which the historical Output belongs: update the "billed service billing number" in the Output table. That is, because the digital asset 1 of the account a1 has been transferred, the digital asset 1 no longer exists under the account a1 name, and the digital asset 1 under the account a1 name can be characterized to no longer have validity by changing the historical output characterizing the digital asset 1 under the account a1 name from the asset unused state to the asset used state.
And step S103, setting the transaction state corresponding to the business bill information in the bill record table to be a transaction state, and obtaining the updated business bill information.
In the present application, the traded state may correspond to a transaction service type, for example, if the transaction service type is a transfer type, the traded state may be a transfer success state; if the transaction service type is a payment type, the transacted state may be a payment success state.
Setting the transaction state corresponding to the service billing message in the billing record table to be the transacted state may correspond to step 3 in the embodiment corresponding to fig. 3: in the database where this account record table is located, a transaction TX3 is executed: and setting the transaction state corresponding to the business bill message corresponding to the transaction business to be a transacted state (a transfer success state).
And step S104, generating a target input message aiming at the target transaction service according to the updated historical output message and the updated service bill message, and storing the target input message into an asset input record table.
In the application, the bill record table and the asset output record table can be associated through the service bill number, and one service bill number corresponds to one output message in one asset output record table. For example, a historical service bill number of a historical service bill message may exist in a historical output message in the asset output record table, and the bill record table may be associated with the asset output record table through the historical service bill number, and through the historical service bill number, the historical service bill message in the bill record table may be acquired, and the historical output message in the bill record table may also be acquired.
Because one service bill number corresponds to one output message, the specific method for generating the target input message may be to obtain the historical service bill number corresponding to the updated historical output message and the target service bill number corresponding to the updated service bill message; in the asset output record table, the history serial number to which the updated history output message belongs can be acquired; wherein, the historical sequence number is used for representing the index position of the updated historical output message in the asset output record table; a target input message for the target transaction service may be generated based on the historical service bill number, the target service bill number, and the historical sequence number.
It should be appreciated that the process of generating a target input message and storing the target input message to the asset input record table may correspond to step 3 in the embodiment corresponding to FIG. 3 described above: the data (the service bill number, serial number and related elements of the historical output) related to the historical output (the asset source information of the digital asset 1) is stored in the Input table.
Step S105, generating a target output message aiming at the target transaction service according to the updated service bill message, the asset transfer amount and the received account address, and storing the target output message into an asset output record table; the targeted output message has an asset unused status.
In the application, the target service bill number corresponding to the updated service bill message can be obtained; generating an incremental sequence number in the asset output record table; a target output message for the target transaction service may then be generated based on the target service bill number, the incremented serial number, the receiving account address, and the asset transfer amount.
It can be understood that the asset construction rule corresponding to the target transaction service may be obtained; wherein the asset construction rules may be used to specify construction criteria for the asset transfer amount; if the asset construction rule is a real-time construction rule, the asset construction standard is a real-time construction standard, and a specific method for generating a target output message for the target transaction service according to the target service bill number, the incremental serial number, the receiving account address and the asset transfer amount is as follows: and constructing the target asset corresponding to the asset transfer amount according to the asset construction information corresponding to the asset transfer amount. If the asset construction rule is a delay construction rule, the asset construction standard is a delay construction standard, the asset construction information corresponding to the asset transfer amount can be acquired, and the target output message for the target transaction service is generated according to the target service bill number, the incremental serial number, the receiving account address and the asset construction information.
Alternatively, it is understood that if the asset amount mapped by the sending account address is greater than the asset transfer amount, for example, in the embodiment corresponding to fig. 3, the digital asset owned by account a1 is digital asset 1, the digital asset transferred to account a2 is digital asset 2, and the value of digital asset 1 is greater than that of digital asset 2. In this case, a differential asset is generated, an affiliated output message may be generated based on the differential asset and stored in the asset output record table.
The specific method may be that the difference asset yield between the total asset amount corresponding to the account asset and the asset transfer amount may be obtained; generating an auxiliary output message aiming at the target transaction service according to the updated service bill message, the differential asset yield and the sending account address, and storing the auxiliary output message into an asset output record table; wherein the adjunct output message has the asset unused status.
It should be understood that when the asset amount mapped by the sending account address is greater than the asset transfer amount, when the service billing message is generated in the above step S101, the service billing message is generated not according to the asset transfer amount, but according to the asset amount mapped by the sending account address (for example, the value of the digital asset 1 of the account a1), that is, the total asset amount of the payer (sending account address) in each transaction is recorded in the billing table. The total asset amount may be used to account for the sum of the amounts of the asset Input record table (Input table) and the asset Output record table (Output table).
For example, taking the case that the transaction service in the embodiment corresponding to fig. 3 is account a1 and is transferred to account a2 for one digital asset 2, the total transaction amount contained in the service billing message recorded in the bill record table is the value of digital asset 1, the digital asset element contained in the target output message recorded in the asset output record table includes the value of digital asset 2, and the digital asset element contained in the auxiliary output message recorded in the asset output record table includes the value of digital asset 3 (difference digital asset); since the sum of the values for digital asset 2 and digital asset 3 is the value for digital asset 1, it can be determined that the accounting of the asset output record table is error-free.
Optionally, it may be understood that, because a digital asset under an account name is invalidated when it is spent (corresponding to an output message that is in an asset used state), in order to make the invalidated digital asset not occupy the memory in the asset output record table, the output message with the asset used state in the asset output record table may be migrated according to time, so that the output message with the asset unused state is recorded in the asset output record table.
The specific migration method may be that, within a heartbeat cycle, the output message to be migrated in the asset output record table may be acquired; wherein the output message to be migrated has a used status of the asset; subsequently, the output message to be migrated and the input message and the service billing message associated with the output message to be migrated can be migrated to the historical database.
The specific migration method may also be, for example, described below with the migration target output message as an example, and the internal migration time range may be obtained; if the record timestamp of the target output message belongs to the internal migration time range, the asset transfer amount and the receiving account address contained in the target output message can be acquired; the receiving account address can be respectively used as an updating account address and an updating receiving account address, and according to the updating sending account address, the asset transfer amount and the updating account address, an updating service bill message, an updating input message and an updating output message are generated, the updating service bill message is stored in an bill record table, the updating input message is stored in an asset input record table, and the updating output message is stored in an asset output record table; wherein the update output message has an unused state;
subsequently, the target output message can be switched from the asset unused state to an asset used state, and the target output message with the asset used state is determined as the output message to be migrated; the outgoing message to be migrated and the incoming message and service billing message associated with the outgoing message to be migrated may then be migrated to a historical database.
It should be appreciated that if the digital asset accounting system is time sensitive, an outgoing message (e.g., a target outgoing message) having an asset unused status in the asset output record table may be internally transferred, i.e., its asset status is changed from an asset unused status to an asset used status, and an updated outgoing message having an asset unused status is generated, and then the outgoing message having an asset used status may be migrated to the historian.
For ease of understanding, please refer to fig. 5 together, and fig. 5 is a schematic diagram of data migration according to an embodiment of the present application. The method includes setting a migration time for an Output message in a UTXO data structure (Output table), acquiring an asset state of the Output message in the asset Output record table once the migration time is reached, and taking the Output message with the asset used state as an Output message to be migrated if the asset state of the Output message is an asset used state, and migrating the Output message to be migrated and an Input message (included in the Input table) and a service billing message (included in the billing record table) associated with the Output message to be migrated to a history database.
As shown in fig. 5, if the migration time is once every 10 minutes, the asset status of the output message may be obtained in the UTXO data structure when the migration time is reached.
Wherein, the asset output table of the UTXO data structure comprises an output message 1, an output message 2, an output message 3, an output message 4 and an output message 5; the asset state of the output message 1 is the used asset state, the asset state of the output message 2 is the used asset state, the asset state of the output message 3 is the unused asset state, the asset state of the output message 4 is the used asset state, and the asset state of the output message 5 is the used asset state. Then outgoing message 1 with the asset used status, outgoing record 2, outgoing message 4, and outgoing message 5 may be migrated to the history database.
It should be appreciated that an outgoing message 3 with an unused status of the asset may be internally transferred so that a new output (outgoing message) may be generated, and the outgoing message 3 may become a spent outgoing message, the spent outgoing message 3 may be migrated to the history database and stored in the asset output table in the UTXO data structure.
As shown in fig. 5, if the account corresponding to the output message is the account M, that is, the account number of the recipient recorded in the output message is the account number of the account M, the digital asset recorded in the output message may be internally transferred, that is, the digital asset may be transferred from the account M to the account M, so that the output message 3 may become spent (the asset status is the asset used status), and a new output message (the output message 6 shown in fig. 5) may also be generated. The output message 3 with the asset used status may then be migrated to a historical database, and the resulting new output message 6 stored in the asset output record table in the UTXO data structure.
The output message is migrated, and the output message stored in the UTXO data structure is output message 6, and the remaining output messages (including output message 1, output message 2, output message 3, output message 4, and output message 5) are all migrated to the history database.
In the embodiment of the application, for a target transaction service, a service bill message is recorded through an account bill record table, information related to an asset source initiating an account address in the target transaction service is recorded through an asset input record table, information such as a receiving account address and an asset transfer amount in the target transaction service is recorded through an asset output record table, and the asset input record table, the asset output record table and the account bill record table have an association relationship; therefore, for the target transaction service, the asset source of the initiating account address in the target transaction service can be known through the asset input record table, and the destination (receiving account address) of the asset in the target transaction service can be known through the asset output record table, so that the complete asset transfer process is reserved, and the asset transfer path is clearer; in the asset input record table, the account asset initiating the account address is switched from an asset unused state to a used state, and under the condition that the asset is recorded as the used state, the asset cannot be referred again, so that the condition that the asset is repeatedly used can be controlled; and the process of using the UTXO data structure to carry out failure processing is simplified, and the failed digital assets only need to be transferred according to time, so that a large amount of data storage space can be saved. In summary, the method can keep a complete asset transfer process through the account bill record table, the asset input record table and the asset output record table, so that an asset transfer path is clearer, and in the asset transfer process, assets can be controlled to be reused, so that the reliability of service accounting can be improved, and the process does not depend on digital asset data stored in a digital asset database any more, so that the storage pressure of the database can be reduced; meanwhile, the failure processing flow is simplified, and the data storage space is saved.
It should be appreciated that after storing information (a transaction billing message, an asset input message, and an asset output message) related to a target transaction service in a digital asset billing system (including a billing table, an asset input record table, and an asset output record table), an asynchronous compensation operation may be performed based on the information recorded in the digital asset billing system.
For ease of understanding, please refer to fig. 6, fig. 6 is a schematic flowchart of an asynchronous compensation operation provided by an embodiment of the present application. As shown in fig. 6, the process may include:
step S201, a first account database to which the sending account address belongs is obtained, and a second account database to which the receiving account address belongs is obtained; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises a sending account address; the second account database includes a mapping relationship between a second account address and the asset, and the second account address includes a receiving account address.
Step S202, in the first account database, the asset status of the account asset is set to be used.
In the present application, the process from step S201 to step S202 may correspond to step 4 in the embodiment corresponding to fig. 3: and (5) asynchronous compensation processing. In the database where account a1 resides, the digital asset 1 record for account a1 is changed from locked to used.
It should be noted that, if the asset amount of the sending account address is greater than the asset transfer amount in the transaction service, a record of the differential asset needs to be added to the first account database.
The specific method may be that, according to the dependent output message (dependent output message corresponding to the amount of the differential asset) in the embodiment corresponding to fig. 4, the differential asset corresponding to the amount of the differential asset may be acquired; subsequently, a first account database to which the sending account address belongs may be acquired; wherein, the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises the sending account address; a mapping between the sending account address and the differential asset may be created and added to the first account database; the asset status of the differencing asset may then be set to an available status in the first account database.
The method for acquiring the differential asset according to the dependent output message may be the same as the method for acquiring the target asset according to the target output message, and the method for acquiring the target asset may be the method for acquiring the target asset, in which if the asset information of the target asset is included in the target output message, the target asset may be acquired according to the asset information.
If the asset construction standard of the asset transfer amount corresponding to the target transaction service in the embodiment corresponding to fig. 4 is the delay construction standard, the asset construction information included in the target output message is the asset construction information, the target output message may be obtained in the asset output record table, and the target asset corresponding to the asset transfer amount may be constructed according to the asset construction information. Similarly, for obtaining the differential asset, if the asset information of the differential asset is included in the dependent output message, the differential asset may be obtained according to the asset information, and if the asset construction information of the differential asset is included in the dependent output message, the differential asset may be constructed according to the asset construction information.
The asset status of the differencing asset may then be set to an available status in the first account database.
Step S203, creating a mapping relationship between the receiving account address and the target asset, and adding the mapping relationship between the receiving account address and the target asset to the second account database.
In the present application, it should be understood that steps S201-S202 may correspond to the asynchronous compensation process of step 4 in the embodiment corresponding to fig. 3 described above, the difference asset corresponding to digital asset 3, the asset transfer amount corresponding to the value of digital asset 2, and the account asset transmitting the account address corresponding to digital asset 1. Creating a mapping between the receiving account address and the target asset, adding the mapping between the receiving account address and the target asset to the second account database may correspond to: in the database where account a2 resides, the digital asset 2 record for account a2 is added. Setting the asset status of the differencing asset to an available status in the first account database may correspond to: in the database where account a1 is located, a record of digital asset 3 for account a1 is inserted, setting the status of digital asset 3 to an available status.
In the embodiment of the application, through the record information in the account list record table, the asset output record table and the asset input record table, all related sub-transactions of the digital asset (for example, sub-transactions for adding the digital asset into a database) can be processed asynchronously, and the sub-transaction sequence in the distributed transaction can be shortened.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure. As shown in fig. 7, the data processing apparatus may be a computer program (including program code) running on a computer device, for example, the data processing apparatus is an application software; the data processing apparatus may be adapted to perform the method illustrated in fig. 4. As shown in fig. 7, the data processing apparatus 1 may include: a bill storage module 11, an asset acquisition module 12, a state switching module 13, a transaction state setting module 14, an input record generation module 15, and an output record generation module 16.
The bill storage module 11 is configured to store a service bill message of the target transaction service into an bill record table; the target transaction service comprises a sending account address, an asset transfer amount and a receiving account address; the account bill record table has an incidence relation with the asset output record table and the asset input record table;
an asset acquisition module 12 for acquiring an account asset belonging to the sending account address;
the state switching module 13 is configured to acquire a historical output message used for representing an asset source of the account asset from the asset output record table, and switch the historical output message from an asset unused state to an asset used state to obtain an updated historical output message;
the transaction state setting module 14 is configured to set a transaction state corresponding to the service bill message in the bill record table to a transacted state, so as to obtain an updated service bill message;
an input record generating module 15, configured to generate a target input message for the target transaction service according to the updated historical output message and the updated service bill message, and store the target input message in an asset input record table;
an output record generating module 16, configured to generate a target output message for the target transaction service according to the updated service bill message, the asset transfer amount, and the received account address, and store the target output message in an asset output record table; the targeted output message has an asset unused status.
For a specific implementation manner of the bill storage module 11, the asset acquisition module 12, the state switching module 13, the transaction state setting module 14, the input record generation module 15, and the output record generation module 16, reference may be made to the description of steps S101 to S105 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 7, the bill storage module 11 may include: a number acquisition unit 111, a transaction type acquisition unit 112, and a bill storage unit 113.
A number obtaining unit 111, configured to obtain a transaction number used for representing a target transaction service, and generate a target service bill number according to the transaction number;
a transaction type obtaining unit 112, configured to obtain a transaction service type to which the target transaction service belongs;
and the bill storage unit 113 is configured to generate a service bill message of the target transaction service according to the transaction number, the target service bill number, the asset transfer amount, and the transaction service type, and store the service bill message in the bill record table.
For specific implementation of the number obtaining unit 111, the transaction type obtaining unit 112, and the bill storage unit 113, reference may be made to the description in step S101 in the embodiment corresponding to fig. 4, and details will not be repeated here.
Referring to fig. 7, the asset acquisition module 12 may include: a data acquisition unit 121 and an asset acquisition unit 122.
A data obtaining unit 121, configured to obtain a first account database to which the sending account address belongs; the first account database comprises a mapping relation between an account address and an asset; the account address comprises a sending account address;
and the asset acquiring unit 122 is configured to acquire, in the first account database, an asset having a mapping relationship with the sending account address, and use the asset having the mapping relationship with the sending account address as an account asset belonging to the sending account address.
For specific implementation of the data obtaining unit 121 and the asset obtaining unit 122, reference may be made to the description in step S102 in the embodiment corresponding to fig. 4, and details are not repeated here.
The business bill number is generated according to the transaction number of the transaction business, and one business bill number corresponds to an output message in the asset output record table;
referring to fig. 7, the input record generating module 15 may include: a bill number acquisition unit 151, a history number acquisition unit 152, and an input record generation unit 153.
A bill number obtaining unit 151, configured to obtain a historical service bill number corresponding to the updated historical output message and a target service bill number corresponding to the updated service bill message;
a history sequence number obtaining unit 152, configured to obtain, in the asset output record table, a history sequence number to which the updated history output message belongs; the historical sequence number is used for representing the index position of the updated historical output message in the asset output record table;
and an input record generating unit 153, configured to generate a target input message for the target transaction service according to the historical service bill number, the target service bill number, and the historical serial number.
For a specific implementation manner of the bill number obtaining unit 151, the history serial number obtaining unit 152, and the input record generating unit 153, reference may be made to the description in step S104 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 7, the output record generating module 16 may include: a target number acquisition unit 161, an increment number generation unit 162, and an output record generation unit 163.
A target number obtaining unit 161, configured to obtain a target service bill number corresponding to the updated service bill message;
an incremental sequence number generation unit 162 configured to generate an incremental sequence number in the asset output record table;
and the output record generating unit 163 is configured to generate a target output message for the target transaction service according to the target service bill number, the incremental serial number, the receiving account address, and the asset transfer amount.
For a specific implementation manner of the target number obtaining unit 161, the increment number generating unit 162, and the output record generating unit 163, reference may be made to the description in step S105 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 7, the output record generating unit 163 may include: a build rule acquisition subunit 1631, an asset building subunit 1632, and an output record generation subunit 1633.
A construction rule obtaining subunit 1631, configured to obtain an asset construction rule corresponding to the target transaction service; the asset construction rule is used for defining the construction standard of the asset transfer amount;
an asset construction subunit 1632, configured to, if the asset construction standard of the asset transfer amount is the real-time construction standard, construct, according to the asset construction information corresponding to the asset transfer amount, a target asset corresponding to the asset transfer amount;
and an output record generating subunit 1633, configured to generate a target output message for the target transaction service according to the target service bill number, the incremented serial number, the receiving account address, and the asset information of the target asset.
For a specific implementation manner of the construction rule obtaining subunit 1631, the asset construction subunit 1632, and the output record generating subunit 1633, reference may be made to the description in step S105 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 7, the data processing apparatus 1 may further include: a construction information acquisition module 17 and a target output message generation module 18.
A construction information obtaining module 17, configured to obtain asset construction information corresponding to the asset transfer amount if the asset construction standard of the asset transfer amount is a delay construction standard;
and the target output message generation module 18 is configured to generate a target output message for the target transaction service according to the target service bill number, the incremental serial number, the receiving account address, and the asset construction information.
The specific implementation manner of the construction information obtaining module 17 and the target output message generating module 18 may refer to the description in step S105 in the embodiment corresponding to fig. 4, and will not be described herein again.
Referring to fig. 7, the data processing apparatus 1 may further include: target asset construction module 19.
And the target asset construction module 19 is configured to, if the asset construction standard of the asset transfer amount is the delay construction standard, acquire the target output message in the asset output record table, and construct the target asset corresponding to the asset transfer amount according to the asset construction information in the target output message.
The specific implementation manner of the target asset construction module 19 may refer to the description of step S202 in the embodiment corresponding to fig. 6, and will not be described herein again.
Referring to fig. 7, the data processing apparatus 1 may further include: a database acquisition module 20, an asset status setting module 21, and a mapping relation adding module 22.
A database obtaining module 20, configured to obtain a first account database to which the sending account address belongs, and a second account database to which the receiving account address belongs; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises a sending account address; the second account database comprises a mapping relation between a second account address and the assets, and the second account address comprises a receiving account address;
an asset status setting module 21, configured to set an asset status of an account asset to a used status in the first account database;
and the mapping relation adding module 22 is configured to create a mapping relation between the receiving account address and the target asset, and add the mapping relation between the receiving account address and the target asset to the second account database.
For a specific implementation manner of the database obtaining module 20, the asset state setting module 21, and the mapping relation adding module 22, reference may be made to the descriptions of step S201 to step S203 in the embodiment corresponding to fig. 6, which will not be described herein again.
Referring to fig. 7, the data processing apparatus 1 may further include: a difference amount acquisition module 23 and an auxiliary record generation module 24.
A difference amount obtaining module 23, configured to obtain a difference asset amount between the total asset amount corresponding to the account asset and the asset transfer amount;
an auxiliary record generating module 24, configured to generate an auxiliary output message for the target transaction service according to the updated service bill message, the difference asset yield, and the sending account address, and store the auxiliary output message in an asset output record table; the dependent outgoing message has an asset unused status.
For a specific implementation manner of the difference obtaining module 23 and the auxiliary record generating module 24, reference may be made to the description of generating the auxiliary output message in step S105 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 7, the data processing apparatus 1 may further include: a difference asset acquisition module 25, a first database acquisition module 26, a relationship addition module 27, and a status setting module 28.
A difference asset obtaining module 25, configured to obtain, according to the attached output message, a difference asset corresponding to the difference asset production amount;
a first database obtaining module 26, configured to obtain a first account database to which the sending account address belongs; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises a sending account address;
a relationship adding module 27, configured to create a mapping relationship between the sending account address and the difference asset, and add the mapping relationship between the sending account address and the difference asset to the first account database;
a status setting module 28 for setting the asset status of the differencing asset to an available status in the first account database.
For a specific implementation manner of the difference asset obtaining module 25, the first database obtaining module 26, the relationship adding module 27, and the state setting module 28, reference may be made to the description of step S202 in the embodiment corresponding to fig. 6, and details will not be described here.
Referring to fig. 7, the data processing apparatus 1 may further include: a record to be migrated acquisition module 29 and a record migration module 30.
A to-be-migrated record obtaining module 29, configured to obtain, in the heartbeat cycle, an to-be-migrated output message in the asset output record table; the message to be migrated has an asset used status;
and the record migration module 30 is configured to migrate the output message to be migrated and the input message and the service billing message associated with the output message to be migrated to the historical database.
For a specific implementation manner of the to-be-migrated record obtaining module 29 and the record migration module 30, reference may be made to the description in step S105 in the embodiment corresponding to fig. 4, which will not be described herein again.
Referring to fig. 7, the data processing apparatus 1 may further include: a time range acquisition module 31, an information acquisition module 32, an update record storage module 33, an asset status switching module 34, and a message migration module 35.
A time range obtaining module 31, configured to obtain an internal migration time range;
the information acquisition module 32 is configured to acquire an asset transfer amount and a receiving account address included in the target output message if the record timestamp of the target output message belongs to the internal migration time range;
an update record storage module 33, configured to use the receiving account address as an update sending account address and an update receiving account address, respectively, generate an update service billing message, an update input message, and an update output message according to the update sending account address, the asset transfer amount, and the update receiving account address, store the update output message in the asset output record table, store the update service billing message in the billing record table, and store the update input message in the asset input record table; the update output message has an asset unused status;
the asset state switching module 34 is configured to switch the target output message from an asset unused state to an asset used state, and determine the target output message having the asset used state as the output message to be migrated;
and the message migration module 35 is configured to migrate the output message to be migrated and the input message and the service billing message associated with the output message to be migrated to the historical database.
For specific implementation manners of the time range obtaining module 31, the information obtaining module 32, the update record storage module 33, the asset state switching module 34, and the message migration module 35, reference may be made to the description in step S105 in the embodiment corresponding to fig. 4, which will not be described herein again.
In the embodiment of the application, for a target transaction service, a service bill message is recorded through an account bill record table, information related to an asset source initiating an account address in the target transaction service is recorded through an asset input record table, information such as a receiving account address and an asset transfer amount in the target transaction service is recorded through an asset output record table, and the asset input record table, the asset output record table and the account bill record table have an association relationship; therefore, for the target transaction service, the asset source of the initiating account address in the target transaction service can be known through the asset input record table, and the destination (receiving account address) of the asset in the target transaction service can be known through the asset output record table, so that the complete asset transfer process is reserved, and the asset transfer path is clearer; in the asset input record table, the account asset initiating the account address is switched from an asset unused state to a used state, and under the condition that the asset is recorded as the used state, the asset cannot be referred again, so that the condition that the asset is repeatedly used can be controlled; and the process of using the UTXO data structure to carry out failure processing is simplified, and the failed digital assets only need to be transferred according to time, so that a large amount of data storage space can be saved. In summary, the method can keep a complete asset transfer process through the account bill record table, the asset input record table and the asset output record table, so that an asset transfer path is clearer, and in the asset transfer process, assets can be controlled to be reused, so that the reliability of service accounting can be improved, and the process does not depend on digital asset data stored in a digital asset database any more, so that the storage pressure of the database can be reduced; meanwhile, the failure processing flow is simplified, and the data storage space is saved.
Further, please refer to fig. 8, where fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 8, the apparatus 1 in the embodiment corresponding to fig. 7 may be applied to the computer device 1000, and the computer device 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the computer apparatus 1000 further includes: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 8, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 8, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
storing the business bill information of the target transaction business into an account bill record table; the target transaction service comprises a sending account address, an asset transfer amount and a receiving account address; the account bill record table has an incidence relation with the asset output record table and the asset input record table;
acquiring account assets belonging to a sending account address, acquiring historical output information for representing asset sources of the account assets from an asset output record table, and switching the historical output information from an asset unused state to an asset used state to obtain updated historical output information;
setting a transaction state corresponding to the business bill information in the bill record table as a transaction state to obtain an updated business bill information;
generating a target input message aiming at the target transaction service according to the updated historical output message and the updated service bill message, and storing the target input message into an asset input record table;
generating a target output message aiming at the target transaction service according to the updated service bill message, the asset transfer amount and the received account address, and storing the target output message into an asset output record table; the targeted output message has an asset unused status.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the data processing method in the embodiment corresponding to fig. 4 to fig. 6, and may also perform the description of the data processing apparatus 1 in the embodiment corresponding to fig. 7, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, where a computer program executed by the aforementioned data processing computer device 1000 is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method in the embodiments corresponding to fig. 4 to fig. 6 can be executed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application.
The computer readable storage medium may be the data processing apparatus provided in any of the foregoing embodiments or an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, provided on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the computer device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the computer device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
In one aspect of the application, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided by one aspect of the embodiments of the present application.
The terms "first," "second," and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (15)

1. A data processing method, comprising:
storing the business bill information of the target transaction business into an account bill record table; the target transaction service comprises the sending account address, the asset transfer amount and the receiving account address; the bill record table has an incidence relation with the asset output record table and the asset input record table;
acquiring account assets belonging to the sending account address, acquiring historical output information used for representing asset sources of the account assets from the asset output record table, and switching the historical output information from an asset unused state to an asset used state to obtain updated historical output information;
setting a transaction state corresponding to the business bill message in the bill record table to be a transacted state, and obtaining an updated business bill message;
generating a target input message aiming at the target transaction service according to the updated historical output message and the updated service bill message, and storing the target input message to the asset input record table;
generating a target output message aiming at the target transaction service according to the updated service bill message, the asset transfer amount and the receiving account address, and storing the target output message to the asset output record table; the targeted output message has the asset unused status.
2. The method of claim 1, wherein storing the transaction billing message for the target transaction service to a billing record table comprises:
acquiring a transaction number used for representing the target transaction service, and generating a target service bill number according to the transaction number;
acquiring a transaction service type to which the target transaction service belongs;
and generating a business bill message of the target transaction business according to the transaction number, the target business bill number, the asset transfer amount and the transaction business type, and storing the business bill message to an bill record table.
3. The method of claim 1, wherein obtaining account assets belonging to the sending account address comprises:
acquiring a first account database to which the sending account address belongs; the first account database comprises a mapping relation between an account address and an asset; the account address comprises the sending account address;
and acquiring the assets which have the mapping relation with the sending account address in the first account database, and taking the assets which have the mapping relation with the sending account address as the account assets belonging to the sending account address.
4. The method of claim 2, wherein the bill record table is associated with the asset output record table by a service bill number, wherein the service bill number is a bill number generated according to a transaction number of a transaction service, and wherein one service bill number corresponds to an output message in one asset output record table;
generating a target input message for the target transaction service according to the updated historical output message and the updated service bill message, including:
acquiring a historical service bill number corresponding to the updated historical output message and the target service bill number corresponding to the updated service bill message;
in the asset output record table, acquiring a history serial number to which the updated history output message belongs; the historical sequence number is used for representing the index position of the updated historical output message in the asset output record table;
and generating a target input message aiming at the target transaction service according to the historical service bill number, the target service bill number and the historical serial number.
5. The method of claim 2, wherein generating a target output message for the target transaction service based on the updated service billing message, the asset transfer amount, and the receive account address comprises:
acquiring the target service bill number corresponding to the updated service bill message;
generating an incremental sequence number in the asset output record table;
and generating a target output message aiming at the target transaction service according to the target service bill number, the incremental serial number, the receiving account address and the asset transfer amount.
6. The method of claim 5, wherein generating a target output message for the target transaction service based on the target service billing number, the incremented serial number, the received account address, and the asset transfer amount comprises:
acquiring an asset construction rule corresponding to the target transaction service; the asset construction rules are used for defining construction standards of the asset transfer amount;
if the asset construction standard of the asset transfer amount is a real-time construction standard, constructing a target asset corresponding to the asset transfer amount according to asset construction information corresponding to the asset transfer amount;
and generating a target output message aiming at the target transaction service according to the target service bill number, the incremental serial number, the receiving account address and the asset information of the target asset.
7. The method of claim 6, further comprising:
if the asset construction standard of the asset transfer amount is a delay construction standard, acquiring asset construction information corresponding to the asset transfer amount;
and generating a target output message aiming at the target transaction service according to the target service bill number, the incremental serial number, the receiving account address and the asset construction information.
8. The method of claim 7, further comprising:
and if the asset construction standard of the asset transfer amount is a delay construction standard, acquiring the target output message in the asset output record table, and constructing the target asset corresponding to the asset transfer amount according to the asset construction information in the target output message.
9. The method according to claim 6 or 8, characterized in that the method further comprises:
acquiring a first account database to which the sending account address belongs and a second account database to which the receiving account address belongs; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises the sending account address; the second account database comprises a mapping relation between a second account address and an asset, and the second account address comprises the receiving account address;
setting, in the first account database, an asset status of the account asset to a used status;
and creating a mapping relation between the receiving account address and the target asset, and adding the mapping relation between the receiving account address and the target asset into the second account database.
10. The method of claim 1, further comprising:
acquiring the difference asset yield between the total asset amount corresponding to the account asset and the asset transfer amount;
generating an auxiliary output message aiming at the target transaction service according to the updated service bill message, the differential asset yield and the sending account address, and storing the auxiliary output message to the asset output record table; the dependent output message has the asset unused status.
11. The method of claim 10, further comprising:
acquiring the differential assets corresponding to the differential asset yield according to the auxiliary output message;
acquiring a first account database to which the sending account address belongs; the first account database comprises a mapping relation between a first account address and an asset; the first account address comprises the sending account address;
creating a mapping relationship between the sending account address and the differential asset, and adding the mapping relationship between the sending account address and the differential asset to the first account database;
setting, in the first account database, an asset status of the differencing asset to an available status.
12. The method of claim 1, further comprising:
acquiring output information to be migrated in the asset output record table within a heartbeat cycle; the output message to be migrated has the asset used status;
and migrating the output message to be migrated and the input message and the service bill message associated with the output message to be migrated to a historical database.
13. The method of claim 1, further comprising:
obtaining an internal migration time range;
if the recording timestamp of the target output message belongs to the internal migration time range, acquiring the asset transfer amount and the receiving account address contained in the target output message;
respectively using the receiving account address as an updating sending account address and an updating receiving account address, generating an updating service bill message, an updating input message and an updating output message according to the updating sending account address, the asset transfer amount and the updating receiving account address, and storing the updating output message into the asset output record table, the updating service bill message into the bill record table and the updating input message into the asset input record table; the update output message has the asset unused status;
switching the target output message from the asset unused state to the asset used state, and determining the target output message with the asset used state as an output message to be migrated;
and migrating the output message to be migrated and the input message and the service bill message associated with the output message to be migrated to a historical database.
14. A computer device, comprising: a processor, a memory, and a network interface;
the processor is coupled to the memory and the network interface, wherein the network interface is configured to provide network communication functionality, the memory is configured to store program code, and the processor is configured to invoke the program code to perform the method of any of claims 1-13.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method of any of claims 1-13.
CN202210065015.0A 2020-09-09 2020-09-09 Data processing method and device and readable storage medium Pending CN114398376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210065015.0A CN114398376A (en) 2020-09-09 2020-09-09 Data processing method and device and readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210065015.0A CN114398376A (en) 2020-09-09 2020-09-09 Data processing method and device and readable storage medium
CN202010943315.5 2020-09-09

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202010943315.5 Division 2020-09-09 2020-09-09

Publications (1)

Publication Number Publication Date
CN114398376A true CN114398376A (en) 2022-04-26

Family

ID=81259649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210065015.0A Pending CN114398376A (en) 2020-09-09 2020-09-09 Data processing method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN114398376A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115034902A (en) * 2022-06-21 2022-09-09 支付宝(杭州)信息技术有限公司 Accounting processing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115034902A (en) * 2022-06-21 2022-09-09 支付宝(杭州)信息技术有限公司 Accounting processing method and device

Similar Documents

Publication Publication Date Title
US11328093B1 (en) Protecting sensitive data
US11100502B1 (en) Modular, configurable smart contracts for blockchain transaction processing validations
CN111309745B (en) Virtual resource processing method and device, electronic equipment and storage medium
CN106325870B (en) Method and device for realizing dynamic form API (application program interface)
CN110020846B (en) Transfer service processing method and system
US20210304191A1 (en) System and method for integration and validation
CN111639309B (en) Data processing method and device, node equipment and storage medium
CN114971827A (en) Account checking method and device based on block chain, electronic equipment and storage medium
CN113486114B (en) Block chain intelligent contract calling management method
CN113191906A (en) Service data processing method and device, electronic equipment and storage medium
CN114398376A (en) Data processing method and device and readable storage medium
CN111324645A (en) Data processing method and device for block chain
CN115203747A (en) Data account creation method and device
CN115221559A (en) Data account access authorization method and device
CN114581088A (en) Aggregated payment method, device and system for SaaS (software as a service) system
CN115391343A (en) Bill data processing method and device, electronic equipment and storage medium
CN114648012A (en) Bill processing method and device, electronic equipment and computer readable medium
CN115203746A (en) Data account access authorization method and device
CN114722108A (en) Customer service data processing method and device, electronic equipment and storage medium
CN112465498A (en) Data processing method and device for application blockchain enterprise wallet
CN111476562A (en) Virtual resource transfer method, device, electronic equipment and storage medium
CN111897822A (en) Account state information processing method and device, electronic equipment and storage medium
CN112541756B (en) Block chain contract upgrading method and device, computer equipment and readable storage medium
CN114331447B (en) Cross-link message submitting method and device
CN112712403B (en) Offline invoice issuing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination