Blockchain-based Business Data Processing Method, Device, Equipment and Storage Medium
Through the blockchain-based business data processing method, the incomplete and inefficient invoice content during the electronic invoice issuance process is solved, efficient electronic invoice generation and account balance update are achieved, and invoice issuance efficiency and data accuracy are improved.
Patent Information
- Application Number
- CN202411361942.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the process of issuing electronic invoices, the invoice contents are incomplete and irregular. The invoice issuance efficiency is low and manual assistance is required, resulting in the invoice issuance process inefficient.
The blockchain-based business data processing method is adopted to obtain the business data to be traded for price prediction, generate the initial transaction contract, and update the contract based on feedback information, and finally generate electronic bills, and use blockchain technology to verify and on-chain processing to realize the generation of electronic bills and update the account balance.
It improves the invoice efficiency, reduces unnecessary information exchange processes, shortens transaction completion time, reduces manual input and error rates, and ensures data accuracy and consistency.
Smart Images

Figure CN119338539B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a blockchain-based business data processing method, device, equipment and storage medium. Background Art
[0002] In today's digital age, the issuance and management of financial invoices has become an indispensable part of corporate operations. With the advancement of "Internet +" technology and the development of the market, electronic invoices have gradually replaced traditional paper invoices and become the mainstream form of invoices. The current form of invoicing requires manual assistance. However, when the workload of invoicing is large, problems such as incomplete, non-standard or unclear invoice content may occur, such as missing purchaser information, unclear product or service names, etc., and the invoicing efficiency during the invoicing process is not high. Summary of the invention
[0003] The embodiments of the present application provide a blockchain-based business data processing method, device, equipment and storage medium, which can improve the efficiency of invoicing.
[0004] On the one hand, an embodiment of the present application provides a business data processing method based on blockchain, the method comprising:
[0005] Acquire the business data to be traded sent by the first object, perform price prediction on the business data to be traded, obtain the predicted transaction price of the business data to be traded, generate an initial transaction contract based on the predicted transaction price and the business data to be traded, and send the initial transaction contract to the first object, so that the first object generates feedback information based on the initial transaction contract;
[0006] Acquire feedback information sent by the first object, predict contract update data that meets the transaction rate condition based on the feedback information, and update the initial transaction contract based on the contract update data to obtain an updated transaction contract;
[0007] Generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be uploaded to the blockchain based on the first invoicing key data; the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract;
[0008] When it is detected that the second block to be chained has been created in the invoicing node, the transaction data and transaction signature in the second block are verified; the transaction data is used to indicate that the transaction funds in the account address of the first object are transferred to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block;
[0009] If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, the first block and the second block are sequentially chained, a first electronic bill corresponding to the transaction order is generated based on the chained first block, the first electronic bill is sent to the first object, and the account balance of the first object and the account balance of the main object in the state tree in the blockchain are updated based on the chained second block.
[0010] On the one hand, an embodiment of the present application provides a business data processing device based on blockchain, the device comprising:
[0011] A contract generation module, configured to obtain the business data to be traded sent by the first object, perform price prediction on the business data to be traded, obtain the predicted transaction price of the business data to be traded, generate an initial transaction contract based on the predicted transaction price and the business data to be traded, and send the initial transaction contract to the first object, so that the first object generates feedback information based on the initial transaction contract;
[0012] A contract update module, configured to obtain feedback information sent by the first object, predict contract update data that meets the transaction rate condition based on the feedback information, and update the initial transaction contract based on the contract update data to obtain an updated transaction contract;
[0013] A block creation module, configured to generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be uploaded to the blockchain based on the first invoicing key data; the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract;
[0014] A data verification module is used to verify the transaction data and transaction signature in the second block when it is detected that the second block to be chained has been created in the invoicing node; the transaction data is used to indicate that the transaction funds in the account address of the first object are transferred to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block;
[0015] The bill generation module is used to, if it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then sequentially chain the first block and the second block, generate a first electronic bill corresponding to the transaction order based on the chained first block, send the first electronic bill to the first object, and update the account balance of the first object and the account balance of the main object in the state tree in the blockchain based on the chained second block.
[0016] In a possible implementation, when the contract generation module is used to generate an initial transaction contract based on the predicted transaction price and the business data to be traded, the contract generation module is specifically used to perform the following operations:
[0017] Obtaining the contract template associated with the to-be-traded business data from the business template library, and generating a Gaussian noise image according to the contract template and the initial noise data;
[0018] The predicted transaction price and the business data to be traded are semantically expanded through a large language model to obtain an instruction text;
[0019] The Gaussian noise image and the instruction text are input into the Wensheng graph model, the Gaussian noise image is feature extracted by the Wensheng graph model to obtain Gaussian noise features, and the Gaussian noise features are forward diffused to obtain a forward noise vector;
[0020] The feature encoding of the instruction text is performed through the text graph model to obtain the text encoding feature. The Gaussian noise image is denoised according to the forward noise vector and the text encoding feature to obtain the initial transaction contract.
[0021] In a possible implementation, when the contract update module is used to predict the contract update data that meets the transaction rate condition based on the feedback information, the contract update module is specifically used to perform the following operations:
[0022] Perform semantic analysis on the feedback information to obtain feedback semantic data, and generate the object demand price based on the feedback semantic data;
[0023] Obtain price update parameters, and generate M transaction prices to be updated based on the object demand price, predicted transaction price and price update parameters; M is a positive integer;
[0024] Obtaining M historical transaction behavior data corresponding to the transaction prices to be updated, respectively, and performing feature extraction on the M historical transaction behavior data to obtain M historical transaction behavior features;
[0025] Extract features of the transaction business data to obtain features of the transaction business, perform cross-attention processing on the transaction business features and M historical transaction behavior features, and obtain M cross-attention scores;
[0026] Determine an attention score threshold based on the transaction rate condition, and form a cross-attention sequence with the cross-attention scores greater than or equal to the attention score threshold among the M cross-attention scores; the cross-attention sequence includes N cross-attention scores, where N is a positive integer less than or equal to M;
[0027] Obtain the to-be-updated transaction prices corresponding to N cross-attention scores respectively, and determine the largest to-be-updated transaction price among the N to-be-updated transaction prices as the contract update data.
[0028] In a possible implementation manner, when the contract update module is used to update the initial transaction contract based on the contract update data to obtain the updated transaction contract, the contract update module is specifically used to perform the following operations:
[0029] Perform image recognition on the initial transaction contract to obtain an image recognition result, and perform text feature extraction on the image recognition result to obtain the initial text features;
[0030] Perform character segmentation on the initial text features to obtain character segmentation features, perform character recognition on the character segmentation features to obtain text information, and perform typesetting on the text information to obtain a text parsing result;
[0031] Determine the to-be-updated fields that match the predicted transaction price in the text parsing result, replace the to-be-updated fields with the contract update data in the text parsing result to obtain an updated text parsing result, and fuse the non-text layer corresponding to the initial transaction contract with the updated text parsing result to obtain the updated transaction contract; The non-text layer refers to the image after removing the text parsing result from the initial transaction contract.
[0032] In a possible implementation manner, when the bill generation module is used to generate the first electronic bill corresponding to the transaction order based on the first block that has been chained, the bill generation module is specifically used to perform the following operations:
[0033] Obtain the first key invoicing data for the transaction order in the first block that has been chained, and generate a first invoicing instruction for the first key invoicing data; The first invoicing instruction includes the first key invoicing data;
[0034] Send the first invoicing instruction to the invoicing processing component so that the invoicing processing component adds the first invoicing instruction to the invoicing processing sequence; The position of the first invoicing instruction is at the end of the invoicing processing sequence; The invoicing processing component is used to perform invoicing processing on each invoicing instruction in the invoicing processing sequence according to the sorting position of the invoicing instructions in the invoicing processing sequence;
[0035] Obtain the processing result of the invoicing processing component for the first invoicing instruction, and determine the processing result as the first electronic bill corresponding to the transaction order.
[0036] In a possible implementation manner, the bill generation module is further used to perform the following operations:
[0037] Detect the urgency level of the transaction order corresponding to the first invoicing instruction to obtain the urgency level value corresponding to the transaction order;
[0038] If the urgency value is greater than or equal to the urgency threshold, a priority invoicing processing request for the transaction order is generated and sent to the first processing node, so that the first processing node generates an invoicing processing notice for the priority invoicing processing request;
[0039] When the invoicing processing notice indicates that the priority invoicing processing request passes, notify the invoicing processing component to move the sorting position of the first invoicing instruction to the first place in the invoicing processing sequence.
[0040] In a possible implementation manner, when the bill generation module is used to detect the urgency of the transaction order corresponding to the first invoicing instruction and obtain the urgency value corresponding to the transaction order, the bill generation module is specifically used to perform the following operations:
[0041] Determine the influencing factors that affect the urgency of the transaction order corresponding to the first invoicing instruction, obtain the urgency influencing data associated with the influencing factors from the transaction order, input the urgency influencing data into the urgency evaluation model, and perform feature extraction on the urgency influencing data based on the urgency evaluation model to obtain the influencing data features;
[0042] Obtain B urgency labels and the label degree values respectively corresponding to the B urgency labels, perform feature extraction on the B urgency labels to obtain a label feature sequence including B label features; B is a positive integer;
[0043] Perform cross-attention processing on the influencing data features and the label feature sequence to obtain an urgency attention sequence including B attention scores, determine the urgency label corresponding to the largest attention score in the urgency attention sequence as the target urgency label, and determine the label degree value corresponding to the target urgency label as the urgency value corresponding to the transaction order; the B urgency labels include the target urgency label.
[0044] In a possible implementation manner, the blockchain-based business data processing device further includes a bill approval module, and the bill approval module is specifically used to perform the following operations:
[0045] When receiving the second electronic bill sent by the second object, obtain the second key invoicing data in the second electronic bill, perform block traversal in the blockchain based on the second key invoicing data, and if the target block containing the second key invoicing data is traversed, it is determined that the legality detection for the second electronic bill passes;
[0046] Obtain the third object indicated in the second key invoicing data, and if the third object is an associated object of the main object, it is determined that the compliance detection for the second electronic bill passes;
[0047] If the legality detection and compliance detection of the second electronic bill both pass, obtain the transaction value corresponding to the second electronic bill from the target block.
[0048] Obtain the account address of the second object, obtain the asset to be transferred corresponding to the transaction value from the digital assets corresponding to the account of the main object, and transfer the asset to be transferred to the account address of the second object.
[0049] In a possible implementation, the business data processing device based on the blockchain further includes a business processing module, and the business processing module is specifically configured to perform the following operations:
[0050] Obtain the set of electronic bills associated with the main object, and obtain the transaction flow information of the account corresponding to the main object; the set of electronic bills includes the first electronic bill and the second electronic bill.
[0051] Perform data verification on the set of electronic bills through the transaction flow information, and determine the electronic bills that pass the data verification in the set of electronic bills as actual electronic bills.
[0052] Generate a financial statement for the main object based on the actual electronic bills.
[0053] In a possible implementation, when the business processing module is used to generate a financial statement for the main object based on the actual electronic bills, the business processing module is specifically configured to perform the following operations:
[0054] Classify the actual electronic bills according to the bill type to obtain P expenditure electronic bills and Q income electronic bills; both P and Q are positive integers.
[0055] Extract the expenditure transaction data in the P expenditure electronic bills and the business types corresponding to the expenditure transaction data respectively, and add the first type character to the P expenditure transaction data respectively to obtain P updated expenditure transaction data; the first type character is used to represent the data type of the updated expenditure transaction data.
[0056] Extract the income transaction data in the Q income electronic bills and the business types corresponding to the income transaction data respectively, and add the second type character to the Q income transaction data respectively to obtain Q updated income transaction data; the second type character is used to represent the data type of the updated income transaction data.
[0057] Perform drawing processing on the P updated expenditure transaction data, the business types corresponding to the P updated expenditure transaction data respectively, the Q updated income transaction data, and the business types corresponding to the Q updated income transaction data respectively to obtain a financial statement for the main object.
[0058] In a possible implementation, the business processing module is specifically further configured to perform the following operations:
[0059] Obtain a business analysis request, obtain the business analysis template indicated by the business analysis request from the business template library based on the business analysis request, and input the business analysis request, financial statements, and business analysis template into a large language model;
[0060] Semantically parse the business analysis request through the large language model to obtain business semantic information, and generate an initial business analysis result for the business analysis request based on the business semantic information and financial statements;
[0061] Determine A to-be-supplemented fields in the business analysis template, respectively obtain the context information of the A to-be-supplemented fields, and split the initial business analysis result based on the A context information to obtain business analysis fields corresponding to the A to-be-supplemented fields respectively; A is a positive integer;
[0062] In the business analysis template, replace the A to-be-supplemented fields with the business analysis fields corresponding to the A to-be-supplemented fields respectively to obtain a target business analysis result for the business analysis request.
[0063] An embodiment of the present application provides a computer device on the one hand, including a processor, a memory, and an input / output interface;
[0064] The processor is respectively connected to the memory and the input / output interface. Among them, the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device including the processor executes the method in an embodiment of the present application on the one hand.
[0065] An embodiment of the present application provides a computer-readable storage medium on the one hand. The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computer device with the processor executes the method in an embodiment of the present application on the one hand.
[0066] An embodiment of the present application provides a computer program product or a computer program on the one hand. 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 methods provided in various alternative manners in an embodiment of the present application on the one hand. In other words, when the computer instructions are executed by the processor, the methods provided in various alternative manners in an embodiment of the present application are implemented.
[0067] Implementing the embodiments of the present application will have the following beneficial effects:
[0068] In an embodiment of the present application, the business data to be traded sent by the first object is obtained, a price prediction is performed on the business data to be traded to obtain a predicted transaction price of the business data to be traded, an initial transaction contract is generated based on the predicted transaction price and the business data to be traded, and the initial transaction contract is sent to the first object, so that the first object generates feedback information based on the initial transaction contract; the feedback information sent by the first object is obtained, contract update data that meets the transaction rate condition is predicted based on the feedback information, and the initial transaction contract is updated based on the contract update data to obtain an updated transaction contract; a transaction order is generated based on the updated transaction contract, and the transaction order is sent to the first object, and the first invoicing key data in the transaction order is sent to the invoicing node in the blockchain, so that the invoicing node generates a first block to be chained based on the first invoicing key data; the transaction order includes updating the transaction contract The same as the contract signature generated for the updated transaction contract; when it is detected that the second block to be chained has been created in the invoicing node, the transaction data and transaction signature in the second block are verified; the transaction data is used to indicate that the transaction funds in the account address of the first object are transferred to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block; if it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, the first block and the second block are chained in turn, and the first electronic bill corresponding to the transaction order is generated based on the first block that has been chained, the first electronic bill is sent to the first object, and the account balance of the first object and the account balance of the main object in the state tree of the blockchain are updated based on the second block that has been chained. Through the above process, the transaction price is predicted based on the business data to be traded, and the initial transaction contract is generated based on the predicted transaction price. The initial transaction contract is directly sent to the first object to obtain feedback information, and the initial transaction contract is updated based on the feedback information to obtain an updated transaction contract, thereby saving unnecessary multiple information exchange processes and accelerating the transaction completion time; after the transaction order is generated, the corresponding first block to be chained is generated based on the first invoicing key data corresponding to the transaction order, so that when it is detected that the second block (including transaction data for the transaction order) has been created, that is, when the first object agrees to the transaction order, the two blocks can be directly chained to obtain the corresponding electronic invoice, thereby improving the invoicing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0070] Figure 1 It is an architecture diagram of network interaction provided by an embodiment of the present application;
[0071] Figure 2 It is a schematic diagram of a scenario of a business data processing method based on blockchain provided by an embodiment of the present application;
[0072] Figure 3 It is a flowchart of a business data processing method based on blockchain provided by an embodiment of the present application Figure 1 ;
[0073] Figure 4 It is a flowchart of a business data processing method based on blockchain provided by an embodiment of the present application Figure 2 ;
[0074] Figure 5 It is a schematic diagram of a business data processing device based on blockchain provided by an embodiment of the present application;
[0075] Figure 6 It is a schematic diagram of the structure of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0076] 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.
[0077] Among them, if it is necessary to collect data of an object (such as a user, etc.) in the present application, a prompt interface or a pop-up window is displayed before and during the collection. The prompt interface or the pop-up window is used to prompt the user that certain data is currently being collected. Only after obtaining the user's confirmation operation on the prompt interface or the pop-up window, the relevant steps for data acquisition are started, otherwise it ends. Moreover, for the obtained user data, it will be used in reasonable, legal scenarios or uses, etc. Optionally, in some scenarios where user data needs to be used but the user's authorization has not been obtained, authorization can also be requested from the user, and the user data will be used when the authorization is passed.
[0078] It can be understood that in the specific implementation manners of the present application, for the user data involved, when the following embodiments of the present application are applied to specific products or technologies, the user's permission or consent needs to be obtained, and the collection, use, and processing of the relevant data need to comply with the relevant laws, regulations, and standards in the relevant regions.
[0079] In the embodiments of the present application, please refer to Figure 1 , Figure 1It is a network interaction architecture diagram provided by an embodiment of the present application. Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. It is mainly used to sort data in chronological order, encrypt it into a ledger, making it impossible to be tampered with or forged, and at the same time, data verification, storage, and update can be carried out. Essentially, blockchain is a decentralized database, and each node in this database stores an identical blockchain. The blockchain network divides nodes into core nodes, data nodes, and light nodes, where core nodes are responsible for the consensus of the entire blockchain network, that is to say, core nodes are consensus nodes in the blockchain network. For the process in which data or generated blocks in the blockchain network are written into the ledger, it can be that the client sends data or generated blocks to data nodes or light nodes, and then this data or generated blocks are passed between data nodes or light nodes in the blockchain network in a relay manner until the consensus node receives this data or generated blocks. The consensus node then packs this data into a block, conducts consensus with other consensus nodes, and after the consensus passes, writes the block carrying this data into the ledger.
[0080] As Figure 1 shown, this network architecture may include a core node cluster 101, a data node cluster 102, and a user terminal cluster 103. As Figure 1 shown, this core node cluster 101 may include core node 101a, core node 101b, …, core node 101n. This data node cluster 102 may specifically include data node 102a, data node 102b, …, data node 102n. This user terminal cluster 103 may specifically include user terminal 103a, user terminal 103b, …, user terminal 103n.
[0081] As Figure 1 shown, user terminals 103a, 103b, …, 103n may be respectively network-connected to data nodes 102a, 102b, …, 102n so that user terminals can conduct data interaction with data nodes through this network connection; data nodes 102a, 102b, …, 102n may be respectively network-connected to core nodes 101a, 101b, …, 101n so that data nodes can conduct data interaction with core nodes through this network connection; data nodes 102a, 102b, …, 102n are connected to each other so that data interaction can be carried out between data nodes, and core nodes 101a, 101b, …, 101n are connected to each other so that data interaction can be carried out between core nodes.
[0082] Taking the user terminal 103a, the data node 102a, and the core node 101a as examples, the data node 102a can receive the data sent by the user terminal 103a. The data node 102a can package the data to generate a block, and send the block to the core node 101a through the data node cluster 102. Subsequently, the core node 101a can, according to the node identifiers of other core nodes (i.e., consensus nodes) in the blockchain network, send the above-mentioned block to other core nodes in its blockchain network respectively. Other core nodes will verify the newly generated block (i.e., conduct consensus), and after completing the verification, add the above-mentioned block to the ledger they belong to. Among them, each core node in the blockchain network has its corresponding node identifier, and each core node in the blockchain network can store the node identifiers of other core nodes in the blockchain network, so as to subsequently broadcast the generated block to other core nodes in the blockchain network according to the node identifiers of other core nodes. Other core nodes will conduct consensus on the newly generated block, and after the consensus passes, add the newly generated block to the ledgers of other core nodes as well, so that the transaction data stored on all core nodes in the blockchain network is consistent.
[0083] For the sake of understanding, the user terminal corresponding to the first object (i.e., the user) can be Figure 1 the user terminal 103b shown, and the user terminal corresponding to the main object can be Figure 1 the user terminal 103a shown. Both the user terminal 103a and the user terminal 103b can be installed with a resource client. The resource client can be used to implement the resource management service function and realize the communication connection with the decentralized application client based on this resource management service function. Among them, the resource client is a tool for managing and storing user digital assets. For example, digital assets can be transferred to other accounts based on the resource client, and digital assets transferred from other accounts can also be received based on the resource client. The resource client can be a hardware device or a software program. It can be understood that with the wide deployment of various decentralized applications on the blockchain and the increase in user activities on the blockchain, when ordinary users use decentralized applications, they can use the blockchain key management tool for login. The address in the blockchain key management tool corresponds to a user on the blockchain, and the decentralized application can obtain the user address from the key management tool through some interfaces.
[0084] The user terminal 103a can obtain the business data to be traded sent by the first object (user terminal 103b), wherein the business data to be traded may include items that the first object needs to rent or purchase from the main object corresponding to the user terminal 103a, as well as the quantity of items, etc. The user terminal 103a can predict the price of the business data to be traded through the price list prepared in advance by the main object or the trained pricing prediction model, and obtain the predicted transaction price of the business data to be traded. An initial transaction contract can be generated based on the predicted transaction price and the business data to be traded, and the initial transaction contract can be sent to the user terminal 103b corresponding to the first object. After receiving the initial transaction contract, the first object can read and determine the transaction content and predicted transaction price, etc., and generate a feedback information based on the initial transaction contract, and send the feedback information to the user terminal 103a. Among them, when the first object has doubts about the predicted transaction price (for example, it is believed that the predicted transaction price does not meet psychological expectations), the feedback information may include feedback on the predicted transaction price (for example, it is believed that the predicted transaction price is too high, and a price reduction is requested or an expected transaction price is fed back, etc.).
[0085] The user terminal 103a can obtain the feedback information sent by the first object, and predict the contract update data that meets the transaction rate condition based on the feedback information. For example, the user terminal 103a can determine a transaction price that satisfies a certain transaction rate condition (for example, the expected transaction rate reaches 85%) and greatly satisfies its own benefits based on the feedback information and the predicted transaction price, and determine it as the contract update data. The initial transaction contract can be updated based on the contract update data to obtain an updated transaction contract. The user terminal 103a can generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain (for example, it can be Figure 1The data node 102a) shown in the figure enables the invoicing node to generate a first block to be uploaded to the blockchain based on the first invoicing key data. Among them, the transaction order includes an updated transaction contract and a contract signature generated for the updated transaction contract. The transaction order can be a transaction invitation including the updated transaction contract and the contract signature generated for the updated transaction contract. That is, when the first party agrees to the transaction invitation, the transaction can take effect. When the user terminal 103a detects that a second block to be uploaded to the blockchain has been created in the invoicing node, that is, after the first party agrees to the transaction order (or signs the updated transaction contract), the user terminal 103b can send the transaction information for the transaction order (including the transaction order, the transaction data for the transaction order, the transaction signature, etc.) to the invoicing node. The invoicing node can determine the block hash of the first block as the parent block hash, generate a block body based on the transaction information, and create a second block based on the parent block hash and the block body. At this time, the second block can be detected in the invoicing node. The user terminal 103a can verify the transaction data and the transaction signature in the second block; among them, the transaction data is used to indicate the transfer of the transaction funds in the account address of the first party to the account address of the main party (the party corresponding to the user terminal 103a). If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then the first block and the second block are successively processed for uploading to the blockchain. A first electronic bill corresponding to the transaction order is generated based on the uploaded first block, the first electronic bill is sent to the first party, and the account balances of the first party and the main party in the status tree in the blockchain are updated based on the uploaded second block.
[0086] It can be understood that the user terminal mentioned in the embodiments of the present application may also be a computer device. The computer device in the embodiments of the present application includes, but is not limited to, a terminal device or a server. In other words, the computer device may be a server or a terminal device, or a system composed of a server and a terminal device. Among them, the above-mentioned terminal device may be an electronic device, including, but not limited to, a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a vehicle-mounted device, an Augmented Reality / Virtual Reality (AR / VR) device, a head-mounted display, a smart TV, a wearable device, a smart speaker, a digital camera, a camera, and other mobile internet devices (MID) with network access capabilities, or terminal devices in scenarios such as trains, ships, and flights. Among them, the above-mentioned server may 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, vehicle-road collaboration, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0087] Through the above process, the transaction price is predicted based on the business data to be traded, an initial transaction contract is generated based on the predicted transaction price, and the initial transaction contract is directly sent to the first object to obtain feedback information. The initial transaction contract is updated based on the feedback information to obtain an updated transaction contract, thereby saving unnecessary multiple information exchange processes, improving the transaction closing efficiency, and accelerating the transaction completion time; after generating the transaction order, a first block to be chained is generated based on the first invoicing key data corresponding to the transaction order, so that when it is detected that a second block (including transaction data for the transaction order) has been created, that is, when the first object agrees to the transaction order, the two blocks can be quickly and directly chained to obtain the corresponding electronic bill, improving the invoicing efficiency.
[0088] Specifically, please refer to Figure 2 , Figure 2 is a schematic diagram of the scenario of a blockchain-based business data processing method provided by the embodiments of the present application. As Figure 2As shown, the user terminal 103a can obtain the business data to be traded sent by the user terminal 103b (first object), perform price prediction on the business data to be traded to obtain a predicted transaction price, generate an initial transaction contract 201 based on the predicted transaction price and the business data to be traded, and send the initial transaction contract 201 to the user terminal 103b. After the user terminal 103b receives the initial transaction contract 201, feedback information can be generated based on the initial transaction contract 201, and the feedback information can be sent to the user terminal 103a. After the user terminal 103a receives the feedback information, it can predict the contract update data that meets the transaction rate condition based on the feedback information, and update the initial transaction contract 201 based on the contract update data to obtain an updated transaction contract 202. A transaction order is generated based on the updated transaction contract 202, wherein the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract. The user terminal 103a can send the transaction order to the user terminal 103b, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain (for example, it can be Figure 1 The data node 102a shown in FIG. 10A ) enables the billing node to generate a first block to be chained (for example, block 203 ) based on the first billing key data.
[0089] When it is detected that the second block to be chained has been created in the invoicing node (for example, it can be block 204), that is, when the user terminal 103b receives the above transaction order, after the first object agrees to conduct the transaction order, the user terminal 103b can send the transaction information (including transaction data and transaction signature) corresponding to the transaction order to the above invoicing node, so that the invoicing node creates the second block based on the transaction information. At this time, the user terminal 103a can detect that the second block to be chained has been created in the invoicing node and can verify the transaction data and transaction signature in the second block. Among them, the transaction data is used to indicate the transfer of the transaction funds in the account address of the first object to the account address of the main object; the parent block hash in the block header of the second block is the block hash of the first block. If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then the first block and the second block are successively chained, that is, the invoicing node (data node 102a) sends block 203 and block 204 to the core node (consensus node) for consensus, and after the consensus is completed, the above blocks (including block 203 and block 204) are added to the ledger to which they belong, that is, block 203 and block 204 in the blockchain 205 have been chained. The user terminal 103a can generate the first electronic bill corresponding to the transaction order based on the chained first block, send the first electronic bill to the first object (user terminal 103b), and update the account balance of the first object and the account balance of the main object in the state tree in the blockchain 205 based on the chained second block.
[0090] Through the above process, the transaction price is predicted based on the business data to be transacted, the initial transaction contract is generated based on the predicted transaction price, and the initial transaction contract is directly sent to the first object to obtain feedback information. The initial transaction contract is updated based on the feedback information to obtain the updated transaction contract, thus saving unnecessary multiple information exchange processes, improving the transaction completion efficiency, and accelerating the transaction conclusion time; after generating the transaction order, the first block to be chained corresponding to the transaction order is generated based on the first invoicing key data corresponding to the transaction order, so that when it is detected that the second block (including the transaction data for the transaction order) has been created, that is, when the first object agrees to the transaction order, the two blocks can be quickly and directly chained to obtain the corresponding electronic bill, thus improving the invoicing efficiency.
[0091] Further, please refer to Figure 3 , Figure 3 which is a schematic flowchart of a blockchain-based business data processing method provided by an embodiment of the present application. Figure 1 The blockchain-based business data processing method can be executed by a computer device, and the computer device can be such as Figure 1Any user terminal in the user terminal device cluster shown. The following will take the data processing method executed by a computer device as an example for explanation. The data processing method may at least include the following steps S301-S305:
[0092] Step S301, obtain the business data to be traded sent by the first object, perform price prediction on the business data to be traded, obtain the predicted transaction price of the business data to be traded, generate an initial transaction contract based on the predicted transaction price and the business data to be traded, and send the initial transaction contract to the first object, so that the first object generates feedback information based on the initial transaction contract.
[0093] In an embodiment of the present application, a computer device may obtain the business data to be traded sent by the first object, predict the price of the business data to be traded, and obtain the predicted transaction price of the business data to be traded. Among them, the business data to be traded may be the items that the first object needs to purchase or rent and the number of items that need to be purchased or rented. The computer device may obtain the selling price or rental price of a single item set in advance by the party to which the item belongs, and calculate the predicted transaction price of the business data to be traded. Optionally, the computer device may call and train a pricing prediction model, and use the pricing prediction model to predict the price of one or more items included in the business data to be traded to obtain the predicted transaction price of the business data to be traded. The computer device may obtain the contract template associated with the business data to be traded from the business template library, and generate an initial transaction contract based on the contract template, the business data to be traded, and the predicted transaction price through the text graph model. It can be understood that the initial transaction contract also includes the identity information, account information, and signatures of the two parties to the transaction. The computer device may send the initial transaction contract to the first object so that the first object generates feedback information based on the initial transaction contract. That is, after receiving the initial transaction contract, the first business object can check the contract content in the initial transaction contract, generate feedback information based on the contract content, and send the feedback information to the computer device. The feedback information can be opinion information on the predicted transaction price in the initial transaction contract, for example, it can be an expected transaction price proposed by the first object, or it can be information that the predicted transaction price is too high and needs to be discounted or reduced.
[0094] Step S302, obtaining feedback information sent by the first object, predicting contract update data that meets the transaction rate condition based on the feedback information, and updating the initial transaction contract based on the contract update data to obtain an updated transaction contract.
[0095] In an embodiment of the present application, a computer device may obtain feedback information sent by a first object, and predict contract update data that meets the deal success rate condition. It can be understood that, in order to achieve maximum benefits, the contract update data predicted by the computer device not only meets a certain deal success rate condition (for example, the probability of reaching a deal with the first object reaches 90%), but also is the highest price among multiple transaction prices that meet the deal success rate condition. For example, for transaction prices of 2000 and 2100, both meet the 90% deal success rate condition, but since the transaction price of 2100 is higher than the transaction price of 2000, the transaction price of 2100 is determined as the contract update data. Further, the computer device updates the initial transaction contract based on the contract update data, that is, replaces the predicted transaction price in the initial transaction contract with the contract update data to obtain an updated transaction contract.
[0096] Step S303: Generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be chained based on the first invoicing key data; the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract.
[0097] In an embodiment of the present application, a computer device may generate a transaction order based on the updated transaction contract. The transaction order may include the updated transaction contract and the contract signature generated for the updated transaction contract. Among them, the contract signature is a digital signature obtained by encrypting the contract digest with the private key of the object (main object) corresponding to the computer device, and the contract digest is obtained by hashing the updated transaction contract with a hash function. The computer device may send the transaction order to the first object. The transaction order may be a transaction page. After determining that the transaction order is correct, the first object may directly click the button or component indicating agreement to the transaction on the transaction page to make the transaction order take effect. While sending the first invoicing key data in the transaction order to the first object, the computer device also needs to send the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be chained based on the first invoicing key data. Among them, the first invoicing key data includes information about the invoicing party (the object corresponding to the computer device) and the receiving party (the first object), the invoicing business (the business data to be transacted), the invoicing amount (the contract update data), the date, etc.; the first block includes a block header and a block body. The block header includes a version number, the hash value of the previous block in the blockchain, a timestamp, a difficulty value, a nonce, etc., and the block body is used to store the hash value of the first invoicing key data.
[0098] Step S304: When it is detected that the second block to be chained has been created in the invoicing node, verify the transaction data and transaction signature in the second block; the transaction data is used to indicate the transfer of the transaction funds in the account address of the first object to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block.
[0099] In an embodiment of the present application, when the computer device detects that the second block to be chained has been created in the invoicing node, it can verify the transaction data and transaction signature in the second block. Among them, the parent block hash in the block header of the second block is the block hash (hash value of the first block) of the first block; the transaction data is used to indicate the transfer of the transaction funds in the account address of the first object to the account address of the main object (the object corresponding to the computer device). Specifically, the computer device can obtain the storage information in the second block, and the storage information includes transaction data and transaction signature. The computer device can obtain the transaction funds in the transaction data and compare the value of the transaction funds with the value of the contract funds (i.e., contract update data) in the updated transaction contract. If the two values are the same, it is considered that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract; further, the computer device obtains the public key of the main object, decrypts the transaction signature with the public key of the main object to obtain the transaction digest corresponding to the transaction signature, and compares the transaction digest with the contract digest mentioned above to verify whether they are the same.
[0100] Step S305: If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract and the transaction signature is the same as the contract signature, then perform the chaining process on the first block and the second block in sequence, generate the first electronic bill corresponding to the transaction order based on the chained first block, send the first electronic bill to the first object, and update the account balance of the first object and the account balance of the main object in the state tree in the blockchain based on the chained second block.
[0101] In an embodiment of the present application, if the computer device verifies that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, the computer device can perform the process of uploading the first block and the second block to the blockchain in sequence, that is, send the first block and the second block in the invoicing node to the consensus nodes in the blockchain for consensus processing. After the consensus is completed, the process of uploading the first block and the second block to the blockchain is completed. The computer device can generate a first electronic bill corresponding to the transaction order based on the uploaded first block and send the first electronic bill to the first object; it can update the account balance of the first object and the account balance of the main object in the state tree in the blockchain based on the uploaded second block, that is, transfer the digital assets corresponding to the transaction funds that the first object needs to pay from the account of the first object to the account corresponding to the main object to complete the payment operation. Optionally, the computer device can also create a trusted asset voucher (Token) for the digital assets corresponding to the transaction funds and send the trusted asset voucher to the first object. The trusted asset voucher is used to indicate the amount payable by the first object to the main object (i.e., the digital assets corresponding to the transaction funds). After the digital assets corresponding to the transaction funds in the account balance of the first object are transferred to the account balance of the main object, the trusted asset voucher can be transferred to the account of the main object, indicating that the receivables of the main object against the first object have been settled. For example, if the main object sells a product worth 1000 yuan to the first object, the main object can create a Token of equal value for the first object. This Token represents the 1000 yuan payable by the first object to the main object. When the first object makes the payment, the Token will be transferred to the account of the main object, indicating that the accounts receivable have been settled.
[0102] Through the above process, the transaction price is predicted based on the business data to be transacted, an initial transaction contract is generated based on the predicted transaction price, and the initial transaction contract is directly sent to the first object to obtain feedback information. The initial transaction contract is updated based on the feedback information to obtain an updated transaction contract, thus saving unnecessary multiple information exchange processes and accelerating the transaction conclusion time; after generating the transaction order, the first block to be uploaded to the blockchain is generated based on the first key invoicing data corresponding to the transaction order, so that when it is detected that the second block (including the transaction data for the transaction order) has been created, that is, when the first object agrees to the transaction order, the two blocks can be directly uploaded to the blockchain to obtain the corresponding electronic bill, improving the invoicing efficiency. Moreover, the first key invoicing information obtained by the computer device from the transaction order includes all the key data for generating the electronic bill, reducing the omission rate of manually obtaining the first key invoicing information; it is automatically input by the computer device into the electronic bill template to generate the final electronic bill, which not only reduces the time for manual input but also reduces the error rate.
[0103] Further, please refer to Figure 4 , Figure 4 which is a flowchart of a blockchain-based business data processing method provided by an embodiment of the present application Figure 2 . The blockchain-based business data processing method can be executed by a computer device, and the computer device can be any user terminal device in the user terminal device cluster as shown in Figure 1 . Hereinafter, it will be described by taking the execution of this data processing method by a computer device as an example. Among them, the data processing method can at least include the following steps S401-step S408:
[0104] Step S401: Obtain the to-be-traded business data sent by the first object, perform price prediction on the to-be-traded business data to obtain the predicted transaction price of the to-be-traded business data, generate an initial transaction contract based on the predicted transaction price and the to-be-traded business data, and send the initial transaction contract to the first object so that the first object generates feedback information based on the initial transaction contract.
[0105] In the embodiment of the present application, the computer device can obtain the to-be-traded business data sent by the first object and perform price prediction on the to-be-traded business data price to obtain the predicted transaction price of the to-be-traded business data. Among them, the to-be-traded business data can be the items that the first object needs to purchase or lease and the quantity of the items that need to be purchased or leased. The computer device can obtain the selling price or rent of a single item set in advance by the item owner and calculate the predicted transaction price of the to-be-traded business data. Optionally, the computer device can call and train a completed pricing prediction model, and perform price prediction on one or more items included in the to-be-traded business data through the pricing prediction model to obtain the predicted transaction price of the to-be-traded business data. The computer device can obtain the contract template associated with the to-be-traded business data from the business template library, and generate a Gaussian noise image according to the contract template and the initial noise data; it can perform semantic expansion on the predicted transaction price and the to-be-traded business data through a large language model to obtain an indication text; for example, the indication text can be expressed as "using the predicted transaction price and the to-be-traded business data as the specific data content of the contract". The computer device can input the Gaussian noise image and the indication text into a text-to-image model, and perform feature extraction on the Gaussian noise image through the text-to-image model to obtain the mean vector and variance vector of the Gaussian noise image. Among them, the mean vector can be the average value of all pixel values of the Gaussian noise image on each channel, that is, the first-order statistic of the Gaussian noise image, and the variance vector can be the average value of the variances of the pixel values of each channel. That is, the second-order statistic of the Gaussian noise image. The computer device can randomly sample in the mean vector and variance vector of the Gaussian noise image to obtain a latent mean vector and a latent variance vector, and generate Gaussian noise features based on the latent mean vector and the latent variance vector.
[0106] Furthermore, the computer device obtains the latent variable distribution in the forward diffusion network layer of the Vincent graph model, wherein the latent variable distribution is a conceptual distribution of added noise, for example, it can be a Gaussian distribution. The computer device can continuously add a random noise vector to the Gaussian noise feature in T time steps to obtain a forward noise vector. Wherein, T is a positive integer, the time step refers to the amplitude of adding noise to the Gaussian noise feature based on the latent variable distribution, and the noise can refer to unnecessary or redundant interference information present in the image data. When T is large enough, the forward noise vector can be used to represent an image that completely contains noise. Further, the computer device can feature encode the indication text through the text encoding layer in the Vincent graph to obtain a text encoding feature. Specifically, the computer device can perform text segmentation on the indication text through the text encoding layer to obtain a word element sequence corresponding to the indication text, and encode each word element in the word element sequence corresponding to the indication text to obtain a text encoding feature. Wherein, a word element in the word element sequence refers to the smallest basic unit obtained after the target frame text is segmented. The method of text segmentation can be based on word segmentation (word-based), character segmentation (character-based), and subword segmentation (subword-based), which is not limited in the embodiments of the present application. Further, the computer device can perform denoising on the Gaussian noise image according to the forward noise vector and the text encoding feature to obtain the initial transaction contract. That is, the computer device continuously performs noise prediction on the forward noise vector through the text encoding feature in T time steps to obtain a predicted noise vector, and denoises the forward noise vector through the predicted noise vector to obtain a target potential vector. The computer device can reconstruct the target potential vector through the decoder in the Wensheng graph model to obtain a target predicted image, and determine the target predicted image as the initial transaction contract. The initial transaction contract is further sent to the first object so that the first object generates corresponding feedback information based on the initial transaction contract. Among them, the feedback information can be opinion information on the predicted transaction price in the initial transaction contract, for example, it can be an expected transaction price proposed by the first object, or it can be information that the predicted transaction price is too high and needs to be discounted or reduced.
[0107] Step S402, obtaining feedback information sent by the first object, predicting contract update data that meets the transaction rate condition based on the feedback information, and updating the initial transaction contract based on the contract update data to obtain an updated transaction contract.
[0108] In an embodiment of the present application, a computer device can obtain feedback information sent by a first object, perform semantic parsing on the feedback information to obtain feedback semantic data, and generate an object demand price based on the feedback semantic data; the object demand price refers to the psychological expected price of the first object obtained by analyzing the feedback information. The computer device can obtain a price update parameter, and generate M to-be-updated transaction prices based on the object demand price, the predicted transaction price, and the price update parameter; M is a positive integer. The price update parameter can be set manually. For example, if the price update parameter is set to 100, the object demand price is 2400, and the predicted transaction price is 3000, then M is 6, and the M to-be-updated transaction prices obtained are "2400, 2500, 2600, 2700, 2800, 2900" respectively. The computer device can obtain the historical transaction behavior data corresponding to each of the M to-be-updated transaction prices, that is, from the historical transaction behavior data of a to-be-updated transaction price, obtain the historical transaction behavior data corresponding to this to-be-updated transaction price, and the historical transaction behavior data includes the traded items, the quantity of the items, the transaction time, and the transaction object, etc.
[0109] The computer device can extract features from the M historical transaction behavior data to obtain M historical transaction behavior features; it can extract features from the to-be-traded business data to obtain to-be-traded business features, and perform cross-attention processing on the to-be-traded business features and the M historical transaction behavior features to obtain M cross-attention scores. Among them, a possible cross-attention processing method can be seen in Formula ①:
[0110]
[0111] As shown in Formula ①, Attention(Q, K, V) represents the cross-attention function, Q is used to represent the query vector query, K is used to represent the key vector key, and V is used to represent the value vector value; T represents the transpose, and K T represents the transpose matrix of K. The computer device can determine the M historical transaction behavior features as the query vector, and determine the to-be-traded business features as the key vector and the value vector, and d k is used to represent the number of dimensions corresponding to the to-be-traded business features. Through Formula ①, a cross-attention score sequence can be obtained, and the cross-attention score sequence includes M cross-attention scores.
[0112] The computer device can determine the attention score threshold based on the transaction rate condition, and form a cross-attention sequence with the cross-attention scores greater than or equal to the attention score threshold among the M cross-attention scores; the cross-attention sequence includes N cross-attention scores, where N is a positive integer less than or equal to M. For example, the attention score threshold is 0.85, and the cross-attention score sequence composed of M cross-attention scores is (0.44, 0.99, 0.87, 0.64, 0.92, 0.66), then the final cross-attention sequence can be (0.99, 0.87, 0.92). The computer device can obtain the transaction prices to be updated corresponding to the N cross-attention scores, and determine the largest transaction price to be updated among the N transaction prices to be updated as the contract update data. For example, the transaction prices to be updated corresponding to the cross-attention score sequences (0.44, 0.99, 0.87, 0.64, 0.92, 0.66) are (2400, 2500, 2600, 2700, 2800, 2900), respectively. Then, the N transaction prices to be updated corresponding to the cross-attention sequence (0.99, 0.87, 0.92) are (2500, 2600, 2800). The largest transaction price to be updated among the N transaction prices to be updated is 2800, and the contract update parameter can be 2800.
[0113] Furthermore, the computer device can perform image recognition on the initial transaction contract to obtain an image recognition result. The image recognition result may include a non-text layer and a text layer. The text layer in the image recognition result can be extracted using image processing and machine learning technology to obtain initial text features. Optionally, the computer device can also perform operations such as denoising, binarization, and tilt correction on the image corresponding to the initial transaction contract to improve the accuracy of image recognition. Furthermore, the initial text features can be segmented to obtain character segmentation features, and character recognition can be performed on the character segmentation features to obtain text information; that is, the extracted character segmentation features are matched with the template to identify the text corresponding to the character segmentation features to obtain the final text information. The text information can be typeset and proofread to obtain a text analysis result; wherein, the computer device can perform image recognition on the initial transaction contract through optical character recognition (OCR) technology to obtain the final text analysis result.
[0114] The computer device can determine the to-be-updated fields that match the predicted transaction price in the text parsing results, replace the to-be-updated fields with the contract update data in the text parsing results to obtain an updated text parsing result, and merge the non-text layer corresponding to the initial transaction contract with the updated text parsing result to obtain an updated transaction contract; the non-text layer refers to the image of the initial transaction contract after the text parsing result is removed.
[0115] Step S403: Generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be chained based on the first invoicing key data; the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract.
[0116] In the embodiment of the present application, the specific implementation process of step S403 can refer to the specific description process in step S303 in Figure 3 and will not be elaborated here.
[0117] Step S404: When it is detected that a second block to be chained has been created in the invoicing node, verify the transaction data and the transaction signature in the second block; the transaction data is used to indicate the transfer of the transaction funds in the account address of the first object to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block.
[0118] In the embodiment of the present application, the specific implementation process of step S404 can refer to the specific description process in step S304 in Figure 3 and will not be elaborated here.
[0119] Step S405: If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then perform the chaining process on the first block and the second block in sequence, generate a first electronic bill corresponding to the transaction order based on the chained first block, send the first electronic bill to the first object, and update the account balance of the first object and the account balance of the main object in the status tree in the blockchain based on the chained second block.
[0120] In an embodiment of the present application, if the computer device verifies that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, the computer device can perform the on-chain processing on the first block and the second block in sequence, that is, send the first block and the second block in the invoicing node to the consensus nodes in the blockchain for consensus processing. After the consensus is completed, the on-chain process of the first block and the second block is completed. The computer device can obtain the first invoicing key data for the transaction order in the on-chain first block and generate a first invoicing instruction for the first invoicing key data. Among them, the first invoicing instruction includes the first invoicing key data; that is, the computer device needs to create machine-readable machine instructions for the first invoicing key data. Further, the first invoicing instruction can be sent to the invoicing processing component so that the invoicing processing component adds the first invoicing instruction to the invoicing processing sequence. Among them, the invoicing processing sequence includes one or more invoicing instructions, and the position of the first invoicing instruction is at the end of the invoicing processing sequence; the invoicing processing component is used to perform invoicing processing on each invoicing instruction in the invoicing processing sequence according to the sorting position of the invoicing instructions in the invoicing processing sequence; normally, the invoicing instructions in the invoicing processing sequence are sorted according to the addition order or timestamp of the invoicing instructions, and the invoicing processing component needs to process them one by one according to the timestamp of the invoicing instructions. After the invoicing processing component completes the invoicing processing of the invoicing instructions before the first invoicing instruction, it can perform the invoicing processing on the first invoicing instruction, obtain the processing result of the invoicing processing component for the first invoicing instruction, and determine the processing result as the first electronic bill corresponding to the transaction order.
[0121] Optionally, in abnormal situations, for example, the computer device detects the urgency level of the transaction order corresponding to the first invoicing instruction and obtains the urgency level value corresponding to the transaction order. If the urgency level value is greater than or equal to the urgency level threshold, it is considered that the computer device needs to perform urgent processing on the first invoicing instruction. At this time, the computer device can generate a priority invoicing processing request for the transaction order and send the priority invoicing processing request to the first processing node so that the first processing node generates a corresponding invoicing processing notice for the priority invoicing processing request. Among them, the invoicing processing notice can indicate whether the priority invoicing processing request passes. For example, if the first processing node determines that the first invoicing instruction can be urgently processed, it determines "priority invoicing processing request passed" as the invoicing processing notice; if the first processing node determines that the first invoicing instruction cannot be urgently processed, it determines "priority invoicing processing request not passed" as the invoicing processing notice. When the invoicing processing notice indicates that the priority invoicing processing request passes, the computer device can notify the invoicing processing component to move the sorting position of the first invoicing instruction to the first place in the invoicing processing sequence. Subsequently, the invoicing processing component can give priority to processing the first invoicing instruction and complete the urgent processing process for the first invoicing instruction.
[0122] Among them, the specific implementation process for the computer device to detect the urgency level of the transaction order corresponding to the first invoicing instruction and obtain the urgency level value corresponding to the transaction order can be as follows: The computer device can determine the influencing factors that affect the urgency level of the transaction order corresponding to the first invoicing instruction, obtain the urgency level influencing data associated with the influencing factors from the transaction order, input the urgency level influencing data into the urgency level evaluation model, and perform feature extraction on the urgency level influencing data based on the urgency level evaluation model to obtain the influencing data features. Among them, the influencing factors include the delivery deadline of the order, the importance of the customer (the first object), the order amount (contract update parameter, transaction funds), the inventory status, etc. Further, B urgency level tags and the tag level values respectively corresponding to the B urgency level tags can be obtained, and feature extraction is performed on the B urgency level tags to obtain a tag feature sequence containing B tag features; B is a positive integer. Among them, the urgency level tags can be "extremely high", "high", "medium", "low", "extremely low", etc. The computer device can perform cross-attention processing on the influencing data features and the tag feature sequence to obtain an urgency level attention sequence containing B attention scores. Among them, the cross-attention processing process can refer to the above formula ①, which will not be elaborated here. Further, the urgency level tag corresponding to the maximum attention score in the urgency level attention sequence can be determined as the target urgency level tag, and the tag level value corresponding to the target urgency level tag can be determined as the urgency level value corresponding to the transaction order; the B urgency level tags include the target urgency level tag.
[0123] Step S406, when receiving the second electronic bill sent by the second object, obtain the account address of the second object, obtain the asset to be transferred corresponding to the transaction value from the digital assets corresponding to the account of the main object, and transfer the asset to be transferred to the account address of the second object.
[0124] In an embodiment of the present application, when a computer device receives a second electronic bill sent by a second object, the computer device may obtain second key invoicing data in the second electronic bill, perform a block traversal in the blockchain based on the second key invoicing data. If a target block containing the second key invoicing data is traversed, it is determined that the legality detection for the second electronic bill passes; that is, the computer device detects whether the second electronic bill exists in the blockchain and verifies its legality. Among them, the second object may be one or more employee objects in the company corresponding to the main object. The computer device may obtain a third object indicated in the second key invoicing data. If the third object is an associated object of the main object, it is determined that the compliance detection for the second electronic bill passes. Among them, the third object refers to the payee indicated in the second electronic bill. When a transaction is reached between the second object and the third object, the third object is an associated object of the main object, and the actual parties to the transaction are the main object and the third object, and the payment behavior of the second object is an advance payment behavior, it is determined that the compliance detection for the second electronic bill passes. If both the legality detection and the compliance detection for the second electronic bill pass, the computer device may obtain the transaction value corresponding to the second electronic bill (the amount paid by the second object to the third object) from the target block, further obtain the account address of the second object, and obtain the transferable assets corresponding to the transaction value from the digital assets corresponding to the account of the main object, and transfer the transferable assets to the account address of the second object. That is, the whole process is the process of electronic bill (i.e., invoice) reimbursement. After the second object pays an amount payable (actually, the main object should pay the third object) to the third object, the second object may obtain the digital assets corresponding to the amount payable from the main object based on the second electronic bill.
[0125] Step S407: Obtain an electronic bill set associated with the main object, and generate a financial statement for the main object based on the electronic bill set.
[0126] In an embodiment of the present application, the computer device may obtain an electronic bill set associated with the main object. The electronic bill set includes payment electronic bills (invoices issued by the trading party) and receipt electronic bills (invoices issued by the main object to the trading party), and the payment electronic bills include the second electronic bill, and the receipt electronic bills include the first electronic bill. Further, the transaction flow information of the account corresponding to the main object may be obtained; that is, the receipt information and payment information of the main object. The computer device may perform data verification on the electronic bill set through the transaction flow information, that is, verify whether the receipt information in the transaction flow information of the main object's account includes the receivable data in the receipt electronic bill; verify whether the payment information in the transaction flow information of the main object's account includes the payable data in the payment electronic bill. The electronic bills that pass the data verification in the electronic bill set may be determined as actual electronic bills.
[0127] Furthermore, the computer device can generate a financial statement for the main object based on the actual electronic bills. Specifically, the computer device can classify the actual electronic bills according to the bill type to obtain P expenditure electronic bills and Q income electronic bills; both P and Q are positive integers. The expenditure transaction data in the P expenditure electronic bills and the corresponding business types are respectively extracted, and a first type of character is added to each of the P expenditure transaction data to obtain P updated expenditure transaction data. The first type of character is used to represent the data type of the updated expenditure transaction data. For example, the first type of character can be represented as "-". When the expenditure transaction data in an expenditure electronic bill is 4000, the updated expenditure transaction data corresponding to this expenditure electronic bill can be represented as "-4000", which is used to indicate that the main object has an expenditure or payment of 4000, that is, the value of the main object's account balance has decreased by 4000.
[0128] The computer device can respectively extract the income transaction data in the Q income electronic bills and the corresponding business types, and add a second type of character to each of the Q income transaction data to obtain Q updated income transaction data. The second type of character is used to represent the data type of the updated income transaction data. For example, the second type of character can be represented as "+". When the income transaction data in an income electronic bill is 80000, the updated income transaction data corresponding to this income electronic bill can be represented as "+80000", which is used to indicate that the main object has an income or receipt of 80000, that is, the value of the main object's account balance has increased by 80000. Subsequently, the computer device can perform plotting processing on the P updated expenditure transaction data, the business types corresponding to the P updated expenditure transaction data respectively, the Q updated income transaction data, and the business types corresponding to the Q updated income transaction data respectively, to obtain a financial statement for the main object. The computer device can use a text-to-image model to generate a corresponding financial statement with the above data as the guiding text, or can select a suitable data visualization tool or library for plotting processing, such as Excel, Tableau, Power BI, Matplotlib of Python, etc., which is not limited here.
[0129] It should be understood that before performing the plotting processing, the computer device should also determine the basic structure of the financial statement, including the balance sheet, income statement, cash flow statement, etc., and determine the key indicators to be displayed, such as total revenue, total expenditure, net profit, total assets, total liabilities, etc.
[0130] Step S408, obtain a business analysis request and generate a target business analysis result for the business analysis request.
[0131] In an embodiment of the present application, a computer device may obtain a business analysis request, obtain a business analysis template indicated by the business analysis request from a business template library based on the business analysis request, and input the business analysis request, financial statements, and business analysis template into a large language model. The large language model may perform semantic parsing on the business analysis request to obtain business semantic information, that is, determine what the business analysis request is, what needs to be done, and other content. An initial business analysis result for the business analysis request may be generated based on the business semantic information and financial statements; that is, based on the business semantic information, the data in the financial statements is analyzed to obtain the initial business analysis result. For example, identify the changing trends and potential problems of the financial situation, or prepare explanations and discussions of the financial statements for reporting to stakeholders (such as management, investors, or auditors).
[0132] The computer device may determine A to-be-supplemented fields in the business analysis template, respectively obtain the context information of the A to-be-supplemented fields, and segment the initial business analysis result based on the context information of the A to obtain business analysis fields corresponding to the A to-be-supplemented fields respectively; A is a positive integer. Among them, the to-be-supplemented fields may be fields in the business analysis template that need to be filled according to specific data (such as the initial business analysis result). The computer device may replace the A to-be-supplemented fields in the business analysis template with the business analysis fields corresponding to the A to-be-supplemented fields respectively to obtain a target business analysis result for the business analysis request.
[0133] Through the above process, the transaction price is predicted based on the to-be-traded business data, an initial transaction contract is generated based on the predicted transaction price, and the initial transaction contract is directly sent to the first object to obtain feedback information, and the initial transaction contract is updated based on the feedback information to obtain an updated transaction contract, thus saving unnecessary multiple information exchange processes and accelerating the transaction completion time; after generating the transaction order, a first block to be chained is generated based on the first key invoicing data corresponding to the transaction order, so that when it is detected that a second block (including transaction data for the transaction order) has been created, that is, when the first object agrees to the transaction order, the two blocks can be directly chained to obtain the corresponding electronic bill, improving the invoicing efficiency. Moreover, the first key invoicing information obtained by the computer device from the transaction order includes all the key data for generating the electronic bill, reducing the omission rate of manually obtaining the first key invoicing information; it is automatically input into the electronic bill template by the computer device to generate the final electronic bill, which not only reduces the time for manual input but also reduces the error rate. The computer device can accurately identify the second key invoicing data in the second electronic bill and perform legality and compliance verification, reducing the error of manual review. And a financial statement and a template business analysis result can be generated based on the electronic bill set without manual drawing and manual analysis, saving labor costs.
[0134] For further information, see Figure 5 , Figure 5 Schematic diagram of a business data processing device based on blockchain provided in an embodiment of the present application. The business data processing device based on blockchain can be a computer program (including program code, etc.) running on a computer device. For example, the business data processing device based on blockchain can be an application software; the business data processing device based on blockchain can be used to execute the corresponding steps in the method provided in an embodiment of the present application. Figure 5 As shown, the blockchain-based business data processing device 500 can be used Figure 3 and Figure 4 The computer device in the corresponding embodiment, specifically, the blockchain-based business data processing device may include: a contract generation module 11, a contract update module 12, a block creation module 13, a data verification module 14, a bill generation module 15, a bill approval module 16, and a business processing module 17.
[0135] The contract generation module 11 is used to obtain the business data to be traded sent by the first object, perform price prediction on the business data to be traded, obtain the predicted transaction price of the business data to be traded, generate an initial transaction contract based on the predicted transaction price and the business data to be traded, and send the initial transaction contract to the first object, so that the first object generates feedback information based on the initial transaction contract;
[0136] The contract updating module 12 is used to obtain feedback information sent by the first object, predict contract update data that meets the transaction rate condition based on the feedback information, and update the initial transaction contract based on the contract update data to obtain an updated transaction contract;
[0137] The block creation module 13 is used to generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be uploaded to the blockchain based on the first invoicing key data; the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract;
[0138] The data verification module 14 is used to verify the transaction data and transaction signature in the second block when it is detected that the second block to be chained has been created in the invoicing node; the transaction data is used to indicate that the transaction funds in the account address of the first object are transferred to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block;
[0139] The bill generation module 15 is used to, if it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then sequentially chain the first block and the second block, generate a first electronic bill corresponding to the transaction order based on the chained first block, send the first electronic bill to the first object, and update the account balance of the first object and the account balance of the main object in the state tree in the blockchain based on the chained second block.
[0140] In a possible implementation, when the contract generation module 11 is used to generate an initial transaction contract based on the predicted transaction price and the transaction business data, the contract generation module 11 is specifically used to perform the following operations:
[0141] Obtaining the contract template associated with the to-be-traded business data from the business template library, and generating a Gaussian noise image according to the contract template and the initial noise data;
[0142] The predicted transaction price and the business data to be traded are semantically expanded through a large language model to obtain an instruction text;
[0143] The Gaussian noise image and the instruction text are input into the Wensheng graph model, the Gaussian noise image is feature extracted by the Wensheng graph model to obtain Gaussian noise features, and the Gaussian noise features are forward diffused to obtain a forward noise vector;
[0144] The feature encoding of the instruction text is performed through the text graph model to obtain the text encoding feature. The Gaussian noise image is denoised according to the forward noise vector and the text encoding feature to obtain the initial transaction contract.
[0145] In a possible implementation, when the contract updating module 12 is used to predict the contract updating data satisfying the transaction rate condition based on the feedback information, the contract updating module 12 is specifically used to perform the following operations:
[0146] Perform semantic analysis on the feedback information to obtain feedback semantic data, and generate the object demand price based on the feedback semantic data;
[0147] Obtain price update parameters, and generate M transaction prices to be updated based on the object demand price, predicted transaction price and price update parameters; M is a positive integer;
[0148] Obtaining M historical transaction behavior data corresponding to the transaction prices to be updated, respectively, and performing feature extraction on the M historical transaction behavior data to obtain M historical transaction behavior features;
[0149] Extract features of the transaction business data to obtain features of the transaction business, perform cross-attention processing on the transaction business features and M historical transaction behavior features, and obtain M cross-attention scores;
[0150] Determine an attention score threshold based on the transaction rate condition, and form a cross-attention sequence with the cross-attention scores greater than or equal to the attention score threshold among the M cross-attention scores; the cross-attention sequence includes N cross-attention scores, where N is a positive integer less than or equal to M;
[0151] Obtain the transaction prices to be updated corresponding to the N cross-attention scores respectively, and determine the largest transaction price to be updated among the N transaction prices to be updated as the contract update data.
[0152] In a possible implementation, the contract updating module 12 is used to update the initial transaction contract based on the contract update data. When the updated transaction contract is obtained, the contract updating module 12 is specifically used to perform the following operations:
[0153] Perform image recognition on the initial transaction contract to obtain an image recognition result, and perform text feature extraction on the image recognition result to obtain initial text features;
[0154] Performing character segmentation on the initial text features to obtain character segmentation features, performing character recognition on the character segmentation features to obtain text information, typeset the text information, and obtain text parsing results;
[0155] Determine the fields to be updated that match the predicted transaction price in the text parsing results, replace the fields to be updated with the contract update data in the text parsing results to obtain an updated text parsing result, merge the non-text layer corresponding to the initial transaction contract with the updated text parsing result to obtain an updated transaction contract; the non-text layer refers to the image of the initial transaction contract after the text parsing result is removed.
[0156] In a possible implementation, when the bill generation module 15 is used to generate a first electronic bill corresponding to a transaction order based on the first block on the chain, the bill generation module 15 is specifically used to perform the following operations:
[0157] Acquire the first invoicing key data for the transaction order in the first block on the chain, and generate a first invoicing instruction for the first invoicing key data; the first invoicing instruction includes the first invoicing key data;
[0158] Send the first invoicing instruction to the invoicing processing component so that the invoicing processing component adds the first invoicing instruction to the invoicing processing sequence; the position of the first invoicing instruction is at the end of the invoicing processing sequence; the invoicing processing component is used to perform invoicing processing on each invoicing instruction in the invoicing processing sequence according to the sorting position of the invoicing instructions in the invoicing processing sequence.
[0159] Obtain the processing result of the invoicing processing component for the first invoicing instruction, and determine the processing result as the first electronic bill corresponding to the transaction order.
[0160] In a possible implementation, the bill generation module 15 is further used to perform the following operations:
[0161] Detect the urgency level of the transaction order corresponding to the first invoicing instruction to obtain the urgency level value corresponding to the transaction order.
[0162] If the urgency level value is greater than or equal to the urgency level threshold, generate a priority invoicing processing request for the transaction order, and send the priority invoicing processing request to the first processing node so that the first processing node generates an invoicing processing notice for the priority invoicing processing request.
[0163] When the invoicing processing notice indicates that the priority invoicing processing request passes, notify the invoicing processing component to move the sorting position of the first invoicing instruction to the first place in the invoicing processing sequence.
[0164] In a possible implementation, when the bill generation module 15 is used to detect the urgency level of the transaction order corresponding to the first invoicing instruction to obtain the urgency level value corresponding to the transaction order, the bill generation module 15 is specifically used to perform the following operations:
[0165] Determine the influencing factors that affect the urgency level of the transaction order corresponding to the first invoicing instruction, obtain the urgency level influencing data associated with the influencing factors from the transaction order, input the urgency level influencing data into the urgency level evaluation model, and perform feature extraction on the urgency level influencing data based on the urgency level evaluation model to obtain the influencing data features.
[0166] Obtain B urgency level labels and the label degree values respectively corresponding to the B urgency level labels, perform feature extraction on the B urgency level labels to obtain a label feature sequence including B label features; B is a positive integer.
[0167] Perform cross-attention processing on the impact data feature and label feature sequences to obtain an urgency attention sequence containing B attention scores. Determine the urgency label corresponding to the maximum attention score in the urgency attention sequence as the target urgency label, and determine the label degree value corresponding to the target urgency label as the urgency value corresponding to the transaction order; the B urgency labels include the target urgency label.
[0168] In a possible implementation, the blockchain-based business data processing device 500 further includes a bill approval module 16, and the bill approval module 16 is specifically configured to perform the following operations:
[0169] When receiving the second electronic bill sent by the second object, obtain the second key invoicing data in the second electronic bill, perform block traversal in the blockchain based on the second key invoicing data. If a target block containing the second key invoicing data is traversed, it is determined that the legality detection for the second electronic bill passes;
[0170] Obtain the third object indicated in the second key invoicing data. If the third object is an associated object of the main object, it is determined that the compliance detection for the second electronic bill passes;
[0171] If both the legality detection and the compliance detection for the second electronic bill pass, obtain the transaction value corresponding to the second electronic bill from the target block;
[0172] Obtain the account address of the second object, obtain the asset to be transferred corresponding to the transaction value from the digital assets corresponding to the account of the main object, and transfer the asset to be transferred to the account address of the second object.
[0173] In a possible implementation, the blockchain-based business data processing device 500 further includes a business processing module 17, and the business processing module 17 is specifically configured to perform the following operations:
[0174] Obtain the set of electronic bills associated with the main object, and obtain the transaction flow information of the account corresponding to the main object; the set of electronic bills includes the first electronic bill and the second electronic bill;
[0175] Perform data verification on the set of electronic bills through the transaction flow information, and determine the electronic bills that pass the data verification in the set of electronic bills as the actual electronic bills;
[0176] Generate a financial statement for the main object based on the actual electronic bills.
[0177] In a possible implementation, when the business processing module 17 is used to generate a financial statement for the main object based on the actual electronic bills, the business processing module 17 is specifically configured to perform the following operations:
[0178] Classify the actual electronic bills according to the bill type to obtain P expenditure electronic bills and Q income electronic bills; both P and Q are positive integers;
[0179] Extract the expenditure transaction data in the P expenditure electronic bills and the corresponding business types of the expenditure transaction data respectively, and add the first type of character to each of the P expenditure transaction data to obtain P updated expenditure transaction data; the first type of character is used to represent the data type of the updated expenditure transaction data;
[0180] Extract the income transaction data in the Q income electronic bills and the corresponding business types of the income transaction data respectively, and add the second type of character to each of the Q income transaction data to obtain Q updated income transaction data; the second type of character is used to represent the data type of the updated income transaction data;
[0181] Perform drawing processing on the P updated expenditure transaction data, the business types corresponding to the P updated expenditure transaction data respectively, the Q updated income transaction data, and the business types corresponding to the Q updated income transaction data respectively to obtain a financial statement for the main object.
[0182] In a possible implementation manner, the service processing module 17 is specifically further configured to perform the following operations:
[0183] Obtain a service analysis request, obtain the service analysis template indicated by the service analysis request from the service template library based on the service analysis request, and input the service analysis request, the financial statement, and the service analysis template into the large language model;
[0184] Perform semantic parsing on the service analysis request through the large language model to obtain service semantic information, and generate an initial service analysis result for the service analysis request based on the service semantic information and the financial statement;
[0185] Determine A to-be-supplemented fields in the service analysis template, obtain the context information of the A to-be-supplemented fields respectively, and split the initial service analysis result based on the A context information to obtain service analysis fields corresponding to the A to-be-supplemented fields respectively; A is a positive integer;
[0186] In the service analysis template, replace the A to-be-supplemented fields with the service analysis fields corresponding to the A to-be-supplemented fields respectively to obtain a target service analysis result for the service analysis request.
[0187] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 6As shown in the figure, the computer device 600 in the embodiment of the present application may include: a processor 601, a network interface 604, and a memory 605. In addition, the computer device 600 may further include: a user interface 603 and at least one communication bus 602. Among them, the communication bus 602 is used to realize the connection and communication between these components. Among them, the user interface 603 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the user interface 603 may further include a standard wired interface and a wireless interface. The network interface 604 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 605 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. Optionally, the memory 605 may further be at least one storage device located far from the aforementioned processor 601. As Figure 6 shown, the memory 605, 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.
[0188] The network interface 604 can provide a network communication network element; while the user interface 603 is mainly used to provide an input interface for users; and the processor 601 can be used to call the device control application program stored in the memory 605 to perform the following operations:
[0189] Obtain the to-be-traded service data sent by the first object, perform price prediction on the to-be-traded service data to obtain the predicted trading price of the to-be-traded service data, generate an initial trading contract based on the predicted trading price and the to-be-traded service data, and send the initial trading contract to the first object so that the first object can generate feedback information based on the initial trading contract;
[0190] Obtain the feedback information sent by the first object, predict the contract update data that meets the transaction success rate condition based on the feedback information, and update the initial trading contract based on the contract update data to obtain an updated trading contract;
[0191] Generate a trading order based on the updated trading contract, send the trading order to the first object, and send the first invoicing key data in the trading order to the invoicing node in the blockchain so that the invoicing node can generate the first block to be chained based on the first invoicing key data; The trading order includes the updated trading contract and the contract signature generated for the updated trading contract;
[0192] When it is detected that the second block to be chained has been created in the invoicing node, verify the transaction data and transaction signature in the second block; the transaction data is used to indicate the transfer of the trading funds in the account address of the first object to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block;
[0193] If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then the first block and the second block are successively processed for being uploaded to the blockchain. Based on the uploaded first block, a first electronic bill corresponding to the transaction order is generated, and the first electronic bill is sent to the first object. Based on the uploaded second block, the account balance of the first object and the account balance of the main object in the state tree in the blockchain are updated.
[0194] In addition, it should be pointed out here that: The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded and executed by the processor Figure 3 or Figure 4 the methods provided by each step in Figure 3 or Figure 4 The implementation manners provided by each step in, which will not be elaborated here. In addition, the description of the beneficial effects of adopting the same method will not be elaborated either. For the technical details not disclosed in the embodiment of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiment of the present application. As an example, the computer program can be deployed to be executed on one computer device, or on multiple computer devices located at one place, or on multiple computer devices distributed at multiple places and interconnected through a communication network.
[0195] The computer-readable storage medium can be the device provided in any of the foregoing embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer-readable storage medium can 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 can also be used to temporarily store the data that has been output or will be output.
[0196] The embodiment of the present application also provides a computer program product or a computer program, which 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 Figure 3 orFigure 4 The methods provided in various optional ways in [reference] are not elaborated here.
[0197] In the description of the embodiments of this application, the terms "first", "second", etc. in the specification, claims and drawings 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, device, product or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally further include unlisted steps or modules, or may optionally further include other step units inherent to these processes, methods, devices, products or equipment.
[0198] In the embodiments of this application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.
[0199] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in this 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.
[0200] The methods and related devices provided in the embodiments of this application are described with reference to the method flowcharts and / or structure diagrams provided in the embodiments of this application. Specifically, each process and / or block of the method flowchart and / or structure 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 devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable devices generate for implementation in the process Figure 1 a process or multiple processes and / or structure schematic Figure 1Apparatus for the functions specified in one or more boxes. These computer program instructions may also be stored in a computer-readable memory capable of guiding a computer or other programmable device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including the instruction apparatus, or are transmitted via a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The instruction apparatus implements in the process Figure 1 One process or multiple processes and / or structural schematic Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing in the process Figure 1 One process or multiple processes and / or structural schematic steps for the functions specified in one or more boxes.
[0201] The steps in the method embodiments of the present application may be adjusted, combined, and deleted according to actual needs.
[0202] The modules in the device embodiments of the present application may be combined, divided, and deleted according to actual needs.
[0203] What is disclosed above is only the preferred embodiments of the present application. Of course, the scope of the 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 business data processing method based on blockchain, characterized in that: The method comprises: Acquire the business data to be traded sent by the first object, perform price prediction on the business data to be traded, obtain the predicted transaction price of the business data to be traded, generate an initial transaction contract based on the predicted transaction price and the business data to be traded, and send the initial transaction contract to the first object, so that the first object generates feedback information based on the initial transaction contract; Acquire the feedback information sent by the first object, predict contract update data that meets the transaction rate condition based on the feedback information, and update the initial transaction contract based on the contract update data to obtain an updated transaction contract; Generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to the invoicing node in the blockchain, so that the invoicing node generates a first block to be uploaded to the blockchain based on the first invoicing key data; the transaction order includes the updated transaction contract and the contract signature generated for the updated transaction contract; When it is detected that the second block to be chained has been created in the invoicing node, the transaction data and transaction signature in the second block are verified; the transaction data is used to indicate that the transaction funds in the account address of the first object are transferred to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block; If it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, the first block and the second block are sequentially chained, a first electronic bill corresponding to the transaction order is generated based on the chained first block, the first electronic bill is sent to the first object, and the account balance of the first object and the account balance of the main object in the status tree in the blockchain are updated based on the chained second block.
2. The method according to claim 1, characterized in that The generating of the initial transaction contract based on the predicted transaction price and the to-be-transacted business data comprises: Acquire a contract template associated with the to-be-traded business data from a business template library, and generate a Gaussian noise image according to the contract template and initial noise data; Performing semantic expansion on the predicted transaction price and the to-be-transacted business data through a large language model to obtain an indication text; Inputting the Gaussian noise image and the instruction text into a Vincent graph model, performing feature extraction on the Gaussian noise image through the Vincent graph model to obtain Gaussian noise features, and performing forward diffusion processing on the Gaussian noise features to obtain a forward noise vector; The instruction text is feature encoded by the text graph model to obtain text encoding features, and the Gaussian noise image is denoised according to the forward noise vector and the text encoding features to obtain an initial transaction contract.
3. The method according to claim 1, characterized in that The predicting of contract update data satisfying a transaction rate condition based on the feedback information includes: Performing semantic analysis on the feedback information to obtain feedback semantic data, and generating an object demand price based on the feedback semantic data; Obtaining price update parameters, and generating M transaction prices to be updated based on the object demand price, the predicted transaction price and the price update parameters; M is a positive integer; Obtaining the completed historical transaction behavior data corresponding to the M transaction prices to be updated, respectively, and performing feature extraction on the M completed historical transaction behavior data to obtain M historical transaction behavior features; Extracting features from the to-be-traded business data to obtain features of the to-be-traded business, and performing cross-attention processing on the to-be-traded business features and the M historical transaction behavior features to obtain M cross-attention scores; Determine an attention score threshold based on the transaction rate condition, and form a cross-attention sequence with the cross-attention scores greater than or equal to the attention score threshold among the M cross-attention scores; the cross-attention sequence includes N cross-attention scores, where N is a positive integer less than or equal to M; The transaction prices to be updated corresponding to the N cross-attention scores are obtained, and the largest transaction price to be updated among the N transaction prices to be updated is determined as the contract update data.
4. The method according to claim 1, characterized in that: The updating of the initial transaction contract based on the contract update data to obtain an updated transaction contract includes: Performing image recognition on the initial transaction contract to obtain an image recognition result, and performing text feature extraction on the image recognition result to obtain initial text features; Performing character segmentation on the initial text features to obtain character segmentation features, performing character recognition on the character segmentation features to obtain text information, and typeset the text information to obtain a text parsing result; Determine the to-be-updated fields that match the predicted transaction price in the text parsing result, replace the to-be-updated fields with the contract update data in the text parsing result to obtain an updated text parsing result, merge the non-text layer corresponding to the initial transaction contract with the updated text parsing result to obtain an updated transaction contract; the non-text layer refers to the image of the initial transaction contract after the text parsing result is removed.
5. The method according to claim 1, characterized in that The step of generating a first electronic bill corresponding to the transaction order based on the first block on the chain includes: Acquire the first invoicing key data for the transaction order in the first block that has been uploaded to the chain, and generate a first invoicing instruction for the first invoicing key data; the first invoicing instruction includes the first invoicing key data; The first invoicing instruction is sent to the invoicing processing component, so that the invoicing processing component adds the first invoicing instruction to the invoicing processing sequence; the first invoicing instruction is located at the end of the invoicing processing sequence; the invoicing processing component is used to perform invoicing processing on each invoicing instruction in the invoicing processing sequence according to the sorting position of the invoicing instructions in the invoicing processing sequence; A processing result of the invoicing processing component on the first invoicing instruction is obtained, and the processing result is determined as a first electronic bill corresponding to the transaction order.
6. The method according to claim 5, characterized in that The method further comprises: Performing an urgency detection on the transaction order corresponding to the first invoicing instruction to obtain an urgency value corresponding to the transaction order; If the urgency value is greater than or equal to the urgency threshold, a priority invoicing processing request is generated for the transaction order, and the priority invoicing processing request is sent to the first processing node, so that the first processing node generates an invoicing processing notification for the priority invoicing processing request; When the invoicing processing notification indicates that the priority invoicing processing request is passed, the invoicing processing component is notified to move the sorting position of the first invoicing instruction to the first place in the invoicing processing sequence.
7. The method according to claim 6, characterized in that The performing an urgency detection on the transaction order corresponding to the first invoicing instruction to obtain an urgency value corresponding to the transaction order includes: Determine an influencing factor affecting the urgency of the transaction order corresponding to the first invoicing instruction, obtain urgency impact data associated with the influencing factor from the transaction order, input the urgency impact data into an urgency assessment model, and perform feature extraction on the urgency impact data based on the urgency assessment model to obtain impact data features; Obtain B urgency tags and tag degree values corresponding to the B urgency tags, perform feature extraction on the B urgency tags, and obtain a tag feature sequence containing B tag features; B is a positive integer; Cross-attention processing is performed on the influencing data features and the label feature sequence to obtain an urgency attention sequence including B attention scores, the urgency label corresponding to the maximum attention score in the urgency attention sequence is determined as the target urgency label, and the label degree value corresponding to the target urgency label is determined as the urgency value corresponding to the transaction order; the B urgency labels include the target urgency label.
8. The method according to claim 1, characterized in that The method further comprises: When receiving the second electronic bill sent by the second object, obtaining the second billing key data in the second electronic bill, performing block traversal in the blockchain based on the second billing key data, and determining that the legitimacy check for the second electronic bill has passed if the target block containing the second billing key data is traversed; Acquire a third object indicated in the second invoicing key data, and if the third object is an associated object of the main object, determine that the compliance check for the second electronic invoice passes; If the legality check and the compliance check for the second electronic bill are both passed, obtaining the transaction value corresponding to the second electronic bill from the target block; The account address of the second object is obtained, the asset to be transferred corresponding to the transaction value is obtained from the digital assets corresponding to the account of the main object, and the asset to be transferred is transferred to the account address of the second object.
9. The method according to claim 8, characterized in that The method further comprises: Acquire an electronic bill set associated with the main object, and acquire transaction flow information of the account corresponding to the main object; the electronic bill set includes the first electronic bill and the second electronic bill; Performing data verification on the electronic bill set through the transaction flow information, and determining the electronic bills in the electronic bill set that have passed the data verification as actual electronic bills; A financial statement for the master object is generated based on the actual electronic invoice.
10. The method according to claim 9, characterized in that The generating of a financial statement for the main object based on the actual electronic bill includes: Classify the actual electronic bills according to bill types to obtain P expenditure electronic bills and Q income electronic bills; P and Q are both positive integers; Respectively extracting the expenditure transaction data in the P expenditure electronic receipts and the business types corresponding to the expenditure transaction data, respectively adding first type characters to the P expenditure transaction data, to obtain P updated expenditure transaction data; the first type characters are used to represent the data type of the updated expenditure transaction data; Respectively extracting the income transaction data from the Q income electronic receipts and the business types corresponding to the income transaction data, and respectively adding second-type characters to the Q income transaction data to obtain Q updated income transaction data; the second-type characters are used to represent the data type of the updated income transaction data; The P updated expenditure transaction data, the business types respectively corresponding to the P updated expenditure transaction data, the Q updated income transaction data, and the business types respectively corresponding to the Q updated income transaction data are graphed to obtain a financial statement for the main object.
11. The method according to claim 9, characterized in that The method further comprises: Obtaining a business analysis request, obtaining a business analysis template indicated by the business analysis request from a business template library based on the business analysis request, and inputting the business analysis request, the financial statement, and the business analysis template into a large language model; Performing semantic analysis on the business analysis request through the large language model to obtain business semantic information, and generating an initial business analysis result for the business analysis request based on the business semantic information and the financial statement; Determine A to-be-supplemented fields in the business analysis template, respectively obtain context information of the A to-be-supplemented fields, and segment the initial business analysis result based on the A context information to obtain business analysis fields corresponding to the A to-be-supplemented fields respectively; A is a positive integer; The A fields to be supplemented are replaced in the business analysis template with business analysis fields corresponding to the A fields to be supplemented, respectively, to obtain a target business analysis result for the business analysis request.
12. A business data processing device based on blockchain, characterized in that: The device comprises: a contract generation module, configured to obtain the business data to be traded sent by the first object, perform price prediction on the business data to be traded, obtain the predicted transaction price of the business data to be traded, generate an initial transaction contract based on the predicted transaction price and the business data to be traded, and send the initial transaction contract to the first object, so that the first object generates feedback information based on the initial transaction contract; A contract updating module, configured to obtain the feedback information sent by the first object, predict contract update data satisfying a transaction rate condition based on the feedback information, and update the initial transaction contract based on the contract update data to obtain an updated transaction contract; A block creation module, configured to generate a transaction order based on the updated transaction contract, send the transaction order to the first object, and send the first invoicing key data in the transaction order to an invoicing node in the blockchain, so that the invoicing node generates a first block to be uploaded to the blockchain based on the first invoicing key data; the transaction order includes the updated transaction contract and a contract signature generated for the updated transaction contract; A data verification module, configured to verify the transaction data and transaction signature in the second block when it is detected that the second block to be chained has been created in the invoicing node; the transaction data is used to indicate that the transaction funds in the account address of the first object are transferred to the account address of the main object, and the parent block hash in the block header of the second block is the block hash of the first block; The bill generation module is used to, if it is verified that the value of the transaction funds in the transaction data matches the value of the contract funds in the updated transaction contract, and the transaction signature is the same as the contract signature, then sequentially chain the first block and the second block, generate a first electronic bill corresponding to the transaction order based on the chained first block, send the first electronic bill to the first object, and update the account balance of the first object and the account balance of the main object in the state tree in the blockchain based on the chained second block.
13. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Data processing method, device and equipment based on block chain and readable storage medium
CN112907244A
Data processing method and device, equipment and storage medium
CN117114903A