WO2023124302A1 - Data processing method and apparatus, terminal device and storage medium - Google Patents

Data processing method and apparatus, terminal device and storage medium Download PDF

Info

Publication number
WO2023124302A1
WO2023124302A1 PCT/CN2022/120863 CN2022120863W WO2023124302A1 WO 2023124302 A1 WO2023124302 A1 WO 2023124302A1 CN 2022120863 W CN2022120863 W CN 2022120863W WO 2023124302 A1 WO2023124302 A1 WO 2023124302A1
Authority
WO
WIPO (PCT)
Prior art keywords
chain
cross
sequence number
interaction information
information
Prior art date
Application number
PCT/CN2022/120863
Other languages
French (fr)
Chinese (zh)
Inventor
汪小益
邱炜伟
李伟
蔡亮
Original Assignee
杭州趣链科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州趣链科技有限公司 filed Critical 杭州趣链科技有限公司
Publication of WO2023124302A1 publication Critical patent/WO2023124302A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation

Definitions

  • the present application belongs to the technical field of blockchain, and in particular relates to a data processing method, device, terminal equipment and storage medium.
  • the link between the cross-chain networks will be unavailable for a long time, resulting in the inability to exchange information between the cross-chain networks.
  • the information between the cross-chain networks is often out of sync, which will lead to information congestion between the cross-chain networks, service unavailability, etc., making the cross-chain network unable to operate normally.
  • the embodiment of the present application provides a data processing method, device, terminal equipment and storage medium, which can ensure the synchronization of information between cross-chain networks, thereby ensuring the normal operation of the cross-chain system.
  • the embodiment of this application provides a data processing method, which is applied to the first cross-chain gateway in the first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and at least A first application chain, the method includes:
  • the first cross-chain gateway acquires the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, the The second application chain is the application chain in the second blockchain organization;
  • the first cross-chain gateway obtains the second historical interaction information stored in the second blockchain organization, and the second historical interaction information is the interaction between the second application chain and the first application chain information;
  • the first cross-chain gateway compares the first historical interaction information with the second historical interaction information to obtain a first comparison result
  • the first cross-chain gateway updates the first historical interaction information according to the first comparison result .
  • the embodiment of the present application provides a data processing device, which is applied to the first cross-chain gateway in the first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and at least A first application chain, the device includes:
  • the first acquisition module is configured to acquire the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain,
  • the second application chain is an application chain in the second blockchain organization;
  • the second acquisition module is used to acquire the second historical interaction information stored in the second blockchain organization, the second historical interaction information is the interaction between the second application chain and the first application chain information;
  • a comparison module configured to compare the first historical interaction information with the second historical interaction information to obtain a first comparison result
  • a first information updating module configured to update the first historical interaction according to the first comparison result when the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information information.
  • an embodiment of the present application provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor, and the processor executes the computer program When implementing the data processing method described in any one of the above-mentioned first aspects.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any one of the above-mentioned first aspects. data processing method.
  • an embodiment of the present application provides a computer program product, which enables the terminal device to execute the data processing method described in any one of the above first aspects when the computer program product is run on the terminal device.
  • the first cross-chain gateway acquires the first historical interaction information stored in the first blockchain organization, and the first historical interaction information is the first application chain and the second application chain.
  • Interaction information between chains the second application chain is the application chain in the second blockchain organization; obtain the second historical interaction information stored in the second blockchain organization, the second historical interaction information is the second application chain and Interaction information between the first application chains; compare the first historical interaction information with the second historical interaction information to obtain the first comparison result; the first comparison result indicates the first historical interaction information and the second historical interaction When the information is inconsistent, the first historical interaction information is updated according to the first comparison result.
  • the first cross-chain gateway is based on the historical interaction information between the first application chain and the second application chain stored by the two blockchain organizations.
  • the historical interaction information stored in the first blockchain organization is updated, thereby restoring data across organizations, ensuring information synchronization between cross-chain networks, and ensuring the normal operation of the cross-chain system.
  • Fig. 1 is a schematic structural diagram of a cross-organization blockchain system provided by an embodiment of the present application
  • Fig. 2 is a schematic flow chart of a data processing method provided by an embodiment of the present application.
  • Fig. 3 is a schematic flow chart of a data processing method provided by another embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
  • Fig. 5 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the term “if” may be construed depending on the context as “when” or “once” or “in response to determining” or “in response to detecting” .
  • the phrase “if determined” or “if [the described condition or event] is detected” may be construed, depending on the context, to mean “once determined” or “in response to the determination” or “once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
  • references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • the data processing method provided in the embodiment of the present application may be applicable to the application scenario shown in FIG. 1 .
  • FIG. 1 it is a schematic diagram of a cross-organizational blockchain system provided by an embodiment of the present application.
  • the inter-organizational blockchain system includes a blockchain organization A, a blockchain organization B, a blockchain organization C, and a blockchain organization D. Among them, the communication between various blockchain organizations is realized through the cross-chain gateways in each blockchain organization.
  • blockchain organization A includes cross-chain gateway A1, relay chain A2, application chain A3, and application chain A4, where application chain A3 communicates with relay chain A2 through cross-chain gateway A5, and application chain A4 communicates with The relay chain A2 communicates through the cross-chain gateway A6;
  • the blockchain organization B includes the cross-chain gateway B1, the relay chain B2, the application chain B3 and the application chain B4, and the application chain B3 and the relay chain B2 communicate through the cross-chain Chain gateway B5 communicates, application chain B4 and relay chain B2 communicate through cross-chain gateway B6;
  • blockchain organization C includes cross-chain gateway C1, relay chain C2, application chain C3 and application chain C4, of which application chain C3 Communicate with the relay chain C2 through the cross-chain gateway C5, and communicate between the application chain C4 and the relay chain C2 through the cross-chain gateway C6;
  • blockchain organization D includes cross-chain gateway D1, relay chain D2, and application chain D3 and the application chain D4, wherein the communication between the application chain D3 and the relay chain D2 is through
  • the relay chain provides cross-chain services for each application chain in its blockchain organization.
  • the communication connection structure between cross-chain gateways that realize cross-organization communication interaction in each blockchain organization is a ring structure. This is just an example.
  • Other communication connection structures (such as star structure) that can realize inter-communication between cross-chain gateways It can be used, and there is no specific limitation here.
  • cross-chain gateways such as cross-chain gateway A5 and cross-chain gateway B5
  • cross-chain gateway A5 and cross-chain gateway B5 the purpose of setting up cross-chain gateways between the relay chain and the application chain is to ensure the integrity of the application chain and the relay chain under the same blockchain organization.
  • Cross-chain interaction the main functions of the cross-chain gateway include adapting to the cross-chain interaction of the relay chain and the application chain, monitoring or consuming cross-chain events on the relay chain and the application chain.
  • cross-chain gateways such as cross-chain gateway A1, cross-chain gateway B1
  • its purpose is to provide large-scale cross-chain The ability to join a large-scale cross-chain network jointly maintained with other blockchain organizations.
  • This cross-chain gateway includes monitoring cross-organization cross-chain events of the current relay chain, submitting cross-organization cross-chain events to the current relay chain, and joining a peer-to-peer network with other cross-chain gateways to forward cross-organization cross-chain events or monitor.
  • the above-mentioned inter-organizational blockchain system can realize the requirements of trusted transmission and credible storage between organizations.
  • the blockchain organizations in the cross-organizational blockchain system correspond to different organizations.
  • organizations can be understood as industry organizations or institutions. What needs to be explained is that an organization includes multiple sub-organizations, and the application chain is the blockchain of the sub-organizations.
  • blockchain organization A is a blockchain system under a financial industry organization. There are multiple financial institutions or financial companies in the financial industry organization. Each financial institution or financial company is called a sub-organization. Each sub-organization Corresponds to an application chain.
  • the application chain can be an alliance chain, and then the blockchain organization corresponding to the application chain is an alliance chain cluster.
  • cross-chain messages for cross-chain interaction between different application chains include cross-chain messages between application chains under the same blockchain organization and application chains under different blockchain organizations.
  • cross-chain messages include cross-chain requests and cross-chain receipts.
  • Fig. 2 shows a schematic flowchart of the data processing method provided by the present application, wherein the method is applied to the first cross-chain gateway in the first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and At least one first application chain, referring to Figure 2, the detailed description of the data processing method is as follows:
  • the first cross-chain gateway acquires the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, and the second application chain is the interaction information between the first application chain and the second application chain.
  • the application chain in the second blockchain organization is the first historical interaction information stored in the first blockchain organization.
  • the first cross-chain gateway is used to realize the cross-chain interaction between the first blockchain organization and other different blockchain organizations.
  • the first historical interaction information includes a first message sequence number and first message content corresponding to the first message sequence number.
  • the first message content is the message content of the cross-chain interaction between the first application chain and the second application chain.
  • interaction information between the first application chain and the second application chain includes interaction information of the first information type and interaction information of the second information type.
  • the first information type is the information type of the interaction information sent by the first application chain to the second application chain.
  • the first information type includes a first information subtype and a second information subtype, where the first information subtype is the information subtype for which the first application chain sends an interaction request message to the second application chain, and the second information subtype
  • the type is the information subtype of the interaction receipt message sent by the first application chain to the second application chain.
  • the second information type is the information type of the interaction information sent by the second application chain to the first application chain.
  • the second information type includes a third information subtype and a fourth information subtype, where the third information subtype is the information subtype for which the second application chain sends an interaction request message to the first application chain, and the fourth information subtype
  • the type is the information subtype of the interaction receipt message sent by the second application chain to the first application chain.
  • each sub-type of information For each sub-type of information, set the initial message number of the corresponding message to 0, and each time a sub-type of interaction message is obtained between the first application chain and the second application chain, the message of the sub-type of interaction message obtained before Add 1 to the sequence number, and use it as the message sequence number of the interaction message of the subtype currently obtained.
  • step S201 may specifically include: the first cross-chain gateway acquires the first historical interaction information stored in the first application chain.
  • the acquisition of the first historical interaction information by the first cross-chain gateway through the first application chain needs to be carried out in a trusted environment, which has high requirements for the reliability of the environment. If the environment becomes untrustworthy, the data on the application chain may be at risk of leakage. Therefore, from the perspective of high availability of data, the data will be more secure by adopting the relay chain method.
  • the reason is that the data interaction between different application chains in the same blockchain organization is consensused through the relay chain, and then stored in the corresponding application chain, and the data interaction between application chains of different blockchain organizations is also It needs to be consensused through their respective relay chains, and then stored in the corresponding application chain, which can ensure the security of the data on the application chain.
  • the first blockchain organization also includes the first relay chain.
  • the first relay chain and the first application chain respectively store the first historical interaction information.
  • the first cross-chain gateway obtains the first historical interaction information stored in the first relay chain.
  • the first cross-chain gateway acquires second historical interaction information stored in the second blockchain organization, where the second historical interaction information is the interaction information between the second application chain and the first application chain.
  • the structure of the second blockchain organization is the same as that of the first blockchain organization.
  • the second blockchain organization includes a second cross-chain gateway and multiple second application chains.
  • the second cross-chain gateway is used to realize the cross-chain interaction between the second blockchain organization and other different blockchain organizations.
  • the first application chain is an application chain in the first blockchain organization
  • the second application chain is an application chain in the second blockchain organization
  • the historical interaction information between the two that is, the first The interaction information between an application chain and the second application chain is stored in the first blockchain organization and the second blockchain organization respectively, which facilitates subsequent information comparison and data recovery.
  • the second historical interaction information includes a second message sequence number and a second message content corresponding to the second message sequence number.
  • the second message content is the message content of the cross-chain interaction between the second application chain and the first application chain.
  • step S202 may specifically include: the first cross-chain gateway obtains the second historical interaction information stored in the second application chain through the second cross-chain gateway.
  • the second cross-chain gateway obtains the second historical interaction information through the second application chain, which needs to be carried out in a trusted environment, which has a high degree of environmental credibility. requirements. If the environment becomes untrustworthy, the data on the application chain may be at risk of leakage. Therefore, from the perspective of high availability of data, the data will be more secure by adopting the relay chain method. See step S201 for details and will not repeat them here.
  • the second blockchain organization also includes a second relay chain.
  • the second relay chain and the second application chain respectively store the second historical interaction information.
  • the first cross-chain gateway obtains the second historical interaction information stored in the second relay chain through the second cross-chain gateway.
  • the first cross-chain gateway compares the first historical interaction information with the second historical interaction information to obtain a first comparison result.
  • the first cross-chain gateway compares the first historical interaction information with the second historical interaction information, which can be achieved by comparing the message sequence number, or by comparing the message content.
  • the first cross-chain gateway updates the first historical interaction information according to the first comparison result.
  • the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information.
  • the first message sequence number is different from the second message sequence number; if the comparison between the first historical interaction information and the second historical interaction information is realized by comparing the message content, the first comparison result indicates that the first historical interaction information and the second historical interaction information.
  • the inconsistency of the historical interaction information is specifically represented by the fact that the content of the first message is different from the content of the second message, that is, the content of the messages in the corresponding historical interaction information is inconsistent.
  • step S201 may include:
  • step S2011 the first cross-chain gateway obtains the first service list stored in the first blockchain organization, and the first service list includes all historical interaction information of all application chain services for cross-chain transmission through the first blockchain organization.
  • application chain service can be understood as the smart contract on the application chain or part of the data in the ledger on the chain.
  • all application chain services for cross-chain transmission through the first blockchain organization include application chain services affiliated to the first blockchain organization and application chain services affiliated to other blockchain organizations.
  • other blockchain organizations include the second blockchain organization, the third blockchain organization, and the like.
  • the historical interaction information of application chain services affiliated to other blockchain organizations includes the historical interaction information of application chain services affiliated to the second blockchain organization and the historical interaction information of application chain services affiliated to the third blockchain organization, etc. .
  • Step S2012 the first cross-chain gateway filters out the third historical interaction information in the first service list to obtain the fourth historical interaction information, wherein the third historical interaction information includes the application chain service station belonging to the first blockchain organization The historical interaction information between each first application chain in the corresponding first blockchain organization, and the first application chain in the first blockchain organization corresponding to the application chain service belonging to the first blockchain organization and other The historical interaction information between the application chains in the blockchain organization; the fourth historical interaction information includes the application chains in other blockchain organizations corresponding to the application chain services of other blockchain organizations and the first block Historical interaction information between the first application chains in the chain organization.
  • the third historical interaction information includes the application chain service station belonging to the first blockchain organization
  • the fourth historical interaction information includes the application chains in other blockchain organizations corresponding to the application chain services of other blockchain organizations and the first block Historical interaction information between the first
  • Step S2013 the first cross-chain gateway classifies the fourth historical interaction information according to the identification of the blockchain organization, and obtains a plurality of fifth historical interaction information, wherein each fifth historical interaction information belongs to other blockchain organizations Corresponding to the application chain service of a blockchain organization in , the historical interaction information between the application chain in the blockchain organization and the first application chain in the first blockchain organization.
  • step S2014 the first cross-chain gateway uses the identification of the second blockchain organization to select the second application chain and the second application chain service corresponding to the application chain service belonging to the second blockchain organization from a plurality of fifth historical interaction information.
  • step S202 may include:
  • the first cross-chain gateway obtains the second historical interaction information stored in the second blockchain organization through the second cross-chain gateway in the second blockchain organization.
  • the step The implementation process of S203 may include:
  • Step S2031 the first cross-chain gateway compares the target first message sequence number with the target second message sequence number to obtain the first comparison result, wherein the target first message sequence number is the largest message sequence number among the first message sequence numbers, and the target The second message sequence number is the largest message sequence number in the second message sequence numbers.
  • step S204 may include:
  • Step S2041 if the target first message serial number is greater than the target second message serial number, the first cross-chain gateway obtains the third message content corresponding to the third message serial number stored in the first blockchain organization, and passes the second blockchain
  • the second cross-chain gateway in the organization sends a third message sequence number and third message content to the second application chain, wherein the third message sequence number is a message sequence number in the first message sequence number except the second message sequence number.
  • the message content in the historical interaction information between the first application chain and the second application chain includes one or more message contents.
  • the historical interaction information between the first application chain and the second application chain includes one or more.
  • the target first message sequence number is greater than the target second message sequence number, it means that the number of messages between the first application chain and the second application chain stored in the first blockchain organization is more than that stored in the second blockchain organization.
  • the number of messages between the first application chain and the second application chain that is, the redundant messages in the first blockchain organization have not been successfully sent to the second application chain in the second blockchain organization before.
  • the first cross-chain gateway needs to send the third message content corresponding to the third message sequence number to the second application chain through the second cross-chain gateway.
  • the third message sequence number may be one message sequence number or multiple message sequence numbers, which is specifically determined by the difference between the target first message sequence number and the target second message sequence number. For example, if the first message sequence number includes 1, 2, 3, 4, and 5, and the second message sequence number includes 1 and 2, it means that the messages between the first application chain and the second application chain stored in the second blockchain organization The number is three less than the number of messages between the first application chain and the second application chain stored in the first blockchain organization.
  • the first cross-chain gateway needs to actively obtain the message number 3 from the first blockchain organization. , 4, and 5 cross-chain messages, and finally send the cross-chain messages with message numbers 3, 4, and 5 to the second application chain under the second blockchain organization through a point-to-point connection with the second cross-chain gateway.
  • Step S2042 if the target first message sequence number is smaller than the target second message sequence number, the first cross-chain gateway obtains the fourth message content corresponding to the fourth message sequence number stored in the second blockchain organization, and sends the first application chain to the first application chain.
  • the fourth message sequence numbers are messages other than the first message sequence numbers in the second message sequence numbers serial number.
  • the target first message sequence number is less than the target second message sequence number, it means that the number of messages between the first application chain and the second application chain stored in the first blockchain organization is less than that stored in the second blockchain organization.
  • the number of messages between the first application chain and the second application chain that is, the redundant messages in the second blockchain organization have not been successfully sent to the first application chain in the first blockchain organization before.
  • the first cross-chain gateway needs to obtain the redundant messages in the second blockchain organization through the second cross-chain gateway, and send them to the first application chain, and send the redundant messages in the second blockchain organization The message is updated to the first historical interaction information.
  • the fourth message sequence number may be one message sequence number or multiple message sequence numbers, which is specifically determined by a difference between the first message sequence number and the second message sequence number.
  • the first message sequence number includes 1 and 2
  • the second message sequence number includes 1, 2, 3, 4, and 5, which means that the messages between the first application chain and the second application chain stored in the second blockchain organization
  • the number is three more than the number of messages between the first application chain and the second application chain stored in the first blockchain organization.
  • the first cross-chain gateway needs to obtain the second blockchain organization through the second cross-chain gateway.
  • the cross-chain messages with message numbers 3, 4, and 5 stored in , and the cross-chain messages with message numbers 3, 4, and 5 are sent to the first application chain, and updated to the first historical interaction information.
  • step S203 is given above, that is, by comparing the message sequence numbers to achieve The update of data makes the data update processing more efficient.
  • the data update processing is also performed based on the data in the two blockchain organizations . So further, before comparing the message serial numbers, the first cross-chain gateway only needs to obtain the message serial number corresponding to the message content of the cross-chain interaction between the first application chain and the second application chain, and there is no need to obtain additional messages The message content corresponding to the serial number, that is, the first cross-chain gateway only obtains the message serial number in the historical interaction information, which can further improve the efficiency of data update processing while saving data processing resources.
  • the above data processing process is the process of updating the historical interaction information between the application chains of the blockchain organization after the cross-chain gateway is started. After the update of the historical interaction information is completed, the cross-chain gateway enters the normal operating state.
  • the target application chain needs to process these cross-chain messages in the order of cross-chain messages.
  • the destination application chain may receive subsequent cross-chain messages when the destination application chain fails to receive the message, so that although the destination application chain receives subsequent messages, It cannot be processed in time, and there is a risk of message blocking and service unavailability.
  • the above method further includes:
  • the first cross-chain gateway when the first cross-chain gateway detects the first interaction information between the first application chain and the second application chain, the first cross-chain gateway obtains the fifth historical interaction information, wherein the first interaction information includes the fifth message sequence number and the fifth message content corresponding to the fifth message number, the fifth historical interaction information is the interaction information between the first application chain and the second application chain before receiving the first interaction information, and the fifth historical interaction information includes the sixth message The sequence number and the content of the sixth message corresponding to the sequence number of the sixth message.
  • the first interaction information is interaction information of a first information type or interaction information of a second information type.
  • the first interaction information is interaction information of the first information type
  • the first interaction information is a first interaction request message or a first interaction receipt message sent by the first application chain to the second application chain.
  • the first interaction information is interaction information of the second information type
  • the first interaction information is a second interaction request message or a second interaction receipt message sent by the second application chain to the first application chain.
  • the first cross-chain gateway monitors the first interaction information between the first application chain and the second application chain, it indicates that cross-chain interaction is currently required between the first application chain and the second application chain.
  • the cross-chain interaction between the first application chain and the second application chain has been processed accordingly, and the first cross-chain gateway needs to obtain the fifth historical interaction information.
  • the first cross-chain gateway may obtain the fifth historical interaction information from the corresponding chain that stores the fifth historical interaction information.
  • the first cross-chain gateway can also obtain the fifth historical interaction information from the local memory, that is, the first cross-chain gateway maintains the interaction sequence number between the first application chain and the second application chain after each execution of the cross-chain message , to reduce network communication interactions and improve network performance.
  • the cross-chain gateway can maintain the interaction sequence number between the application chains, and if the cross-chain gateway maintains the interaction sequence number between the application chains, the data processing efficiency is higher.
  • the application chain and the relay chain also maintain the interaction sequence number between the application chain, which can be obtained when the cross-chain gateway is down and recovers.
  • the information type of the fifth historical interaction information is the same as that of the first interaction information.
  • the first cross-chain gateway obtains the fifth historical interaction information in the first application chain.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the first cross-chain gateway acquires fifth historical interaction information in the first relay chain.
  • the first cross-chain gateway obtains the fifth historical interaction information in the second application chain through the second cross-chain gateway.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the first cross-chain gateway acquires fifth historical interaction information in the second relay chain.
  • the first cross-chain gateway updates the fifth historical interaction information according to the fifth message sequence number and the target sixth message sequence number, wherein the target sixth message sequence number
  • the serial number is the largest message serial number in the sixth message serial number
  • the first preset condition is that the fifth message serial number is greater than the target sixth message serial number, and the difference between the fifth message serial number and the target sixth message serial number is greater than 1.
  • the message content in the fifth historical interaction information includes one or more message contents, and correspondingly, the sixth message sequence number in the fifth interaction information includes one or more messages.
  • the fifth message sequence number and the target sixth message sequence number meet the first preset condition, it means that after the target sixth message sequence number and before the fifth message sequence number, there is an unsuccessfully sent or received cross-link in the first blockchain organization. chain message.
  • the first cross-chain gateway needs to follow the fifth The message sequence number and the target sixth message sequence number update the fifth historical interaction information.
  • step S302 may include:
  • the first cross-chain gateway acquires the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number.
  • the first cross-chain gateway obtains the seventh message corresponding to the seventh message number between the fifth message number and the sixth message number in the first application chain content.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the first cross-chain gateway obtains the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number in the first relay chain.
  • the first cross-chain gateway obtains the correspondence between the fifth message number in the second application chain and the sixth message number of the target through the second cross-chain gateway. The content of the seventh message.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the first cross-chain gateway obtains the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number in the second relay chain through the second cross-chain gateway.
  • the first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information.
  • the first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information in the first application chain.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the second blockchain organization also includes the second relay chain.
  • a cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information in the first relay chain.
  • the first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth message in the second application chain through the second cross-chain gateway.
  • the first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth message in the second application chain through the second cross-chain gateway.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the second blockchain organization also includes the second relay chain.
  • a cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information in the second relay chain through the second cross-chain gateway.
  • the first cross-chain gateway After the first cross-chain gateway obtains the updated fifth historical interaction information, the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information.
  • step S303 may include:
  • Step S3031 if the information type of the first interaction information is the first information type, then the first cross-chain gateway sends the first interaction information to the second application chain through the second cross-chain gateway in the second blockchain organization, and the first The information type is the information type of the interaction information sent by the first application chain to the second application chain.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the second blockchain organization also includes the second relay chain.
  • a cross-chain gateway sends the first interaction information to the second relay chain through the second cross-chain gateway, and the second relay chain forwards the first interaction information to the second application chain.
  • the second cross-chain gateway after receiving the first interaction information, the second cross-chain gateway also needs to check the order of the first interaction information before sending the first interaction information to the second application chain, that is, the second cross-chain The gateway acquires sixth historical interaction information, where the sixth historical interaction information is interaction information between the first application chain and the second application chain before receiving the first interaction information.
  • the detailed implementation steps can refer to the first cross-chain gateway side, and will not be repeated here.
  • the information type of the sixth historical interaction information is the same as that of the first interaction information.
  • Step S3032 if the information type of the first interaction information is the second information type, the first cross-chain gateway sends the first interaction information to the first application chain, and the second information type is that the second application chain sends the interaction information to the first application chain The message type of the message.
  • the first blockchain organization also includes the first relay chain
  • the second blockchain organization also includes the second relay chain
  • the second blockchain organization also includes the second relay chain.
  • a cross-chain gateway sends the first interaction information to the first relay chain, and the first relay chain forwards the first interaction information to the first application chain.
  • step S301 the above method further includes:
  • the first cross-chain gateway does not process the first interaction information.
  • the fifth message sequence number is equal to or less than the target sixth message sequence number, indicating that the fifth message sequence number has been stored in the fifth historical interaction message, that is, the first interaction information has been processed by the first application chain, so There is no need to further process the first interaction information.
  • the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information, and the second preset condition is the fifth message sequence number It is greater than the target sixth message sequence number, and the difference between the fifth message sequence number and the target sixth message sequence number is 1.
  • the fifth message sequence number and the target sixth message sequence number satisfy the second preset condition, it means that the first interaction information just needs to be processed according to the sequence.
  • processing the first interaction information by the first cross-chain gateway according to the information type of the first interaction information is the same as the implementation process of processing the first interaction information by the first cross-chain gateway according to the information type of the first interaction information in step S303. See the description of step S303 , which will not be repeated here.
  • Relay chain A2 receives a first cross-chain interaction request from application chain A3.
  • the first cross-chain interaction request is used to request cross-chain interaction with application chain B3.
  • the first cross-chain interaction request includes message sequence number and pair The specific request content should be the message sequence number.
  • the relay chain A2 sends the first cross-chain interaction request to the cross-chain gateway A1;
  • the relay chain A2 receives the first cross-chain interaction request from the application chain A3, after inspection, it is found that the target application chain that requires cross-chain interaction is not an application chain within the blockchain organization, then the first cross-chain The chain interaction request is forwarded to the cross-chain gateway A1.
  • the cross-chain gateway A1 detects the first cross-chain interaction request
  • the cross-chain gateway A1 acquires the first historical cross-chain interaction request initiated by the application chain A3 to the application chain B3.
  • the cross-chain gateway A1 compares the largest message sequence number in the first historical cross-chain interaction request with the message sequence number in the first cross-chain interaction request, and obtains a comparison result.
  • the cross-chain gateway A1 obtains the first cross-chain interaction through the relay chain A2
  • the second historical cross-chain interaction request corresponding to each message sequence number between the message sequence number in the interaction request and the maximum message sequence number in the first historical cross-chain interaction message, and the second historical cross-chain interaction request corresponding to each message sequence number Send it to the cross-chain gateway B1, which will forward it to the relay chain B2, and finally the relay chain B2 will send the second historical cross-chain interaction request corresponding to each message sequence number to the application chain B3.
  • the second historical cross-chain interaction request refers to a cross-chain interaction request that was not successfully sent before the first cross-chain interaction request.
  • the adapter in cross-chain gateway A1 will send the second historical cross-chain interaction request corresponding to each message sequence number to Send to cross-chain gateway B1.
  • the second historical cross-chain interaction request that was not successfully sent before can be sent to the application chain B3, so as to ensure that the application chain B3 processes the corresponding cross-chain interaction requests in the order of the cross-chain interaction requests.
  • step S408 is executed.
  • the cross-chain gateway A1 does not process the first cross-chain interaction request.
  • the cross-chain gateway A1 sends a first cross-chain interaction request to the cross-chain gateway B1.
  • the cross-chain gateway B1 detects the first cross-chain interaction request, the cross-chain gateway B1 obtains the third historical cross-chain interaction request initiated by the application chain A3 to the application chain B3; The message sequence number is compared with the message sequence number in the first cross-chain interaction request to obtain the comparison result.
  • cross-chain gateway B1 obtains the first cross-chain interaction through cross-chain gateway A1
  • the fourth historical cross-chain interaction request corresponding to each message sequence number between the message sequence number in the interaction request and the maximum message sequence number in the third historical cross-chain interaction message, and forward the fourth historical cross-chain interaction request to the relay chain B2 , and finally the relay chain B2 sends the fourth historical cross-chain interaction request corresponding to each message sequence number to the application chain B3.
  • step S413 is executed.
  • the cross-chain gateway B1 does not process the first cross-chain interaction request.
  • the cross-chain gateway B1 forwards the first cross-chain interaction request to the relay chain B2, and finally the relay chain B2 sends the first cross-chain interaction request to the application chain B3.
  • the application chain B3 executes corresponding services based on the first cross-chain interaction request, and generates a first cross-chain interaction receipt.
  • the method of the embodiment of the present application realizes non-dependent and reliable services between cross-blockchain organizations by recovering the data after the cross-chain gateway goes down abnormally and automatically adjusting the message sequence number during operation, and enables the dynamic connection of cross-blockchain organizations Entering or exiting the cross-organization blockchain system has a technical base, which provides engineering operability for the realization of cross-chain management and operation monitoring of the cross-organization blockchain system.
  • FIG. 4 shows a structural block diagram of a data processing device provided by the embodiment of the present application.
  • the data processing device is applied to a first cross-chain gateway in a first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and multiple first application chains.
  • the apparatus 500 may include: a first acquiring module 510 , a second acquiring module 520 , a comparing module 530 and a first information updating module 540 .
  • the first acquisition module 510 is used to acquire the first historical interaction information stored in the first blockchain organization
  • the first historical interaction information is the interaction information between the first application chain and the second application chain
  • the second application chain The chain is the application chain in the second blockchain organization.
  • the second acquiring module 520 is configured to acquire second historical interaction information stored in the second blockchain organization, where the second historical interaction information is the interaction information between the second application chain and the first application chain.
  • the comparison module 530 is configured to compare the first historical interaction information with the second historical interaction information to obtain a first comparison result.
  • the first information updating module 540 is configured to update the first historical interaction information according to the first comparison result when the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information.
  • the first acquiring module 510 may be specifically configured to:
  • the fourth historical interaction information is the historical interaction information between the application chains in other blockchain organizations and the first application chain in the first blockchain organization corresponding to the application chain services belonging to other blockchain organizations; Classify the fourth historical interaction information according to the identification of the blockchain organization to obtain a plurality of fifth historical interaction information, wherein each fifth historical interaction information belongs to a blockchain organization in other blockchain organizations Corresponding to the application chain service, the historical interaction information between the application chain in the blockchain organization and the first application chain in the
  • the second acquiring module 520 may be specifically configured to:
  • the second historical interaction information stored in the second blockchain organization is obtained through the second cross-chain gateway in the second blockchain organization.
  • the first historical interaction information includes the first message sequence number and the first message content corresponding to the first message sequence number
  • the second historical interaction information includes the second message sequence number and the second message content corresponding to the second message sequence number.
  • Message content; correspondingly, the comparison module 530 can specifically be used for:
  • the target first message sequence number is the largest sequence number among the first message sequence numbers
  • the target second message sequence number is the second message sequence number The largest sequence number in .
  • the first information update module 540 may specifically be used for:
  • the target first message sequence number is greater than the target second message sequence number, obtain the third message content corresponding to the third message sequence number stored in the first blockchain organization, and pass through the second cross-chain gateway in the second blockchain organization Sending the third message sequence number and the third message content to the second application chain, wherein the third message sequence number is a message sequence number in the first message sequence number except the second message sequence number.
  • the target first message sequence number is smaller than the target second message sequence number, obtain the fourth message content corresponding to the fourth message sequence number stored in the second blockchain organization, and send the fourth message sequence number and fourth message content to the first application chain , and add the fourth message sequence number and the fourth message content to the first historical interaction information, where the fourth message sequence number is a message sequence number other than the first message sequence number in the second message sequence number.
  • the device 500 also includes:
  • the third acquisition module is configured to acquire the fifth historical interaction information when the first interaction information between the first application chain and the second application chain is monitored, wherein the first interaction information includes the fifth message sequence number and the corresponding fifth message The fifth message content of the sequence number, the fifth historical interaction information is the interaction information between the first application chain and the second application chain before receiving the first interaction information, the fifth historical interaction information includes the sixth message sequence number and the corresponding sixth The sixth message content of the message sequence number.
  • the second information update module is configured to update the fifth historical interaction information according to the fifth message sequence number and the sixth message sequence number when the fifth message sequence number and the target sixth message sequence number meet the first preset condition, wherein the target sixth message sequence number
  • the serial number is the largest message serial number in the sixth message serial number
  • the first preset condition is that the fifth message serial number is greater than the target sixth message serial number
  • the difference between the fifth message serial number and the target sixth message serial number is greater than 1.
  • the first processing module is configured to process the first interaction information according to the information type of the first interaction information after obtaining the updated fifth historical interaction information.
  • the second information update module may be specifically configured to:
  • the seventh message sequence number and the seventh message content are added to the fifth historical interaction information.
  • the device 500 also includes:
  • the second processing module is configured to not process the first interaction information when the fifth message sequence number is equal to or less than the target sixth message sequence number.
  • the third processing module is configured to process the first interaction information according to the information type of the first interaction information when the fifth message sequence number and the target sixth message sequence number meet a second preset condition, where the second preset condition is the fifth message sequence number greater than the sixth message sequence number, and the difference between the fifth message sequence number and the sixth message sequence number is 1.
  • the first processing module or the third processing module may specifically be used for:
  • the information type of the first interaction information is the first information type
  • the information type of the first interaction information is the second information type
  • the first interaction information is sent to the first application chain
  • the second information type is the information type of the interaction information sent by the second application chain to the first application chain.
  • the embodiment of the present application also provides a first blockchain organization, the first blockchain organization includes a first cross-chain gateway and a plurality of first application chains, the first blockchain organization is used to implement the above data processing method .
  • the embodiment of the present application also provides a terminal device.
  • the terminal device 600 may include: at least one processor 610, a memory 620, and A running computer program, when the processor 610 executes the computer program, implements the steps in any of the foregoing method embodiments, for example, step S201 to step S204 in the embodiment shown in FIG. 5 .
  • the processor 410 executes the computer program, it realizes the functions of the modules/units in the above-mentioned device embodiments, for example, the functions of the modules 510 to 540 shown in FIG. 4 .
  • the computer program can be divided into one or more modules/units, and one or more modules/units are stored in the memory 620 and executed by the processor 610 to complete the present application.
  • the one or more modules/units may be a series of computer program segments capable of accomplishing specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 600 .
  • FIG. 5 is only an example of a terminal device, and does not constitute a limitation on the terminal device. It may include more or less components than those shown in the figure, or combine certain components, or different components, such as Input and output devices, network access devices, buses, etc.
  • the processor 610 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory 620 can be an internal storage unit of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card) etc.
  • the memory 620 is used to store the computer program and other programs and data required by the terminal device.
  • the memory 620 can also be used to temporarily store data that has been output or will be output.
  • the bus can be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the buses in the drawings of the present application are not limited to only one bus or one type of bus.
  • the data processing method provided by the embodiment of the present application can be applied to terminal devices such as computers, tablet computers, notebook computers, netbooks, and personal digital assistants (personal digital assistants, PDAs).
  • terminal devices such as computers, tablet computers, notebook computers, netbooks, and personal digital assistants (personal digital assistants, PDAs).
  • PDAs personal digital assistants
  • the disclosed terminal equipment, apparatus and method may be implemented in other ways.
  • the terminal device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can also be completed by instructing related hardware through computer programs.
  • the computer programs can be stored in a computer-readable storage medium, and the computer When the program is executed by one or more processors, it can realize the steps of the above-mentioned various method embodiments.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can also be completed by instructing related hardware through computer programs.
  • the computer programs can be stored in a computer-readable storage medium, and the computer When the program is executed by one or more processors, it can realize the steps of the above-mentioned various method embodiments.
  • the terminal device when the computer program product runs on the terminal device, the terminal device can implement the steps in the foregoing method embodiments when executed.
  • the computer program includes computer program code
  • the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signal telecommunication signal and software distribution medium, etc.
  • the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excluding electrical carrier signals and telecommunication signals.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application is applicable to the technical field of blockchains, and provides a data processing method and apparatus, a terminal device and a storage medium. The method comprises: a first cross-chain gateway acquires first historical interaction information stored in a first blockchain organization, the first historical interaction information being interaction information between a first application-specific blockchain and a second application-specific blockchain, and the second application-specific blockchain being an application-specific blockchain in a second blockchain organization; the first cross-chain gateway acquires second historical interaction information stored in the second blockchain organization, the second historical interaction information being interaction information between the second application-specific blockchain and the first application-specific blockchain; the first cross-chain gateway compares the first historical interaction information with the second historical interaction information so as to obtain a first comparison result; and if the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information, the first cross-chain gateway, according to the first comparison result, updates the first historical interaction information. The method may ensure the normal operation of a cross-chain system.

Description

数据处理方法、装置、终端设备及存储介质Data processing method, device, terminal device and storage medium
本申请要求于2021年12月31日在中国专利局提交的、申请号为202111664031.3、发明名称为“数据处理方法、装置、终端设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111664031.3 and the title of the invention "data processing method, device, terminal equipment and storage medium" filed at the China Patent Office on December 31, 2021, the entire content of which is passed References are incorporated in this application.
技术领域technical field
本申请属于区块链技术领域,尤其涉及一种数据处理方法、装置、终端设备及存储介质。The present application belongs to the technical field of blockchain, and in particular relates to a data processing method, device, terminal equipment and storage medium.
背景技术Background technique
近年来,随着区块链跨链技术的快速发展,万链互联的时代已然到来,越来越多的数据面临着跨组织、跨时空的可信传输与可信存证的需求。目前,有多种单组织模式下的中继跨链方案用来满足组织内部的成员跨链需求,而若要满足不同组织之间的成员跨链需求,则需要组成跨组织的大规模混合跨链网络的万链互连系统。In recent years, with the rapid development of blockchain cross-chain technology, the era of Wanchain interconnection has arrived, and more and more data is faced with the need for credible transmission and credible storage across organizations and across time and space. At present, there are a variety of relay cross-chain solutions under the single-organization mode to meet the cross-chain needs of members within the organization, and to meet the cross-chain needs of members between different organizations, it is necessary to form a large-scale hybrid cross-chain across organizations. The Wanchain interconnection system of the chain network.
若网络连接异常,跨链网络之间链路长时间不可用,导致跨链网络之间无法进行信息交互。在网络恢复连接之后,跨链网络之间的信息往往是不同步的,这将导致跨链网络之间信息堵塞、服务不可用等情况,使得跨链网络无法正常运转。If the network connection is abnormal, the link between the cross-chain networks will be unavailable for a long time, resulting in the inability to exchange information between the cross-chain networks. After the network connection is restored, the information between the cross-chain networks is often out of sync, which will lead to information congestion between the cross-chain networks, service unavailability, etc., making the cross-chain network unable to operate normally.
技术问题technical problem
本申请实施例提供了一种数据处理方法、装置、终端设备及存储介质,可以保证跨链网络之间的信息同步,从而保证跨链系统的正常运转。The embodiment of the present application provides a data processing method, device, terminal equipment and storage medium, which can ensure the synchronization of information between cross-chain networks, thereby ensuring the normal operation of the cross-chain system.
技术解决方案technical solution
本申请实施例采用的技术方案是:The technical scheme that the embodiment of the present application adopts is:
第一方面,本申请实施例提供了一种数据处理方法,应用于第一区块链组织中的第一跨链网关,所述第一区块链组织包括所述第一跨链网关和至少一个第一应用链,所述方法包括:In the first aspect, the embodiment of this application provides a data processing method, which is applied to the first cross-chain gateway in the first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and at least A first application chain, the method includes:
第一跨链网关获取所述第一区块链组织中存储的第一历史交互信息,所述第一历史交互信息为所述第一应用链与第二应用链之间的交互信息,所述第二应用链为第二区块链组织中的应用链;The first cross-chain gateway acquires the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, the The second application chain is the application chain in the second blockchain organization;
所述第一跨链网关获取所述第二区块链组织中存储的第二历史交互信息,所述第二历史交互信息为所述第二应用链与所述第一应用链之间的交互信息;The first cross-chain gateway obtains the second historical interaction information stored in the second blockchain organization, and the second historical interaction information is the interaction between the second application chain and the first application chain information;
所述第一跨链网关将所述第一历史交互信息和所述第二历史交互信息进行比对,得到第一比对结果;The first cross-chain gateway compares the first historical interaction information with the second historical interaction information to obtain a first comparison result;
若所述第一比对结果表示所述第一历史交互信息与所述第二历史交互信息不一致,则所述第一跨链网关根据所述第一比对结果更新所述第一历史交互信息。If the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information, the first cross-chain gateway updates the first historical interaction information according to the first comparison result .
第二方面,本申请实施例提供了一种数据处理装置,应用于第一区块链组织中的第一跨链网关,所述第一区块链组织包括所述第一跨链网关和至少一个第一应用链,所述装置 包括:In the second aspect, the embodiment of the present application provides a data processing device, which is applied to the first cross-chain gateway in the first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and at least A first application chain, the device includes:
第一获取模块,用于获取所述第一区块链组织中存储的第一历史交互信息,所述第一历史交互信息为所述第一应用链与第二应用链之间的交互信息,所述第二应用链为第二区块链组织中的应用链;The first acquisition module is configured to acquire the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, The second application chain is an application chain in the second blockchain organization;
第二获取模块,用于获取所述第二区块链组织中存储的第二历史交互信息,所述第二历史交互信息为所述第二应用链与所述第一应用链之间的交互信息;The second acquisition module is used to acquire the second historical interaction information stored in the second blockchain organization, the second historical interaction information is the interaction between the second application chain and the first application chain information;
比对模块,用于将所述第一历史交互信息和所述第二历史交互信息进行比对,得到第一比对结果;A comparison module, configured to compare the first historical interaction information with the second historical interaction information to obtain a first comparison result;
第一信息更新模块,用于在所述第一比对结果表示所述第一历史交互信息与所述第二历史交互信息不一致时,根据所述第一比对结果更新所述第一历史交互信息。A first information updating module, configured to update the first historical interaction according to the first comparison result when the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information information.
第三方面,本申请实施例提供了一种终端设备,包括:存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第一方面中任一项所述的数据处理方法。In a third aspect, an embodiment of the present application provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and operable on the processor, and the processor executes the computer program When implementing the data processing method described in any one of the above-mentioned first aspects.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面中任一项所述的数据处理方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any one of the above-mentioned first aspects. data processing method.
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的数据处理方法。In a fifth aspect, an embodiment of the present application provides a computer program product, which enables the terminal device to execute the data processing method described in any one of the above first aspects when the computer program product is run on the terminal device.
有益效果Beneficial effect
本申请实施例提供的数据处理方法的有益效果在于:第一跨链网关通过获取第一区块链组织中存储的第一历史交互信息,第一历史交互信息为第一应用链与第二应用链之间的交互信息,第二应用链为第二区块链组织中的应用链;获取第二区块链组织中存储的第二历史交互信息,第二历史交互信息为第二应用链与第一应用链之间的交互信息;将第一历史交互信息和第二历史交互信息进行比对,得到第一比对结果;在第一比对结果表示第一历史交互信息与第二历史交互信息不一致时,根据第一比对结果更新第一历史交互信息,这样,第一跨链网关基于两个区块链组织各自存储的第一应用链与第二应用链之间的历史交互信息的比较结果,在信息不一致时,更新第一区块链组织中存储的历史交互信息,从而恢复跨组织间的数据,保证跨链网络之间的信息同步,进而保证跨链系统的正常运转。The beneficial effect of the data processing method provided by the embodiment of the present application is that: the first cross-chain gateway acquires the first historical interaction information stored in the first blockchain organization, and the first historical interaction information is the first application chain and the second application chain. Interaction information between chains, the second application chain is the application chain in the second blockchain organization; obtain the second historical interaction information stored in the second blockchain organization, the second historical interaction information is the second application chain and Interaction information between the first application chains; compare the first historical interaction information with the second historical interaction information to obtain the first comparison result; the first comparison result indicates the first historical interaction information and the second historical interaction When the information is inconsistent, the first historical interaction information is updated according to the first comparison result. In this way, the first cross-chain gateway is based on the historical interaction information between the first application chain and the second application chain stored by the two blockchain organizations. As a result of the comparison, when the information is inconsistent, the historical interaction information stored in the first blockchain organization is updated, thereby restoring data across organizations, ensuring information synchronization between cross-chain networks, and ensuring the normal operation of the cross-chain system.
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the above-mentioned second aspect to the fifth aspect, reference can be made to the relevant description in the above-mentioned first aspect, which will not be repeated here.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only for the present application For some embodiments, those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative efforts.
图1是本申请一实施例提供的跨组织区块链系统的结构示意图;Fig. 1 is a schematic structural diagram of a cross-organization blockchain system provided by an embodiment of the present application;
图2是本申请一实施例提供的数据处理方法的流程示意图;Fig. 2 is a schematic flow chart of a data processing method provided by an embodiment of the present application;
图3是本申请另一实施例提供的数据处理方法的流程示意图;Fig. 3 is a schematic flow chart of a data processing method provided by another embodiment of the present application;
图4是本申请一实施例提供的数据处理装置的结构示意图;Fig. 4 is a schematic structural diagram of a data processing device provided by an embodiment of the present application;
图5是本申请一实施例提供的终端设备的结构示意图。Fig. 5 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other Presence or addition of features, wholes, steps, operations, elements, components and/or collections thereof.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当……时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be construed depending on the context as "when" or "once" or "in response to determining" or "in response to detecting" . Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined" or "in response to the determination" or "once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification and the appended claims of the present application, the terms "first", "second", "third" and so on are only used to distinguish descriptions, and should not be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
本申请实施例提供的数据处理方法可适用于图1所示的应用场景。其中,参照图1,是本申请实施例提供的跨组织区块链系统的示意图。该跨组织区块链系统包括区块链组织A、区块链组织B、区块链组织C和区块链组织D。其中,通过各个区块链组织中的跨链网关实现各个区块链组织之间通信。The data processing method provided in the embodiment of the present application may be applicable to the application scenario shown in FIG. 1 . Wherein, referring to FIG. 1 , it is a schematic diagram of a cross-organizational blockchain system provided by an embodiment of the present application. The inter-organizational blockchain system includes a blockchain organization A, a blockchain organization B, a blockchain organization C, and a blockchain organization D. Among them, the communication between various blockchain organizations is realized through the cross-chain gateways in each blockchain organization.
参照图1,区块链组织A包括跨链网关A1、中继链A2、应用链A3和应用链A4,其中应用链A3与中继链A2之间通过跨链网关A5通信,应用链A4与中继链A2之间通过跨链网关A6通信;区块链组织B包括跨链网关B1、中继链B2、应用链B3和应用链B4,其中应用链B3与中继链B2之间通过跨链网关B5通信,应用链B4与中继链B2之间通过跨链网关B6通信;区块链组织C包括跨链网关C1、中继链C2、应用链C3和应用链C4,其中应用链C3与中继链C2之间通过跨链网关C5通信,应用链C4与中继链C2之间通过跨链网关C6通信;区块链组织D包括跨链网关D1、中继链D2、应用链D3和应用链D4, 其中应用链D3与中继链D2之间通过跨链网关D5通信,应用链D4与中继链D2之间通过跨链网关D6通信。其中,中继链为其所在区块链组织中的各个应用链提供跨链服务。各个区块链组织中实现跨组织通信交互的跨链网关之间的通信连接结构为环形结构,这里仅为一示例,其他可以实现跨链网关间相互通信的通信连接结构(比如星型结构)均可,这里不做具体限定。Referring to Figure 1, blockchain organization A includes cross-chain gateway A1, relay chain A2, application chain A3, and application chain A4, where application chain A3 communicates with relay chain A2 through cross-chain gateway A5, and application chain A4 communicates with The relay chain A2 communicates through the cross-chain gateway A6; the blockchain organization B includes the cross-chain gateway B1, the relay chain B2, the application chain B3 and the application chain B4, and the application chain B3 and the relay chain B2 communicate through the cross-chain Chain gateway B5 communicates, application chain B4 and relay chain B2 communicate through cross-chain gateway B6; blockchain organization C includes cross-chain gateway C1, relay chain C2, application chain C3 and application chain C4, of which application chain C3 Communicate with the relay chain C2 through the cross-chain gateway C5, and communicate between the application chain C4 and the relay chain C2 through the cross-chain gateway C6; blockchain organization D includes cross-chain gateway D1, relay chain D2, and application chain D3 and the application chain D4, wherein the communication between the application chain D3 and the relay chain D2 is through the cross-chain gateway D5, and the communication between the application chain D4 and the relay chain D2 is through the cross-chain gateway D6. Among them, the relay chain provides cross-chain services for each application chain in its blockchain organization. The communication connection structure between cross-chain gateways that realize cross-organization communication interaction in each blockchain organization is a ring structure. This is just an example. Other communication connection structures (such as star structure) that can realize inter-communication between cross-chain gateways It can be used, and there is no specific limitation here.
需要说明的是,在中继链与应用链之间设置跨链网关(比如跨链网关A5、跨链网关B5),其目的是为了保证同一区块链组织下的应用链和中继链的跨链交互,跨链网关的主要功能包括适配中继链和应用链的跨链交互、监听或消费中继链和应用链上的跨链事件。It should be noted that the purpose of setting up cross-chain gateways (such as cross-chain gateway A5 and cross-chain gateway B5) between the relay chain and the application chain is to ensure the integrity of the application chain and the relay chain under the same blockchain organization. Cross-chain interaction, the main functions of the cross-chain gateway include adapting to the cross-chain interaction of the relay chain and the application chain, monitoring or consuming cross-chain events on the relay chain and the application chain.
各区块链组织之间通信交互(即跨组织跨链交互)是基于跨链网关(比如跨链网关A1、跨链网关B1)实现的,其目的是为当前区块链组织提供大规模跨链能力,使其能加入与其他区块链组织共同维护的大规模跨链网络。The communication and interaction between various blockchain organizations (that is, cross-organization and cross-chain interaction) is realized based on cross-chain gateways (such as cross-chain gateway A1, cross-chain gateway B1), and its purpose is to provide large-scale cross-chain The ability to join a large-scale cross-chain network jointly maintained with other blockchain organizations.
该跨链网关的主要功能包括监听当前中继链的跨组织跨链事件、向当前中继链提交跨组织跨链事件、加入与其他跨链网关组成的点对点网络进行跨组织跨链事件的转发或监听。The main functions of this cross-chain gateway include monitoring cross-organization cross-chain events of the current relay chain, submitting cross-organization cross-chain events to the current relay chain, and joining a peer-to-peer network with other cross-chain gateways to forward cross-organization cross-chain events or monitor.
上述跨组织区块链系统能够实现跨组织间的可信传输与可信存证的需求。这里,跨组织区块链系统中的区块链组织对应不同组织,这里,组织可以理解为行业组织或机构。需要解释的是,一个组织包括多个子组织,应用链为子组织的区块链。比如,区块链组织A是一个金融行业组织下的区块链系统,该金融行业组织中有多个金融机构或者金融公司,每个金融机构或金融公司被称作一个子组织,每个子组织对应一个应用链。具体的,应用链可以是联盟链,那么该应用链对应的区块链组织则为联盟链集群。The above-mentioned inter-organizational blockchain system can realize the requirements of trusted transmission and credible storage between organizations. Here, the blockchain organizations in the cross-organizational blockchain system correspond to different organizations. Here, organizations can be understood as industry organizations or institutions. What needs to be explained is that an organization includes multiple sub-organizations, and the application chain is the blockchain of the sub-organizations. For example, blockchain organization A is a blockchain system under a financial industry organization. There are multiple financial institutions or financial companies in the financial industry organization. Each financial institution or financial company is called a sub-organization. Each sub-organization Corresponds to an application chain. Specifically, the application chain can be an alliance chain, and then the blockchain organization corresponding to the application chain is an alliance chain cluster.
在该跨组织区块链系统下,不同应用链之间进行跨链交互的跨链消息包括同一区块链组织下各个应用链之间的跨链消息和不同区块链组织下的各个应用链之间的跨链消息。其中,跨链消息包括跨链请求和跨链回执。Under this cross-organization blockchain system, cross-chain messages for cross-chain interaction between different application chains include cross-chain messages between application chains under the same blockchain organization and application chains under different blockchain organizations. Cross-chain messages between. Among them, cross-chain messages include cross-chain requests and cross-chain receipts.
图2示出了本申请提供的数据处理方法的示意性流程图,其中,该方法应用于第一区块链组织中第一跨链网关,第一区块链组织包括第一跨链网关和至少一个第一应用链,参照图2,对数据处理方法的详述如下:Fig. 2 shows a schematic flowchart of the data processing method provided by the present application, wherein the method is applied to the first cross-chain gateway in the first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and At least one first application chain, referring to Figure 2, the detailed description of the data processing method is as follows:
S201,第一跨链网关获取第一区块链组织中存储的第一历史交互信息,第一历史交互信息为第一应用链与第二应用链之间的交互信息,第二应用链为第二区块链组织中的应用链。S201, the first cross-chain gateway acquires the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, and the second application chain is the interaction information between the first application chain and the second application chain. The application chain in the second blockchain organization.
其中,第一跨链网关用于实现第一区块链组织与其他不同区块链组织之间的跨链交互。Among them, the first cross-chain gateway is used to realize the cross-chain interaction between the first blockchain organization and other different blockchain organizations.
可选的,第一历史交互信息包括第一消息序号和对应第一消息序号的第一消息内容。其中,第一消息内容为第一应用链与第二应用链之间进行跨链交互的消息内容。Optionally, the first historical interaction information includes a first message sequence number and first message content corresponding to the first message sequence number. Wherein, the first message content is the message content of the cross-chain interaction between the first application chain and the second application chain.
需要说明的是,第一应用链与第二应用链之间的交互信息包括第一信息类型的交互信息和第二信息类型的交互信息。It should be noted that the interaction information between the first application chain and the second application chain includes interaction information of the first information type and interaction information of the second information type.
其中,第一信息类型为第一应用链向第二应用链发送交互信息的信息类型。具体的,第一信息类型包括第一信息子类型和第二信息子类型,其中,第一信息子类型为第一应用链向第二应用链发送交互请求消息的信息子类型,第二信息子类型为第一应用链向第二应 用链发送交互回执消息的信息子类型。Wherein, the first information type is the information type of the interaction information sent by the first application chain to the second application chain. Specifically, the first information type includes a first information subtype and a second information subtype, where the first information subtype is the information subtype for which the first application chain sends an interaction request message to the second application chain, and the second information subtype The type is the information subtype of the interaction receipt message sent by the first application chain to the second application chain.
第二信息类型为第二应用链向第一应用链发送交互信息的信息类型。具体的,第二信息类型包括第三信息子类型和第四信息子类型,其中,第三信息子类型为第二应用链向第一应用链发送交互请求消息的信息子类型,第四信息子类型为第二应用链向第一应用链发送交互回执消息的信息子类型。The second information type is the information type of the interaction information sent by the second application chain to the first application chain. Specifically, the second information type includes a third information subtype and a fourth information subtype, where the third information subtype is the information subtype for which the second application chain sends an interaction request message to the first application chain, and the fourth information subtype The type is the information subtype of the interaction receipt message sent by the second application chain to the first application chain.
针对每种子类型的信息,设置对应消息的初始消息序号为0,第一应用链与第二应用链之间每获取一种子类型的交互消息,都在之前获取的该子类型的交互消息的消息序号上加1,作为当前获取的该子类型的交互消息的消息序号。For each sub-type of information, set the initial message number of the corresponding message to 0, and each time a sub-type of interaction message is obtained between the first application chain and the second application chain, the message of the sub-type of interaction message obtained before Add 1 to the sequence number, and use it as the message sequence number of the interaction message of the subtype currently obtained.
可选的,第一应用链中存储第一历史交互信息。相应的,步骤S201具体可以包括:第一跨链网关获取第一应用链中存储的第一历史交互信息。Optionally, the first historical interaction information is stored in the first application chain. Correspondingly, step S201 may specifically include: the first cross-chain gateway acquires the first historical interaction information stored in the first application chain.
需要说明的是,第一跨链网关通过第一应用链获取第一历史交互信息,是需要在可信的环境中进行的,对于环境可信度有很高的要求。若环境变得不可信,则应用链上的数据可能存在泄露的风险。所以从数据的高可用层面来看,采用中继链的方式,数据会更加安全。其原因在于,同一区块链组织中不同应用链之间进行数据交互均通过中继链进行共识后,再存储至对应的应用链中,不同区块链组织的应用链之间进行数据交互也需要通过各自的中继链进行共识后,再存储至相应的应用链中,这样能够保证应用链上数据的安全性。It should be noted that the acquisition of the first historical interaction information by the first cross-chain gateway through the first application chain needs to be carried out in a trusted environment, which has high requirements for the reliability of the environment. If the environment becomes untrustworthy, the data on the application chain may be at risk of leakage. Therefore, from the perspective of high availability of data, the data will be more secure by adopting the relay chain method. The reason is that the data interaction between different application chains in the same blockchain organization is consensused through the relay chain, and then stored in the corresponding application chain, and the data interaction between application chains of different blockchain organizations is also It needs to be consensused through their respective relay chains, and then stored in the corresponding application chain, which can ensure the security of the data on the application chain.
综上,若本申请实施例的方法应用于图1所示的场景中,第一区块链组织还包括第一中继链。其中,第一中继链和第一应用链分别存储有第一历史交互信息。To sum up, if the method of the embodiment of the present application is applied to the scenario shown in FIG. 1 , the first blockchain organization also includes the first relay chain. Wherein, the first relay chain and the first application chain respectively store the first historical interaction information.
为了保证第一应用链上数据的安全性,第一跨链网关获取第一中继链中存储的第一历史交互信息。In order to ensure the security of data on the first application chain, the first cross-chain gateway obtains the first historical interaction information stored in the first relay chain.
S202,第一跨链网关获取第二区块链组织中存储的第二历史交互信息,第二历史交互信息为第二应用链与第一应用链之间的交互信息。S202. The first cross-chain gateway acquires second historical interaction information stored in the second blockchain organization, where the second historical interaction information is the interaction information between the second application chain and the first application chain.
本步骤中,第二区块链组织的结构与第一区块链组织的结构相同。第二区块链组织包括第二跨链网关和多个第二应用链。In this step, the structure of the second blockchain organization is the same as that of the first blockchain organization. The second blockchain organization includes a second cross-chain gateway and multiple second application chains.
其中,第二跨链网关用于实现第二区块链组织与其他不同区块链组织之间的跨链交互。Among them, the second cross-chain gateway is used to realize the cross-chain interaction between the second blockchain organization and other different blockchain organizations.
需要说明的是,由于第一应用链为第一区块链组织中的应用链,第二应用链为第二区块链组织中的应用链,所以二者之间的历史交互信息,即第一应用链与第二应用链之间的交互信息分别存储在第一区块链组织和第二区块链组织,这样便于后续信息比对和数据恢复。It should be noted that since the first application chain is an application chain in the first blockchain organization, and the second application chain is an application chain in the second blockchain organization, the historical interaction information between the two, that is, the first The interaction information between an application chain and the second application chain is stored in the first blockchain organization and the second blockchain organization respectively, which facilitates subsequent information comparison and data recovery.
可选的,第二历史交互信息包括第二消息序号和对应第二消息序号的第二消息内容。其中,第二消息内容为第二应用链与第一应用链之间进行跨链交互的消息内容。Optionally, the second historical interaction information includes a second message sequence number and a second message content corresponding to the second message sequence number. Wherein, the second message content is the message content of the cross-chain interaction between the second application chain and the first application chain.
可选的,第二应用链中存储第二历史交互信息。相应的,步骤S202具体可以包括:第一跨链网关通过第二跨链网关获取第二应用链中存储的第二历史交互信息。Optionally, the second historical interaction information is stored in the second application chain. Correspondingly, step S202 may specifically include: the first cross-chain gateway obtains the second historical interaction information stored in the second application chain through the second cross-chain gateway.
需要说明的是,在第二区块链组织侧,第二跨链网关通过第二应用链获取第二历史交互信息,是需要在可信的环境中进行的,对于环境可信度有很高的要求。若环境变得不可信,则应用链上的数据可能存在泄露的风险。所以从数据的高可用层面来看,采用中继链 的方式,数据会更加安全。原因详见步骤S201这里不再赘述。It should be noted that on the side of the second blockchain organization, the second cross-chain gateway obtains the second historical interaction information through the second application chain, which needs to be carried out in a trusted environment, which has a high degree of environmental credibility. requirements. If the environment becomes untrustworthy, the data on the application chain may be at risk of leakage. Therefore, from the perspective of high availability of data, the data will be more secure by adopting the relay chain method. See step S201 for details and will not repeat them here.
综上,若本申请实施例的方法应用于图1所示的场景中,第二区块链组织还包括第二中继链。其中,第二中继链和第二应用链分别存储有第二历史交互信息。To sum up, if the method of the embodiment of the present application is applied to the scenario shown in FIG. 1 , the second blockchain organization also includes a second relay chain. Wherein, the second relay chain and the second application chain respectively store the second historical interaction information.
为了保证第二应用链上数据的安全性,第一跨链网关通过第二跨链网关获取第二中继链中存储的第二历史交互信息。In order to ensure the security of data on the second application chain, the first cross-chain gateway obtains the second historical interaction information stored in the second relay chain through the second cross-chain gateway.
S203,第一跨链网关将第一历史交互信息和第二历史交互信息进行比对,得到第一比对结果。S203. The first cross-chain gateway compares the first historical interaction information with the second historical interaction information to obtain a first comparison result.
由上述可知,第一历史交互信息包括第一消息序号和对应第一消息序号的第一消息内容,第二历史交互信息包括第二消息序号和对应第二消息序号的第二消息内容。所以,第一跨链网关将第一历史交互信息和第二历史交互信息进行比对,可以通过比对消息序号来实现,也可以通过比对消息内容来实现。It can be known from the above that the first historical interaction information includes the first message sequence number and the first message content corresponding to the first message sequence number, and the second historical interaction information includes the second message sequence number and the second message content corresponding to the second message sequence number. Therefore, the first cross-chain gateway compares the first historical interaction information with the second historical interaction information, which can be achieved by comparing the message sequence number, or by comparing the message content.
S204,若第一比对结果表示第一历史交互信息与第二历史交互信息不一致,则第一跨链网关根据第一比对结果更新第一历史交互信息。S204. If the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information, the first cross-chain gateway updates the first historical interaction information according to the first comparison result.
这里,若通过比对消息序号来实现第一历史交互信息和第二历史交互信息之间的对比,则第一比对结果表示第一历史交互信息与第二历史交互信息不一致的具体表示为第一消息序号与第二消息序号不同;若通过比对消息内容来实现第一历史交互信息和第二历史交互信息之间的比对,则第一比对结果表示第一历史交互信息与第二历史交互信息不一致的具体表示为第一消息内容与第二消息内容不同,即各自对应的历史交互信息中的消息内容不一致。Here, if the comparison between the first historical interaction information and the second historical interaction information is realized by comparing the message sequence numbers, the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information. The first message sequence number is different from the second message sequence number; if the comparison between the first historical interaction information and the second historical interaction information is realized by comparing the message content, the first comparison result indicates that the first historical interaction information and the second historical interaction information The inconsistency of the historical interaction information is specifically represented by the fact that the content of the first message is different from the content of the second message, that is, the content of the messages in the corresponding historical interaction information is inconsistent.
在一种可能的实现方式中,步骤S201的实现过程可以包括:In a possible implementation manner, the implementation process of step S201 may include:
步骤S2011,第一跨链网关获取第一区块链组织中存储的第一服务列表,第一服务列表包括通过第一区块链组织进行跨链传输的所有应用链服务的所有历史交互信息。In step S2011, the first cross-chain gateway obtains the first service list stored in the first blockchain organization, and the first service list includes all historical interaction information of all application chain services for cross-chain transmission through the first blockchain organization.
需要说明的是,应用链服务可以理解为应用链上的智能合约或者链上账本中的部分数据。It should be noted that the application chain service can be understood as the smart contract on the application chain or part of the data in the ledger on the chain.
其中,通过第一区块链组织进行跨链传输的所有应用链服务包括隶属于第一区块链组织的应用链服务和隶属于其他区块链组织的应用链服务。Among them, all application chain services for cross-chain transmission through the first blockchain organization include application chain services affiliated to the first blockchain organization and application chain services affiliated to other blockchain organizations.
这里,其他区块链组织中包括第二区块链组织、第三区块链组织等。Here, other blockchain organizations include the second blockchain organization, the third blockchain organization, and the like.
隶属于其他区块链组织的应用链服务的历史交互信息包括隶属于第二区块链组织的应用链服务的历史交互信息和隶属于第三区块链组织的应用链服务的历史交互信息等。The historical interaction information of application chain services affiliated to other blockchain organizations includes the historical interaction information of application chain services affiliated to the second blockchain organization and the historical interaction information of application chain services affiliated to the third blockchain organization, etc. .
步骤S2012,第一跨链网关滤除第一服务列表中的第三历史交互信息,得到第四历史交互信息,其中,第三历史交互信息包括隶属于第一区块链组织的应用链服务所对应的第一区块链组织中各个第一应用链之间的历史交互信息,和隶属于第一区块链组织的应用链服务所对应的第一区块链组织中第一应用链与其他区块链组织中的应用链之间的历史交互信息;第四历史交互信息包括隶属于其他区块链组织的应用链服务所对应的、其他区块链组织中的应用链与第一区块链组织中的第一应用链之间的历史交互信息。Step S2012, the first cross-chain gateway filters out the third historical interaction information in the first service list to obtain the fourth historical interaction information, wherein the third historical interaction information includes the application chain service station belonging to the first blockchain organization The historical interaction information between each first application chain in the corresponding first blockchain organization, and the first application chain in the first blockchain organization corresponding to the application chain service belonging to the first blockchain organization and other The historical interaction information between the application chains in the blockchain organization; the fourth historical interaction information includes the application chains in other blockchain organizations corresponding to the application chain services of other blockchain organizations and the first block Historical interaction information between the first application chains in the chain organization.
步骤S2013,第一跨链网关对第四历史交互信息按照区块链组织的标识进行分类,得 到多个第五历史交互信息,其中,每个第五历史交互信息为隶属于其他区块链组织中的一个区块链组织的应用链服务所对应的、该区块链组织中的应用链与第一区块链组织中的第一应用链之间的历史交互信息。Step S2013, the first cross-chain gateway classifies the fourth historical interaction information according to the identification of the blockchain organization, and obtains a plurality of fifth historical interaction information, wherein each fifth historical interaction information belongs to other blockchain organizations Corresponding to the application chain service of a blockchain organization in , the historical interaction information between the application chain in the blockchain organization and the first application chain in the first blockchain organization.
步骤S2014,第一跨链网关利用第二区块链组织的标识,从多个第五历史交互信息中选取隶属于第二区块链组织的应用链服务所对应的、第二应用链与第一应用链之间的所述第一历史交互信息。In step S2014, the first cross-chain gateway uses the identification of the second blockchain organization to select the second application chain and the second application chain service corresponding to the application chain service belonging to the second blockchain organization from a plurality of fifth historical interaction information. The first historical interaction information between application chains.
相应的,在一种可能的实现方式中,步骤S202的实现过程可以包括:Correspondingly, in a possible implementation manner, the implementation process of step S202 may include:
第一跨链网关根据第二区块链组织的标识,通过第二区块链组织中的第二跨链网关获取第二区块链组织中存储的第二历史交互信息。According to the identification of the second blockchain organization, the first cross-chain gateway obtains the second historical interaction information stored in the second blockchain organization through the second cross-chain gateway in the second blockchain organization.
需要说明的是,消息序号相对于消息序号对应的消息内容而言,其数据更为简单,消息序号处理起来更为高效,所以为了进一步提高数据处理效率,在一种可能的实现方式中,步骤S203的实现过程可以包括:It should be noted that, compared with the message content corresponding to the message sequence number, the data of the message sequence number is simpler, and the processing of the message sequence number is more efficient. Therefore, in order to further improve the data processing efficiency, in a possible implementation, the step The implementation process of S203 may include:
步骤S2031,第一跨链网关将目标第一消息序号和目标第二消息序号进行比对,得到第一比对结果,其中,目标第一消息序号为第一消息序号中的最大消息序号,目标第二消息序号为第二消息序号中的最大消息序号。Step S2031, the first cross-chain gateway compares the target first message sequence number with the target second message sequence number to obtain the first comparison result, wherein the target first message sequence number is the largest message sequence number among the first message sequence numbers, and the target The second message sequence number is the largest message sequence number in the second message sequence numbers.
相应的,步骤S204的实现过程可以包括:Correspondingly, the implementation process of step S204 may include:
步骤S2041,若目标第一消息序号大于目标第二消息序号,则第一跨链网关获取第一区块链组织中存储的第三消息序号对应的第三消息内容,并通过第二区块链组织中的第二跨链网关向第二应用链发送第三消息序号和第三消息内容,其中,第三消息序号为第一消息序号中除第二消息序号之外的消息序号。Step S2041, if the target first message serial number is greater than the target second message serial number, the first cross-chain gateway obtains the third message content corresponding to the third message serial number stored in the first blockchain organization, and passes the second blockchain The second cross-chain gateway in the organization sends a third message sequence number and third message content to the second application chain, wherein the third message sequence number is a message sequence number in the first message sequence number except the second message sequence number.
需要说明的是,第一应用链与第二应用链之间的历史交互信息中的消息内容包括一条或者多条消息内容,相应的,第一应用链与第二应用链之间的历史交互信息中的消息序号包括一个或者多个。It should be noted that the message content in the historical interaction information between the first application chain and the second application chain includes one or more message contents. Correspondingly, the historical interaction information between the first application chain and the second application chain The message sequence number in includes one or more.
其中,若目标第一消息序号大于目标第二消息序号,说明第一区块链组织中存储的第一应用链和第二应用链之间的消息数量多于第二区块链组织中存储的第一应用链与第二应用链之间的消息数量,也就是说,第一区块链组织中多余出来的消息在之前并未成功发送该第二区块链组织中的第二应用链。为了实现数据恢复,需要第一跨链网关将第三消息序号对应的第三消息内容,通过第二跨链网关发送至第二应用链。Among them, if the target first message sequence number is greater than the target second message sequence number, it means that the number of messages between the first application chain and the second application chain stored in the first blockchain organization is more than that stored in the second blockchain organization. The number of messages between the first application chain and the second application chain, that is, the redundant messages in the first blockchain organization have not been successfully sent to the second application chain in the second blockchain organization before. In order to realize data recovery, the first cross-chain gateway needs to send the third message content corresponding to the third message sequence number to the second application chain through the second cross-chain gateway.
需要说明的是,第三消息序号可以是一个消息序号也可以是多个消息序号,具体由目标第一消息序号与目标第二消息序号之间的差值确定。比如,第一消息序号包括1、2、3、4和5,第二消息序号包括1和2,则说明第二区块链组织中存储的第一应用链与第二应用链之间的消息数量比第一区块链组织中存储的第一应用链和第二应用链之间的消息数量少三条,此时,需要第一跨链网关主动向第一区块链组织获取消息序号为3、4和5的跨链消息,并通过与第二跨链网关的点对点连接最终将消息序号为3、4和5的跨链消息发送至第二区块链组织下的第二应用链。It should be noted that the third message sequence number may be one message sequence number or multiple message sequence numbers, which is specifically determined by the difference between the target first message sequence number and the target second message sequence number. For example, if the first message sequence number includes 1, 2, 3, 4, and 5, and the second message sequence number includes 1 and 2, it means that the messages between the first application chain and the second application chain stored in the second blockchain organization The number is three less than the number of messages between the first application chain and the second application chain stored in the first blockchain organization. At this time, the first cross-chain gateway needs to actively obtain the message number 3 from the first blockchain organization. , 4, and 5 cross-chain messages, and finally send the cross-chain messages with message numbers 3, 4, and 5 to the second application chain under the second blockchain organization through a point-to-point connection with the second cross-chain gateway.
步骤S2042,若目标第一消息序号小于目标第二消息序号,则第一跨链网关获取第二 区块链组织中存储的第四消息序号对应的第四消息内容,向第一应用链发送第四消息序号和第四消息内容,并将第四消息序号和第四消息内容添加至第一历史交互信息中,其中,第四消息序号为第二消息序号中除第一消息序号之外的消息序号。Step S2042, if the target first message sequence number is smaller than the target second message sequence number, the first cross-chain gateway obtains the fourth message content corresponding to the fourth message sequence number stored in the second blockchain organization, and sends the first application chain to the first application chain. Four message sequence numbers and fourth message contents, and add the fourth message sequence numbers and fourth message contents to the first historical interaction information, wherein the fourth message sequence numbers are messages other than the first message sequence numbers in the second message sequence numbers serial number.
这里,若目标第一消息序号小于目标第二消息序号,说明第一区块链组织中存储的第一应用链和第二应用链之间的消息数量少于第二区块链组织中存储的第一应用链与第二应用链之间的消息数量,也就是说,第二区块链组织中多余出来的消息在之前并未成功发送该第一区块链组织中的第一应用链。为了实现数据恢复,需要第一跨链网关通过第二跨链网关获取第二区块链组织中多余出来的消息,并发送给第一应用链,并将第二区块链组织中多余出来的消息更新到第一历史交互信息中。Here, if the target first message sequence number is less than the target second message sequence number, it means that the number of messages between the first application chain and the second application chain stored in the first blockchain organization is less than that stored in the second blockchain organization. The number of messages between the first application chain and the second application chain, that is, the redundant messages in the second blockchain organization have not been successfully sent to the first application chain in the first blockchain organization before. In order to achieve data recovery, the first cross-chain gateway needs to obtain the redundant messages in the second blockchain organization through the second cross-chain gateway, and send them to the first application chain, and send the redundant messages in the second blockchain organization The message is updated to the first historical interaction information.
需要说明的是,第四消息序号可以是一个消息序号也可以是多个消息序号,具体由第一消息序号与第二消息序号之间的差值确定。比如,第一消息序号包括1和2,第二消息序号包括1、2、3、4和5,则说明第二区块链组织中存储的第一应用链与第二应用链之间的消息数量比第一区块链组织中存储的第一应用链和第二应用链之间的消息数量多三条,此时,需要第一跨链网关通过第二跨链网关获取第二区块链组织中存储的消息序号为3、4和5的跨链消息,并将消息序号为3、4和5的跨链消息发送给第一应用链,并更新到第一历史交互信息中。It should be noted that the fourth message sequence number may be one message sequence number or multiple message sequence numbers, which is specifically determined by a difference between the first message sequence number and the second message sequence number. For example, the first message sequence number includes 1 and 2, and the second message sequence number includes 1, 2, 3, 4, and 5, which means that the messages between the first application chain and the second application chain stored in the second blockchain organization The number is three more than the number of messages between the first application chain and the second application chain stored in the first blockchain organization. At this time, the first cross-chain gateway needs to obtain the second blockchain organization through the second cross-chain gateway. The cross-chain messages with message numbers 3, 4, and 5 stored in , and the cross-chain messages with message numbers 3, 4, and 5 are sent to the first application chain, and updated to the first historical interaction information.
由于消息序号相对于消息序号对应的消息内容而言,其数据更为简单,对消息序号处理起来更为高效,上述给出了步骤S203的一个可能的实现方式,即通过比对消息序号来实现数据的更新,使得数据更新处理更为高效。Compared with the message content corresponding to the message sequence number, the data of the message sequence number is simpler, and the processing of the message sequence number is more efficient. A possible implementation of step S203 is given above, that is, by comparing the message sequence numbers to achieve The update of data makes the data update processing more efficient.
由于第一区块链组织和第二区块链组织中均存储有第一应用链和第二应用链之间的交互数据,数据更新处理也是基于这两个区块链组织中的数据进行的。所以进一步的,在比对消息序号之前,第一跨链网关只需要获取第一应用链与第二应用链之间进行跨链交互的消息内容对应的消息序号即可,不需要再额外获取消息序号对应的消息内容,也就是第一跨链网关只获取历史交互信息中的消息序号,这样可以在节省数据处理资源的情况下,进一步提高数据更新处理效率。Since the interaction data between the first application chain and the second application chain are stored in both the first blockchain organization and the second blockchain organization, the data update processing is also performed based on the data in the two blockchain organizations . So further, before comparing the message serial numbers, the first cross-chain gateway only needs to obtain the message serial number corresponding to the message content of the cross-chain interaction between the first application chain and the second application chain, and there is no need to obtain additional messages The message content corresponding to the serial number, that is, the first cross-chain gateway only obtains the message serial number in the historical interaction information, which can further improve the efficiency of data update processing while saving data processing resources.
以上数据处理过程是在跨链网关启动后,对区块链组织的应用链之间的历史交互信息的更新过程,在完成历史交互信息的更新后,跨链网关进入正常运行状态。The above data processing process is the process of updating the historical interaction information between the application chains of the blockchain organization after the cross-chain gateway is started. After the update of the historical interaction information is completed, the cross-chain gateway enters the normal operating state.
对于由不同区块链组织构成的跨组织区块链系统,可参照图1,通过上述方法每个区块链组织只需要关注与自身区块链组织相关的跨链交互,无需遍历及存储与自身区块链组织无关的跨链交互,极大提升了跨链网关启动时的数据恢复效率。For a cross-organization blockchain system composed of different blockchain organizations, refer to Figure 1. Through the above method, each blockchain organization only needs to pay attention to the cross-chain interaction related to its own blockchain organization, without traversal and storage and The cross-chain interaction irrelevant to its own blockchain organization greatly improves the data recovery efficiency when the cross-chain gateway starts.
在跨链网关进入正常运行状态后,不同区块链组织的各应用链之间进行跨链交互时,目的应用链需要按照跨链消息的先后顺序处理这些跨链消息。但是由于网络不稳定等原因,可能导致在目的应用链未能成功收到消息的情况下,又收到后续发来的跨链消息,这样使得目的应用链端虽然接收到后续发来的消息,也不能及时处理,存在消息阻塞和服务不可用的风险。After the cross-chain gateway enters the normal operation state, when the application chains of different blockchain organizations perform cross-chain interaction, the target application chain needs to process these cross-chain messages in the order of cross-chain messages. However, due to network instability and other reasons, the destination application chain may receive subsequent cross-chain messages when the destination application chain fails to receive the message, so that although the destination application chain receives subsequent messages, It cannot be processed in time, and there is a risk of message blocking and service unavailability.
为了解决上述问题,参照图3,在一种可能的实现方式中,上述方法还包括:In order to solve the above problem, referring to FIG. 3, in a possible implementation, the above method further includes:
S301,当第一跨链网关监测到第一应用链与第二应用链之间的第一交互信息,第一跨链网关获取第五历史交互信息,其中,第一交互信息包括第五消息序号和对应第五消息序号的第五消息内容,第五历史交互信息为在接收到第一交互信息之前第一应用链与第二应用链之间的交互信息,第五历史交互信息包括第六消息序号和对应第六消息序号的第六消息内容。S301, when the first cross-chain gateway detects the first interaction information between the first application chain and the second application chain, the first cross-chain gateway obtains the fifth historical interaction information, wherein the first interaction information includes the fifth message sequence number and the fifth message content corresponding to the fifth message number, the fifth historical interaction information is the interaction information between the first application chain and the second application chain before receiving the first interaction information, and the fifth historical interaction information includes the sixth message The sequence number and the content of the sixth message corresponding to the sequence number of the sixth message.
参照图1所示的实现方式中的阐述,第一交互信息为第一信息类型的交互信息或者第二信息类型的交互信息。Referring to the description in the implementation manner shown in FIG. 1 , the first interaction information is interaction information of a first information type or interaction information of a second information type.
若第一交互信息为第一信息类型的交互信息,则第一交互信息为第一应用链向第二应用链发送的第一交互请求消息或者第一交互回执消息。If the first interaction information is interaction information of the first information type, the first interaction information is a first interaction request message or a first interaction receipt message sent by the first application chain to the second application chain.
若第一交互信息为第二信息类型的交互信息,则第一交互信息为第二应用链向第一应用链发送的第二交互请求消息或者第二交互回执消息。If the first interaction information is interaction information of the second information type, the first interaction information is a second interaction request message or a second interaction receipt message sent by the second application chain to the first application chain.
这里,当第一跨链网关监测到第一应用链与第二应用链之间的第一交互信息说明第一应用链与第二应用链之间当前需要跨链交互,而为了保证在此之前的第一应用链与第二应用链之间的跨链交互都得到了相应的处理,第一跨链网关需要获取第五历史交互信息。Here, when the first cross-chain gateway monitors the first interaction information between the first application chain and the second application chain, it indicates that cross-chain interaction is currently required between the first application chain and the second application chain. The cross-chain interaction between the first application chain and the second application chain has been processed accordingly, and the first cross-chain gateway needs to obtain the fifth historical interaction information.
这里,第一跨链网关可以是从存储第五历史交互信息的对应链上获取第五历史交互信息。Here, the first cross-chain gateway may obtain the fifth historical interaction information from the corresponding chain that stores the fifth historical interaction information.
第一跨链网关还可以从本地内存中获取第五历史交互信息,也就是第一跨链网关在每次执行完跨链消息后自行维护第一应用链和第二应用链之间的交互序号,以减少网络通信交互,提升网络性能。The first cross-chain gateway can also obtain the fifth historical interaction information from the local memory, that is, the first cross-chain gateway maintains the interaction sequence number between the first application chain and the second application chain after each execution of the cross-chain message , to reduce network communication interactions and improve network performance.
因为连接应用链的跨链网关同一时间只有一个,所以跨链网关可以维护应用链之间的交互序号,而且若跨链网关维护应用链之间的交互序号的话,数据处理效率更高。当然应用链和中继链中也维护了应用链之间的交互序号,可以供跨链网关宕机恢复时获取。Because there is only one cross-chain gateway connected to the application chain at a time, the cross-chain gateway can maintain the interaction sequence number between the application chains, and if the cross-chain gateway maintains the interaction sequence number between the application chains, the data processing efficiency is higher. Of course, the application chain and the relay chain also maintain the interaction sequence number between the application chain, which can be obtained when the cross-chain gateway is down and recovers.
需要说明的是,第五历史交互信息的信息类型与第一交互信息的信息类型相同。It should be noted that the information type of the fifth historical interaction information is the same as that of the first interaction information.
可选的,若第一交互信息为第一信息类型的交互信息,则第一跨链网关获取第一应用链中的第五历史交互信息。Optionally, if the first interaction information is the interaction information of the first information type, the first cross-chain gateway obtains the fifth historical interaction information in the first application chain.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,则第一跨链网关获取第一中继链中的第五历史交互信息。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, and the second blockchain organization also includes the second relay chain, then The first cross-chain gateway acquires fifth historical interaction information in the first relay chain.
若第一交互信息为第二信息类型的交互信息,则第一跨链网关通过第二跨链网关获取第二应用链中的第五历史交互信息。If the first interaction information is the interaction information of the second information type, the first cross-chain gateway obtains the fifth historical interaction information in the second application chain through the second cross-chain gateway.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,则第一跨链网关获取第二中继链中的第五历史交互信息。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, and the second blockchain organization also includes the second relay chain, then The first cross-chain gateway acquires fifth historical interaction information in the second relay chain.
S302,若第五消息序号与目标第六消息序号满足第一预设条件,则第一跨链网关根据第五消息序号和目标第六消息序号更新第五历史交互信息,其中,目标第六消息序号为第六消息序号中的最大消息序号,第一预设条件为第五消息序号大于目标第六消息序号,且 第五消息序号与目标第六消息序号之差大于1。S302. If the fifth message sequence number and the target sixth message sequence number meet the first preset condition, the first cross-chain gateway updates the fifth historical interaction information according to the fifth message sequence number and the target sixth message sequence number, wherein the target sixth message sequence number The serial number is the largest message serial number in the sixth message serial number, and the first preset condition is that the fifth message serial number is greater than the target sixth message serial number, and the difference between the fifth message serial number and the target sixth message serial number is greater than 1.
需要说明的是,第五历史交互信息中的消息内容包括一条或多条消息内容相应的,第五交互信息中的第六消息序号包括一个或多个。It should be noted that the message content in the fifth historical interaction information includes one or more message contents, and correspondingly, the sixth message sequence number in the fifth interaction information includes one or more messages.
这里,若第五消息序号与目标第六消息序号满足第一预设条件,说明在目标第六消息序号之后,第五消息序号之前,第一区块链组织中存在未成功发送或者接收的跨链消息。为了保证第二应用链按照跨链消息的先后顺序及时处理跨链消息,或者保证第一应用链按照收到的跨链消息的先后顺序及时处理跨链消息,第一跨链网关需要根据第五消息序号和目标第六消息序号更新第五历史交互信息。Here, if the fifth message sequence number and the target sixth message sequence number meet the first preset condition, it means that after the target sixth message sequence number and before the fifth message sequence number, there is an unsuccessfully sent or received cross-link in the first blockchain organization. chain message. In order to ensure that the second application chain processes cross-chain messages in a timely manner according to the order of cross-chain messages, or that the first application chain processes cross-chain messages in a timely manner according to the order in which cross-chain messages are received, the first cross-chain gateway needs to follow the fifth The message sequence number and the target sixth message sequence number update the fifth historical interaction information.
在一种可能的实现方式中,步骤S302的实现过程可包括:In a possible implementation manner, the implementation process of step S302 may include:
S3021,第一跨链网关获取第五消息序号与目标第六消息序号之间第七消息序号对应的第七消息内容。S3021. The first cross-chain gateway acquires the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number.
具体的,若第一交互信息为第一信息类型的交互信息,则第一跨链网关获取第一应用链中的第五消息序号与第六消息序号之间第七消息序号对应的第七消息内容。Specifically, if the first interaction information is the interaction information of the first information type, the first cross-chain gateway obtains the seventh message corresponding to the seventh message number between the fifth message number and the sixth message number in the first application chain content.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,则第一跨链网关获取第一中继链中的第五消息序号与目标第六消息序号之间第七消息序号对应的第七消息内容。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, and the second blockchain organization also includes the second relay chain, then The first cross-chain gateway obtains the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number in the first relay chain.
若第一交互信息为第二信息类型的交互信息,则第一跨链网关通过第二跨链网关获取第二应用链中的第五消息序号与目标第六消息序号之间第七消息序号对应的第七消息内容。If the first interaction information is the interaction information of the second information type, the first cross-chain gateway obtains the correspondence between the fifth message number in the second application chain and the sixth message number of the target through the second cross-chain gateway. The content of the seventh message.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,则第一跨链网关通过第二跨链网关获取第二中继链中的第五消息序号与目标第六消息序号之间第七消息序号对应的第七消息内容。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, and the second blockchain organization also includes the second relay chain, then The first cross-chain gateway obtains the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number in the second relay chain through the second cross-chain gateway.
S3022,第一跨链网关将第七消息序号和第七消息内容添加至第五历史交互信息中。S3022. The first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information.
可选的,若第一交互信息为第一信息类型的交互信息,则第一跨链网关将第七消息序号和第七消息内容添加至第一应用链中的第五历史交互信息中。Optionally, if the first interaction information is the interaction information of the first information type, the first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information in the first application chain.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,第一跨链网关将第七消息序号和第七消息内容添加至第一中继链中的第五历史交互信息中。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, the second blockchain organization also includes the second relay chain, and the second blockchain organization also includes the second relay chain. A cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information in the first relay chain.
可选的,若第一交互信息为第二信息类型的交互信息,则第一跨链网关通过第二跨链网关将第七消息序号和第七消息内容添加至第二应用链中的第五历史交互信息中。Optionally, if the first interaction information is the interaction information of the second information type, the first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth message in the second application chain through the second cross-chain gateway. In the historical interaction information.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,第一跨链网关通过第二跨链网关将第七消息序号和第七消息内容添加至第二中继链中的第五历史交互信息中。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, the second blockchain organization also includes the second relay chain, and the second blockchain organization also includes the second relay chain. A cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information in the second relay chain through the second cross-chain gateway.
S303,在第一跨链网关在得到更新后的第五历史交互信息之后,第一跨链网关根据第一交互信息的信息类型处理第一交互信息。S303. After the first cross-chain gateway obtains the updated fifth historical interaction information, the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information.
在一种可能的实现方式中,步骤S303的实现过程可以包括:In a possible implementation manner, the implementation process of step S303 may include:
步骤S3031,若第一交互信息的信息类型为第一信息类型,则第一跨链网关通过第二区块链组织中的第二跨链网关向第二应用链发送第一交互信息,第一信息类型为第一应用链向第二应用链发送交互信息的信息类型。Step S3031, if the information type of the first interaction information is the first information type, then the first cross-chain gateway sends the first interaction information to the second application chain through the second cross-chain gateway in the second blockchain organization, and the first The information type is the information type of the interaction information sent by the first application chain to the second application chain.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,第一跨链网关通过第二跨链网关向第二中继链发送第一交互信息,由第二中继链将第一交互信息转发给第二应用链。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, the second blockchain organization also includes the second relay chain, and the second blockchain organization also includes the second relay chain. A cross-chain gateway sends the first interaction information to the second relay chain through the second cross-chain gateway, and the second relay chain forwards the first interaction information to the second application chain.
需要说明的是,第二跨链网关在接收到第一交互信息之后,向第二应用链发送第一交互信息之前,同样也需要检查给第一交互信息的有序性,即第二跨链网关获取第六历史交互信息,该第六历史交互信息为在接收到第一交互信息之前第一应用链与第二应用链之间的交互信息。通过检查确定是否需要更新第六历史交互信息,详细实现步骤可参考第一跨链网关侧,这里不再赘述。It should be noted that after receiving the first interaction information, the second cross-chain gateway also needs to check the order of the first interaction information before sending the first interaction information to the second application chain, that is, the second cross-chain The gateway acquires sixth historical interaction information, where the sixth historical interaction information is interaction information between the first application chain and the second application chain before receiving the first interaction information. By checking to determine whether the sixth historical interaction information needs to be updated, the detailed implementation steps can refer to the first cross-chain gateway side, and will not be repeated here.
需要说明的是,第六历史交互信息的信息类型与第一交互信息的信息类型相同。It should be noted that the information type of the sixth historical interaction information is the same as that of the first interaction information.
步骤S3032,若第一交互信息的信息类型为第二信息类型,则第一跨链网关向第一应用链发送第一交互信息,第二信息类型为第二应用链向第一应用链发送交互信息的信息类型。Step S3032, if the information type of the first interaction information is the second information type, the first cross-chain gateway sends the first interaction information to the first application chain, and the second information type is that the second application chain sends the interaction information to the first application chain The message type of the message.
相应的,若本申请实施例的方法应用于图1所示的场景中,即第一区块链组织还包括第一中继链,第二区块链组织还包括第二中继链,第一跨链网关向第一中继链发送第一交互信息,由第一中继链将第一交互信息转发给第一应用链。Correspondingly, if the method of the embodiment of this application is applied to the scenario shown in Figure 1, that is, the first blockchain organization also includes the first relay chain, the second blockchain organization also includes the second relay chain, and the second blockchain organization also includes the second relay chain. A cross-chain gateway sends the first interaction information to the first relay chain, and the first relay chain forwards the first interaction information to the first application chain.
在一种可能的实现方式中,在步骤S301之后,上述方法还包括:In a possible implementation, after step S301, the above method further includes:
S304,若第五消息序号等于或者小于目标第六消息序号,则第一跨链网关对第一交互信息不做处理。S304. If the fifth message sequence number is equal to or less than the target sixth message sequence number, the first cross-chain gateway does not process the first interaction information.
需要说明的是,第五消息序号等于或者小于目标第六消息序号,说明第五历史交互消息中已存储第五消息序号,也就是说,第一交互信息已经被第一应用链处理过,所以不需要对第一交互信息再做处理。It should be noted that the fifth message sequence number is equal to or less than the target sixth message sequence number, indicating that the fifth message sequence number has been stored in the fifth historical interaction message, that is, the first interaction information has been processed by the first application chain, so There is no need to further process the first interaction information.
S305,若第五消息序号与目标第六消息序号满足第二预设条件,则第一跨链网关根据第一交互信息的信息类型处理第一交互信息,第二预设条件为第五消息序号大于目标第六消息序号,且第五消息序号与目标第六消息序号之差为1。S305, if the fifth message sequence number and the target sixth message sequence number meet the second preset condition, the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information, and the second preset condition is the fifth message sequence number It is greater than the target sixth message sequence number, and the difference between the fifth message sequence number and the target sixth message sequence number is 1.
这里,若第五消息序号与目标第六消息序号满足第二预设条件,说明第一交互信息按照先后顺序刚好是需要被处理。Here, if the fifth message sequence number and the target sixth message sequence number satisfy the second preset condition, it means that the first interaction information just needs to be processed according to the sequence.
具体的,第一跨链网关根据第一交互信息的信息类型处理第一交互信息与步骤S303部分第一跨链网关根据第一交互信息的信息类型处理第一交互信息的实现过程相同,具体详见步骤S303部分的阐述,这里不再赘述。Specifically, processing the first interaction information by the first cross-chain gateway according to the information type of the first interaction information is the same as the implementation process of processing the first interaction information by the first cross-chain gateway according to the information type of the first interaction information in step S303. See the description of step S303 , which will not be repeated here.
下面参照图1所示的跨组织区块链系统,以一示例具体说明在跨组织区块链系统中的各跨链网关进入正常运行状态后,本申请实施例的数据处理方法(即跨链消息的消息序号矫正方法)的实现过程。Referring to the inter-organizational blockchain system shown in Figure 1, an example is used to specifically illustrate the data processing method of the embodiment of the present application after each cross-chain gateway in the inter-organizational blockchain system enters a normal operating state The implementation process of the message sequence number correction method of the message).
S401,中继链A2接收来自应用链A3的第一跨链交互请求,该第一跨链交互请求用于请求与应用链B3进行跨链交互,该第一跨链交互请求包括消息序号和对应该消息序号的具体请求内容。S401. Relay chain A2 receives a first cross-chain interaction request from application chain A3. The first cross-chain interaction request is used to request cross-chain interaction with application chain B3. The first cross-chain interaction request includes message sequence number and pair The specific request content should be the message sequence number.
S402,中继链A2向跨链网关A1发送该第一跨链交互请求;S402, the relay chain A2 sends the first cross-chain interaction request to the cross-chain gateway A1;
这里,中继链A2接收到来自应用链A3的第一跨链交互请求后,经过检查发现需要进行跨链交互的目的应用链不是本区块链组织内的应用链,则将该第一跨链交互请求转发给跨链网关A1。Here, after the relay chain A2 receives the first cross-chain interaction request from the application chain A3, after inspection, it is found that the target application chain that requires cross-chain interaction is not an application chain within the blockchain organization, then the first cross-chain The chain interaction request is forwarded to the cross-chain gateway A1.
S403,当跨链网关A1监测到该第一跨链交互请求,跨链网关A1获取应用链A3向应用链B3发起的第一历史跨链交互请求。S403. When the cross-chain gateway A1 detects the first cross-chain interaction request, the cross-chain gateway A1 acquires the first historical cross-chain interaction request initiated by the application chain A3 to the application chain B3.
S404,跨链网关A1将第一历史跨链交互请求中的最大消息序号与该第一跨链交互请求中的消息序号进行比较,得到比较结果。S404, the cross-chain gateway A1 compares the largest message sequence number in the first historical cross-chain interaction request with the message sequence number in the first cross-chain interaction request, and obtains a comparison result.
S405,若第一跨链交互请求中的消息序号大于第一历史跨链交互请求中的最大消息序号,且二者之差大于1,则跨链网关A1通过中继链A2获取第一跨链交互请求中的消息序号与第一历史跨链交互消息中的最大消息序号之间每个消息序号对应的第二历史跨链交互请求,并将每个消息序号对应的第二历史跨链交互请求发送给跨链网关B1,由该跨链网关B1转发给中继链B2,最后由中继链B2将每个消息序号对应的第二历史跨链交互请求发送给应用链B3。S405, if the message sequence number in the first cross-chain interaction request is greater than the largest message sequence number in the first historical cross-chain interaction request, and the difference between the two is greater than 1, then the cross-chain gateway A1 obtains the first cross-chain interaction through the relay chain A2 The second historical cross-chain interaction request corresponding to each message sequence number between the message sequence number in the interaction request and the maximum message sequence number in the first historical cross-chain interaction message, and the second historical cross-chain interaction request corresponding to each message sequence number Send it to the cross-chain gateway B1, which will forward it to the relay chain B2, and finally the relay chain B2 will send the second historical cross-chain interaction request corresponding to each message sequence number to the application chain B3.
需要说明的是,第二历史跨链交互请求指的是在第一跨链交互请求之前未成功发送的跨链交互请求。It should be noted that the second historical cross-chain interaction request refers to a cross-chain interaction request that was not successfully sent before the first cross-chain interaction request.
具体的,跨链网关A1中的适配器会根据第二历史跨链交互请求中的目的中继链ID(即中继链B2的ID),将每个消息序号对应的第二历史跨链交互请求发送给跨链网关B1。Specifically, the adapter in cross-chain gateway A1 will send the second historical cross-chain interaction request corresponding to each message sequence number to Send to cross-chain gateway B1.
经过该步骤,能够将之前未成功发送的第二历史跨链交互请求发送至应用链B3,从而保证应用链B3按照跨链交互请求的先后顺序处理相应的跨链交互请求。After this step, the second historical cross-chain interaction request that was not successfully sent before can be sent to the application chain B3, so as to ensure that the application chain B3 processes the corresponding cross-chain interaction requests in the order of the cross-chain interaction requests.
在步骤S405之后,执行步骤S408。After step S405, step S408 is executed.
S406,若第一跨链交互请求中的消息序号等于第一历史跨链交互请求中的最大消息序号,则跨链网关A1对第一跨链交互请求不做处理。S406. If the message sequence number in the first cross-chain interaction request is equal to the maximum message sequence number in the first historical cross-chain interaction request, the cross-chain gateway A1 does not process the first cross-chain interaction request.
S407,若第一跨链交互请求中的消息序号大于第一历史跨链交互请求中的最大消息序号,且二者之差等于1,则执行步骤S408。S407. If the message sequence number in the first cross-chain interaction request is greater than the maximum message sequence number in the first historical cross-chain interaction request, and the difference between the two is equal to 1, execute step S408.
S408,跨链网关A1向跨链网关B1发送第一跨链交互请求。S408, the cross-chain gateway A1 sends a first cross-chain interaction request to the cross-chain gateway B1.
S409,当跨链网关B1监测到该第一跨链交互请求,跨链网关B1获取应用链A3向应用链B3发起的第三历史跨链交互请求;将第三历史跨链交互请求中的最大消息序号与该第一跨链交互请求中的消息序号进行比较,得到比较结果。S409. When the cross-chain gateway B1 detects the first cross-chain interaction request, the cross-chain gateway B1 obtains the third historical cross-chain interaction request initiated by the application chain A3 to the application chain B3; The message sequence number is compared with the message sequence number in the first cross-chain interaction request to obtain the comparison result.
S410,若第一跨链交互请求中的消息序号大于第三历史跨链交互请求中的最大消息序号,且二者之差大于1,则跨链网关B1通过跨链网关A1获取第一跨链交互请求中的消息序号与第三历史跨链交互消息中的最大消息序号之间每个消息序号对应的第四历史跨链交互请求,并将第四历史跨链交互请求转发给中继链B2,最后由中继链B2将每个消息序号 对应的第四历史跨链交互请求发送给应用链B3。S410, if the message sequence number in the first cross-chain interaction request is greater than the maximum message sequence number in the third historical cross-chain interaction request, and the difference between the two is greater than 1, cross-chain gateway B1 obtains the first cross-chain interaction through cross-chain gateway A1 The fourth historical cross-chain interaction request corresponding to each message sequence number between the message sequence number in the interaction request and the maximum message sequence number in the third historical cross-chain interaction message, and forward the fourth historical cross-chain interaction request to the relay chain B2 , and finally the relay chain B2 sends the fourth historical cross-chain interaction request corresponding to each message sequence number to the application chain B3.
在步骤S410之后,执行步骤S413。After step S410, step S413 is executed.
S411,若第一跨链交互请求中的消息序号等于或者小于第三历史跨链交互请求中的最大消息序号,则跨链网关B1对第一跨链交互请求不做处理。S411. If the message sequence number in the first cross-chain interaction request is equal to or less than the maximum message sequence number in the third historical cross-chain interaction request, the cross-chain gateway B1 does not process the first cross-chain interaction request.
S412,若第一跨链交互请求中的消息序号大于第三历史跨链交互请求中的最大消息序号,且二者之差等于1,则执行步骤S413。S412. If the message sequence number in the first cross-chain interaction request is greater than the maximum message sequence number in the third historical cross-chain interaction request, and the difference between the two is equal to 1, execute step S413.
S413,跨链网关B1将第一跨链交互请求转发给中继链B2,最后由中继链B2将第一跨链交互请求发送给应用链B3。S413, the cross-chain gateway B1 forwards the first cross-chain interaction request to the relay chain B2, and finally the relay chain B2 sends the first cross-chain interaction request to the application chain B3.
S414,应用链B3基于第一跨链交互请求执行相应的服务,生成第一跨链交互回执。S414. The application chain B3 executes corresponding services based on the first cross-chain interaction request, and generates a first cross-chain interaction receipt.
之后,通过以上同理路径将第一跨链交互回执返回给应用链A3,这里不再赘述。Afterwards, the first cross-chain interaction receipt is returned to AppChain A3 through the same path as above, which will not be repeated here.
通过上述跨链消息的消息序号矫正,能够保证跨组织区块链系统在运行时的网络容错。而且通过主动消息获取,保证了即使遇到跨组织区块链系统在运行时的网络不稳定问题也可高效规避重放与消息遗漏。Through the correction of the message sequence number of the above-mentioned cross-chain messages, it is possible to ensure the network fault tolerance of the cross-organizational blockchain system during operation. Moreover, through active message acquisition, it is ensured that replay and message omission can be efficiently avoided even if the network instability problem of the cross-organizational blockchain system is encountered during operation.
本申请实施例的方法通过将跨链网关宕机异常后数据恢复和运行时自动调整消息序号,使得跨区块链组织间实现了非依赖式可靠服务,而且使得跨区块链组织的动态接入或者退出跨组织区块链系统具备了技术底座,为跨组织区块链系统跨链管理及运行监控的实现提供了工程可操作性。The method of the embodiment of the present application realizes non-dependent and reliable services between cross-blockchain organizations by recovering the data after the cross-chain gateway goes down abnormally and automatically adjusting the message sequence number during operation, and enables the dynamic connection of cross-blockchain organizations Entering or exiting the cross-organization blockchain system has a technical base, which provides engineering operability for the realization of cross-chain management and operation monitoring of the cross-organization blockchain system.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
对应于上文实施例所述的数据处理方法,图4示出了本申请实施例提供的数据处理装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。该数据处理装置应用于第一区块链组织中的第一跨链网关,第一区块链组织包括第一跨链网关和多个第一应用链。Corresponding to the data processing method described in the above embodiment, FIG. 4 shows a structural block diagram of a data processing device provided by the embodiment of the present application. For the convenience of description, only the parts related to the embodiment of the present application are shown. The data processing device is applied to a first cross-chain gateway in a first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and multiple first application chains.
参照图4,该装置500可以包括:第一获取模块510、第二获取模块520、比对模块530和第一信息更新模块540。Referring to FIG. 4 , the apparatus 500 may include: a first acquiring module 510 , a second acquiring module 520 , a comparing module 530 and a first information updating module 540 .
其中,第一获取模块510,用于获取第一区块链组织中存储的第一历史交互信息,第一历史交互信息为第一应用链与第二应用链之间的交互信息,第二应用链为第二区块链组织中的应用链。Among them, the first acquisition module 510 is used to acquire the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, and the second application chain The chain is the application chain in the second blockchain organization.
第二获取模块520,用于获取第二区块链组织中存储的第二历史交互信息,第二历史交互信息为第二应用链与第一应用链之间的交互信息。The second acquiring module 520 is configured to acquire second historical interaction information stored in the second blockchain organization, where the second historical interaction information is the interaction information between the second application chain and the first application chain.
对比模块530,用于将第一历史交互信息和第二历史交互信息进行比对,得到第一比对结果。The comparison module 530 is configured to compare the first historical interaction information with the second historical interaction information to obtain a first comparison result.
第一信息更新模块540,用于在第一比对结果表示第一历史交互信息与第二历史交互信息不一致时,根据第一比对结果更新第一历史交互信息。The first information updating module 540 is configured to update the first historical interaction information according to the first comparison result when the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information.
在一种可能的实现方式中,第一获取模块510具体可以用于:In a possible implementation manner, the first acquiring module 510 may be specifically configured to:
获取第一区块链组织中存储的第一服务列表,第一服务列表通过第一区块链组织进行 跨链传输的所有应用链服务的所有历史交互信息;滤除第一服务列表中的第三历史交互信息,得到第四历史交互信息,其中,第三历史交互信息包括隶属于第一区块链组织的应用链服务所对应的、第一区块链组织中各个第一应用链之间的历史交互信息,和隶属于第一区块链组织的应用链服务所对应的、第一区块链组织中第一应用链与其他区块链组织中的应用链之间的历史交互信息;第四历史交互信息为隶属于其他区块链组织的应用链服务所对应的、其他区块链组织中的应用链与第一区块链组织中的第一应用链之间的历史交互信息;对第四历史交互信息按照区块链组织的标识进行分类,得到多个第五历史交互信息,其中,每个第五历史交互信息为隶属于其他区块链组织中的一个区块链组织的应用链服务所对应的、该区块链组织中的应用链与第一区块链组织中的第一应用链之间的历史交互信息;利用第二区块链组织的标识,从多个第五历史交互信息中选取隶属于第二区块链组织的应用链服务所对应的、第二应用链与第一应用链之间的第一历史交互信息。Obtain the first service list stored in the first blockchain organization, and all historical interaction information of all application chain services that the first service list performs cross-chain transmission through the first blockchain organization; filter out the first service list in the first service list Three historical interaction information to obtain the fourth historical interaction information, wherein the third historical interaction information includes the information between each first application chain in the first blockchain organization corresponding to the application chain service belonging to the first blockchain organization The historical interaction information of the first blockchain organization and the historical interaction information between the first application chain in the first blockchain organization and the application chains in other blockchain organizations corresponding to the application chain service belonging to the first blockchain organization; The fourth historical interaction information is the historical interaction information between the application chains in other blockchain organizations and the first application chain in the first blockchain organization corresponding to the application chain services belonging to other blockchain organizations; Classify the fourth historical interaction information according to the identification of the blockchain organization to obtain a plurality of fifth historical interaction information, wherein each fifth historical interaction information belongs to a blockchain organization in other blockchain organizations Corresponding to the application chain service, the historical interaction information between the application chain in the blockchain organization and the first application chain in the first blockchain organization; using the identification of the second blockchain organization, from multiple The first historical interaction information between the second application chain and the first application chain corresponding to the application chain service belonging to the second blockchain organization is selected from the five historical interaction information.
在一种可能的实现方式中,第二获取模块520具体可以用于:In a possible implementation manner, the second acquiring module 520 may be specifically configured to:
根据第二区块链组织的标识,通过第二区块链组织中的第二跨链网关获取第二区块链组织中存储的第二历史交互信息。According to the identification of the second blockchain organization, the second historical interaction information stored in the second blockchain organization is obtained through the second cross-chain gateway in the second blockchain organization.
在一种可能的实现方式中,第一历史交互信息包括第一消息序号和对应第一消息序号的第一消息内容,第二历史交互信息包括第二消息序号和对应第二消息序号的第二消息内容;相应的,对比模块530具体可以用于:In a possible implementation manner, the first historical interaction information includes the first message sequence number and the first message content corresponding to the first message sequence number, and the second historical interaction information includes the second message sequence number and the second message content corresponding to the second message sequence number. Message content; correspondingly, the comparison module 530 can specifically be used for:
将目标第一消息序号和目标第二消息序号进行比对,得到第一比对结果,其中,目标第一消息序号为第一消息序号中的最大序号,目标第二消息序号为第二消息序号中的最大序号。Comparing the target first message sequence number with the target second message sequence number to obtain the first comparison result, wherein the target first message sequence number is the largest sequence number among the first message sequence numbers, and the target second message sequence number is the second message sequence number The largest sequence number in .
相应的,第一信息更新模块540具体可以用于:Correspondingly, the first information update module 540 may specifically be used for:
若目标第一消息序号大于目标第二消息序号,则获取第一区块链组织中存储的第三消息序号对应的第三消息内容,并通过第二区块链组织中的第二跨链网关向第二应用链发送第三消息序号和第三消息内容,其中,第三消息序号为第一消息序号中除第二消息序号之外的消息序号。If the target first message sequence number is greater than the target second message sequence number, obtain the third message content corresponding to the third message sequence number stored in the first blockchain organization, and pass through the second cross-chain gateway in the second blockchain organization Sending the third message sequence number and the third message content to the second application chain, wherein the third message sequence number is a message sequence number in the first message sequence number except the second message sequence number.
若目标第一消息序号小于目标第二消息序号,则获取第二区块链组织中存储的第四消息序号对应的第四消息内容,向第一应用链发送第四消息序号和第四消息内容,并将第四消息序号和第四消息内容添加至第一历史交互信息中,其中,第四消息序号为第二消息序号中除第一消息序号之外的消息序号。If the target first message sequence number is smaller than the target second message sequence number, obtain the fourth message content corresponding to the fourth message sequence number stored in the second blockchain organization, and send the fourth message sequence number and fourth message content to the first application chain , and add the fourth message sequence number and the fourth message content to the first historical interaction information, where the fourth message sequence number is a message sequence number other than the first message sequence number in the second message sequence number.
在一种可能的实现方式中,该装置500还包括:In a possible implementation manner, the device 500 also includes:
第三获取模块,用于当监测到第一应用链与第二应用链之间的第一交互信息,获取第五历史交互信息,其中,第一交互信息包括第五消息序号和对应第五消息序号的第五消息内容,第五历史交互信息为在接收到第一交互信息之前第一应用链与第二应用链之间的交互信息,第五历史交互信息包括第六消息序号和对应第六消息序号的第六消息内容。The third acquisition module is configured to acquire the fifth historical interaction information when the first interaction information between the first application chain and the second application chain is monitored, wherein the first interaction information includes the fifth message sequence number and the corresponding fifth message The fifth message content of the sequence number, the fifth historical interaction information is the interaction information between the first application chain and the second application chain before receiving the first interaction information, the fifth historical interaction information includes the sixth message sequence number and the corresponding sixth The sixth message content of the message sequence number.
第二信息更新模块,用于在第五消息序号与目标第六消息序号满足第一预设条件时,根据第五消息序号和第六消息序号更新第五历史交互信息,其中,目标第六消息序号为第 六消息序号中的最大消息序号,第一预设条件为第五消息序号大于目标第六消息序号,且第五消息序号与目标第六消息序号之差大于1。The second information update module is configured to update the fifth historical interaction information according to the fifth message sequence number and the sixth message sequence number when the fifth message sequence number and the target sixth message sequence number meet the first preset condition, wherein the target sixth message sequence number The serial number is the largest message serial number in the sixth message serial number, and the first preset condition is that the fifth message serial number is greater than the target sixth message serial number, and the difference between the fifth message serial number and the target sixth message serial number is greater than 1.
第一处理模块,用于在得到更新后的第五历史交互信息之后,根据第一交互信息的信息类型处理第一交互信息。The first processing module is configured to process the first interaction information according to the information type of the first interaction information after obtaining the updated fifth historical interaction information.
在一种可能的实现方式中,第二信息更新模块具体可以用于:In a possible implementation manner, the second information update module may be specifically configured to:
获取第五消息序号与目标第六消息序号之间第七消息序号对应的第七消息内容。Obtain the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number.
将第七消息序号和第七消息内容添加至第五历史交互信息中。The seventh message sequence number and the seventh message content are added to the fifth historical interaction information.
在一种可能的实现方式中,该装置500还包括:In a possible implementation manner, the device 500 also includes:
第二处理模块,用于在第五消息序号等于或者小于目标第六消息序号时,对第一交互信息不做处理。The second processing module is configured to not process the first interaction information when the fifth message sequence number is equal to or less than the target sixth message sequence number.
第三处理模块,用于在第五消息序号与目标第六消息序号满足第二预设条件时,根据第一交互信息的信息类型处理第一交互信息,第二预设条件为第五消息序号大于第六消息序号,且第五消息序号与第六消息序号之差为1。The third processing module is configured to process the first interaction information according to the information type of the first interaction information when the fifth message sequence number and the target sixth message sequence number meet a second preset condition, where the second preset condition is the fifth message sequence number greater than the sixth message sequence number, and the difference between the fifth message sequence number and the sixth message sequence number is 1.
在一种可能的实现方式中,第一处理模块或第三处理模块具体可以用于:In a possible implementation manner, the first processing module or the third processing module may specifically be used for:
若第一交互信息的信息类型为第一信息类型,则通过第二区块链组织中的第二跨链网关向第二应用链发送第一交互信息,第一信息类型为第一应用链向所述第二应用链发送交互信息的信息类型。If the information type of the first interaction information is the first information type, send the first interaction information to the second application chain through the second cross-chain gateway in the second blockchain organization, and the first information type is the first application chain to The information type of the interaction information sent by the second application chain.
若第一交互信息的信息类型为第二信息类型,则向第一应用链发送第一交互信息,第二信息类型为第二应用链向第一应用链发送交互信息的信息类型。If the information type of the first interaction information is the second information type, the first interaction information is sent to the first application chain, and the second information type is the information type of the interaction information sent by the second application chain to the first application chain.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat them here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Completion of modules means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the aforementioned method embodiments, and details will not be repeated here.
本申请实施例还提供了一种第一区块链组织,该第一区块链组织包括第一跨链网关和多个第一应用链,第一区块链组织用于实现上述数据处理方法。The embodiment of the present application also provides a first blockchain organization, the first blockchain organization includes a first cross-chain gateway and a plurality of first application chains, the first blockchain organization is used to implement the above data processing method .
本申请实施例还提供了一种终端设备,参见图5,该终端设备600可以包括:至少一个处理器610、存储器620以及存储在所述存储器620中并可在所述至少一个处理器610上运行的计算机程序,所述处理器610执行所述计算机程序时实现上述任意各个方法实施 例中的步骤,例如图5所示实施例中的步骤S201至步骤S204。或者,处理器410执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如图4所示模块510至540的功能。The embodiment of the present application also provides a terminal device. Referring to FIG. 5, the terminal device 600 may include: at least one processor 610, a memory 620, and A running computer program, when the processor 610 executes the computer program, implements the steps in any of the foregoing method embodiments, for example, step S201 to step S204 in the embodiment shown in FIG. 5 . Alternatively, when the processor 410 executes the computer program, it realizes the functions of the modules/units in the above-mentioned device embodiments, for example, the functions of the modules 510 to 540 shown in FIG. 4 .
示例性的,计算机程序可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器620中,并由处理器610执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序段,该程序段用于描述计算机程序在终端设备600中的执行过程。Exemplarily, the computer program can be divided into one or more modules/units, and one or more modules/units are stored in the memory 620 and executed by the processor 610 to complete the present application. The one or more modules/units may be a series of computer program segments capable of accomplishing specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 600 .
本领域技术人员可以理解,图5仅仅是终端设备的示例,并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如输入输出设备、网络接入设备、总线等。Those skilled in the art can understand that FIG. 5 is only an example of a terminal device, and does not constitute a limitation on the terminal device. It may include more or less components than those shown in the figure, or combine certain components, or different components, such as Input and output devices, network access devices, buses, etc.
处理器610可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 610 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器620可以是终端设备的内部存储单元,也可以是终端设备的外部存储设备,例如插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。所述存储器620用于存储所述计算机程序以及终端设备所需的其他程序和数据。所述存储器620还可以用于暂时地存储已经输出或者将要输出的数据。The memory 620 can be an internal storage unit of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card) etc. The memory 620 is used to store the computer program and other programs and data required by the terminal device. The memory 620 can also be used to temporarily store data that has been output or will be output.
总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。The bus can be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
本申请实施例提供的数据处理方法可以应用于计算机、平板电脑、笔记本电脑、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。The data processing method provided by the embodiment of the present application can be applied to terminal devices such as computers, tablet computers, notebook computers, netbooks, and personal digital assistants (personal digital assistants, PDAs). The embodiments of the present application do not make any restrictions on the specific types of terminal devices .
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的终端设备、装置和方法,可以通过其它的方式实现。例如,以上所描述的终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多 个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed terminal equipment, apparatus and method may be implemented in other ways. For example, the terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components May be combined or may be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被一个或多个处理器执行时,可实现上述各个方法实施例的步骤。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can also be completed by instructing related hardware through computer programs. The computer programs can be stored in a computer-readable storage medium, and the computer When the program is executed by one or more processors, it can realize the steps of the above-mentioned various method embodiments.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被一个或多个处理器执行时,可实现上述各个方法实施例的步骤。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can also be completed by instructing related hardware through computer programs. The computer programs can be stored in a computer-readable storage medium, and the computer When the program is executed by one or more processors, it can realize the steps of the above-mentioned various method embodiments.
同样,作为一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。Likewise, as a computer program product, when the computer program product runs on the terminal device, the terminal device can implement the steps in the foregoing method embodiments when executed.
其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excluding electrical carrier signals and telecommunication signals.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still implement the foregoing embodiments Modifications to the technical solutions described in the examples, or equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application, and should be included in the Within the protection scope of this application.

Claims (12)

  1. 一种数据处理方法,其特征在于,应用于第一区块链组织中的第一跨链网关,所述第一区块链组织包括所述第一跨链网关和至少一个第一应用链,所述方法包括:A data processing method, characterized in that it is applied to a first cross-chain gateway in a first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and at least one first application chain, The methods include:
    所述第一跨链网关获取所述第一区块链组织中存储的第一历史交互信息,所述第一历史交互信息为所述第一应用链与第二应用链之间的交互信息,所述第二应用链为第二区块链组织中的应用链;The first cross-chain gateway obtains the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, The second application chain is an application chain in the second blockchain organization;
    所述第一跨链网关获取所述第二区块链组织中存储的第二历史交互信息,所述第二历史交互信息为所述第二应用链与所述第一应用链之间的交互信息;The first cross-chain gateway obtains the second historical interaction information stored in the second blockchain organization, and the second historical interaction information is the interaction between the second application chain and the first application chain information;
    所述第一跨链网关将所述第一历史交互信息和所述第二历史交互信息进行比对,得到第一比对结果;The first cross-chain gateway compares the first historical interaction information with the second historical interaction information to obtain a first comparison result;
    若所述第一比对结果表示所述第一历史交互信息与所述第二历史交互信息不一致,则所述第一跨链网关根据所述第一比对结果更新所述第一历史交互信息。If the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information, the first cross-chain gateway updates the first historical interaction information according to the first comparison result .
  2. 如权利要求1所述的数据处理方法,其特征在于,所述第一跨链网关获取所述第一区块链组织中存储的第一历史交互信息,包括:The data processing method according to claim 1, wherein the first cross-chain gateway obtains the first historical interaction information stored in the first blockchain organization, including:
    所述第一跨链网关获取所述第一区块链组织中存储的第一服务列表,所述第一服务列表包括通过所述第一区块链组织进行跨链传输的所有应用链服务的所有历史交互信息;The first cross-chain gateway obtains the first service list stored in the first blockchain organization, and the first service list includes the information of all application chain services that perform cross-chain transmission through the first blockchain organization All historical interaction information;
    所述第一跨链网关滤除所述第一服务列表中的第三历史交互信息,得到第四历史交互信息,其中,所述第三历史交互信息包括隶属于所述第一区块链组织的应用链服务所对应的、所述第一区块链组织中各个第一应用链之间的历史交互信息,和隶属于所述第一区块链组织的应用链服务所对应的、所述第一区块链组织中第一应用链与其他区块链组织中的应用链之间的历史交互信息;所述第四历史交互信息为隶属于所述其他区块链组织的应用链服务所对应的、所述其他区块链组织中的应用链与所述第一区块链组织中的第一应用链之间的历史交互信息;The first cross-chain gateway filters out the third historical interaction information in the first service list to obtain fourth historical interaction information, wherein the third historical interaction information includes Corresponding to the application chain service of the first blockchain organization, the historical interaction information between the first application chains in the first blockchain organization, and corresponding to the application chain service belonging to the first blockchain organization, the The historical interaction information between the first application chain in the first blockchain organization and the application chains in other blockchain organizations; the fourth historical interaction information is provided by the application chain services belonging to the other blockchain organizations Corresponding historical interaction information between the application chains in the other blockchain organization and the first application chain in the first blockchain organization;
    所述第一跨链网关对所述第四历史交互信息按照区块链组织的标识进行分类,得到多个第五历史交互信息,其中,每个所述第五历史交互信息为隶属于所述其他区块链组织中的一个区块链组织的应用链服务所对应的、该区块链组织中的应用链与所述第一区块链组织中的第一应用链之间的历史交互信息;The first cross-chain gateway classifies the fourth historical interaction information according to the identification of the blockchain organization to obtain a plurality of fifth historical interaction information, wherein each of the fifth historical interaction information belongs to the Corresponding to the application chain service of a blockchain organization in other blockchain organizations, the historical interaction information between the application chain in the blockchain organization and the first application chain in the first blockchain organization ;
    所述第一跨链网关利用第二区块链组织的标识,从所述多个第五历史交互信息中选取隶属于所述第二区块链组织的应用链服务所对应的、所述第二应用链与所述第一应用链之间的所述第一历史交互信息。The first cross-chain gateway uses the identity of the second blockchain organization to select the first cross-chain service corresponding to the application chain service belonging to the second blockchain organization from the plurality of fifth historical interaction information. The first historical interaction information between the second application chain and the first application chain.
  3. 如权利要求2所述的数据处理方法,其特征在于,所述第一跨链网关获取所述第二区块链组织中存储的第二历史交互信息,包括:The data processing method according to claim 2, wherein the first cross-chain gateway obtains the second historical interaction information stored in the second blockchain organization, including:
    所述第一跨链网关根据所述第二区块链组织的标识,通过所述第二区块链组织中的第二跨链网关获取所述第二区块链组织中存储的所述第二历史交互信息。According to the identification of the second blockchain organization, the first cross-chain gateway obtains the first cross-chain gateway stored in the second blockchain organization through the second cross-chain gateway in the second blockchain organization. 2. Historical interaction information.
  4. 如权利要求1所述的数据处理方法,其特征在于,所述第一历史交互信息包括第一 消息序号和对应所述第一消息序号的第一消息内容,所述第二历史交互信息包括第二消息序号和对应所述第二消息序号的第二消息内容;The data processing method according to claim 1, wherein the first historical interaction information includes a first message sequence number and the first message content corresponding to the first message sequence number, and the second historical interaction information includes the first message sequence number A message sequence number and a second message content corresponding to the second message sequence number;
    所述第一跨链网关将所述第一历史交互信息和所述第二历史交互信息进行比对,得到第一比对结果,包括:The first cross-chain gateway compares the first historical interaction information with the second historical interaction information to obtain a first comparison result, including:
    所述第一跨链网关将目标第一消息序号和目标第二消息序号进行比对,得到所述第一比对结果,其中,所述目标第一消息序号为所述第一消息序号中的最大消息序号,所述目标第二消息序号为所述第二消息序号中的最大消息序号;The first cross-chain gateway compares the target first message sequence number with the target second message sequence number to obtain the first comparison result, wherein the target first message sequence number is the first message sequence number in the first message sequence number The largest message sequence number, the target second message sequence number is the largest message sequence number in the second message sequence numbers;
    相应的,所述若所述第一比对结果表示所述第一历史交互信息与所述第二历史交互信息不一致,则所述第一跨链网关根据所述第一比对结果更新所述第一历史交互信息,包括:Correspondingly, if the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information, the first cross-chain gateway updates the First historical interaction information, including:
    若所述目标第一消息序号大于所述目标第二消息序号,则所述第一跨链网关获取所述第一区块链组织中存储的第三消息序号对应的第三消息内容,并通过所述第二区块链组织中的第二跨链网关向所述第二应用链发送所述第三消息序号和所述第三消息内容,其中,所述第三消息序号为所述第一消息序号中除所述第二消息序号之外的消息序号;If the target first message sequence number is greater than the target second message sequence number, the first cross-chain gateway obtains the third message content corresponding to the third message sequence number stored in the first blockchain organization, and passes The second cross-chain gateway in the second blockchain organization sends the third message sequence number and the third message content to the second application chain, wherein the third message sequence number is the first a message sequence number other than the second message sequence number in the message sequence number;
    若所述目标第一消息序号小于所述目标第二消息序号,则所述第一跨链网关获取所述第二区块链组织中存储的第四消息序号对应的第四消息内容,向所述第一应用链发送所述第四消息序号和所述第四消息内容,并将所述第四消息序号和所述第四消息内容添加至所述第一历史交互信息中,其中,所述第四消息序号为所述第二消息序号中除所述第一消息序号之外的消息序号。If the target first message sequence number is smaller than the target second message sequence number, the first cross-chain gateway obtains the fourth message content corresponding to the fourth message sequence number stored in the second blockchain organization, and sends The first application chain sends the fourth message sequence number and the fourth message content, and adds the fourth message sequence number and the fourth message content to the first historical interaction information, wherein the The fourth message sequence number is a message sequence number in the second message sequence numbers except the first message sequence number.
  5. 如权利要求1所述的数据处理方法,其特征在于,所述方法还包括:The data processing method according to claim 1, wherein the method further comprises:
    当所述第一跨链网关监测到所述第一应用链与所述第二应用链之间的第一交互信息,所述第一跨链网关获取第五历史交互信息,其中,所述第一交互信息包括第五消息序号和对应所述第五消息序号的第五消息内容,所述第五历史交互信息为在接收到所述第一交互信息之前所述第一应用链与所述第二应用链之间的交互信息,所述第五历史交互信息包括第六消息序号和对应所述第六消息序号的第六消息内容;When the first cross-chain gateway monitors the first interaction information between the first application chain and the second application chain, the first cross-chain gateway acquires fifth historical interaction information, wherein the first The interaction information includes a fifth message sequence number and fifth message content corresponding to the fifth message sequence number, and the fifth historical interaction information is the first application chain and the first application chain before receiving the first interaction information The interaction information between two application chains, the fifth historical interaction information includes a sixth message sequence number and a sixth message content corresponding to the sixth message sequence number;
    若所述第五消息序号与目标第六消息序号满足第一预设条件,则所述第一跨链网关根据所述第五消息序号和所述目标第六消息序号更新所述第五历史交互信息,其中,所述目标第六消息序号为所述第六消息序号中的最大消息序号,所述第一预设条件为所述第五消息序号大于所述目标第六消息序号,且所述第五消息序号与所述目标第六消息序号之差大于1;If the fifth message sequence number and the target sixth message sequence number meet the first preset condition, the first cross-chain gateway updates the fifth historical interaction according to the fifth message sequence number and the target sixth message sequence number information, wherein the target sixth message sequence number is the largest message sequence number among the sixth message sequence numbers, the first preset condition is that the fifth message sequence number is greater than the target sixth message sequence number, and the The difference between the fifth message sequence number and the target sixth message sequence number is greater than 1;
    在所述第一跨链网关在得到更新后的所述第五历史交互信息之后,所述第一跨链网关根据所述第一交互信息的信息类型处理所述第一交互信息。After the first cross-chain gateway obtains the updated fifth historical interaction information, the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information.
  6. 如权利要求5所述的数据处理方法,其特征在于,所述若所述第五消息序号与目标第六消息序号满足第一预设条件,则所述第一跨链网关根据所述第五消息序号和所述目标第六消息序号更新所述第五历史交互信息,包括:The data processing method according to claim 5, wherein, if the fifth message sequence number and the target sixth message sequence number meet the first preset condition, the first cross-chain gateway according to the fifth The message sequence number and the target sixth message sequence number update the fifth historical interaction information, including:
    所述第一跨链网关获取所述第五消息序号与所述目标第六消息序号之间第七消息序号对应的第七消息内容;The first cross-chain gateway obtains the seventh message content corresponding to the seventh message number between the fifth message number and the target sixth message number;
    所述第一跨链网关将所述第七消息序号和所述第七消息内容添加至所述第五历史交互信息中。The first cross-chain gateway adds the seventh message sequence number and the seventh message content to the fifth historical interaction information.
  7. 如权利要求5所述的数据处理方法,其特征在于,所述当所述第一跨链网关监测到所述第一应用链与所述第二应用链之间的第一交互信息,所述第一跨链网关获取第五历史交互信息之后,所述方法还包括:The data processing method according to claim 5, wherein when the first cross-chain gateway monitors the first interaction information between the first application chain and the second application chain, the After the first cross-chain gateway obtains the fifth historical interaction information, the method further includes:
    若所述第五消息序号等于或者小于所述目标第六消息序号,则所述第一跨链网关对所述第一交互信息不做处理;If the fifth message sequence number is equal to or less than the target sixth message sequence number, the first cross-chain gateway does not process the first interaction information;
    若所述第五消息序号与所述目标第六消息序号满足第二预设条件,则所述第一跨链网关根据所述第一交互信息的信息类型处理所述第一交互信息,所述第二预设条件为第五消息序号大于所述目标第六消息序号,且所述第五消息序号与所述目标第六消息序号之差为1。If the fifth message sequence number and the target sixth message sequence number satisfy a second preset condition, the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information, and the The second preset condition is that the fifth message sequence number is greater than the target sixth message sequence number, and the difference between the fifth message sequence number and the target sixth message sequence number is 1.
  8. 根据权利要求5或7所述的数据处理方法,其特征在于,所述第一跨链网关根据所述第一交互信息的信息类型处理所述第一交互信息,包括:The data processing method according to claim 5 or 7, wherein the first cross-chain gateway processes the first interaction information according to the information type of the first interaction information, including:
    若所述第一交互信息的信息类型为第一信息类型,则所述第一跨链网关通过所述第二区块链组织中的第二跨链网关向所述第二应用链发送所述第一交互信息,所述第一信息类型为所述第一应用链向所述第二应用链发送交互信息的信息类型;If the information type of the first interaction information is the first information type, the first cross-chain gateway sends the second cross-chain gateway to the second application chain through the second cross-chain gateway in the second blockchain organization First interaction information, where the first information type is the information type of the interaction information sent by the first application chain to the second application chain;
    若所述第一交互信息的信息类型为第二信息类型,则所述第一跨链网关向所述第一应用链发送所述第一交互信息,所述第二信息类型为所述第二应用链向所述第一应用链发送交互信息的信息类型。If the information type of the first interaction information is the second information type, the first cross-chain gateway sends the first interaction information to the first application chain, and the second information type is the second information type. The application chain sends the information type of the interaction information to the first application chain.
  9. 根据权利要求8所述的数据处理方法,其特征在于,所述第一信息类型包括第一信息子类型和第二信息子类型,其中,所述第一信息子类型为第一应用链向第二应用链发送交互请求消息的信息子类型,所述第二信息子类型为第一应用链向第二应用链发送交互回执消息的信息子类型;所述第二信息类型包括第三信息子类型和第四信息子类型,其中,所述第三信息子类型为第二应用链向第一应用链发送交互请求消息的信息子类型,所述第四信息子类型为第二应用链向第一应用链发送交互回执消息的信息子类型;The data processing method according to claim 8, wherein the first information type includes a first information subtype and a second information subtype, wherein the first information subtype is the first application link to the second information subtype. The information subtype of the interaction request message sent by the second application chain, the second information subtype is the information subtype of the interaction receipt message sent by the first application chain to the second application chain; the second information type includes the third information subtype and a fourth information subtype, wherein the third information subtype is the information subtype for the second application chain to send an interaction request message to the first application chain, and the fourth information subtype is the information subtype that the second application chain sends to the first application chain The information subtype of the interaction receipt message sent by the application chain;
    针对每种子类型的信息,设置交互消息的初始消息序号为0,所述第一应用链与所述第二应用链之间每获取一种信息子类型的交互消息,在之前获取的该信息子类型的交互消息的消息序号上加1,作为当前获取的该信息子类型的交互消息的消息序号。For each subtype of information, set the initial message sequence number of the interaction message to 0, and each time an interaction message of an information subtype is obtained between the first application chain and the second application chain, the previously obtained information subtype Add 1 to the message sequence number of the interaction message of the type, and use it as the message sequence number of the currently acquired interaction message of the information subtype.
  10. 一种数据处理装置,其特征在于,应用于第一区块链组织中的第一跨链网关,所述第一区块链组织包括所述第一跨链网关和至少一个第一应用链,所述装置包括:A data processing device, characterized in that it is applied to a first cross-chain gateway in a first blockchain organization, and the first blockchain organization includes the first cross-chain gateway and at least one first application chain, The devices include:
    第一获取模块,用于获取所述第一区块链组织中存储的第一历史交互信息,所述第一历史交互信息为所述第一应用链与第二应用链之间的交互信息,所述第二应用链为第二区块链组织中的应用链;The first acquisition module is configured to acquire the first historical interaction information stored in the first blockchain organization, the first historical interaction information is the interaction information between the first application chain and the second application chain, The second application chain is an application chain in the second blockchain organization;
    第二获取模块,用于获取所述第二区块链组织中存储的第二历史交互信息,所述第二历史交互信息为所述第二应用链与所述第一应用链之间的交互信息;The second acquisition module is used to acquire the second historical interaction information stored in the second blockchain organization, the second historical interaction information is the interaction between the second application chain and the first application chain information;
    比对模块,用于将所述第一历史交互信息和所述第二历史交互信息进行比对,得到第 一比对结果;A comparison module, configured to compare the first historical interaction information with the second historical interaction information to obtain a first comparison result;
    第一信息更新模块,用于在所述第一比对结果表示所述第一历史交互信息与所述第二历史交互信息不一致时,根据所述第一比对结果更新所述第一历史交互信息。A first information updating module, configured to update the first historical interaction according to the first comparison result when the first comparison result indicates that the first historical interaction information is inconsistent with the second historical interaction information information.
  11. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至9任一项所述的数据处理方法。A terminal device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, characterized in that, when the processor executes the computer program, the computer program according to claims 1 to 1 is implemented. The data processing method described in any one of 9.
  12. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9任一项所述的数据处理方法。A computer-readable storage medium storing a computer program, wherein the computer program implements the data processing method according to any one of claims 1 to 9 when executed by a processor.
PCT/CN2022/120863 2021-12-31 2022-09-23 Data processing method and apparatus, terminal device and storage medium WO2023124302A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111664031.3A CN114006911B (en) 2021-12-31 2021-12-31 Data processing method and device, terminal equipment and storage medium
CN202111664031.3 2021-12-31

Publications (1)

Publication Number Publication Date
WO2023124302A1 true WO2023124302A1 (en) 2023-07-06

Family

ID=79932498

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/120863 WO2023124302A1 (en) 2021-12-31 2022-09-23 Data processing method and apparatus, terminal device and storage medium

Country Status (2)

Country Link
CN (1) CN114006911B (en)
WO (1) WO2023124302A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114006911B (en) * 2021-12-31 2022-04-26 杭州趣链科技有限公司 Data processing method and device, terminal equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200050774A1 (en) * 2018-08-08 2020-02-13 Panasonic Intellectual Property Corporation Of America Data protection method, authentication server, data protection system, and data structure
CN111769948A (en) * 2020-06-15 2020-10-13 布比(北京)网络技术有限公司 Block chain-based inter-chain interaction method, system, device and computer equipment
CN111814175A (en) * 2020-09-15 2020-10-23 北京东方通科技股份有限公司 Inter-block chain cross-chain information transmission control system
CN112667601A (en) * 2020-12-30 2021-04-16 杭州趣链科技有限公司 Block chain identifier management method, terminal device and computer-readable storage medium
CN112669038A (en) * 2020-12-28 2021-04-16 杭州趣链科技有限公司 Account inquiry system and cross-chain gateway
CN112861190A (en) * 2021-04-23 2021-05-28 腾讯科技(深圳)有限公司 Data cross-chain cooperation method, system and device
CN112948153A (en) * 2021-05-14 2021-06-11 支付宝(杭州)信息技术有限公司 Method and device for message cross-link transmission
CN114006911A (en) * 2021-12-31 2022-02-01 杭州趣链科技有限公司 Data processing method and device, terminal equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415784B (en) * 2018-02-27 2020-04-24 阿里巴巴集团控股有限公司 Cross-block-chain interaction method, device, system and electronic equipment
CN109189853B (en) * 2018-08-08 2021-05-28 众安信息技术服务有限公司 Method and device for synchronizing data between block chains
CN110046998B (en) * 2019-01-31 2020-04-14 阿里巴巴集团控股有限公司 Cross-chain right using system, method, device, electronic equipment and storage medium
US10901983B2 (en) * 2019-03-01 2021-01-26 Wanchain Ltd. System and method for universal blockchain interoperability
CN110597907B (en) * 2019-09-10 2021-10-29 腾讯科技(深圳)有限公司 Cross-block-chain data information synchronization method, device, equipment and medium
CN112003889B (en) * 2020-07-10 2022-11-08 南京邮电大学 Distributed cross-link system and cross-link information interaction and system access control method
CN112822181B (en) * 2020-12-30 2022-08-16 杭州趣链科技有限公司 Verification method of cross-chain transaction, terminal device and readable storage medium
CN112651046A (en) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 Data synchronization method, device and system for cross-chain transaction and terminal equipment
CN113114759B (en) * 2021-04-09 2022-06-10 杭州链网科技有限公司 Chain-crossing method and system for realizing multi-chain intercommunication
CN113111126A (en) * 2021-04-12 2021-07-13 浙江永旗区块链科技有限公司 Block chain cross-chain forwarding system and forwarding method thereof
CN113194141B (en) * 2021-04-29 2022-08-23 杭州链网科技有限公司 Chain-crossing network bridge construction method based on heterogeneous block chain
CN113315832B (en) * 2021-05-26 2022-07-12 杭州云象网络技术有限公司 Cross-chain information synchronization method, system and device based on cloud cross-chain transfer protocol

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200050774A1 (en) * 2018-08-08 2020-02-13 Panasonic Intellectual Property Corporation Of America Data protection method, authentication server, data protection system, and data structure
CN111769948A (en) * 2020-06-15 2020-10-13 布比(北京)网络技术有限公司 Block chain-based inter-chain interaction method, system, device and computer equipment
CN111814175A (en) * 2020-09-15 2020-10-23 北京东方通科技股份有限公司 Inter-block chain cross-chain information transmission control system
CN112669038A (en) * 2020-12-28 2021-04-16 杭州趣链科技有限公司 Account inquiry system and cross-chain gateway
CN112667601A (en) * 2020-12-30 2021-04-16 杭州趣链科技有限公司 Block chain identifier management method, terminal device and computer-readable storage medium
CN112861190A (en) * 2021-04-23 2021-05-28 腾讯科技(深圳)有限公司 Data cross-chain cooperation method, system and device
CN112948153A (en) * 2021-05-14 2021-06-11 支付宝(杭州)信息技术有限公司 Method and device for message cross-link transmission
CN114006911A (en) * 2021-12-31 2022-02-01 杭州趣链科技有限公司 Data processing method and device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN114006911B (en) 2022-04-26
CN114006911A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
US10873622B2 (en) Call chain-based concurrency control method and apparatus, and control node
US11444783B2 (en) Methods and apparatuses for processing transactions based on blockchain integrated station
US9753954B2 (en) Data node fencing in a distributed file system
CN111741114A (en) System, method and equipment capable of monitoring cross-chain interaction based on block chain
US20120174109A1 (en) Processing a batched unit of work
EP3937423A1 (en) Methods and apparatuses for identifying replay transaction based on dedicated blockchain node device
WO2023124302A1 (en) Data processing method and apparatus, terminal device and storage medium
US20210329093A1 (en) Methods and apparatuses for identifying to-be-filtered transaction based on blockchain integrated station
CN112671928A (en) Equipment centralized management architecture, load balancing method, electronic equipment and storage medium
CN109391526B (en) Network loop detection method and device
WO2023040453A1 (en) Transaction information processing method and apparatus
CN107948063B (en) Method for establishing aggregation link and access equipment
CN111652728A (en) Transaction processing method and device
WO2023109217A1 (en) Data processing method, blockchain system, computer device and storage medium
CN114265753A (en) Management method and management system of message queue and electronic equipment
CN112636987B (en) Cross-chain gateway determination method and system for block chain and terminal equipment
WO2024103854A1 (en) Cross-chain transaction method and system, electronic device, and storage medium
CN115378798B (en) Multi-cluster gateway cooperation method and system based on dynamic perception
CN103414591A (en) Method and system for fast converging when port failure is recovered
CN114880266B (en) Fault processing method and device, computer equipment and storage medium
WO2022199229A1 (en) Suspended transaction inspection method and apparatus, electronic device and storage medium
CN116166390A (en) Service processing method and device, electronic equipment and storage medium
WO2023065788A1 (en) Method and apparatus for upgrading blockchain system, and terminal device
CN115361141A (en) Relay cross-link verification method and device, storage medium and electronic equipment
CN116846888A (en) Consensus processing method, device, equipment and storage medium of block chain network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913567

Country of ref document: EP

Kind code of ref document: A1