A data processing method, device and readable storage medium

By establishing the correlation between the bill record table, asset input record table and asset output record table in the digital asset accounting system, the storage pressure and reliability problems of the distributed storage system when the amount of data increases, achieving a clearer asset transfer path and higher accounting reliability.

CN114398376BActive Publication Date: 2025-06-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210065015.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-09
Publication Date
2025-06-24
Estimated Expiration
2040-09-09

AI Technical Summary

Technical Problem

The distributed storage digital asset accounting system faces great storage pressure when the data volume increases. At the same time, due to the possible repeated reference of digital assets, the reliability of distributed transaction accounting is low.

Method used

By establishing an association between the billing record table, the asset input record table and the asset output record table, record business billing messages, asset sources and asset transfer information, ensure the clarity of the asset transfer path, and switch asset status in the asset input record table to avoid reuse.

Benefits of technology

This method effectively reduces the storage pressure of the database, improves the reliability of business accounting, simplifies the failure processing process, and saves data storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398376B_ABST
    Figure CN114398376B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method, device, and readable storage medium. The present application belongs to the field of computers. The method includes: storing the business bill message of the target transaction service in the bill record table; obtaining the account assets belonging to the sending account address, obtaining the historical output message used to characterize the source of the account assets from the asset output record table, and changing the historical output message to the asset used state; setting the transaction status corresponding to the business bill message to the traded state; generating a target input message according to the updated historical output message and the updated business bill message, and storing it in the asset input record table; generating a target output message according to the updated business bill message, the asset transfer amount, and the receiving account address, and storing it in the asset output record table. By using the present application, the storage pressure on the database can be reduced, and at the same time, the reliability of business accounting can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application filed with the Chinese Patent Office on September 9, 2020, with the application number 2020109433155 and the application title "A Data Processing Method, Device and Readable Storage Medium", the entire content of which is incorporated herein by reference. Technical Field

[0002] This application relates to the field of computer technology, and in particular, to a data processing method, device, and readable storage medium. Background Art

[0003] The digital asset accounting system includes a distributed system. That is to say, one way of accounting for digital assets is to use a distributed storage method for accounting. In distributed storage, an account database is usually used to record the asset information under an account, and an additional digital asset database is used to record the specific information of digital assets (for example, recording the account to which the digital asset belongs); if a digital asset database is used to record the specific information of digital assets, the digital asset database will also record relevant information such as information on changes in the ownership of digital assets, information on the status change flow of digital assets, and information on the derivative flow of digital assets. As the number of digital assets increases, the data recorded in the digital asset database will also increase accordingly. The huge and complex data brings great pressure to the digital asset database. However, if a digital asset database is not used to record digital assets, it is very likely that a digital asset will be repeatedly referenced, resulting in low reliability of distributed transaction accounting. Summary of the Invention

[0004] Embodiments of this application provide a data processing method, device, and readable storage medium, which can reduce the storage pressure of the database and improve the reliability of business accounting at the same time.

[0005] On the one hand, an embodiment of this application provides a data processing method, including:

[0006] Storing the business bill message of the target transaction business into the bill record table; the target transaction business includes a sending account address, an asset transfer amount, and a receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table;

[0007] Obtaining the account assets belonging to the sending account address, obtaining the historical output message used to represent the source of the account assets from the asset output record table, and switching the historical output message from the asset unused state to the asset used state to obtain the updated historical output message;

[0008] Setting the transaction status corresponding to the business bill message in the bill record table to the traded status to obtain the updated business bill message;

[0009] Generate a target input message for the target transaction service according to the updated historical output message and the updated business bill message, and store the target input message in the asset input record table;

[0010] Generate a target output message for the target transaction service according to the updated business bill message, the asset transfer amount, and the receiving account address, and store the target output message in the asset output record table; the target output message has an asset unused status.

[0011] An embodiment of the present application provides a data processing device on the one hand, including:

[0012] A bill storage module for storing the business bill message of the target transaction service in the bill record table; the target transaction service includes a sending account address, an asset transfer amount, and a receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table;

[0013] An asset acquisition module for acquiring the account assets belonging to the sending account address;

[0014] A status switching module for obtaining a historical output message for characterizing the asset source of the account assets from the asset output record table, and switching the historical output message from the asset unused status to the asset used status to obtain an updated historical output message;

[0015] A transaction status setting module for setting the transaction status corresponding to the business bill message in the bill record table to the traded status to obtain an updated business bill message;

[0016] An input record generation module for generating a target input message for the target transaction service according to the updated historical output message and the updated business bill message, and storing the target input message in the asset input record table;

[0017] An output record generation module for generating a target output message for the target transaction service according to the updated business bill message, the asset transfer amount, and the receiving account address, and storing the target output message in the asset output record table; the target output message has an asset unused status.

[0018] Among them, the bill storage module includes:

[0019] A number acquisition unit for acquiring a transaction number for characterizing the target transaction service, and generating a target business bill number according to the transaction number;

[0020] A transaction type acquisition unit for acquiring the transaction service type to which the target transaction service belongs;

[0021] A bill storage unit, which is used to generate a business bill message for a target transaction business according to a transaction number, a target business bill number, an asset transfer amount, and a transaction business type, and store the business bill message in a bill record table.

[0022] Among them, the asset acquisition module includes:

[0023] A data acquisition unit, which is used to acquire a first account database to which the sending account address belongs; the first account database includes a mapping relationship between an account address and an asset; the account address includes the sending account address;

[0024] An asset acquisition unit, which is used to acquire an asset that has a mapping relationship with the sending account address in the first account database, and use the asset that has a mapping relationship with the sending account address as the account asset belonging to the sending account address.

[0025] Among them, the bill record table and the asset output record table are associated through a business bill number. The business bill number is a bill number generated according to the transaction number of the transaction business. One business bill number corresponds to an output message in an asset output record table;

[0026] The input record generation module includes:

[0027] A bill number acquisition unit, which is used to acquire the historical business bill number corresponding to the updated historical output message and the target business bill number corresponding to the updated business bill message;

[0028] A historical sequence number acquisition unit, which is used to acquire the historical sequence number to which the updated historical output message belongs in the asset output record table; the historical sequence number is used to represent the index position of the updated historical output message in the asset output record table;

[0029] An input record generation unit, which is used to generate a target input message for the target transaction business according to the historical business bill number, the target business bill number, and the historical sequence number.

[0030] Among them, the output record generation module includes:

[0031] A target number acquisition unit, which is used to acquire the target business bill number corresponding to the updated business bill message;

[0032] An incrementing sequence number generation unit, which is used to generate an incrementing sequence number in the asset output record table;

[0033] An output record generation unit, which is used to generate a target output message for the target transaction business according to the target business bill number, the incrementing sequence number, the receiving account address, and the asset transfer amount.

[0034] Among them, the output record generation unit includes:

[0035] A construction rule acquisition subunit, configured to acquire an asset construction rule corresponding to a target transaction service; the asset construction rule is used to specify the construction standard of the asset transfer volume;

[0036] An asset construction subunit, configured to, if the asset construction standard of the asset transfer volume is a real-time construction standard, construct a target asset corresponding to the asset transfer volume according to the asset construction information corresponding to the asset transfer volume;

[0037] An output record generation subunit, configured to generate a target output message for the target transaction service according to the target service bill number, increment sequence number, receiving account address, and asset information of the target asset.

[0038] Wherein, the device further includes:

[0039] A construction information acquisition module, configured to, if the asset construction standard of the asset transfer volume is a delayed construction standard, acquire the asset construction information corresponding to the asset transfer volume;

[0040] A target output message generation module, configured to generate a target output message for the target transaction service according to the target service bill number, increment sequence number, receiving account address, and asset construction information.

[0041] Wherein, the device further includes:

[0042] A target asset construction module, configured to, if the asset construction standard of the asset transfer volume is a delayed construction standard, acquire a target output message in an asset output record table, and construct a target asset corresponding to the asset transfer volume according to the asset construction information in the target output message.

[0043] Wherein, the device further includes:

[0044] A database acquisition module, configured to acquire 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 includes a mapping relationship between a first account address and an asset; the first account address includes the sending account address; the second account database includes a mapping relationship between a second account address and an asset, and the second account address includes the receiving account address;

[0045] An asset status setting module, configured to set the asset status of the account asset to a used status in the first account database;

[0046] A mapping relationship adding module, configured to create a mapping relationship between the receiving account address and the target asset, and add the mapping relationship between the receiving account address and the target asset to the second account database.

[0047] Wherein, the device further includes:

[0048] A difference amount acquisition module, configured to acquire a difference asset amount between the total asset amount corresponding to the account asset and the asset transfer amount;

[0049] An affiliated record generation module, configured to generate an affiliated output message for the target transaction service according to the updated business bill message, the difference asset amount, and the sending account address, and store the affiliated output message in the asset output record table; the affiliated output message has an asset unused status.

[0050] Wherein, the device further includes:

[0051] A difference asset acquisition module, configured to acquire the difference asset corresponding to the difference asset amount according to the affiliated output message;

[0052] A first database acquisition module, configured to acquire the first account database to which the sending account address belongs; the first account database includes the mapping relationship between the first account address and the asset; the first account address includes the sending account address;

[0053] A relationship addition module, 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;

[0054] A status setting module, configured to set the asset status of the difference asset to an available status in the first account database.

[0055] Wherein, the device further includes:

[0056] A to-be-migrated record acquisition module, configured to acquire the to-be-migrated output message in the asset output record table during the heartbeat period; the to-be-migrated output message has an asset used status;

[0057] A record migration module, configured to migrate the to-be-migrated output message, the input message and the business bill message associated with the to-be-migrated output message to the historical database.

[0058] Wherein, the device further includes:

[0059] A time range acquisition module, configured to acquire the internal migration time range;

[0060] An information acquisition module, configured to acquire the asset transfer amount and the 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;

[0061] An update record storage module is used to use the received account address as the updated sending account address and the updated receiving account address respectively. According to the updated sending account address, the asset transfer amount, and the updated receiving account address, it generates an updated service bill message, an updated input message, and an updated output message, stores the updated output message in the asset output record table, the updated service bill message in the bill record table, and the updated input message in the asset input record table; the updated output message has an asset unused status;

[0062] An asset status switching module is used to switch the target output message from the asset unused status to the asset used status, and determine the target output message with the asset used status as the output message to be migrated;

[0063] A message migration module is used to migrate the output message to be migrated, the input message and the service bill message associated with the output message to be migrated to the historical database.

[0064] On the one hand, an embodiment of the present application provides a computer device, including: a processor and a memory;

[0065] The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute the method in the embodiment of the present application.

[0066] On the one hand, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by the processor, the method in the embodiment of the present application is executed.

[0067] On the one hand, the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions. The computer instructions are 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, so that the computer device executes the method provided in one aspect of the embodiment of the present application.

[0068] In the embodiments of the present application, for a target transaction business, a bill record table is used to record business bill messages, an asset input record table is used to record relevant information about the asset source of the initiating account address in the target transaction business, and an asset output record table is used to record information such as the receiving account address and the amount of asset transfer in the target transaction business. There is an association relationship between the asset input record table, the asset output record table, and the bill record table. In this way, for the target transaction business, the asset source of the initiating account address in the target transaction business can be known through the asset input record table, and the destination of the asset (receiving account address) in the target transaction business can be known through the asset output record table, thus retaining the complete asset transfer process and making the asset transfer path clearer. Moreover, in the asset input record table, the account assets of the initiating account address will be switched from the asset unused state to the used state. In the case where the asset is recorded as the used state, the asset will not be referenced again, so the situation of asset reuse can be controlled. In summary, the present application can retain the complete asset transfer process through the bill record table, the asset input record table, and the asset output record table, making the asset transfer path clearer, and in the asset transfer process, the asset can be prevented from being reused, thereby improving the reliability of business accounting. Moreover, this process no longer depends on the digital asset data stored in the digital asset database. Therefore, the storage pressure on the database can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0070] Figure 1 is a network architecture diagram provided by an embodiment of the present application;

[0071] Figure 2a is a representation diagram of a UTXO data structure provided by an embodiment of the present application;

[0072] Figure 2b is a bookkeeping schematic diagram of a transfer scenario provided by an embodiment of the present application;

[0073] Figure 3 is a scenario schematic diagram provided by an embodiment of the present application;

[0074] Figure 4 is a flowchart of a data processing method provided by an embodiment of the present application;

[0075] Figure 5It is a schematic diagram of data migration provided by an embodiment of the present application;

[0076] Figure 6 It is a schematic flowchart of an asynchronous compensation operation provided by an embodiment of the present application;

[0077] Figure 7 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application;

[0078] Figure 8 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0079] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0080] Please refer to Figure 1 , Figure 1 which is a network architecture diagram provided by an embodiment of the present application. As Figure 1 shown, the network architecture may include a service server 1000 and a user terminal cluster. The user terminal cluster may include one or more user terminals, and the number of user terminals will not be limited here. As Figure 1 shown, the multiple user terminals may include user terminal 100a, user terminal 100b, user terminal 100c, …, user terminal 100n; as Figure 1 shown, user terminal 100a, user terminal 100b, user terminal 100c, …, user terminal 100n may be respectively connected to the service server 1000 through a network, so that each user terminal can perform data interaction with the service server 1000 through this network connection.

[0081] It can be understood that each user terminal as Figure 1 shown may be installed with a target application. When the target application runs on each user terminal, it can respectively communicate with Figure 1Data interaction is carried out between the business servers 1000 shown, enabling the business servers 1000 to receive business data from each user terminal. Among them, the target application can include applications with functions of displaying data information such as text, images, audio, and video. For example, the application can be a service application (such as an asset service application), and this service application can be used for users to handle asset-related services (such as asset transfer, asset storage). The business server 1000 in this application can obtain business data according to these applications. For example, the business data can be information related to a transaction service (for example, the transaction service is a transfer service, and the transaction service information includes the recipient address, the amount of asset transfer, and the payer address);

[0082] Subsequently, the business server 1000 can query whether the asset A under the payer's name in the asset accounting system is valid (if the asset A under the payer's name has an unused asset status, it can be considered that the asset A under the payer's name is valid). If the asset A under the payer's name is valid, the asset A under the payer's name can be transferred to the recipient's name, and the relevant information of the transaction service is recorded in the asset accounting system (at this time, the asset A under the payer's name already has an asset used status, and the asset A under the payer's name cannot be used anymore).

[0083] In the embodiment of this application, a user terminal can be selected from multiple user terminals as the target user terminal. The user terminal can include: intelligent terminals with multimedia data processing functions (such as video data playback function, music data playback function) such as smart phones, tablet computers, notebook computers, desktop computers, smart TVs, smart speakers, desktop computers, smart watches, etc., but is not limited thereto. For example, the embodiment of this application can Figure 1 The shown user terminal 100a as the target user terminal. The target application can be integrated in the target user terminal. At this time, the target user terminal can perform data interaction with the business server 1000 through the target application.

[0084] 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 based on this trigger action for the asset transfer control. The user can fill in asset transfer information (such as the user's password, the recipient's account number, and the asset transfer amount, etc.) in this asset transfer information filling interface. Subsequently, the user terminal can send the asset transfer information to the business server. The business server can query from the asset accounting system whether the assets under the user's name have an unused status. If there is an unused status, the business server can transfer the assets under the user's name and record the relevant asset transfer information of the user in the asset accounting system.

[0085] Optionally, it can be understood that the network architecture may include multiple business servers. A user terminal can be connected to one business server. Each business server can obtain the business data (such as the relevant information of a transaction business) in the user terminal connected to it, and verify the validity of the business data. When the business data is valid, execute the relevant business actions (such as transfer business, payment business, etc.) in the business data, and perform bookkeeping processing on the business data.

[0086] Optionally, it can be understood that the user terminal can also obtain business data (such as the relevant information of a transaction business), and verify the validity of the business data. When the business data is valid, execute the relevant business actions (such as transfer business, payment business, etc.) in the business data, and perform bookkeeping processing on the business data.

[0087] It can be understood that the method provided in the embodiments of the present application can be executed by a computer device, and the computer device includes but is not limited to a user terminal or a business server. Among them, the business server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0088] Among them, the user terminal and the business server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not limit this here.

[0089] It can be understood that the above Figure 1 mentioned assets can refer to digital assets, the asset service application can refer to a digital asset service application, and the asset accounting system can refer to a digital asset accounting system.

[0090] It should be noted that in the specific implementation of this application, when dealing with user-related data such as user information and user data (such as the relevant information of the above-mentioned transaction business), it is obtained and processed only after obtaining the permission granted by the user. That is to say, when the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.

[0091] The solution provided by the embodiments of this application is directed to a digital asset accounting system for distributed storage.

[0092] The solution proposed in this application is that in a digital asset system with distributed storage, the Unspent Transaction Output (UTXO) data structure is used to implement distributed transactions for digital asset accounting services.

[0093] A large business system is often composed of several subsystems, and these subsystems have their own independent databases. Often, a business process needs to be completed jointly by multiple subsystems, and these operations may need to be completed in one transaction. At this time, implementing transaction support across databases through a specific method above the database is a distributed transaction.

[0094] To facilitate the understanding of distributed transactions, the following will take the scenario of transferring a digital asset 1 from account A1 to account A2 without change in a transaction business as an example for explanation. For this transaction business, only one digital asset (i.e., digital asset 1) is involved. The distributed transaction of this transaction business involves a total of 3 databases, namely the database to which account A1 belongs, the database to which digital asset 1 belongs, and the database to which account A2 belongs. The sub-transaction sequence for this transaction business can be as follows:

[0095] 1. In the database where account A1 is located, execute transaction TX1: Lock the record of digital asset 1 held by account A1;

[0096] 2. In the database where the billing statement is located, execute transaction TX2: Change the status of the billing statement to in payment (here it is assumed that the design of adding the billing statement record first and then starting the distributed transaction is adopted to avoid "losing the order");

[0097] 3. In the database where digital asset 1 is located, execute transaction TX3: Change the ownership of digital asset 1 from account A1 to account A2;

[0098] 4. In the database where account A1 is located, execute transaction TX4: Change the record of digital asset 1 of account A1 from locked to used;

[0099] 5. In the database where the billing statement is located, execute transaction TX5: change the status of the billing statement to payment successful; the design of this distributed transaction uses the status of the billing statement as the final result of the transaction.

[0100] 6. In the database where account A2 is located, execute transaction TX6: add a record of digital asset 1 for account A2; this sub-transaction can be independent of the distributed transaction, that is, "offline accounting".

[0101] Through the above 6 sub-transactions, the accounting transaction for the transaction business of transferring one digital asset 1 from account A1 to account A2 can be completed.

[0102] UTXO is a data structure that contains transaction data and execution code. UTXO can be understood as the encrypted digital assets that have been received at a certain warehouse or address but have not been spent yet. The characteristics of UTXO include but are not limited to the following 6 characteristics:

[0103] (1) Each UTXO records a payment transaction.

[0104] (2) Each UTXO consists of a set of inputs (Input) and a set of outputs (Output).

[0105] (3) Depending on the transaction type, Input and Output can be empty; but when the transaction type is a payment transaction type or a transfer transaction type, Input and Output must be non-empty.

[0106] (4) Each Input must come from an Output and the elements remain unchanged.

[0107] (5) An Output can only be referenced by one Input.

[0108] (6) The sum of the amounts of all Inputs is equal to the sum of the Output amounts.

[0109] According to the above 6 characteristics of UTXO and the database transaction of digital assets, this application stores all the data of a UTXO data structure in one database. That is to say, it is partitioned by the dimension of the billing statement corresponding to the UTXO transaction business. The Input data, Output data, and billing statement of this UTXO are all stored in the same database. In view of this, the database recording the Input data, Output data, and billing statement can be used to ensure the transactionality of UTXO data records.

[0110] For easy understanding, please refer to Figure 2a , Figure 2a which is a representation diagram of a UTXO data structure provided by an embodiment of this application. As Figure 2aAs shown, the UTXO data structure contains three record tables, namely the bill record table, the Input table, and the Output table. These three record tables are in the same database. The inputs (Input) and outputs (Output) with the same business bill number need to be recorded in an Input table and an Output table respectively.

[0111] Among them, the Input table can record the asset source information of the payer in a transaction business (for example, the asset source information under the name of account A1); the Output table can record the asset transfer information of the payee in a transaction business (for example, record the assets under the name of account A2). Each Input needs to reference an output (asset source). For example, account A transfers digital asset 3 to account A1. This transaction business will generate an output (record digital asset 3 under the name of account A1). Then account A1 transfers digital asset 3 to account A2. For the transaction business of account A1 transferring digital asset 3 to account A2, the Input is the source of the digital asset 3 of account A1, that is, the historical output generated by the historical transaction business of account A transferring digital asset 3 to account A1. That is to say, for the Input of the transaction business of account A1 transferring digital asset 3 to account A2, it references the historical output generated by the historical transaction business of account A transferring digital asset 3 to account A1.

[0112] For easy understanding, the data recorded in the bill record table, the Input table, and the Output table in the UTXO data structure will be described separately as follows:

[0113] Description of the bill record table:

[0114] The bill record table contains the transaction number of the transaction business. This transaction number can be the one passed in when the external system calls the accounting system, and this transaction number can be used as the basis for judging whether the transaction is repeated.

[0115] The bill record table also contains the business bill number of the transaction business. This business bill number can be derived from the above transaction number, so that the bill database obtained using the transaction number is the same as the bill database obtained using the business bill number.

[0116] The bill record table also includes the transaction business type of the transaction, which can be used to determine whether the input and output are empty. Among them, if the transaction business type is a transfer type, a payment type, etc., the input and output cannot be empty, and there must be an asset source (input) of the payer and a payee (output) to whom the asset is transferred; if the transaction business type is a deposit type, the input can be empty, but the output cannot be empty (the output is the amount of assets deposited in the deposit account); if the transaction is a cash withdrawal type, the input cannot be empty (the input is the assets under the name of the cash withdrawal account), but the output can be empty.

[0117] The bill record table also includes the total transaction amount, which can be used to calculate the sum of the amounts in the Input table or the Output table.

[0118] Explanation of the Output table:

[0119] The Output table contains the business bill number, which corresponds to the business bill number in the bill record table. That is to say, for a transaction business, a business bill number can be generated according to the transaction number of the transaction business. This business bill number will be stored in the bill record table and also in the Output table, and the business bill number in the Output table can be set as a foreign key association, so that the Output table can be associated with the bill record table through this business bill number.

[0120] The Output table also contains a serial number, which can be an identifier such as a number, an auto-increment sequence, a string, etc. The serial number and the business bill number together form a unique index of the output message corresponding to a transaction business. The serial number can be the row number of the output message recorded in the Output table.

[0121] The Output table also contains the payee account number, which corresponds to the account address of the payee in this transaction business.

[0122] The Output table also contains the elements of digital assets. According to the asset construction rules of the accounting system, the element information of digital assets is recorded. For example, if the asset construction rule is a real-time construction rule, the digital asset expression can be recorded in this accounting; if the asset construction rule is a delayed construction rule, the necessary information required to generate digital assets can be recorded in this accounting. Among them, the digital asset expression can refer to the digital form of digital assets, which can be used as the carrier of digital assets in software systems and interactions; whether it is value transfer or value exchange, both parties to the transaction need to verify this expression and recognize the value of the digital assets corresponding to the verified expression. The digital asset expression generally includes, but is not limited to, information such as ID, issuer, attribution, etc. and the private key signature of the issuer.

[0123] The Output table also contains the spent business bill numbers. The spent business bill numbers can refer to the business bill numbers of the outputs for which asset transfers have occurred. For example, if account A transfers digital asset 3 to account A1, this transaction will generate an output (recording digital asset 3 under the name of account A1). If account A1 then transfers digital asset 3 to account A2, the transfer of digital asset 3 from account A1 has occurred. The business bill number corresponding to the output generated by the transaction of transferring digital asset 3 from account A to account A1 will be used as the spent business bill number.

[0124] Explanation of the Input table:

[0125] The Input table contains business bill numbers, which correspond to the business bill numbers in the bill record table. That is, for a transaction, a business bill number can be generated based on the transaction number of the transaction. This business bill number will be stored in the bill record table and also in the Input table, and the business bill number in the Input table can be set as a foreign key association, thereby enabling the Input table to be associated with the bill record table through this business bill number.

[0126] The Input table also contains the business bill numbers of historical outputs. In the UTXO data structure, an input needs to reference an output, and this historical output can be the source of the payer's assets in a transaction. The business bill numbers of historical outputs can also be stored in the Input table.

[0127] The Input table also contains the serial numbers of historical outputs. To record the reference relationship between an input and an output, the serial numbers of historical outputs can also be recorded in the Input table. Thus, through the business bill number of this historical output and the serial number of this historical output, a unique index for the historical output is formed.

[0128] The Input table also contains the elements of historical outputs. Here, the elements can refer to the information recorded by the historical outputs, such as the ownership of the historical output (e.g., the payer of the current transaction), digital asset elements, etc.

[0129] For ease of understanding, please also refer to Figure 2b , Figure 2b which is a schematic diagram of accounting for a transfer scenario provided by an embodiment of this application. As Figure 2bAs shown in the figure, for the transaction of transferring a digital asset 1 from account A1 to account A2, relevant information about this transaction will be stored in the bill record table, Input table, and Output table.

[0130] As Figure 2b shown, if the transaction number of the transaction of "transferring a digital asset 1 from account A1 to account A2" is "011", then this transaction number "011" will be stored in the bill record table; based on this transaction number "011", a business bill number "yewu_b" can be derived, and this business bill number "yewu_b" will also be stored in the bill record table; the transaction type of the transaction of "transferring a digital asset 1 from account A1 to account A2" is the transfer type, and the transfer type of the transaction will also be stored in the bill record table; at the same time, the total transaction amount of digital asset 1 will also be stored in the bill record table.

[0131] As Figure 2b shown, in the Input table, relevant information about the payer in the transaction of "transferring a digital asset 1 from account A1 to account A2" will be stored, that is, the source information of the digital asset 1 held by account A1 (the historical output corresponding to account A1). The business bill number "yewu_b" corresponding to the current transaction ("transferring a digital asset 1 from account A1 to account A2") can be stored in the Input table, and the historical business bill number "yewu_a" corresponding to the historical output can also be stored. Here, the historical business bill number "yewu_a" can be understood as: the business bill number corresponding to the historical transaction of "transferring a digital asset 1 from account M to account A1"; at the same time, the serial number "34" of this historical output in the Output table can be obtained and stored in the Input table together; at the same time, relevant information about the historical output (such as account A1 and the digital asset 1 held by account A1) can also be stored in the Input table.

[0132] As Figure 2b shown, in the Output table, relevant information about the payee in the transaction of "transferring a digital asset 1 from account A1 to account A2" will be stored, that is, a record of adding the digital asset 1 held by account A2 (the new output corresponding to account A2).

[0133] In the Output table, the business bill number "yewu_b" corresponding to the current transaction business ("transfer a digital asset 1 from account A1 to account A2") can be stored, and the newly generated serial number "40" can also be stored. Here, the serial number "40" can be understood as follows: if there are already 39 outputs in the Output table, the serial number of the new output corresponding to account A2 in this Output table is 40. At the same time, the account number of the payee (account A2) can be stored in this Outpput table, and the elements of digital asset 1 can be recorded. Also, since there is no longer any digital asset 1 under the name of account A1 after transferring a digital asset 1 from account A1 to account A2, the historical business bill number "yewu_a" in the historical output can be set to the used state to indicate that this historical output (the digital asset 1 held by account A1) has been spent.

[0134] As Figure 2b shown, after account A2 holds digital asset 1, account A2 transfers digital asset 1 to account A3. For this new transaction business "transfer a digital asset 1 from account A2 to account A3", relevant information about this new transaction business will also be stored in the bill record table, Input table, and Output table.

[0135] As Figure 2b shown, the transaction number of this new transaction business "transfer a digital asset 1 from account A2 to account A3" is "015", so this transaction number "015" will be stored in the bill record table. Based on this transaction number "015", a business bill number "yewu_r" can be derived, and this business bill number "yewu_b" will also be stored in the bill record table. The transaction business type of the transaction business "transfer a digital asset 1 from account A1 to account A2" is the transfer type, and the transfer type of the transaction business will also be stored in the bill record table. At the same time, the total transaction amount of digital asset 1 will also be stored in the bill record table.

[0136] As Figure 2b shown, in this Input table, the relevant information of the payer in the transaction business "transfer a digital asset 1 from account A2 to account A3" will be stored, that is, the source information of the digital asset 1 held by account A2 (the historical output corresponding to account A2, that is, the output generated by the above transaction business "transfer a digital asset 1 from account A1 to account A2"). That is to say, the Input table will reference the information in the output generated by the above transaction business "transfer a digital asset 1 from account A1 to account A2".

[0137] In the Input table, the business bill number "yewu_r" corresponding to the current transaction business ("transfer a digital asset 1 from account A2 to account A3") can be stored, or the historical business bill number "yewu_b" corresponding to the historical output can be stored. Here, the historical business bill number "yewu_b" is the business bill number corresponding to the output generated by the above transaction business "transfer a digital asset 1 from account A1 to account A2". At the same time, the serial number of this historical output in the Output table can be obtained as "40", and this serial number "40" can be stored in the Input table together. At the same time, relevant information of the historical output (for example, account A2 and the digital asset 1 held by account A2) can also be stored in this Input table.

[0138] As Figure 2b shown, in the Output table, relevant information of the payee in the transaction business "transfer a digital asset 1 from account A2 to account A3" will be stored, that is, a record of account A3 holding digital asset 1 will be added (the new output corresponding to account A3). The business bill number "yewu_r" corresponding to the current transaction business ("transfer a digital asset 1 from account A2 to account A3") can be stored in the Output table, and the newly generated serial number "45" can be stored. Among them, the serial number "45" here can be understood as follows: there are already 44 outputs in the Output table, and the serial number of the new output corresponding to this account A3 in the Output table is 45.

[0139] At the same time, the account number of the payee (account A3) can be stored in the Output table, and the elements of digital asset 1 can be recorded. At the same time, because after transferring a digital asset 1 from account A2 to account A3, account A2 no longer has digital asset 1 under its name, the historical business bill number "yewu_b" in the output generated by "transfer a digital asset 1 from account A1 to account A2" can be set to the used state to indicate that this output (the digital asset 1 held by account A2) has been spent.

[0140] It should be understood that in the newly generated output, the business bill number "yewu_r" has not been spent and has an unused state, and can be used for subsequent reference in the Input table. If this output (transfer a digital asset 1 from account A3 to other accounts) is subsequently referenced, the business bill number "yewu_r" in this output will also be set to the used state. When in the used state, this output cannot be referenced again.

[0141] For easy understanding, please refer to Figure 3 , Figure 3is a schematic diagram of a scenario provided by an embodiment of the present application. Figure 3 The business server shown can be the above Figure 1 The business server 1000 shown in FIG. Figure 3 The user terminal A1 shown in the figure can be Figure 1 Any one of the user terminals selected from the user terminal cluster of the corresponding embodiment, for example, the user terminal may be the user terminal 100b described above; and Figure 3 The user terminal A2 shown in the figure can be Figure 1 Any user terminal selected from the user terminal cluster of the corresponding embodiment, for example, the user terminal may be the user terminal 100a described above.

[0142] Among them, the transaction business is that account A1 transfers a digital asset 2 to account A2. If the value of digital asset 1 under account A1 is greater than the value of digital asset 2, a digital asset 3 (the difference between digital asset 1 and digital asset 2) will be generated. This transaction business scenario is the change scenario.

[0143] like Figure 3 As shown, account A1 can initiate an asset transfer request (transfer a digital asset 2 to account A2) to the business server through user terminal A1. After receiving the asset transfer request, the business server can query in the digital asset accounting system whether the asset (digital asset 1) under the name of account A1 is valid. If the digital asset 1 under the name of account A1 has an asset used status, it can be determined that the digital asset 1 under the name of account A1 is not valid; if the digital asset 1 under the name of account A1 has an asset unused status, it can be determined that the digital asset 1 under the name of account A1 is valid.

[0144] When the digital asset 1 under the name of the account A1 is valid, the digital asset 2 can be added to the name of the account A2, and the digital asset 3 can be added to the name of the account A1. At the same time, the business server can switch the digital asset 1 under the name of the account A1 in the digital asset accounting system from the asset unused state to the asset used state, so that it is no longer valid, so that in the subsequent process, the digital asset 1 under the name of the account A1 is not allowed to be used again. It should be understood that the business server can record the relevant business information of the transaction business (account A1 transfers a digital asset 2 to account A2) in the digital asset accounting system.

[0145] Among them, the digital asset accounting system includes the database where account A1 is located, the database where account A2 is located, and the UTXO database (including the Input table, the bill record table, and the Output table). The specific process for the business server to record the relevant business information of this transaction business (transferring a digital asset 2 from account A1 to account A2) in this digital asset accounting system can be the following 3 steps:

[0146] 1. In the database where account A1 is located, execute transaction TX1: Lock the record of digital asset 1 held by account A1;

[0147] 2. Obtain the historical output corresponding to digital asset 1 held by account A1 (the asset source information of digital asset 1 of account A1), and then obtain the bill record table to which this historical output belongs. In the database where the bill record table to which this historical output belongs is located, execute transaction TX2: Update the "spent business bill number" in the Output table. It should be understood that the update of the "spent business bill number" in the Output table here can mean switching this historical output from the asset unused state to the asset used state. That is, switch the digital asset 1 under account A1 from the asset unused state to the asset used state, making it no longer valid.

[0148] 3. In the database where this bill record table is located, execute transaction TX3: Set the transaction status of the business bill message corresponding to this transaction business (including information such as the transaction number, business bill number, and transaction type being transfer type corresponding to this transaction business) to the traded status (transfer successful status), and record the UTXO data.

[0149] Among them, the UTXO data includes storing the relevant data of this historical output (the business bill number, serial number, and relevant elements of this historical output) of digital asset 1 (the asset source information) into the Input table; storing the relevant data of the new output1 (adding digital asset 2 to account A2) generated by this transaction business (the business bill number corresponding to this transaction business, the newly generated serial number 1, the account number of account A2, and the elements of digital asset 2) into the Output table; storing the relevant data of the new output2 (adding digital asset 3 to account A1) generated by this transaction business (the business bill number corresponding to this transaction business, the newly generated serial number 2, the account number of account A1, and the elements of digital asset 3) into the Output table.

[0150] Among them, if the asset construction rule corresponding to the digital asset accounting system is the rule of constructing assets in real time, before recording the UTXO data, it is necessary to first complete the construction of digital asset 2 and digital asset 3. After the construction is completed, the information of digital asset 2 and digital asset 3 is respectively recorded in the Output table; if the asset construction rule corresponding to the digital asset accounting system is the rule of constructing assets with a delay, during the process of recording the UTXO data, the necessary information required to generate the digital assets can be recorded.

[0151] It should be understood that to shorten the sub-transaction sequence of the distributed transaction, the present application can use the relevant information of digital asset 2 and digital asset 3 recorded in the UTXO database to asynchronously process the relevant sub-transactions of digital asset 2 and digital asset 3. That is, the above steps 1 - step 3 complete the distributed transaction, and the following steps will perform asynchronous compensation processing:

[0152] 4. Asynchronous compensation processing.

[0153] a. If digital asset 2 and digital asset 3 belong to the type of constructing with a delay (the elements of the digital assets recorded in the Output table are the necessary information required for constructing the digital assets), then digital asset 2 and digital asset 3 can be generated according to the necessary information for construction recorded in the Output table.

[0154] b. In the database where account A1 is located, change the record of digital asset 1 of account A1 from locked to used, and insert the record of digital asset 3 of account A1, and set the status of digital asset 3 to the available status.

[0155] c. In the database where account A2 is located, add the record of digital asset 2 of account A2.

[0156] It should be understood that in the digital asset accounting system with distributed storage, using the UTXO data structure, there is no need to use an independent digital asset database. Using the UTXO data structure can retain the complete asset transfer process, making the asset transfer path clearer and reducing the data required for the independent digital asset database; and in the UTXO database in the digital asset accounting system, the account assets (such as digital asset 1) of the payer (such as account A1) will be switched from the asset unused state to the used state. In the case where the asset is recorded as the used state, the asset will not be referenced again, so the situation of repeated use of the asset can be controlled.

[0157] Furthermore, please refer to Figure 4 , Figure 4 which is a schematic flowchart of a data processing method provided by an embodiment of the present application. This method can be performed by a user terminal (such as the above Figure 1 , Figure 3The user terminal shown) or the service server (e.g., the above Figure 1 shown service server 1000) executes, or can be jointly executed by the user terminal and the service server (such as the service server 1000 in the corresponding embodiment above). For ease of understanding, this embodiment will be described by taking the method being executed by the above service server as an example. Among them, the data processing method can at least include the following steps S101 - step S105: Figure 1 The service bill message of the target transaction service is stored in the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table.

[0158] Step S101, store the service bill message of the target transaction service into the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table.

[0159] In this application, the asset can refer to a digital asset, and the bill record table can correspond to the bill record table of the UTXO database shown in the corresponding embodiment above. The asset input record table can correspond to the Input table of the UTXO database shown in the corresponding embodiment above. The asset output record table can correspond to the Output table of the UTXO database shown in the corresponding embodiment above. Figure 2a The service bill message of the target transaction service is stored in the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table. Figure 2a The service bill message of the target transaction service is stored in the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table. Figure 2a The service bill message of the target transaction service is stored in the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table.

[0160] Each transaction service will have a transaction number. According to this transaction number, a service bill number of the transaction service can be generated. Then, according to the transaction number of the target transaction service, the target service bill number can be generated. The transaction number of the target transaction service and the target service bill number can be obtained, or the transaction service type to which the target transaction service belongs (for example, transfer type, payment type, storage type, withdrawal type, etc.) can be obtained; according to the transaction number, the target service bill number, the asset transfer amount, and the transaction service type, the service bill message of the target transaction service can be generated and stored in the bill record table.

[0161] Step S102, obtain the account assets belonging to the sending account address, obtain the historical output message used to represent the source of the account assets from the asset output record table, and switch the historical output message from the asset unused state to the asset used state to obtain the updated historical output message.

[0162] In this application, the first account database to which the sending account address belongs can be obtained. Among them, the first account database includes the mapping relationship between the account address and the assets. The account address includes the sending account address. Subsequently, the assets having the mapping relationship with the sending account address can be obtained from the first account database, and the assets having the mapping relationship with the sending account address are used as the account assets belonging to the sending account address.

[0163] It should be understood that the sending account address can correspond to the Figure 3 account address of account A1 in the corresponding embodiment above. The account assets can refer to the digital asset 1 under the name of account A1. Obtaining the account assets belonging to the sending account address can refer to Figure 3 step 1 in the corresponding embodiment: In the database where account A1 is located, execute transaction TX1: Lock the record of the digital asset 1 held by account A1.

[0164] Furthermore, the historical output message used to characterize the source of the account assets can be obtained from the asset output record table, and the historical output message is switched from the asset unused state to the asset used state to obtain the updated historical output message.

[0165] It should be understood that this step can correspond to Figure 3 step 2 in the corresponding embodiment: Obtain the historical output corresponding to the digital asset 1 held by account A1 from the Output table (the asset source information of the digital asset 1 of account A1), and then obtain the bill record table to which the historical output belongs. In the database where the bill record table to which the historical output belongs is located, execute transaction TX2: Update the "spent business bill number" in the Output table. That is to say, because the digital asset 1 of account A1 has been transferred, there is no longer digital asset 1 under the name of account A1. Changing the historical output characterizing the digital asset 1 under the name of account A1 from the asset unused state to the asset used state can indicate that the digital asset 1 under the name of account A1 is no longer valid.

[0166] Step S103, set the transaction status corresponding to the business bill message in the bill record table to the traded status to obtain the updated business bill message.

[0167] In this application, the traded status here can correspond to the transaction business type. For example, if the transaction business type is the transfer type, the traded status can be the transfer success status; if the transaction business type is the payment type, the traded status can be the payment success status.

[0168] Setting the transaction status corresponding to the business bill message in the bill record table to the traded status can correspond to Figure 3Step 3 in the corresponding embodiment: In the database where the bill record table is located, execute transaction TX3: Set the transaction status corresponding to the business bill message of the transaction service to the traded status (transfer success status).

[0169] Step S104, generate a target input message for the target transaction service according to the updated historical output message and the updated business bill message, and store the target input message in the asset input record table.

[0170] In this application, the bill record table and the asset output record table can be associated through the business bill number, and one business bill number corresponds to one output message in the asset output record table. For example, there will be a historical business bill number of the historical business bill message in the historical output message in the asset output record table. Then, the bill record table can be associated with the asset output record table through this historical business bill number. Through this historical business bill number, the historical business bill message in the bill record table can be obtained, and the historical output message in the bill record table can also be obtained.

[0171] Because one business bill number corresponds to one output message, the specific method for generating the target input message can be to obtain the historical business bill number corresponding to the updated historical output message and the target business bill number corresponding to the updated business bill message; in the asset output record table, the historical serial number to which the updated historical output message belongs can be obtained; where the historical serial number is used to represent the index position of the updated historical output message in the asset output record table; according to the historical business bill number, the target business bill number, and the historical serial number, a target input message for the target transaction service can be generated.

[0172] It should be understood that the process of generating the target input message and storing the target input message in the asset input record table can correspond to Step 3 in the above corresponding embodiment: Store the relevant data (the business bill number, serial number, and related elements of the historical output) of the historical output (the asset source information of digital asset 1) in the Input table. Figure 3

[0173] Step S105, generate a target output message for the target transaction service according to the updated business bill message, the asset transfer amount, and the receiving account address, and store the target output message in the asset output record table; the target output message has an asset unused status.

[0174] ​In this application, the target business bill number corresponding to the updated business bill message can be obtained; in the asset output record table, an incrementing serial number is generated; subsequently, according to the target business bill number, the incrementing serial number, the receiving account address, and the asset transfer amount, a target output message for the target transaction business can be generated.

[0175] It can be understood that the asset construction rule corresponding to the target transaction business can be obtained; among them, the asset construction rule can be used to specify the construction standard of the asset transfer amount; if the asset construction rule is a real-time construction rule, then the asset construction standard is a real-time construction standard, and the specific method for generating a target output message for the target transaction business according to the target business bill number, the incrementing serial number, the receiving account address, and the asset transfer amount is: according to the asset construction information corresponding to the asset transfer amount, construct the target asset corresponding to the asset transfer amount. If the asset construction rule is a delayed construction rule, then the asset construction standard is a delayed construction standard, and the asset construction information corresponding to the asset transfer amount can be obtained, and a target output message for the target transaction business can be generated according to the target business bill number, the incrementing serial number, the receiving account address, and the asset construction information.

[0176] Optionally, it can be understood that if the asset amount mapped by the sending account address is greater than the asset transfer amount, for example, in the above Figure 3 corresponding embodiment, the digital asset under the name of account A1 is digital asset 1, and 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 will be generated, and an affiliated output message can be generated according to the differential asset and stored in the asset output record table.

[0177] The specific method can be to obtain the differential asset amount between the total asset corresponding to the account asset and the asset transfer amount; according to the updated business bill message, the differential asset amount, and the sending account address, an affiliated output message for the target transaction business can be generated and stored in the asset output record table; among them, the affiliated output message has the unused state of the asset.

[0178] It should be understood that when the asset amount mapped to the sending account address is greater than the asset transfer amount, when generating the business bill message in the above step S101, the business bill message is not generated based on the asset transfer amount, but based on the asset amount mapped to the sending account address (for example, the value of digital asset 1 of account A1). In other words, the total asset amount recorded in the bill record table is the total asset amount of the payer (sending account address) in each transaction. The total asset amount can be used to calculate the sum of the amounts in the asset input record table (Input table) and the asset output record table (Output table).

[0179] For example, taking the above Figure 3 In the corresponding embodiment, the transaction business is that account A1 transfers a digital asset 2 to account A2 as an example. The total transaction amount contained in the business bill message recorded in the bill record table is the value of digital asset 1, and 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 subsidiary output message recorded in the asset output record table includes the value of digital asset 3 (difference digital asset); because the sum of the values ​​of digital asset 2 and digital asset 3 is the value of digital asset 1, it can be determined that the accounting of the asset output record table is correct.

[0180] Optionally, it is understandable that because a digital asset under an account name is spent (the corresponding output message is in the asset used status), the digital asset under the account name becomes invalid. In order to prevent the invalid digital asset from occupying the memory in the asset output record table, the output message with the asset used status in the asset output record table can be migrated according to time, so that the output message with the asset unused status is recorded in the asset output record table.

[0181] The specific migration method may be that, within the heartbeat cycle, the output message to be migrated in the output record table of the asset may be obtained; wherein the output message to be migrated has the status that the asset has been used; and then, the output message to be migrated and the input message and business bill message associated with the output message to be migrated may be migrated to the historical database together.

[0182] The specific migration method can also be as follows. Taking the migrated target output message as an example, the internal migration time range can be obtained. If the recorded timestamp of the target output message belongs to this internal migration time range, the asset transfer amount and the receiving account address included in the target output message can be obtained. The receiving account address can be used as the updated account address and the updated receiving account address respectively. According to the updated sending account address, the asset transfer amount, and the updated account address, an updated business bill message, an updated input message, and an updated output message are generated. The updated business bill message is stored in the bill record table, the updated input message is stored in the asset input record table, and the updated output message is stored in the asset output record table. Among them, the updated output message has an unused status.

[0183] Subsequently, the target output message can be switched from the unused asset status to the used asset status, and the target output message with the used asset status is determined as the output message to be migrated. Subsequently, the output message to be migrated, the input message and the business bill message associated with the output message to be migrated can be migrated to the historical database.

[0184] It should be understood that if the digital asset accounting system is sensitive to time, the output message with the unused asset status (for example, the target output message) in the asset output record table can be internally transferred first, that is, its asset status is changed from the unused asset status to the used asset status, and an updated output message with the unused asset status is generated. Subsequently, the output message with the used asset status can be migrated to the historical database.

[0185] For easy understanding, please also refer to Figure 5 , Figure 5 which is a schematic diagram of data migration provided by an embodiment of the present application. Among them, the present application can set a migration time for the output message in the UTXO data structure (Output table). Once the migration time arrives, the asset status of the output message in the asset output record table can be obtained. If the asset status of the output message is the used asset status, the output message with the used asset status can be used as the output message to be migrated, and the output message to be migrated, the input message (included in the Input table) and the business bill message (included in the bill record table) associated with the output message to be migrated are migrated to the historical database together.

[0186] As Figure 5 shown, if the migration time is once every 10 minutes, when the migration time arrives, the asset status of the output message can be obtained in the UTXO data structure.

[0187] Among them, the asset output table of the UTXO data structure contains output message 1, output message 2, output message 3, output message 4, and output message 5. Among them, the asset status of output message 1 is the asset used status, the asset status of output message 2 is the asset used status, the asset status of output message 3 is the asset unused status, the asset status of output message 4 is the asset used status, and the asset status of output message 5 is the asset used status. Then, output message 1, output record message 2, output message 4, and output message 5 with the asset used status can be migrated to the historical database.

[0188] It should be understood that the output message 3 with the asset unused status can be internally transferred, so that a new output (output message) can be generated. And the output message 3 will become a spent output message. Then, the spent output message 3 can be migrated to the historical database, and the new output message can be stored in the asset output table in the UTXO data structure.

[0189] As Figure 5 shown, if the account corresponding to the output message is account M, that is to say, the account number of the payee recorded in the output message is the account number of account M, then the digital assets recorded in the output message can be internally transferred, that is, the digital assets are transferred from account M to account M, so that the output message 3 becomes spent (the asset status is the asset used status), and a new output message (such as Figure 5 the output message 6 shown) will also be generated. Subsequently, the output message 3 with the asset used status can be migrated to the historical database, and the generated new output message 6 can be stored in the asset output record table in the UTXO data structure.

[0190] After migrating the output message, 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 historical database.

[0191] In the embodiments of the present application, for a target transaction service, a business bill record table is used to record business bill messages, an asset input record table is used to record relevant information about the asset source of the initiating account address in the target transaction service, and an asset output record table is used to record information such as the receiving account address and the asset transfer amount in the target transaction service. There is an association relationship between the asset input record table, the asset output record table, and the bill record table. In this way, 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 of the assets (receiving account address) in the target transaction service can be known through the asset output record table, thus retaining the complete asset transfer process and making the asset transfer path clearer. Moreover, in the asset input record table, the account assets of the initiating account address will be switched from the unused state to the used state. In the case where the asset is recorded as being in the used state, the asset will not be referenced again, so the situation of asset reuse can be controlled. Also, the process of performing invalidation processing using the UTXO data structure is simplified, and only the expired digital assets need to be migrated according to time, which can save a large amount of data storage space. In summary, through the bill record table, the asset input record table, and the asset output record table, the present application can retain the complete asset transfer process, make the asset transfer path clearer, and control the reuse of assets during the asset transfer process, thereby improving the reliability of business accounting. Moreover, this process no longer depends on the digital asset data stored in the digital asset database. Therefore, the storage pressure on the database can be reduced. At the same time, the invalidation processing flow is simplified, and data storage space is saved.

[0192] It should be understood that after storing the relevant information (business bill messages, asset input messages, and asset output messages) of the target transaction service in the digital asset accounting system (including the bill record table, the asset input record table, and the asset output record table), an asynchronous compensation operation can be performed according to the information recorded in the digital asset accounting system.

[0193] For ease of understanding, please refer to Figure 6 , Figure 6 which is a schematic flow diagram of an asynchronous compensation operation provided by the embodiments of the present application. As Figure 6 shown, the process may include:

[0194] Step S201, obtain the first account database to which the sending account address belongs, and the second account database to which the receiving account address belongs; the first account database includes the mapping relationship between the first account address and the asset; the first account address includes the sending account address; the second account database includes the mapping relationship between the second account address and the asset, and the second account address includes the receiving account address.

[0195] Step S202: In the first account database, set the asset status of the account assets to the used status.

[0196] In this application, the process from step S201 to step S202 can correspond to Figure 3 step 4 in the corresponding embodiment above: asynchronous compensation processing. In the database where account A1 is located, change the record of digital asset 1 of account A1 from locked to used.

[0197] It should be noted that if in this transaction service, the asset amount of the sending account address is greater than the asset transfer amount, then in this first account database, a record of the difference asset also needs to be added.

[0198] The specific method can be as follows. According to Figure 4 the affiliated output message (the affiliated output message corresponding to the difference asset amount) in the corresponding embodiment above, the difference asset corresponding to the difference asset amount can be obtained; subsequently, the first account database to which the sending account address belongs can be obtained; wherein, the first account database includes the mapping relationship between the first account address and the assets; the first account address includes the sending account address; the mapping relationship between the sending account address and the difference asset can be created, and the mapping relationship between the sending account address and the difference asset can be added to the first account database; subsequently, in the first account database, the asset status of the difference asset can be set to the available status.

[0199] Among them, the method of obtaining the difference asset according to the affiliated output message can be the same as the method of obtaining the target asset according to the target output message. The method of obtaining the target asset is that if the target output message contains the asset information of the target asset, the target asset can be obtained according to the asset information.

[0200] And if Figure 4 the asset construction standard for the asset transfer amount corresponding to the target transaction service in the corresponding embodiment above is the delayed construction standard, then the target output message contains the asset construction information, and the target output message can be obtained in the asset output record table, and the target asset corresponding to the asset transfer amount can be constructed according to the asset construction information. Similarly, for obtaining the difference asset, if the affiliated output message contains the asset information of the difference asset, the difference asset can be obtained according to the asset information, and if the affiliated output message contains the asset construction information of the difference asset, the difference asset can be constructed according to the asset construction information.

[0201] Subsequently, in the first account database, the asset status of the difference asset can be set to the available status.

[0202] Step S203: Create a mapping relationship between the receiving account address and the target asset, and add the mapping relationship between the receiving account address and the target asset to the second account database.

[0203] In this application, it should be understood that steps S201 - S202 may correspond to the asynchronous compensation processing in step 4 of the corresponding embodiment above. The differential asset corresponds to digital asset 3, the asset transfer amount corresponds to the value of digital asset 2, and the account assets of the sending account address correspond to digital asset 1. 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 may correspond to: In the database where account A2 is located, add a record of digital asset 2 of account A2. In this first account database, setting the asset status of the differential asset to the available status may correspond to: In the database where account A1 is located, insert a record of digital asset 3 of account A1 and set the status of digital asset 3 to the available status. Figure 3

[0204] In the embodiment of this application, through the record information in the bill record table, the asset output record table, and the asset input record table, the related sub - transactions of digital assets (for example, the sub - transaction of adding digital assets to the database) can be processed asynchronously, which can shorten the sub - transaction sequence in the distributed transaction.

[0205] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of a data processing device provided by an embodiment of this application. As Figure 7 shown, the data processing device may be a computer program (including program code) running in a computer device. For example, the data processing device is an application software; the data processing device can be used to execute Figure 4 the method shown. As Figure 7 shown, the data processing device 1 may include: a bill storage module 11, an asset acquisition module 12, a status switching module 13, a transaction status setting module 14, an input record generation module 15, and an output record generation module 16.

[0206] The bill storage module 11 is used to store the business bill message of the target transaction service into the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table;

[0207] The asset acquisition module 12 is used to acquire the account assets belonging to the sending account address;

[0208] ​A status switching module 13, configured to obtain a historical output message for characterizing the source of account assets from an asset output record table, switch the historical output message from an asset unused state to an asset used state, and obtain an updated historical output message;

[0209] A transaction status setting module 14, configured to set the transaction status corresponding to the business bill message in the bill record table to a transaction completed state, and obtain an updated business bill message;

[0210] An input record generation module 15, configured to generate a target input message for a target transaction business according to the updated historical output message and the updated business bill message, and store the target input message in an asset input record table;

[0211] An output record generation module 16, configured to generate a target output message for a target transaction business according to the updated business bill message, the asset transfer amount, and the receiving account address, and store the target output message in an asset output record table; the target output message has an asset unused state.

[0212] Among them, for the specific implementation manners of the bill storage module 11, the asset acquisition module 12, the status switching module 13, the transaction status setting module 14, the input record generation module 15, and the output record generation module 16, reference can be made to the descriptions of steps S101 - S105 in the corresponding embodiments above, which will not be elaborated here. Figure 4 For details, please refer to

[0213] Please refer to Figure 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.

[0214] The number acquisition unit 111 is configured to acquire a transaction number for characterizing a target transaction business, and generate a target business bill number according to the transaction number;

[0215] The transaction type acquisition unit 112 is configured to acquire the transaction business type to which the target transaction business belongs;

[0216] The bill storage unit 113 is configured to generate a business bill message for a target transaction business according to the transaction number, the target business bill number, the asset transfer amount, and the transaction business type, and store the business bill message in the bill record table.

[0217] Among them, for the specific implementation manners of the number acquisition unit 111, the transaction type acquisition unit 112, and the bill storage unit 113, reference can be made to the description in step S101 of the corresponding embodiments above, which will not be elaborated here. Figure 4 For details, please refer to

[0218] Please refer toFigure 7 The asset acquisition module 12 may include: a data acquisition unit 121 and an asset acquisition unit 122.

[0219] The data acquisition unit 121 is configured to acquire a first account database to which the sending account address belongs; the first account database includes a mapping relationship between an account address and an asset; the account address includes the sending account address;

[0220] The asset acquisition unit 122 is configured to acquire, from the first account database, an asset having a mapping relationship with the sending account address, and use the asset having a mapping relationship with the sending account address as the account asset belonging to the sending account address.

[0221] Wherein, for the specific implementation manners of the data acquisition unit 121 and the asset acquisition unit 122, reference may be made to the description in step S102 of the corresponding embodiment above, which will not be elaborated herein. Figure 4 The bill record table and the asset output record table are associated through a business bill number, and the business bill number is a bill number generated according to the transaction number of a transaction business, and one business bill number corresponds to an output message in an asset output record table;

[0222] Please refer to

[0223] The input record generation module 15 may include: a bill number acquisition unit 151, a historical sequence number acquisition unit 152, and an input record generation unit 153. Figure 7

[0224] The bill number acquisition unit 151 is configured to acquire a historical business bill number corresponding to an updated historical output message, and a target business bill number corresponding to an updated business bill message;

[0225] The historical sequence number acquisition unit 152 is configured to acquire, from the asset output record table, a historical sequence number to which the updated historical output message belongs; the historical sequence number is used to represent the index position of the updated historical output message in the asset output record table;

[0226] The input record generation unit 153 is configured to generate a target input message for a target transaction business according to the historical business bill number, the target business bill number, and the historical sequence number.

[0227] Figure 4 Wherein, for the specific implementation manners of the bill number acquisition unit 151, the historical sequence number acquisition unit 152, and the input record generation unit 153, reference may be made to the description in step S104 of the corresponding embodiment above, which will not be elaborated herein.

[0228]

[0228] Please refer to Figure 7, the output record generation module 16 may include: a target number acquisition unit 161, an incrementing sequence number generation unit 162, and an output record generation unit 163.

[0229] The target number acquisition unit 161 is configured to acquire the target business bill number corresponding to the updated business bill message;

[0230] The incrementing sequence number generation unit 162 is configured to generate an incrementing sequence number in the asset output record table;

[0231] The output record generation unit 163 is configured to generate a target output message for the target transaction service according to the target business bill number, the incrementing sequence number, the receiving account address, and the asset transfer amount.

[0232] Among them, for the specific implementation manners of the target number acquisition unit 161, the incrementing sequence number generation unit 162, and the output record generation unit 163, reference may be made to the description in step S105 in the corresponding embodiment above, which will not be elaborated here. Figure 4 Please refer to

[0233] Please refer to Figure 7 , the output record generation unit 163 may include: a construction rule acquisition subunit 1631, an asset construction subunit 1632, and an output record generation subunit 1633.

[0234] The construction rule acquisition subunit 1631 is configured to acquire the asset construction rule corresponding to the target transaction service; the asset construction rule is used to specify the construction standard of the asset transfer amount;

[0235] The asset construction subunit 1632 is configured to, if the asset construction standard of the asset transfer amount is a real-time construction standard, construct a target asset corresponding to the asset transfer amount according to the asset construction information corresponding to the asset transfer amount;

[0236] The output record generation subunit 1633 is configured to generate a target output message for the target transaction service according to the target business bill number, the incrementing sequence number, the receiving account address, and the asset information of the target asset.

[0237] Among them, for the specific implementation manners of the construction rule acquisition subunit 1631, the asset construction subunit 1632, and the output record generation subunit 1633, reference may be made to the description in step S105 in the corresponding embodiment above, which will not be elaborated here. Figure 4 Please refer to

[0238] Please refer to Figure 7 , the data processing device 1 may further include: a construction information acquisition module 17 and a target output message generation module 18.

[0239] Construct an information acquisition module 17, which is used to acquire the asset construction information corresponding to the asset transfer volume if the asset construction standard of the asset transfer volume is the delayed construction standard;

[0240] A target output message generation module 18, which is used to generate a target output message for the target transaction service according to the target business bill number, increment sequence number, receiving account address, and asset construction information.

[0241] Among them, for the specific implementation manners of the information acquisition module 17 and the target output message generation module 18, reference can be made to the description in step S105 in the corresponding embodiment above, and details will not be elaborated here. Figure 4 For details, please refer to

[0242] Please refer to Figure 7 , and this data processing device 1 may further include: a target asset construction module 19.

[0243] The target asset construction module 19 is used to, if the asset construction standard of the asset transfer volume is the delayed construction standard, acquire the target output message in the asset output record table, and construct the target asset corresponding to the asset transfer volume according to the asset construction information in the target output message.

[0244] Among them, for the specific implementation manner of the target asset construction module 19, reference can be made to the description in step S202 in the corresponding embodiment above, and details will not be elaborated here. Figure 6 For details, please refer to

[0245] Please refer to Figure 7 , and this data processing device 1 may further include: a database acquisition module 20, an asset status setting module 21, and a mapping relationship adding module 22.

[0246] The database acquisition module 20 is used to acquire the first account database to which the sending account address belongs and the second account database to which the receiving account address belongs; the first account database includes the mapping relationship between the first account address and the asset; the first account address includes the sending account address; the second account database includes the mapping relationship between the second account address and the asset, and the second account address includes the receiving account address;

[0247] The asset status setting module 21 is used to set the asset status of the account asset to the used status in the first account database;

[0248] The mapping relationship adding module 22 is used to create the mapping relationship between the receiving account address and the target asset, and add the mapping relationship between the receiving account address and the target asset to the second account database.

[0249] Among them, for the specific implementation manners of the database acquisition module 20, the asset status setting module 21, and the mapping relationship addition module 22, reference can be made to the descriptions of steps S201 - S203 in the corresponding embodiments above, which will not be elaborated here. Figure 6 For the descriptions of steps S201 - S203 in the corresponding embodiments above, which will not be elaborated here.

[0250] Please refer to Figure 7 , the data processing device 1 may further include: a difference amount acquisition module 23 and an affiliated record generation module 24.

[0251] The difference amount acquisition module 23 is configured to acquire the difference asset amount between the total asset amount corresponding to the account asset and the asset transfer amount;

[0252] The affiliated record generation module 24 is configured to generate an affiliated output message for the target transaction service according to the updated service bill message, the difference asset amount, and the sending account address, and store the affiliated output message in the asset output record table; the affiliated output message has an asset unused status.

[0253] Among them, for the specific implementation manners of the difference amount acquisition module 23 and the affiliated record generation module 24, reference can be made to the description of generating the affiliated output message in step S105 in the corresponding embodiments above, which will not be elaborated here. Figure 4 For the descriptions of generating the affiliated output message in step S105 in the corresponding embodiments above, which will not be elaborated here.

[0254] Please refer to Figure 7 , the data processing device 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.

[0255] The difference asset acquisition module 25 is configured to acquire the difference asset corresponding to the difference asset amount according to the affiliated output message;

[0256] The first database acquisition module 26 is configured to acquire the first account database to which the sending account address belongs; the first account database includes the mapping relationship between the first account address and the asset; the first account address includes the sending account address;

[0257] The relationship addition module 27 is 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;

[0258] The status setting module 28 is configured to set the asset status of the difference asset to an available status in the first account database.

[0259] Among them, for the specific implementation manners of the difference asset acquisition module 25, the first database acquisition module 26, the relationship addition module 27, and the status setting module 28, reference can be made to the corresponding embodiments above, Figure 6The description of step S202 in the corresponding embodiment will not be elaborated here.

[0260] Please refer to Figure 7 , the data processing device 1 may further include: a migration record acquisition module 29 and a record migration module 30.

[0261] The migration record acquisition module 29 is configured to acquire, within a heartbeat period, the output messages to be migrated in the asset output record table; the output messages to be migrated have the asset used status.

[0262] The record migration module 30 is configured to migrate the output messages to be migrated, the input messages and the service bill messages associated with the output messages to be migrated to the historical database.

[0263] Among them, for the specific implementation manners of the migration record acquisition module 29 and the record migration module 30, reference can be made to the description in step S105 in the corresponding embodiment above, which will not be elaborated here. Figure 4 The description of step S202 in the corresponding embodiment will not be elaborated here.

[0264] Please refer to Figure 7 , the data processing device 1 may further include: a time range acquisition module 31, an information acquisition module 32, an updated record storage module 33, an asset status switching module 34, and a message migration module 35.

[0265] The time range acquisition module 31 is configured to acquire the internal migration time range.

[0266] The information acquisition module 32 is configured to, if the record timestamp of the target output message belongs to the internal migration time range, acquire the asset transfer amount and the receiving account address included in the target output message.

[0267] The updated record storage module 33 is configured to use the receiving account address as the updated sending account address and the updated receiving account address respectively, generate an updated service bill message, an updated input message, and an updated output message according to the updated sending account address, the asset transfer amount, and the updated receiving account address, store the updated output message in the asset output record table, store the updated service bill message in the bill record table, and store the updated input message in the asset input record table; the updated output message has the asset unused status.

[0268] The asset status switching module 34 is configured to switch the target output message from the asset unused status to the asset used status, and determine the target output message with the asset used status as the output message to be migrated.

[0269] The message migration module 35 is configured to migrate the output messages to be migrated, the input messages and the service bill messages associated with the output messages to be migrated to the historical database.

[0270] Among them, for the specific implementation manners of the time range obtaining module 31, the information obtaining module 32, the updated record storage module 33, the asset status switching module 34, and the message migration module 35, reference can be made to the description in step S105 of the corresponding embodiment above, and details will not be elaborated here. Figure 4 The description in step S105 of the corresponding embodiment above will not be repeated here.

[0271] In the embodiment of the present application, for a target transaction service, business bill messages are recorded through a bill record table, relevant information on the asset source of the initiating account address in the target transaction service is recorded through an asset input record table, and information such as the receiving account address and the asset transfer amount in the target transaction service is recorded through an asset output record table. There is an association relationship between the asset input record table, the asset output record table, and the bill record table. In this way, 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 of the assets (receiving account address) in the target transaction service can be known through the asset output record table, thus retaining a complete asset transfer process and making the asset transfer path clearer. Moreover, in the asset input record table, the account assets of the initiating account address are switched from the unused state to the used state. When the asset is recorded as being in the used state, the asset will not be referenced again, so the situation of asset reuse can be controlled. Also, the process of using the UTXO data structure for invalidation processing is simplified, and only the expired digital assets need to be migrated according to time, which can save a large amount of data storage space. In summary, through the bill record table, the asset input record table, and the asset output record table in the present application, a complete asset transfer process can be retained, making the asset transfer path clearer. Moreover, during the asset transfer process, the reuse of assets can be controlled, thereby improving the reliability of business accounting. And this process no longer depends on the digital asset data stored in the digital asset database. Therefore, the storage pressure on the database can be reduced. At the same time, the invalidation processing flow is simplified, and data storage space is saved.

[0272] Further, please refer to Figure 8 , Figure 8 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 8 shown, the above Figure 7The device 1 in the corresponding embodiment can be applied to the above computer device 1000, which may include: a processor 1001, a network interface 1004, and a memory 1005. In addition, the computer device 1000 further includes: a user interface 1003 and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1005 may also be at least one storage device located far from the aforementioned processor 1001. As Figure 8 shown, the memory 1005, as a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0273] In Figure 8 the computer device 1000 shown, the network interface 1004 can provide network communication functions; while the user interface 1003 is mainly used to provide an input interface for users; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to implement:

[0274] Storing the service bill message of the target transaction service into the bill record table; the target transaction service includes the sending account address, the asset transfer amount, and the receiving account address; there is an association relationship between the bill record table, the asset output record table, and the asset input record table;

[0275] Obtaining the account assets belonging to the sending account address, obtaining the historical output message for characterizing the asset source of the account assets from the asset output record table, and switching the historical output message from the asset unused state to the asset used state to obtain the updated historical output message;

[0276] Setting the transaction status corresponding to the service bill message in the bill record table to the traded status to obtain the updated service bill message;

[0277] Generating a target input message for the target transaction service according to the updated historical output message and the updated service bill message, and storing the target input message into the asset input record table;

[0278] Generate a target output message for the target transaction service according to the updated business bill message, the asset transfer volume, and the receiving account address, and store the target output message in the asset output record table; the target output message has an asset unused status.

[0279] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method in the corresponding embodiments mentioned above, and can also execute the description of the data processing device 1 in the corresponding embodiments mentioned above, which will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. Figures 4 to 6 The description of the data processing method in the corresponding embodiments mentioned above, and can also execute the description of the data processing device 1 in the corresponding embodiments mentioned above, which will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. Figure 7 It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method in the corresponding embodiments mentioned above, and can also execute the description of the data processing device 1 in the corresponding embodiments mentioned above, which will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either.

[0280] In addition, it should be pointed out here that: the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the computer device 1000 for data processing mentioned above, and the computer program includes program instructions. When the above-mentioned processor executes the above-mentioned program instructions, it can execute the description of the above-mentioned data processing method in the corresponding embodiments mentioned above. Therefore, it will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application. Figures 4 to 6 It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method in the corresponding embodiments mentioned above, and can also execute the description of the data processing device 1 in the corresponding embodiments mentioned above, which will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application.

[0281] The above-mentioned computer-readable storage medium may be the data processing device provided in any of the foregoing embodiments or the internal storage unit of the above-mentioned computer device, such as the hard disk or 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 media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium is also used to temporarily store data that has been output or will be output.

[0282] In one aspect of the present application, there is provided a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are 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, so that the computer device executes the method provided in one aspect of the embodiments of the present application.

[0283] In the description, claims, and drawings of the embodiments of this application, terms such as "first" and "second" are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally further include steps or modules not listed, or may optionally further include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0284] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0285] The methods and related apparatuses provided in the embodiments of this application are described with reference to the method flowcharts and / or structural schematic diagrams provided in the embodiments of this application. Specifically, each process and / or block of the method flowchart and / or structural schematic diagram, and the combination of the processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or structural schematic Figure 1 one block or multiple blocks. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or structural schematic Figure 1 one block or multiple blocks. These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or structural schematic one block or multiple blocks.

[0286] The above-disclosed are only the preferred embodiments of the present application. Of course, the scope of rights of the present application cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.

Claims

1. A data processing method, characterized in that, Including: Storing the business bill message of the target transaction business into a bill record table; the target transaction business includes a sending account address, an asset transfer amount, and a receiving account address; There is an associated relationship between the bill record table, the asset output record table, and the asset input record table; Obtaining the account assets belonging to the sending account address, obtaining the historical output message used to represent the asset source of the account assets from the asset output record table, and switching the historical output message from the asset unused state to the asset used state to obtain an updated historical output message; Setting the transaction status corresponding to the business bill message in the bill record table to the traded state to obtain an updated business bill message; Generating a target input message for the target transaction business according to the updated historical output message and the updated business bill message, and storing the target input message into the asset input record table; Generating a target output message for the target transaction business according to the updated business bill message, the asset transfer amount, and the receiving account address, and storing the target output message into the asset output record table; The target output message has the asset unused state; Among them, generating a target output message for the target transaction business according to the updated business bill message, the asset transfer amount, and the receiving account address includes: obtaining the target business bill number corresponding to the updated business bill message; generating an incrementing serial number in the asset output record table; obtaining the asset construction rule corresponding to the target transaction business; the asset construction rule is used to specify the construction standard of the asset transfer amount; if the asset construction standard of the asset transfer amount is a real-time construction standard, then constructing the target asset corresponding to the asset transfer amount according to the asset construction information corresponding to the asset transfer amount; generating a target output message for the target transaction business according to the target business bill number, the incrementing serial number, the receiving account address, and the asset information of the target asset.

2. The method according to claim 1, characterized in that, The storing the business bill message of the target transaction business into a bill record table includes: Obtaining the transaction number used to represent the target transaction business, and generating a target business bill number according to the transaction number; Obtaining the transaction business type to which the target transaction business belongs; Generating the 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 the bill record table.

3. The method according to claim 1, wherein The obtaining the account assets belonging to the sending account address includes: Obtaining the first account database to which the sending account address belongs; the first account database includes the mapping relationship between the account address and the assets; the account address includes the sending account address; Obtaining the assets having the mapping relationship with the sending account address in the first account database, and taking the assets having the mapping relationship with the sending account address as the account assets belonging to the sending account address.

4. The method according to claim 2, wherein The bill record table is associated with the asset output record table through a business bill number, which is a bill number generated based on the transaction number of a transaction business. One business bill number corresponds to an output message in an asset output record table; Generating a target input message for the target transaction business according to the updated historical output message and the updated business bill message includes: Obtaining the historical business bill number corresponding to the updated historical output message and the target business bill number corresponding to the updated business bill message; In the asset output record table, obtaining the historical serial number to which the updated historical output message belongs; the historical serial number is used to represent the index position of the updated historical output message in the asset output record table; Generating a target input message for the target transaction business according to the historical business bill number, the target business bill number, and the historical serial number.

5. The method according to claim 1, wherein After obtaining the asset construction rule corresponding to the target transaction business, the method further includes: If the asset construction standard of the asset transfer amount is a delayed construction standard, obtaining the asset construction information corresponding to the asset transfer amount; Generating a target output message for the target transaction business according to the target business bill number, the increment serial number, the receiving account address, and the asset construction information.

6. The method according to claim 5, wherein The method further includes: If the asset construction standard of the asset transfer amount is a delayed construction standard, obtaining 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.

7. The method according to claim 1 or 6, characterized in that, The method further includes: Obtaining 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 includes a mapping relationship between a first account address and an asset; the first account address includes the sending account address; the second account database includes a mapping relationship between a second account address and an asset, and the second account address includes the receiving account address; In the first account database, setting the asset status of the account asset to a used status; 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.

8. The method according to claim 1, characterized in that, The method further includes: Obtaining the difference asset amount between the total asset amount corresponding to the account asset and the asset transfer amount; Generating an affiliated output message for the target transaction business according to the updated business bill message, the difference asset amount, and the sending account address, and storing the affiliated output message in the asset output record table; the affiliated output message has an asset unused status.

9. The method according to claim 8, wherein The method further includes: Obtaining the difference asset corresponding to the difference asset amount according to the affiliated output message. Obtain the first account database to which the sending account address belongs; the first account database includes the mapping relationship between the first account address and the assets; the first account address includes the sending account address; Create the mapping relationship between the sending account address and the differential assets, and add the mapping relationship between the sending account address and the differential assets to the first account database; In the first account database, set the asset status of the differential assets to the available status.

10. The method according to claim 1, wherein The method further includes: During the heartbeat period, obtain the to-be-migrated output messages in the asset output record table; the to-be-migrated output messages have the asset used status; Migrate the to-be-migrated output messages, the input messages and the business bill messages associated with the to-be-migrated output messages to the historical database.

11. The method according to claim 1, wherein The method further includes: Obtain the internal migration time range; If the record timestamp of the target output message belongs to the internal migration time range, obtain the asset transfer amount and the receiving account address included in the target output message; Respectively use the receiving account address as the updated sending account address and the updated receiving account address. According to the updated sending account address, the asset transfer amount and the updated receiving account address, generate an updated business bill message, an updated input message and an updated output message, store the updated output message in the asset output record table, store the updated business bill message in the bill record table, and store the updated input message in the asset input record table; the updated output message has the asset unused status; Switch the target output message from the asset unused status to the asset used status, and determine the target output message with the asset used status as the to-be-migrated output message; Migrate the to-be-migrated output messages, the input messages and the business bill messages associated with the to-be-migrated output messages to the historical database.

12. A computer device, characterized in that, Includes: A processor, a memory and a network interface; The processor is connected to the memory and the network interface. Among them, the network interface is used to provide network communication functions, the memory is used to store program codes, and the processor is used to call the program codes to execute the method according to any one of claims 1-11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by the processor, the method according to any one of claims 1-11 is executed.

Citation Information

Patent Citations

  • Block-chain-based information transfer method, device, medium and electronic device

    CN109388957A