Data processing method and device, equipment, storage medium and program product

By generating and verifying target identifiers and hash values ​​in blockchain technology, ensuring the effectiveness of transaction actions in directed acyclic graphs, the blockchain scalability and data security and decentralization are solved. Contradiction, achieving efficient and secure transaction processing.

CN119151546APending Publication Date: 2024-12-17CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411166959.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the existing blockchain technology, the poor scalability of blockchain transaction performance leads to the need to make concessions to the degree of data security and decentralization when expanding capacity. How to ensure scalability while ensuring data security and The degree of decentralization is an urgent problem to be solved.

Method used

In the data processing method, the target identifier is generated and the verification unit is determined based on the original trading unit in the directed acyclic graph, the target transaction information is verified, and the target transaction unit is constructed after the verification is passed, ensuring that the transaction action meets specific rules and maintains The security and integrity of directed acyclic graphs are used to verify and filter the hash function and hash thresholds to ensure the validity and security of transactions.

Benefits of technology

While ensuring the scalability and decentralization of blockchain, it ensures the security and integrity of data, prevents unauthorized transaction actions, and improves the security and efficiency of transaction processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151546A_ABST
    Figure CN119151546A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, equipment, a storage medium and a program product, and relates to the technical field of blockchains, the data processing method comprises the following steps: in response to a release instruction, generating a target identifier corresponding to the release instruction; when the target identifier meets a first preset requirement, acquiring an original identifier of at least one original transaction unit contained in a directed acyclic graph for the directed acyclic graph pre-constructed by the service provider; determining a verification unit from the original transaction units based on the original identifier; and a verification unit is adopted to verify the target transaction information, and after verification is passed, a construction instruction is generated and sent to the service provider, so that a target transaction unit is constructed based on the target transaction information in the directed acyclic graph. According to the method, the data security and the decentration degree can be guaranteed while the expandability of a transaction structure is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a data processing method, device, equipment, storage medium and program product. Background Art

[0002] Research on the underlying technology of blockchain has found that the block + chain structure represented by Bitcoin and Ethereum networks has the problem of poor scalability. Eliminating the problem of poor scalability is a major difficulty in promoting blockchain technology. However, expanding capacity often requires certain concessions in data security and decentralization.

[0003] How to ensure data security and decentralization while ensuring scalability is an urgent problem to be solved. Summary of the invention

[0004] The present application provides a data processing method, apparatus, device, storage medium and program product to solve the problem of poor scalability of blockchain transaction performance in the prior art.

[0005] In a first aspect, the present application provides a data processing method, characterized in that the method comprises:

[0006] In response to a release instruction, generating a target identifier corresponding to the release instruction;

[0007] When the target identifier meets the first preset requirement, for a directed acyclic graph pre-constructed by the service provider, obtaining an original identifier of at least one original transaction unit included in the directed acyclic graph;

[0008] determining a verification unit from the original transaction unit based on the original identifier;

[0009] The verification unit is used to verify the target transaction information, and after the verification is passed, a construction instruction is generated and sent to a service provider, so as to construct a target transaction unit based on the target transaction information in the directed acyclic graph.

[0010] In one of the embodiments, after generating the target identifier corresponding to the publishing instruction, the method further includes:

[0011] Using a preset hash function, calculate a target hash value corresponding to the target identifier;

[0012] Comparing the target hash value with a preset first hash value threshold;

[0013] When the target identifier meets the first preset requirement, obtaining, for a directed acyclic graph pre-constructed by a service provider, an original identifier of at least one original transaction unit included in the directed acyclic graph, includes:

[0014] When the target hash value is less than or equal to the first hash value threshold, an original identifier of at least one of the original transaction units is obtained.

[0015] In one embodiment, the target hash value is compared with a preset first hash value threshold using the following formula:

[0016] H(tx,nonce1)≤a

[0017] Wherein, H() represents the hash function, (tx, nonce1) represents the target identifier, a represents the first hash value threshold, and H(tx, nonce1) represents the target hash value.

[0018] In one embodiment, the method further comprises:

[0019] When the target identifier does not meet the first preset requirement, generating an update identifier corresponding to the issuing instruction;

[0020] When the update identifier meets the first preset requirement, obtaining an original identifier of at least one original transaction unit included in the directed acyclic graph;

[0021] determining the verification unit from the original transaction unit based on the original identifier;

[0022] The verification unit is used to verify the target transaction information, and after the verification is passed, the construction instruction is generated and sent to the service provider, so as to construct the target transaction unit based on the target transaction information in the directed acyclic graph.

[0023] In one embodiment, determining the verification unit from the original transaction unit based on the original identifier includes:

[0024] Using a preset hash function, calculate the original hash value corresponding to each of the original identifiers;

[0025] Randomly combining a preset number of the original hash values ​​to obtain at least one original hash value set;

[0026] Using the hash function, calculate at least one verification hash value corresponding to the original hash value in each of the original hash value sets;

[0027] When the verification hash values ​​corresponding to the original hash value set are all less than or equal to a preset second hash value threshold, the original transaction unit corresponding to the original hash value set is used as the verification unit; and the second hash value threshold is greater than or equal to the first hash value threshold.

[0028] In one embodiment, the step of determining the verification unit from the original transaction unit based on the original identifier adopts the following formula to determine the verification unit:

[0029] H(H(txN1),H(txN2),…H(txNi),nonce2)≤b

[0030] Among them, H() represents the hash function, txNi represents the i-th original transaction unit, b represents the second hash value threshold, H(txNi) represents the original hash value of the i-th original transaction unit, (H(txN1), H(txN2), …H(txNi), nonce2) represents the original hash value set composed of i original hash values, and H(H(txN1), H(txN2), …H(txNi), nonce2) represents i verification hash values ​​corresponding to the original hash value set.

[0031] In one embodiment, the method further comprises:

[0032] When there is no original hash value set whose corresponding verification hash values ​​are all less than or equal to the second hash value threshold, adjusting the preset number to the updated number;

[0033] Randomly combine the updated number of original hash values ​​to obtain at least one updated hash value set;

[0034] Acquire a second original identifier set corresponding to each of the update hash value sets, and use the hash function to calculate at least one update hash value corresponding to the second original identifier set;

[0035] When the updated hash values ​​corresponding to the updated hash value set are all less than or equal to the second hash value threshold, the original transaction unit corresponding to the updated hash value set is used as the verification unit.

[0036] In one embodiment, after generating a construction instruction and sending it to a service provider to construct a target transaction unit based on the target transaction information in the directed acyclic graph, the process further includes:

[0037] Based on the verification unit, calculating a transaction difficulty value;

[0038] When the transaction difficulty value reaches a preset threshold, a difficulty adjustment prompt is generated.

[0039] In one embodiment, the calculating of the transaction difficulty value based on the verification unit includes:

[0040] Calculating a first verification cost of the target transaction unit and a second verification cost of the verification unit based on the original identifier of the verification unit;

[0041] The transaction difficulty value is determined based on the first verification cost and the second verification cost.

[0042] In one embodiment, the calculating, based on the target identifier of the target transaction unit and the original identifier of the verification unit, the first verification cost of the target transaction unit and the second verification cost of the verification unit comprises:

[0043] Using a preset hash function, calculate the original hash value corresponding to each of the original identifiers;

[0044] Obtaining a preceding verification unit corresponding to each of the verification units and a preceding identifier corresponding to each of the preceding verification units, and using the hash function to calculate a preceding hash value corresponding to each of the preceding identifiers;

[0045] Based on the original hash value and the previous hash value, the first verification cost and the second verification cost are determined.

[0046] In one embodiment, the step of determining the transaction difficulty value based on the first verification cost and the second verification cost uses the following formula to determine the transaction difficulty value:

[0047] F=F1+F2

[0048] F1=∑verify j ,y j =Max(H(txN1),H(txN2),...H(txNl))

[0049] F2=Max(H(txN1), H(txN2),…H(txNi))

[0050] Wherein, F represents the transaction difficulty value, F1 represents the first verification cost, and F2 represents the second verification cost; y j Represents the preceding verification unit corresponding to the j-th verification unit; txNl represents the l-th preceding verification unit corresponding to the j-th verification unit; (H(txN1), H(txN2), …H(txNl)) represents the preceding hash values ​​of the l preceding verification units corresponding to the j-th verification unit, and H(txN1), H(txN2), …H(txNi) represent the original hash values ​​corresponding to each of the verification units.

[0051] In a second aspect, the present application further provides a data processing device, comprising:

[0052] A generating module, configured to generate a target identifier corresponding to the publishing instruction in response to the publishing instruction;

[0053] An acquisition module, configured to acquire, for a directed acyclic graph pre-constructed by a service provider, an original identifier of at least one original transaction unit included in the directed acyclic graph when the target identifier meets a first preset requirement;

[0054] a determination module, configured to determine a verification unit from the original transaction unit based on the original identifier;

[0055] The construction module is used to verify the target transaction information using the verification unit, and after the verification is passed, generate a construction instruction and send it to the service provider, so as to construct a target transaction unit based on the target transaction information in the directed acyclic graph.

[0056] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the data processing method described in any of the above embodiments is implemented.

[0057] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the data processing method described in any of the above embodiments when executed by a processor.

[0058] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program product is executed by a processor, implements the data processing method described in any of the above embodiments.

[0059] The above-mentioned data processing method, device, equipment, storage medium and program product can, upon receiving a release instruction for a specific directed acyclic graph of a service provider, first generate a target identifier that meets the first preset requirement, thereby being able to prove the validity of the transaction action corresponding to the target identifier, and secondly, based on the original identifier of the original transaction unit contained in the directed acyclic graph, screen out a verification unit for verifying the transaction action corresponding to the target identifier, and after the verification unit is verified, trigger the service provider to construct a target transaction unit based on the target transaction information of the transaction action in the directed acyclic graph, thereby ensuring that the transaction action can meet the specific rules formulated by the service provider to maintain the security and integrity of the directed acyclic graph; the directed acyclic graph is applied to transaction processing to ensure data security and decentralization while ensuring scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0061] Figure 1 An application environment diagram of a data processing method in an embodiment;

[0062] Figure 2 is a flow chart of a data processing method in one embodiment;

[0063] Figure 3 is a schematic diagram of the structure of a data processing device in one embodiment;

[0064] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment.

[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0067] The data processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The first terminal 102 communicates with the first server 104 and the second server 108 through the network, and the second terminal 106 also communicates with the first server 104 and the second server 108 through the network. The first terminal 102 and the first server 104 are applied to the service provider, which can be a specific node that can maintain and operate a directed acyclic graph of specific properties. The second terminal 106 and the second server 108 are applied to the service demander, who can send a specific transaction request to the service provider to establish a corresponding transaction unit in the directed acyclic graph based on the transaction request. The service demander can be a transaction initiator.

[0068] For example, the data processing method is applied to the second terminal 106, and the second terminal 106 can generate a target identifier corresponding to the release instruction when receiving the release instruction; and when the target identifier meets the first preset requirement, obtain the pre-stored directed acyclic graph pre-constructed in the first server 104 from the data storage system of the second server 108, and obtain the original identifier of at least one original transaction unit contained in the directed acyclic graph; then determine the verification unit from the original transaction unit based on the target identifier and the original identifier; finally, use the verification unit to verify the target transaction information carried by the release instruction, and after the verification is passed, generate a construction instruction and send it to the first terminal 102 or the first server 104 of the service provider, so as to construct the target transaction unit based on the target transaction information in the directed acyclic graph. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The first terminal 102, the second terminal 106 and the first server 104, the second server 108 can be directly or indirectly connected through wired or wireless communication, such as through a network connection.

[0069] For another example, the data processing method is applied to the second server 108, and the second terminal 106 sends the publishing instruction to the second server 108 when receiving the publishing instruction, and the second server 108 generates a target identifier corresponding to the publishing instruction according to the publishing instruction; and when the target identifier meets the first preset requirement, the directed acyclic graph pre-stored and pre-constructed in the first server 104 is obtained from the data storage system, and the original identifier of at least one original transaction unit contained in the directed acyclic graph is obtained; then based on the target identifier and the original identifier, the verification unit is determined from the original transaction unit; finally, the verification unit is used to verify the target transaction information carried by the publishing instruction, and after the verification is passed, a construction instruction is generated and sent to the first terminal 102 or the first server 104 of the service provider, so as to construct the target transaction unit based on the target transaction information in the directed acyclic graph. It can be understood that the data storage system can be an independent storage device, or the data storage system is located on the server 104, or the data storage system is located on another terminal.

[0070] It should be noted that the network communication between the first terminal 102, the second terminal 106 and the first server 104, the second server 108 is applicable to different network standards, for example, it can be applicable to global system of mobile communication (GSM), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division synchronous code division multiple access (TD-SCDMA), long term evolution (LTE) system and future 5G and other network standards. Optionally, the above communication system can be a system in the scenario of ultra-reliable and low latency communications (URLLC) transmission in a 5G communication system.

[0071] Therefore, optionally, the above-mentioned base station can be a base station (Base Transceiver Station, referred to as BTS) and / or a base station controller in GSM or CDMA, or a base station (NodeB, referred to as NB) and / or a radio network controller (Radio Network Controller, referred to as RNC) in WCDMA, or an evolved base station (EvolutionalNode B, referred to as eNB or eNodeB) in LTE, or a relay station or access point, or a base station (gNB) in the future 5G network, etc., and the present application is not limited here.

[0072] In one embodiment, a data processing method is provided. This embodiment uses the data processing method applied to a second terminal as an example for illustration. It is understandable that the method can also be applied to a second server, and can also be applied to a system including a second terminal and a second server, and is implemented through the interaction between the second terminal and the second server. Figure 2 As shown, the data processing method includes:

[0073] Step 202: In response to the release instruction, generate a target identifier corresponding to the release instruction.

[0074] The issuing instruction refers to an instruction in which the transaction initiator triggers the second terminal to send a request to the first server of the service provider to establish a new transaction unit in the directed acyclic graph constructed in the first server.

[0075] As an example, the release instruction may be issued by a staff member through a fixed component on the human-computer interaction interface of the second terminal, where the fixed component may refer to a pre-built page or applet. Alternatively, the release instruction may be automatically generated by the second terminal when receiving new transaction information. Transaction information refers to the information generated when the transaction initiator performs a transaction action with any other object. It can be understood that the second terminal automatically triggers the generation of the release instruction when the transaction initiator performs a transaction action with others.

[0076] The target identifier is used to uniquely identify a transaction action initiated by the transaction initiator. The second terminal can ensure that the same transaction action will not be repeated multiple times to request the establishment of a transaction unit in the directed acyclic graph by allocating a unique target identifier to each transaction action.

[0077] Step 204: When the target identifier meets the first preset requirement, for the directed acyclic graph pre-constructed by the service provider, obtain the original identifier of at least one original transaction unit included in the directed acyclic graph.

[0078] The first preset requirement is used to verify the validity of the transaction action corresponding to the target identifier. Setting the first preset requirement can prevent unauthorized initiators from forging transaction actions. The first preset requirement ensures that the transaction initiator who requests to establish a transaction unit must have the correct computing power and consume a certain amount of computing resources before requesting to establish a transaction unit. To a certain extent, it prevents unauthorized initiators from initiating a large number of requests to establish transaction units in a short period of time. An unauthorized initiator refers to an object that does not have the right to establish a transaction unit at the service provider.

[0079] A directed acyclic graph refers to a graph structure maintained and operated by a service provider. The edges in a directed acyclic graph have directions and there are no cycles. Each node in the directed acyclic graph represents a transaction unit, and the edges represent the dependencies between transaction units.

[0080] The original transaction unit refers to the transaction unit previously established by the service provider in a specific directed acyclic graph. Each original transaction unit corresponds to an original transaction action, and the timestamp corresponding to each original transaction action is before the timestamp corresponding to the release request.

[0081] The original identifier and the target identifier have the same function and are used to uniquely identify a transaction action.

[0082] Step 206: Based on the original identifier, determine the verification unit from the original transaction unit.

[0083] The verification unit refers to the original transaction unit responsible for ensuring that the transaction action corresponding to the release request meets specific rules. The verification unit can, for example, check the following contents of the transaction action corresponding to the above release request: the validity of the signature, the number of virtual resources input and output, etc.

[0084] Step 208: Use a verification unit to verify the target transaction information, and after the verification is passed, generate a construction instruction and send it to the service provider to construct a target transaction unit based on the target transaction information in the directed acyclic graph.

[0085] The construction instruction refers to an instruction to establish a corresponding target transaction unit in a directed acyclic graph based on the target transaction information related to the current transaction action of the transaction initiator.

[0086] In the above data processing method, when the second terminal receives a publishing instruction for a specific directed acyclic graph of a service provider, it can first generate a target identifier that meets the first preset requirement, so as to prove the validity of the transaction action corresponding to the target identifier, and then based on the original identifier of the original transaction unit contained in the directed acyclic graph, screen out a verification unit for verifying the transaction action corresponding to the target identifier, and after the verification unit is verified, trigger the service provider to construct a target transaction unit based on the target transaction information of the transaction action in the directed acyclic graph, so as to ensure that the transaction action can meet the specific rules formulated by the service provider to maintain the security and integrity of the directed acyclic graph; the directed acyclic graph is applied to transaction processing to ensure data security and decentralization while ensuring scalability.

[0087] In some optional embodiments, after step 202, the following further steps are included:

[0088] Using a preset hash function, calculate a target hash value corresponding to the target identifier;

[0089] Compare the target hash value with a preset first hash value threshold;

[0090] Step 204 includes:

[0091] When the target hash value is less than or equal to the first hash value threshold, an original identifier of at least one original transaction unit is obtained.

[0092] Specifically, after step 202, the target hash value may be compared with a preset first hash value threshold using the following formula:

[0093] H(tx,nonce1)≤a

[0094] Wherein, H() represents a hash function, (tx, nonce1) represents a target identifier, a represents a first hash value threshold, and H(tx, nonce1) represents a target hash value. Specifically, the hash function can be preset to H(string)->64bitheximal.

[0095] In this embodiment, the second terminal can set a first hash value threshold to impose computing power requirements on the transaction initiator, thereby preventing an unauthorized initiator from applying to the service provider to create a meaningless transaction unit.

[0096] In some optional embodiments, the data processing method further includes:

[0097] When the target identifier does not meet the first preset requirement, generating an update identifier corresponding to the release instruction;

[0098] When the updated identifier meets the first preset requirement, obtaining an original identifier of at least one original transaction unit included in the directed acyclic graph;

[0099] Determining a verification unit from the original transaction unit based on the original identifier;

[0100] The target transaction information is verified by a verification unit, and after the verification is passed, a construction instruction is generated and sent to a service provider, so as to construct a target transaction unit based on the target transaction information in a directed acyclic graph.

[0101] The update identifier is also used to uniquely identify a transaction action initiated by the transaction initiator. When the target identifier does not meet the first preset requirement, it can be understood that the target identifier does not meet the conditions for building a transaction unit at the service provider. At this time, the second terminal updates the target identifier until the newly generated update identifier can meet the first preset requirement. By generating the update identifier, it can be proved that the computing power of the transaction initiator meets the needs of the service provider.

[0102] In some optional embodiments, step 206 includes:

[0103] Using a preset hash function, calculate the original hash value corresponding to each of the original identifiers;

[0104] Randomly combining a preset number of the original hash values ​​to obtain at least one original hash value set;

[0105] Using the hash function, calculate at least one verification hash value corresponding to the original hash value in each of the original hash value sets;

[0106] When the verification hash values ​​corresponding to the original hash value set are all less than or equal to a preset second hash value threshold, the original transaction unit corresponding to the original hash value set is used as the verification unit; and the second hash value threshold is greater than or equal to the first hash value threshold.

[0107] Specifically, step 206 may use the following formula to determine the verification unit:

[0108] H(H(txN1),H(txN2),…H(txNi),nonce2)≤b

[0109] Among them, H() represents a hash function, txNi represents the i-th original transaction unit, b represents the second hash value threshold, H(txNi) represents the original hash value of the i-th original transaction unit, H(txNi) represents the original hash value of the i-th original transaction unit, (H(txN1), H(txN2), …H(txNi), nonce2) represents an original hash value set consisting of i original hash values, and H(H(txN1), H(txN2), …H(txNi), nonce2) represents i verification hash values ​​corresponding to the original hash value set.

[0110] As an example, the second terminal obtains four original transaction units Tx1, Tx2, Tx3 and Tx4 from the directed acyclic graph, and the original identifiers of the four original transaction units Tx1, Tx2, Tx3 and Tx4 are nonce a, nonce b, nonce c and nonce d respectively. Assuming that the preset number is 3, the second terminal first uses a preset hash function to calculate the original hash values ​​H(nonce a), H(nonce b), H(nonce c), H(nonce d) corresponding to the four original transaction units Tx1, Tx2, Tx3 and Tx4; and randomly combines the four original hash values ​​according to the preset number 3 to obtain four original hash value sets: ①H(nonce a), H(nonce b), H(nonce c); ②H(nonce a), H(nonce b), H(nonce d); ③H(nonce a), H(nonce c), H(nonce d); ④H(nonce b), H(nonce c), H(nonce d) d); further, the hash function is used again to perform hash operations on the original hash values ​​contained in the various original hash value sets to obtain verification hash values ​​corresponding to the four original hash value sets: ①H(H(nonce a)), H(H(nonce b)), H(H(nonce c)); ②H(H(nonce a)), H(H(nonce b)), H(H(nonce d)); ③H(H(nonce a)), H(H(nonce c)), H(H(nonce d)); ④H(H(nonce b)), H(H(nonce c)), H(H(nonce d)); at this time, if the verification hash values ​​corresponding to the first original hash value set are all less than or equal to the second hash value threshold, the original transaction units Tx1, Tx2, and Tx3 corresponding to the first original hash value set are used as verification units.

[0111] In this embodiment, the second terminal can perform another proof of work to traverse the verification units whose original hash values ​​meet the second hash value threshold from several original transaction units, so that the transaction initiator can make a reference to the verification unit through proof of work.

[0112] In some optional embodiments, the data processing method further includes:

[0113] When there is no original hash value set whose corresponding verification hash values ​​are all less than or equal to the second hash value threshold, adjusting the preset number to the updated number;

[0114] Randomly combine the updated number of original hash values ​​to obtain at least one updated hash value set;

[0115] Obtaining a second original identifier set corresponding to each update hash value set, and calculating at least one update hash value corresponding to the second original identifier set using a hash function;

[0116] When the updated hash values ​​corresponding to the updated hash value set are all less than or equal to the second hash value threshold, the original transaction unit corresponding to the updated hash value set is used as the verification unit.

[0117] When the second terminal cannot find a preset number of verification units from the original transaction unit, it can match the verification unit from the original transaction unit by modifying the number of referenced original transaction units. In this way, it can quickly match the verification unit corresponding to the current transaction action, thereby quickly constructing a reference relationship in a directed acyclic graph.

[0118] In some optional embodiments, after step 208, the following further steps are included:

[0119] Calculate the transaction difficulty value based on the verification unit;

[0120] When the transaction difficulty value reaches the preset threshold, a difficulty adjustment prompt is generated.

[0121] The transaction difficulty value is to ensure the network security of the service provider and the stability of the transaction units in the directed acyclic graph. The transaction difficulty value can reflect the speed at which new transaction units are generated in the service provider.

[0122] When the transaction difficulty value reaches a preset threshold, the second terminal can generate a difficulty adjustment prompt and send it to the service provider, so as to prompt the service provider to adjust the above-mentioned second preset condition to reduce the difficulty of establishing a reference relationship between the new transaction unit and the previous transaction unit, thereby realizing dynamic adjustment of the construction speed of the transaction unit in the service provider.

[0123] In some optional embodiments, the transaction difficulty value is calculated based on the verification unit, including:

[0124] Calculating a first verification cost of the target transaction unit and a second verification cost of the verification unit based on the original identifier of the verification unit;

[0125] A transaction difficulty value is determined based on the first verification cost and the second verification cost.

[0126] The process of calculating the first verification cost and the second verification cost may specifically include: using a pre-set hash function to calculate the original hash value corresponding to each original identifier; obtaining the preceding verification unit corresponding to each verification unit and the preceding identifier corresponding to each preceding verification unit, and using a hash function to calculate the preceding hash value corresponding to each preceding identifier; determining the first verification cost and the second verification cost based on the original hash value and the preceding hash value.

[0127] As an example, the second terminal may use the following formula to calculate the first verification cost and the second verification cost:

[0128] F1=∑verify j ,y j =Max(H(txN1),H(txN2),..H(txNt))

[0129] F2=Max(H(txN1),H(txN2),…H(txNi))

[0130] Wherein, F1 represents the first verification cost, and F2 represents the second verification cost; y j Represents the preceding verification unit corresponding to the j-th verification unit; txNl represents the l-th preceding verification unit corresponding to the j-th verification unit; (H(txN1), H(txN2), …H(txNl)) represents the preceding hash values ​​of the l preceding verification units corresponding to the j-th verification unit, and H(txN1), H(txN2), …H(txNi) represent the original hash values ​​corresponding to each of the verification units.

[0131] Furthermore, the second terminal can add the first verification cost and the second verification cost to obtain a transaction difficulty value, which can be calculated using the following formula:

[0132] F=F1+F2

[0133] Among them, F represents the transaction difficulty value.

[0134] As an example, the second terminal obtains three verification units Tx1, Tx2 and Tx3, as well as the preceding verification units Tx11 and Tx12 corresponding to the verification unit Tx1, the preceding verification units Tx21 and Tx22 corresponding to the verification unit Tx2, and the preceding verification units Tx31 and Tx32 corresponding to the verification unit Tx3 from the directed acyclic graph; and the original identifiers of the three original transaction units Tx1, Tx2, and Tx3 are nonce a, nonce b, and nonce c respectively, the preceding identifiers of the preceding verification units Tx11 and Tx12 are nonced and nonce e respectively; the preceding identifiers of the preceding verification units Tx21 and Tx22 are nonce f and nonce g respectively; the preceding identifiers of the preceding verification units Tx31 and Tx32 are nonce h and nonce i respectively.

[0135] The second terminal first uses a preset hash function to calculate the original hash values ​​H(nonce a), H(nonce b), and H(nonce c) corresponding to the three verification units Tx1, Tx2, and Tx3; wherein H(nonce a) is greater than H(nonce b) and H(nonce c); and uses the hash function again to calculate the pre-order hash values ​​of each pre-order verification unit, and obtains the pre-order hash values ​​H(nonce d) and H(nonce e) corresponding to the pre-order verification units Tx11 and Tx12, the pre-order hash values ​​H(nonce f) and H(nonce g) corresponding to the pre-order verification units Tx21 and Tx22, and the pre-order hash values ​​H(nonceh) and H(nonce i) corresponding to the pre-order verification units Tx31 and Tx32; wherein H(nonce d) is greater than H(nonce e), H(nonce f) is greater than H(nonce g), and H(nonceh) is greater than H(nonce i), and further converts the pre-order hash values ​​H(nonce d) and H(nonce e) into the pre-order hash values ​​H(nonce h). f) and H(nonce h) are added to obtain the first verification cost, H(nonce a) is used as the second verification cost, and H(nonce d)+H(nonce f)+H(nonce h)+H(nonce a) is used as the transaction difficulty value.

[0136] In the above data processing method, when receiving a release instruction for a specific directed acyclic graph of a service provider, a target identifier that meets the first preset requirement can be first generated, so as to prove the validity of the transaction action corresponding to the target identifier. Secondly, based on the original identifier of the original transaction unit contained in the directed acyclic graph, a verification unit for verifying the transaction action corresponding to the target identifier is screened out, and after the verification unit is verified, the service provider is triggered to construct a target transaction unit based on the target transaction information of the transaction action in the directed acyclic graph, so as to ensure that the transaction action can meet the specific rules formulated by the service provider and prevent transaction failure; and, after each new transaction unit is constructed, the transaction difficulty value of the transaction initiator can be calculated, and the transaction difficulty of the transaction initiator can be dynamically adjusted according to the transaction difficulty value, so as to ensure that the transaction unit construction speed of the transaction initiator can be effectively controlled.

[0137] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0138] Based on the same inventive concept, the embodiments of the present application also provide a watermark adding device for implementing the watermark adding method involved above, and a watermark extracting device for implementing the watermark extracting method involved above. The implementation solutions provided by the watermark adding device and the watermark extracting device are similar to the implementation solutions recorded in the watermark adding method and the watermark extracting method described above, so the specific limitations in one or more watermark adding device and watermark extracting device embodiments provided below can refer to the limitations of the watermark adding method and the watermark extracting method described above, and will not be repeated here.

[0139] In one embodiment, Figure 3 As shown, a data processing device 300 is provided, including:

[0140] A generating module 302, configured to generate a target identifier corresponding to the publishing instruction in response to the publishing instruction;

[0141] The acquisition module 304 is used to acquire, for the directed acyclic graph pre-constructed by the service provider, an original identifier of at least one original transaction unit included in the directed acyclic graph when the target identifier meets the first preset requirement;

[0142] A determination module 306, configured to determine a verification unit from the original transaction unit based on the original identifier;

[0143] The construction module 308 is used to verify the target transaction information using the verification unit, and after the verification is passed, generate a construction instruction and send it to the service provider, so as to construct the target transaction unit based on the target transaction information in the directed acyclic graph.

[0144] In some optional embodiments, the generating module 302 is further configured to:

[0145] Using a preset hash function, calculate a target hash value corresponding to the target identifier;

[0146] Compare the target hash value with a preset first hash value threshold;

[0147] When the target hash value is less than or equal to the first hash value threshold, an original identifier of at least one original transaction unit is obtained.

[0148] In some optional embodiments, the generation module 302 is further configured to compare the target hash value with a preset first hash value threshold using the following formula:

[0149] H(tx,nonce1)≤a

[0150] Wherein, H() represents a hash function, (tx, nonce1) represents a target identifier, a represents a first hash value threshold, and H(tx, nonce1) represents a target hash value.

[0151] In some optional embodiments, the generating module 302 is further configured to:

[0152] When the target identifier does not meet the first preset requirement, generating an update identifier corresponding to the release instruction;

[0153] The acquisition module 304 is further configured to: when the updated identifier meets the first preset requirement, acquire an original identifier of at least one original transaction unit included in the directed acyclic graph.

[0154] In some optional embodiments, the determination module 306 is further configured to:

[0155] Using a preset hash function, calculate the original hash value corresponding to each of the original identifiers;

[0156] Randomly combining a preset number of the original hash values ​​to obtain at least one original hash value set;

[0157] Using the hash function, calculate at least one verification hash value corresponding to the original hash value in each of the original hash value sets;

[0158] When the verification hash values ​​corresponding to the original hash value set are all less than or equal to a preset second hash value threshold, the original transaction unit corresponding to the original hash value set is used as the verification unit; and the second hash value threshold is greater than or equal to the first hash value threshold.

[0159] In some optional embodiments, the determination module 306 is further configured to determine the verification unit using the following formula:

[0160] H(H(txN1),H(txN2),…H(txNi),nonce2)≤b

[0161] Among them, H() represents the hash function, txNi represents the i-th original transaction unit, b represents the second hash value threshold, H(txNi) represents the original hash value of the i-th original transaction unit, (H(txN1), H(txN2), …H(txNi), nonce2) represents the original hash value set composed of i original hash values, and H(H(txN1), H(txN2), …H(txNi), nonce2) represents i verification hash values ​​corresponding to the original hash value set.

[0162] In some optional embodiments, the determination module 306 is further configured to:

[0163] When there is no original hash value set whose corresponding verification hash values ​​are all less than or equal to the second hash value threshold, adjusting the preset number to the updated number;

[0164] Randomly combine the updated number of original hash values ​​to obtain at least one updated hash value set;

[0165] Obtaining a second original identifier set corresponding to each update hash value set, and calculating at least one update hash value corresponding to the second original identifier set using a hash function;

[0166] When the updated hash values ​​corresponding to the updated hash value set are all less than or equal to the second hash value threshold, the original transaction unit corresponding to the updated hash value set is used as the verification unit.

[0167] In some optional embodiments, the construction module 308 is further configured to:

[0168] Calculate the transaction difficulty value based on the verification unit;

[0169] When the transaction difficulty value reaches the preset threshold, a difficulty adjustment prompt is generated.

[0170] In some optional embodiments, the construction module 308 is further configured to:

[0171] Calculating a first verification cost of the target transaction unit and a second verification cost of the verification unit based on the original identifier of the verification unit;

[0172] A transaction difficulty value is determined based on the first verification cost and the second verification cost.

[0173] In some optional embodiments, the construction module 308 is further configured to:

[0174] Using a preset hash function, calculate the original hash value corresponding to each original identifier;

[0175] Obtaining a preceding verification unit corresponding to each verification unit and a preceding identifier corresponding to each preceding verification unit, and using a hash function to calculate a preceding hash value corresponding to each preceding identifier;

[0176] Based on the original hash value and the preceding hash value, the first verification cost and the second verification cost are determined. In some optional embodiments, the construction module 308 is further configured to determine the transaction difficulty value using the following formula:

[0177] F=F1+F2

[0178] F1=∑verify j ,y j =Max(H(txN1),H(txN2),...H(txNl))

[0179] F2=Max(H(txN1), H(txN2),…H(txNi))

[0180] Wherein, F represents the transaction difficulty value, F1 represents the first verification cost, and F2 represents the second verification cost; y j Represents the preceding verification unit corresponding to the j-th verification unit; txNl represents the l-th preceding verification unit corresponding to the j-th verification unit; (H(txN1), H(txN2), …H(txNl)) represents the preceding hash values ​​of the l preceding verification units corresponding to the j-th verification unit, and H(txN1), H(txN2), …H(txNi) represent the original hash values ​​corresponding to each of the verification units.

[0181] Each module in the above device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0182] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0183] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0184] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method in any of the above embodiments is implemented.

[0185] In one embodiment, a computer program product is provided, including a computer program. When the computer program product is executed by a processor, the data processing method in any of the above embodiments is implemented.

[0186] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0187] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0188] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data processing method, characterized in that: The method comprises: In response to a release instruction, generating a target identifier corresponding to the release instruction; When the target identifier meets the first preset requirement, for a directed acyclic graph pre-constructed by the service provider, obtaining an original identifier of at least one original transaction unit included in the directed acyclic graph; determining a verification unit from the original transaction unit based on the original identifier; The verification unit is used to verify the target transaction information, and after the verification is passed, a construction instruction is generated and sent to a service provider, so as to construct a target transaction unit based on the target transaction information in the directed acyclic graph.

2. The method according to claim 1, characterized in that After generating the target identifier corresponding to the issuing instruction, the method further includes: Using a preset hash function, calculate a target hash value corresponding to the target identifier; Comparing the target hash value with a preset first hash value threshold; When the target identifier meets the first preset requirement, obtaining, for a directed acyclic graph pre-constructed by a service provider, an original identifier of at least one original transaction unit included in the directed acyclic graph, includes: When the target hash value is less than or equal to the first hash value threshold, an original identifier of at least one of the original transaction units is obtained.

3. The method according to claim 1, characterized in that The target hash value is compared with the preset first hash value threshold using the following formula: H(tx,nonce1)≤a Wherein, H() represents the hash function, (tx, nonce1) represents the target identifier, a represents the first hash value threshold, and H(tx, nonce1) represents the target hash value.

4. The method according to claim 1, characterized in that: The method further comprises: When the target identifier does not meet the first preset requirement, generating an update identifier corresponding to the issuing instruction; When the update identifier meets the first preset requirement, obtaining an original identifier of at least one original transaction unit included in the directed acyclic graph; determining the verification unit from the original transaction unit based on the original identifier; The target transaction information is verified by the verification unit, and after the verification is passed, the construction instruction is generated and sent to the service provider, so as to construct the target transaction unit based on the target transaction information in the directed acyclic graph.

5. The method according to claim 2, characterized in that: The determining of the verification unit from the original transaction unit based on the original identifier includes: Using a preset hash function, calculate the original hash value corresponding to each of the original identifiers; Randomly combine a preset number of the original hash values ​​to obtain at least one original hash value set; Using the hash function, calculate at least one verification hash value corresponding to the original hash value in each of the original hash value sets; When the verification hash values ​​corresponding to the original hash value set are all less than or equal to a preset second hash value threshold, the original transaction unit corresponding to the original hash value set is used as the verification unit; and the second hash value threshold is greater than or equal to the first hash value threshold.

6. The method according to claim 5, characterized in that The step of determining the verification unit from the original transaction unit based on the original identifier adopts the following formula to determine the verification unit: H(H(txN1),H(txN2),…H(txNi),nonce2)≤b Among them, H() represents the hash function, txNi represents the i-th original transaction unit, b represents the second hash value threshold, H(txNi) represents the original hash value of the i-th original transaction unit, (H(txN1), H(txN2), …H(txNi), nonce2) represents the original hash value set composed of i original hash values, and H(H(txN1), H(txN2), …H(txNi), nonce2) represents i verification hash values ​​corresponding to the original hash value set.

7. The method according to claim 5, characterized in that The method further comprises: When there is no original hash value set whose corresponding verification hash values ​​are all less than or equal to the second hash value threshold, adjusting the preset number to the updated number; Randomly combine the updated number of original hash values ​​to obtain at least one updated hash value set; Acquire a second original identifier set corresponding to each of the update hash value sets, and use the hash function to calculate at least one update hash value corresponding to the second original identifier set; When the updated hash values ​​corresponding to the updated hash value set are all less than or equal to the second hash value threshold, the original transaction unit corresponding to the updated hash value set is used as the verification unit.

8. The method according to claim 1, characterized in that After generating a construction instruction and sending it to a service provider to construct a target transaction unit based on the target transaction information in the directed acyclic graph, the method further includes: Based on the verification unit, calculating a transaction difficulty value; When the transaction difficulty value reaches a preset threshold, a difficulty adjustment prompt is generated.

9. The method according to claim 8, characterized in that The calculating of the transaction difficulty value based on the verification unit includes: Calculating a first verification cost of the target transaction unit and a second verification cost of the verification unit based on the original identifier of the verification unit; The transaction difficulty value is determined based on the first verification cost and the second verification cost.

10. The method according to claim 9, characterized in that The calculating, based on the original identifier of the verification unit, a first verification cost of the target transaction unit and a second verification cost of the verification unit comprises: Using a preset hash function, calculate the original hash value corresponding to each of the original identifiers; Obtaining a preceding verification unit corresponding to each of the verification units and a preceding identifier corresponding to each of the preceding verification units, and using the hash function to calculate a preceding hash value corresponding to each of the preceding identifiers; Based on the original hash value and the previous hash value, the first verification cost and the second verification cost are determined.

11. The method according to claim 10, characterized in that The step of determining the transaction difficulty value based on the first verification cost and the second verification cost adopts the following formula to determine the transaction difficulty value: F=F1+F2 F1=∑verify j ,y j =Max(H(txN1),H(txN2),…H(txNl)) F2=Max(H(txN1),H(txN2),…H(txNi)) Wherein, F represents the transaction difficulty value, F1 represents the first verification cost, and F2 represents the second verification cost; y j Represents the preceding verification unit corresponding to the j-th verification unit; txNl represents the l-th preceding verification unit corresponding to the j-th verification unit; (H(txN1), H(txN2), …H(txNl)) represents the preceding hash values ​​of the l preceding verification units corresponding to the j-th verification unit, and H(txN1), H(txN2), …H(txNi) represent the original hash values ​​corresponding to each of the verification units.

12. A data processing device, characterized in that: include: A generating module, configured to generate a target identifier corresponding to the publishing instruction in response to the publishing instruction; An acquisition module, configured to acquire, for a directed acyclic graph pre-constructed by a service provider, an original identifier of at least one original transaction unit included in the directed acyclic graph when the target identifier meets a first preset requirement; a determination module, configured to determine a verification unit from the original transaction unit based on the original identifier; The construction module is used to verify the target transaction information using the verification unit, and after the verification is passed, generate a construction instruction and send it to the service provider, so as to construct a target transaction unit based on the target transaction information in the directed acyclic graph.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the data processing method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 11 are implemented.