Intelligent agent interaction method, system and equipment based on block chain, medium and product
By using a dual-chain network architecture based on blockchain technology, and leveraging distributed identifiers and anchored blockchain networks to achieve decentralized management of intelligent agents, the problem of data privacy leaks and single points of failure caused by centralized platforms is solved, enabling trusted interconnection and efficient collaboration across platforms.
Patent Information
- Application Number
- CN202610106616.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2046-01-27
AI Technical Summary
In existing technologies, the interconnection between intelligent agents relies on centralized service platforms, which leads to risks of data privacy leaks and loss of data sovereignty, as well as the risk of single points of failure.
It adopts a blockchain-based dual-chain network architecture, uses distributed identifiers and anchored blockchain networks to achieve decentralized management of intelligent agents, and performs service discovery and direct interaction through business blockchain networks, avoiding dependence on centralized platforms.
It achieves decentralized management and cross-scenario interoperability of intelligent agent identities, ensures the privacy and sovereignty of interactive data, reduces interaction costs, and improves cross-entity interoperability and trustworthiness.
Smart Images

Figure CN121579439A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the blockchain technology, and in particular to a blockchain-based agent interaction method, system, device, medium and product. BACKGROUND
[0002] With the rapid development of artificial intelligence technology, as a hardware / software entity capable of perceiving and autonomously performing tasks in an environment to achieve goals, an agent has been widely applied in intelligent manufacturing, Internet of Things, smart city and other fields. However, the capability of a single agent is limited, and its great potential is more reflected in the collaboration and interconnection between multiple agents, which complete more complex tasks through cross-agent collaboration. In the prior art, agents often use a centralized service platform for interconnection. Such a centralized service platform requires all agents to register on the centralized service platform first, and then the centralized service platform is responsible for identity authentication, service discovery, task routing and data exchange and other core links. However, such a centralized service platform has significant shortcomings: all interaction data must flow through the centralized service platform, and the platform operator can easily access, monitor and even misuse sensitive data, resulting in the loss of data sovereignty and control by the agent owner, and the risk of data privacy leakage. SUMMARY
[0003] To solve the above technical problems, the present disclosure provides a blockchain-based agent interaction method, system, device, medium and product.
[0004] In one aspect of the present disclosure, a blockchain-based agent interaction method is provided, which is applied to a double-chain network including an anchor blockchain network and a business blockchain network. The business blockchain network includes a plurality of business nodes, and the anchor blockchain network includes a plurality of anchor nodes. The method includes: in response to receiving a service feature of a target service sent by a first agent, a target business node determines a target service list based on the service feature and a service registration list. The target service list includes distributed identifiers and service description information of at least one candidate agent capable of providing the target service. The target business node is one of the plurality of business nodes. The first agent determines a distributed identifier of a second agent in the target service registration list. The first agent obtains a distributed document of the second agent from the anchor blockchain network based on the distributed identifier of the second agent. The distributed document includes service endpoint address information of the second agent. The first agent interacts with the second agent based on the service endpoint address information to obtain the target service provided by the second agent.
[0005] In another aspect of the embodiments of the present disclosure, a blockchain-based agent interaction system is provided, which comprises a first agent, a second agent, and a double-chain network, the double-chain network comprising an anchor blockchain network and a business blockchain network, the business blockchain network comprising a plurality of business nodes, and the anchor blockchain network comprising a plurality of anchor nodes; a target business node configured to, in response to receiving a service feature of a target service sent by the first agent, determine a target service list based on the service feature and a service registration list, the target service list comprising distributed identification and service description information of at least one candidate agent capable of providing the target service, and the target business node being one of the plurality of business nodes; and the first agent configured to generate the service feature, determine distributed identification of the second agent in the target service registration list upon receiving the target service registration list, acquire a distributed document of the second agent from the anchor blockchain network based on the distributed identification of the second agent, the distributed document comprising service endpoint address information of the second agent, and interact with the second agent based on the service endpoint address information to obtain the target service provided by the second agent.
[0006] In yet another aspect of the embodiments of the present disclosure, an electronic device is provided, which comprises a memory configured to store a computer program, and a processor configured to execute the computer program stored in the memory, and the computer program, when executed, implements the method described above.
[0007] In still another aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the method described above.
[0008] In yet another aspect of the embodiments of the present disclosure, a computer program product is provided, which comprises computer program instructions, and the computer program instructions, when executed by a processor, implement the method described above.
[0009] Based on the embodiments of the present disclosure, the dependence on the centralized service platform is effectively broken through the architecture of the double-chain network, the single-point failure risk under the centralized architecture is avoided, and the distributed identity is used as the general identity root of the first / second agent, so that any first / second agent can be uniquely and reliably identified and verified in any scenario. In addition, the distributed identity and the corresponding distributed document of the candidate agent are stored in the anchor block chain network, the decentralized management and cross-scene intercommunication of the agent identity are realized, the identity island among different platforms is broken, the trusted interconnection and intercommunication across systems, platforms and domains are realized, and the cross-agent interoperability is greatly improved. In addition, the first agent directly interacts based on the service endpoint address information obtained on the chain, without the need for centralized server transfer, which ensures the privacy and sovereignty of the interaction data, avoids the risk of misuse of sensitive data by the platform, realizes the transparency of service discovery through the service registration list of the business block chain network, reduces the intermediate intervention in the cooperation process, reduces the interaction cost, and relies on the non-tamperability of the block chain to ensure the credibility of the service description information and the interaction process, thereby providing technical support for the fair and efficient cooperation between agents.
[0010] The technical solutions of the present disclosure will be described in further detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0011] The accompanying drawings, which form a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0012] The present disclosure can be more clearly understood with reference to the following detailed description in conjunction with the accompanying drawings, in which: Figure 1 A flowchart of a blockchain-based agent interaction method in an embodiment of the present disclosure is shown; Figure 2 A flowchart of step 160 in an embodiment of the present disclosure is shown; Figure 3 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown; Figure 4 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown; Figure 5 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown; Figure 6 A flowchart of step S160 in another embodiment of the present disclosure is shown; Figure 7 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown; Figure 8A flowchart illustrating a blockchain-based smart agent interaction method is shown in an application example of this disclosure. Figure 9 A block diagram of a blockchain-based intelligent agent interaction system is shown in an embodiment of this disclosure; Figure 10 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed herein. Detailed Implementation
[0013] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0014] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0015] It should also be understood that in the embodiments disclosed herein, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.
[0016] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.
[0017] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship.
[0018] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0019] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0020] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.
[0021] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0022] It should be noted that like reference numerals and characters refer to like elements throughout the following description and the appended claims thereof, such that, when certain terms are used in the following description and in the appended claims, that specific terms are understood to encompass those items that have the same, similar or equivalent functionality, as those items specifically discussed herein.
[0023] Embodiments of the present disclosure can be applied to terminal devices, computer systems, servers, and the like electronic devices, which can operate with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations that can be suitable for use with terminal devices, computer systems, servers, and the like electronic devices include, but are not limited to: personal computers, servers, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputers, mainframe computers, and distributed cloud computing technology environments that include any of the above systems, and the like.
[0024] Terminal devices, computer systems, servers, and the like electronic devices can be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, and the like, that perform particular tasks or implement particular abstract data types. Computer systems / servers can be practiced in distributed cloud-computing environments with remote processing devices that are linked through a communications network. In a distributed cloud-computing environment, program modules can be located in local or remote computer system storage media including memory storage devices.
[0025] In embodiments of the present disclosure: Blockchain: In a narrow sense, the technology of blockchain can be a chain-like data structure in which data blocks are combined in a sequential manner according to time sequence, and a distributed ledger that is unalterable and unforgeable in a cryptographic manner. In a broad sense, the technology of blockchain can be a technology that verifies and stores data using a block chain-like data structure, generates and updates data using a node consensus algorithm, ensures the security of data transmission and access using cryptography, and uses a smart contract composed of automated script code. A blockchain network includes multiple nodes (Node), and any node generally refers to a computer in a blockchain network, that is, any computer connected to a blockchain network (for example, including smartphones, servers, tablets, laptops, or desktop computers, etc.) is called a node.
[0026] The double-chain network comprises an anchor blockchain network and a business blockchain network, the business blockchain network comprises a plurality of business nodes, and the anchor blockchain network comprises a plurality of anchor nodes. The anchor blockchain network and the business blockchain network are independent blockchain networks respectively. In this embodiment, the nodes in the anchor blockchain network are referred to as anchor nodes, and the nodes in the business blockchain network are referred to as business nodes. The anchor nodes store a blockchain recording data in the anchor blockchain network, and the business nodes store a blockchain recording data in the business blockchain network. The anchor nodes are communicatively connected, the business nodes are communicatively connected, and the anchor nodes and the business nodes are communicatively connected.
[0027] Agent: An agent is an agent that perceives and takes action in an environment to achieve a goal. An agent can be software, hardware or a system. An agent can make decisions by perceiving changes in the environment, according to its own knowledge and algorithm, and then perform actions to affect the environment or achieve the predetermined goal.
[0028] DID (Decentralized Identifier) is a new type of global unique identifier created, owned and controlled by a subject (which can be a person, organization, device, data or artificial intelligence agent). It does not rely on any centralized registration authority, identity provider or CA (Certificate Authority).
[0029] Figure 1 A flowchart of a blockchain-based agent interaction method in the embodiment of the present disclosure is shown. The embodiment can be applied in a double-chain network, such as Figure 1 As shown, the blockchain-based agent interaction method in this embodiment comprises the following steps: In step S100, in response to receiving a service feature of a target service sent by a first agent, a target business node determines a target service list based on the service feature and a service registration list.
[0030] The target service list comprises a DID (Decentralized Identifier) and service description information of at least one candidate agent. Each candidate agent in the at least one candidate agent can provide the target service, i.e., each candidate agent has the ability to provide the target service. The target business node is one of a plurality of business nodes. The service registration list comprises a DID and service description information of a plurality of agents.
[0031] The first agent and the candidate agent can be independent agents. The first agent is a demand side of the target service, and the candidate agent is a candidate provider side of the target service. The target service is a service that can be improved by the candidate agent. For example, the candidate agent can be a visual quality inspection software in a factory, a core decision module of an autonomous vehicle, a management program of a household energy storage battery, or an artificial intelligence (AI) assistant. The candidate agent can be a software / system or hardware that can provide image recognition, road prediction, etc., or hardware that deploys a software / system that provides image recognition, road prediction, etc. For example, the first agent can be a decision module of an autonomous vehicle that needs to obtain super-vision road information, and the candidate agent can be a perception fusion system deployed in a roadside unit that can provide a service (target service) of obtaining super-vision road information. Alternatively, the first agent can be a 3D printing management program that needs quality inspection services, and the candidate agent can be a professional AI visual quality inspection system that can improve the service (target service) of obtaining image information.
[0032] The distributed identifier of the candidate agent is used to identify the candidate agent. The service description information of the candidate agent is used to describe the service that can be provided by the candidate agent and related information of the service. The service feature of the target service is used to represent the attribute of the target service, for example, the service feature of the target service can be the service type, number, etc. of the target service. The service type can be image recognition (service type) or trajectory prediction (service type), etc. The service registration list is stored in the target service node, and the service registration list includes the distributed identifiers and the service description information of multiple agents.
[0033] In one example, the service description information includes the service type, and the first agent and the candidate agent are provided with a software development kit (SDK). The first agent can use the SDK deployed thereon to send the service feature of the target service to the target service node. The target service node determines the agent that can provide the target service as the candidate agent based on the service type of the target service from the service registration list thereon, and forms a target service list with the candidate agent, and then sends the target service list to the first agent.
[0034] In step S120, the first agent determines the distributed identifier of the second agent in the target service registration list.
[0035] In this embodiment, the candidate agent determined by the first agent from the target service registration list is referred to as a second agent. For example, the user can select a candidate agent from the target service registration list as the second agent through the first agent or the first agent automatically.
[0036] In step S140, the first agent obtains the distributed document of the second agent from the anchor blockchain network based on the distributed identifier of the second agent.
[0037] In this embodiment, the distributed document (DID Document) of the second agent is bound to the distributed identifier of the second agent, so that the distributed document corresponds to the distributed identifier.
[0038] The distributed document of the second agent includes the service endpoint address information of the second agent. For example, the service endpoint address information can include the uniform resource locator (URL) address of the service endpoint. The distributed document can also include the distributed identifier of the second agent.
[0039] In one example, the anchor blockchain network stores a plurality of distributed documents. The first agent can send the distributed identifier of the second agent to the anchor blockchain network. The anchor blockchain network determines the distributed document of the second agent based on the distributed identifier of the second agent, and then feeds back the distributed document to the first agent.
[0040] In step S160, the first agent interacts with the second agent based on the service endpoint address information of the second agent to obtain the target service provided by the second agent.
[0041] For example, assuming that the target service is image recognition, the first agent sends an image to be recognized to the second agent through the URL address of the service endpoint of the second agent, and the second agent can recognize the image to be recognized by using a neural network (e.g., a convolutional neural network (CNN)) deployed thereon for image recognition, obtain an image recognition result, and then send the image recognition result to the first agent, so that the first agent obtains the image recognition service (target service) provided by the second agent through the interaction between the first agent and the second agent. In the embodiments of the present disclosure, the architecture of the double-chain network effectively eliminates the dependence on the centralized service platform, avoids the single-point failure risk under the centralized architecture, and uses the distributed identifier as the general identity root of the first / second agent, so that any first / second agent can be uniquely and reliably identified and verified in any scenario. In addition, the anchor blockchain network stores the distributed identifier and the corresponding distributed document of the candidate agent, realizes the decentralized management and cross-scenario intercommunication of the agent identity, breaks the identity island between different platforms, realizes cross-system, cross-platform, and cross-domain trusted interconnection and intercommunication, and greatly improves the cross-agent interoperability. In addition, the first agent directly interacts based on the service endpoint address information obtained on the chain, without the need for centralized server mediation, which ensures the privacy and sovereignty of the interaction data and avoids the risk of misuse of sensitive data by the platform. In addition, the service registration list of the business blockchain network realizes the transparency of service discovery, reduces the intermediate intervention in the collaboration process, reduces the interaction cost, and relies on the non-tamperability of the blockchain to ensure the credibility of the service description information and the interaction process, thereby providing technical support for the fair and efficient collaboration between agents.
[0042] Figure 2 A flowchart for illustrating step 160 in the embodiments of the present disclosure is shown. In some optional implementations, as shown in Figure 2 Step S160 can include the following steps: Step S161, the first agent obtains a session key, encrypts the session key by using the public key of the second agent's key pair, obtains an encrypted session key, and sends the encrypted session key to the second agent based on the service endpoint address information.
[0043] The distributed document of the second agent further includes a public key of a key pair of the second agent. The key pair of the second agent includes a public key and a private key. The private key of the key pair is used for encrypting (signing) data / information, etc., and decrypting data / information encrypted by the public key of the key pair. The public key of the key pair is used for encrypting data / information, etc., and decrypting data / information encrypted by the private key of the key pair.
[0044] For example, the second agent can generate a pair of asymmetric key pairs as the second agent's key pair by using the SDK deployed thereon and a national secret algorithm (SM2). The second agent can store the private key of the second agent's key pair in a hardware security module (HSM) of the second agent or in a trusted execution environment (TEE) of the second agent.
[0045] In an embodiment, the first agent stores a first agent's key pair in the first agent. The first agent's public-private key pair can include a public key and a private key. The first agent's key pair is generated, operated (encrypted / decoded), and stored in the same way as the second agent's key pair. For details, refer to the generation, operation, and storage of the second agent's key pair, which will not be described here.
[0046] The first agent can generate a symmetric key pair as a session key based on a national secret algorithm (SM4) or the like. The first agent signs the distributed identifier of the first agent by using the private key of the first agent's key pair to obtain identity signature information, encrypts the session key by using the public key of the second agent's key pair to obtain an encrypted session key, and then sends the encrypted session key, the identity signature information, and the distributed identifier of the first agent to the second agent through the service endpoint address information of the second agent.
[0047] In step S162, the second agent decrypts the encrypted session key by using the private key of the second agent's key pair to obtain the session key, so that the second agent and the first agent perform encrypted communication based on the session key.
[0048] In an embodiment, the first agent's distributed document corresponding to the first agent's distributed identifier is stored in the blockchain or the anchor node of the anchor blockchain network. The first agent's distributed document stores the public key of the first agent's key pair. The second agent can obtain the first agent's distributed document from the anchor blockchain network based on the first agent's distributed identifier, obtain the public key of the first agent's key pair from the first agent's distributed document, verify the identity signature information by using the public key, and decrypt the encrypted session key by using the private key of the second agent's key pair to obtain the session key if the identity signature information passes the verification.
[0049] Exemplarily, the first agent and the second agent can use a session key to establish an encrypted Hypertext Transfer Protocol Secure (HTTPS) communication channel or a Libra peer-to-peer (Libp2p) encrypted stream communication channel, and can interact based on the encrypted communication channels. Specifically, taking the example in step S160, the first agent encrypts the to-be-recognized image by using the session key to obtain encrypted data, and then transmits the encrypted data to the second agent, for example, can transmit the encrypted data to the second agent through the encrypted communication channel described above, the second agent decrypts the encrypted data by using the session key to obtain the to-be-processed image, the second agent encrypts the image recognition result by using the session key to obtain an encrypted image recognition result, and then transmits the encrypted image recognition result to the first agent, and the first agent decrypts the encrypted image recognition result by using the session to obtain the image recognition result.
[0050] Figure 3 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown. In some optional embodiments, as shown in Figure 3 Before step S161, the following steps can also be included. Step S151, the first agent sends a transaction request for a target service and a service fee to a target business node.
[0051] The transaction request (Deal Proposal) includes: first signature information, which is obtained by signing first preset information by using the private key of the first agent. The first preset information can include the distributed identifier of the first agent. Exemplarily, the transaction request can also include: the distributed identifier of the second agent, the name of the target service, the service characteristics of the target service, the task (target service) content description, and the bid, etc. A transaction negotiation smart contract (Deal Making contract) is deployed in the double-chain network, and the transaction negotiation smart contract is a smart contract for service transactions, for example, can be used for transaction negotiation of related services, and creation and confirmation of task orders, etc. The first agent can call the transaction negotiation smart contract to send the transaction request and the service fee to the target business node through the transaction negotiation smart contract.
[0052] Step S152, the target business node verifies the first signature information.
[0053] When the target service node receives the transaction request and the service charge, the target service node verifies the first signature information by using the public key of the first key pair of the first agent. When the first signature information passes the verification, the target service node proceeds to step S153, otherwise, the transaction for the target service is ended.
[0054] Step S153, when the first signature information passes the verification, the target service node generates an on-chain transaction event for the target service.
[0055] The on-chain transaction event (Event) includes the distributed identifier of the second agent, the distributed identifier of the first agent, and the name of the target service, etc.
[0056] In one example, the target service node broadcasts the on-chain transaction event in the business blockchain network based on the transaction negotiation smart contract, i.e., sends the on-chain transaction event to each service node in the business blockchain network.
[0057] Step S154, in response to the second agent listening to the on-chain transaction event, the second agent sends second signature information to the target service node.
[0058] The second signature information is obtained by signing the second preset information by using the private key of the second key pair of the second agent. The second preset information may include the distributed identifier of the second agent, for example.
[0059] For example, the second agent listens to the business blockchain network in real time. Specifically, when the second agent listens to the target service node or the business blockchain network to generate an on-chain transaction event, the second agent obtains the on-chain transaction event from the target service node. When it is determined that the on-chain transaction event includes the distributed identifier of the second agent, i.e., the on-chain transaction event related to the second agent is found, the second agent processes the on-chain transaction event, otherwise, the on-chain transaction event is discarded, i.e., the on-chain transaction event related to the second agent is not found. When it is determined that the on-chain transaction event includes the distributed identifier of the second agent, the second agent signs the distributed identifier of the second agent by using the private key of the second key pair of the second agent to obtain the second signature information, and sends the second signature information to the target service node. Before generating the second signature information, the second agent can evaluate the on-chain transaction event to determine whether to provide the target service, for example, the transaction amount can be evaluated, the reputation information of the first agent can be evaluated, etc. When it is determined to provide the target service to the first agent, the second signature information is generated.
[0060] Step S155, the target service node verifies the second signature information.
[0061] The target service node verifies the second signature information by using the public key of the second key pair of the second agent.
[0062] Step S156, when the second signature information passes the signature verification, the target business node generates a transaction contract for the target service, and sends the transaction contract to the first agent and the second agent.
[0063] The transaction contract includes a transaction identifier (transaction ID) of the on-chain transaction event. The transaction contract can also include relevant terms for the target service transaction.
[0064] In one example, the target business node generates the transaction contract based on the transaction negotiation smart contract, calls a preset contract template, sends the transaction contract to the first agent and the second agent, and the first agent and the second agent use their respective private keys to sign the transaction contract to obtain the corresponding signed transaction contract, and feed back to the target business node. The target business node performs signature verification on the signed transaction contract fed back by the first agent and the signed transaction contract fed back by the second agent. When the signed transaction contract fed back by the first agent and the signed transaction contract fed back by the second agent both pass the signature verification, the status of the on-chain transaction event is marked as having been reached, the service fee is frozen, and the transaction contract is sent to the first agent and the second agent. When the second signature information does not pass the signature verification, the target business node ends the transaction operation of the target service.
[0065] Step S157, in response to receiving the transaction contract, the first agent performs the operation of obtaining the session key.
[0066] Wherein, after the first agent receives the transaction contract, the first agent performs step S161.
[0067] In some optional embodiments, in the embodiments of the present disclosure, before step S151, the following steps can also be included: the first agent obtains the verifiable credential of the second agent, verifies the verifiable credential, and in response to the verifiable credential passing the verification, the first agent performs the operation of sending the transaction request and the service fee to the target business node.
[0068] The verifiable credential (VC) is a digital proof based on digital signature and encryption technology, used to verify the attributes, qualifications or relationships of entities such as individuals, organizations or devices. The verifiable credential of the second agent is used to prove that the second agent can improve the qualifications of the target service.
[0069] Exemplarily, the distributed document of the second agent further stores a hash value of the verifiable credential of the second agent, the first agent requests the verifiable credential of the second agent based on the service endpoint address information, the second agent feeds back the verifiable credential of the second agent to the first agent, the first agent acquires a public key of an issuing party issuing the verifiable credential, and performs signature verification on the signature in the verifiable credential by using the public key, when the signature in the verifiable credential passes the signature verification, the first agent calculates the hash value of the verifiable credential, when the calculated hash value of the verifiable credential is consistent with the hash value of the verifiable credential of the second agent in the distributed document, it is determined that the verifiable credential passes the verification, the first agent generates a transaction request for the target service, and then performs the operation in step S151.
[0070] Figure 4 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown. In some optional embodiments, as shown in step S152, the target service node can further include the following steps: Figure 4 Step S200, the target service node sends an identity verification request for the first agent to the target anchor node.
[0071] The target anchor node is any anchor node in the plurality of anchor nodes. The identity verification request includes the distributed identifier of the first agent.
[0072] In one embodiment, when the target service node receives the transaction request and the service fee sent by the first agent, the target service node generates an identity verification request for the first agent based on the distributed identifier of the first agent, and sends the identity verification request to the target anchor node.
[0073] Step S210, the target anchor node acquires the verifiable credential of the first agent, verifies the identity of the first agent based on the verifiable credential of the first agent, and obtains an identity verification result of whether the identity of the first agent passes the verification.
[0074] The verifiable credential of the first agent is used to prove the identity authenticity of the first agent. Exemplarily, the target anchor node can request the verifiable credential of the first agent from the first agent, and the first agent feeds back the verifiable credential of the first agent to the target anchor node.
[0075] The identity verification result includes that the identity of the first agent passes the verification or the identity of the first agent does not pass the verification.
[0076] The anchor blockchain network corresponds to a blockchain in which a distributed document of the first agent is stored, and the distributed document stores a hash value of a verifiable credential of the first agent. The target anchor node obtains a public key of an issuing party that issued the verifiable credential of the first agent, and performs signature verification on a signature in the verifiable credential by using the public key. When the signature in the verifiable credential passes the signature verification, the target anchor node calculates a hash value of the verifiable credential. When the calculated hash value of the verifiable credential is consistent with the hash value of the verifiable credential of the first agent stored in the distributed document, it is determined that the first agent passes the identity verification, and an identity verification result that the first agent passes the identity verification is included. Otherwise, it is determined that the first agent fails the identity verification, and an identity verification result that the first agent fails the identity verification is included. The identity verification result is sent to the target service node.
[0077] In step S220, in response to the identity verification result indicating that the first agent passes the identity verification, the target service node performs an operation of performing signature verification on the first signature information.
[0078] When the identity verification result indicates that the first agent fails the identity verification, the target service node ends the transaction operation for the target service.
[0079] In the embodiments of the present disclosure, the target anchor node performs preliminary verification on the identity of the first agent based on the verifiable credential, and then the target service node performs signature verification, which is a double-checking mechanism. The reliability and authority of the identity of the agent are greatly improved, and the risk of false identity or non-compliant agent participating in interaction is effectively eliminated. At the same time, this layered verification method not only ensures the compliance of the identity qualification by relying on the verifiable credential, but also guarantees the authenticity of the interaction behavior through signature verification, which further strengthens the security line of the agent interaction in the double-chain network and provides more solid identity protection for cross-scene trusted cooperation.
[0080] Figure 5 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown. In some optional embodiments, as shown in Figure 5 The embodiments of the present disclosure can further include the following steps: In step S300, in response to listening to the abnormality of the service blockchain network, the first agent sends a transaction request for a target service and a service fee to a target anchor node.
[0081] For example, after step S151, after receiving the transaction request and the service fee sent by the first agent, the target service node sends response information to the first agent. If the first agent does not receive the response information fed back by the target service node within a preset time (for example, 2s) after sending the transaction request to the target service node, it can be determined that the service blockchain network is abnormal.
[0082] The transaction request includes: the first signature information, the distributed identifier of the second agent, the name of the target service, the service characteristics of the target service, the task (target service) content description, and the bid, etc. The first agent can call the transaction negotiation smart contract, and send the transaction request and the service fee to the target anchor node through the transaction negotiation smart contract.
[0083] In step S310, the target anchor node performs signature verification on the first signature information in the transaction request.
[0084] The signature verification manner of the target anchor node on the first signature information is the same as the signature verification manner of the target service node on the first signature information, and the signature verification of the target anchor node on the first signature information can refer to the signature verification of the target service node on the first signature information, which will not be described here.
[0085] In step S320, when the first signature information passes the signature verification, the target anchor node generates an on-chain transaction event for the target service.
[0086] The on-chain transaction event (Event) includes: the distributed identifier of the second agent, the distributed identifier of the first agent, and the name of the target service, etc.
[0087] In one example, the target anchor node broadcasts the on-chain transaction event in the anchor blockchain network based on the transaction negotiation smart contract, that is, sends the on-chain transaction event to each anchor node in the anchor blockchain network.
[0088] In step S330, in response to the second agent listening to the on-chain transaction event, the second signature information is sent to the target anchor node.
[0089] For example, the second agent listens to the anchor blockchain network in real time. Specifically, when the second agent listens to the target anchor node or the anchor blockchain network to generate an on-chain transaction event, the second agent obtains the on-chain transaction event from the target anchor node, and when it is determined that the on-chain transaction event includes the distributed identifier of the second agent, that is, the on-chain transaction event related to itself is found, the second agent processes the on-chain transaction event, otherwise, the on-chain transaction event is discarded, that is, the on-chain transaction event related to itself is not found. When it is determined that the on-chain transaction event includes the distributed identifier of the second agent, the second agent uses its private key to sign the distributed identifier of the second agent to obtain the second signature information, and sends the second signature information to the target anchor node.
[0090] In step S340, the target anchor node performs signature verification on the second signature information.
[0091] The target anchor node verifies the signature of the second signature information in the same way as the target service node verifies the signature of the second signature information. The target anchor node verifies the signature of the second signature information can be referred to the target service node verifies the signature of the second signature information, which will not be repeated here.
[0092] In step S350, when the second signature information passes the signature verification, the target anchor node generates a transaction contract for the target service, and sends the transaction contract to the first agent and the second agent.
[0093] The transaction contract includes a transaction identifier of the on-chain transaction event. The transaction contract can also include relevant terms for the target service transaction. In an embodiment, when the second signature information does not pass the signature verification, the target anchor node ends the transaction operation for the target service.
[0094] The target anchor node generates the transaction contract in the same way as the target service node generates the transaction contract. The target anchor node generates the transaction contract can be referred to the target service node generates the transaction contract, which will not be repeated here.
[0095] In step S360, in response to receiving the transaction contract, the first agent performs an operation of obtaining a session key.
[0096] In step S161, the first agent performs the operation of obtaining the session key after receiving the transaction contract sent by the target anchor node.
[0097] In the embodiments of the present disclosure, when the business blockchain network is abnormal, the target anchor node in the anchor blockchain network is relied on to handle the transaction request and the service fee. By verifying the signatures of both parties (the first signature information and the second signature information) and generating a transaction contract, the target service interaction between the first agent and the second agent is ensured not to be interrupted due to the business blockchain network failure, and the fault tolerance and overall stability of the dual-chain network are improved.
[0098] Figure 6 A flowchart of step S160 in another embodiment of the present disclosure is shown. In some optional embodiments, as shown in Figure 6 Step S160 can further include the following steps: In step S163, in response to receiving the signed transaction completion message sent by the first agent, the target service node performs signature verification on the signed transaction completion message.
[0099] The signed transaction completion message is obtained by signing the transaction completion message with the private key of the first agent's key pair. The transaction completion message includes a transaction identifier of an on-chain transaction event and transaction status information. The transaction status information indicates that the transaction for the target service has been completed.
[0100] For example, a payment settlement smart contract is also deployed in the double-chain network to automate the process of transaction fulfillment verification and value transfer (smart contract). After verifying the off-chain task completion credentials submitted by the agent, the payment settlement smart contract automatically performs fee payment, updates credit points, and generates storage data for the transaction, and synchronizes the storage data of the transaction to the corresponding blockchain.
[0101] For example, after the first agent verifies that the image recognition result is correct, it generates a transaction completion message using the SDK deployed thereon. Then, the first agent signs the transaction completion information using the private key of the key pair, obtains signed transaction information, and sends the signed transaction completion message to the target service node. Based on the payment settlement smart contract, the target service node verifies the signature of the signed transaction completion message using the public key of the first agent's key pair. When the signature verification of the signed transaction completion message is passed, step S164 is executed. When the signature verification of the signed transaction completion message fails, the target service node sends a transaction failure message to the first agent.
[0102] Step S164, in response to the signature verification of the signed transaction completion message, the target service node sends the service fee to the second agent.
[0103] The target service node unfreezes the service fee based on the payment settlement smart contract, and then transfers the service fee to the account of the second agent. The first agent and the second agent complete the transaction for the target service.
[0104] Step S165, the target service node updates the reputation information of the second agent, generates transaction evidence information for the on-chain transaction event, and stores the transaction evidence information in the corresponding blockchains of the anchor blockchain network and the business blockchain network.
[0105] The reputation information includes positive credit points and negative credit points. For example, a reputation system smart contract is also deployed in the double-chain network to automate the management and quantification of the credibility of agents. The reputation system smart contract automatically and non-tamperably updates the reputation information of the agent based on the on-chain verifiable transaction completion record. The target service node increases the positive credit points of the second agent based on the reputation system smart contract to update the reputation information of the second agent.
[0106] The transaction record information includes key metadata of a transaction (i.e., the on-chain transaction event) for the target service, for example, can include: a transaction identifier (transaction ID), a service fee, a status of the transaction, a hash value of updated reputation information, service description information, a transaction contract, a distributed identifier of the first agent, and a distributed identifier of the second agent, and the like.
[0107] For example, the target business node generates transaction record information based on the payment settlement smart contract, stores the transaction record information into the blockchain corresponding to the business blockchain network, and synchronizes the transaction record information to the blockchain corresponding to the anchor blockchain network through cross-chain technology for permanent record, for example, the target business node sends the transaction record information to the target anchor node, and the target anchor node stores the transaction record information into the blockchain corresponding to the anchor blockchain network.
[0108] In the embodiments of the present disclosure, a collaborative architecture of "high-trust anchor blockchain network (managing identity and audit) + high-performance business blockchain network (processing transactions for services) + off-chain point-to-point communication (agents exchange data)" is adopted, the anchor blockchain network focuses on bearing identity management, key commitment, and audit record, and other core operations that require high trust, the business blockchain network concentrates on processing high-frequency transaction business such as discovery, negotiation, and settlement for services, and actual task data exchange is completed through off-chain point-to-point communication. This precise business shunting not only avoids mutual resource occupation of different types of operations, but also fully plays the trusted security advantage of the anchor blockchain network and the high-efficiency processing characteristics of the business blockchain network, greatly improves the overall throughput and response speed of the system, significantly reduces transaction costs, and makes large-scale low-cost commercial-level collaboration between agents possible.
[0109] In addition, the key link (record information) of the whole process of the interaction of the transaction for the target service is left on the blockchain as an unalterable record hash, which builds a clear and reliable data support channel for post-audit, dispute arbitration, and compliance supervision. Supervisors can legally intervene when necessary by virtue of node permissions, perfectly achieving the precise balance of data privacy without compromising security and regulatory audit with basis.
[0110] Figure 7 A flowchart of a blockchain-based agent interaction method in another embodiment of the present disclosure is shown. In some optional embodiments, as shown in Figure 7 Before step S100, the following steps can also be included: Step S400, the target anchor node receives the identity generation request sent by the target agent.
[0111] The target agent is the first agent or any agent in the service registration list. The identity generation request includes the public key in the key pair of the target agent and the service address information. The identity generation request can also include the hash value of the verifiable credential of the target agent and the basic information of the target agent, for example, the name of the target agent and the registration fee.
[0112] For example, before each agent in the first agent and the service registration list interacts, the agent needs to register a distributed identity and a distributed identity document in the anchor blockchain network. Specifically, after the target agent generates its key pair, the target agent can generate an identity generation request and send the identity generation request to the target anchor node.
[0113] In step S410, the target anchor node generates the distributed identity and the distributed document of the target agent based on the identity generation request.
[0114] The distributed document of the target agent includes the distributed identity of the target agent, the public key in the key pair, the service address information, the hash value of the verifiable credential of the target agent, and the ID, storage address and hash value of the distributed document.
[0115] In an embodiment, the target anchor node can generate a distributed identity (DID) and a distributed document (DID Document) based on the W3C DID standard (a global DID standard specification defined by the World Wide Web Consortium (W3C)). The format of the distributed identity includes a fixed prefix, a method name and a specific string. For example, the distributed identity of the target agent can be did:method:example:efnVlm26MymQzBmAJcSCpSbbJMj2Z9nKq, where did: is the fixed prefix, method represents the DID method name used, and efnVlm26MymQzBmAJcSCpSbbJMj2Z9nKq is the specific string. The distributed document can be in JSON (JavaScript Object Notation, JS key-value pair data) format, and the distributed document can include specific fields, for example, the distributed document can include the field of the distributed identity of the target agent, the field of the public key in the key pair, the field of the service address information, the field of the hash value of the verifiable credential, and the field of the ID of the distributed document, the field of the storage address and the field of the hash value.
[0116] In step S420, the target anchor node feeds back the distributed identity of the target agent to the target agent, and stores the distributed document of the target agent in the corresponding blockchain of the anchor blockchain network.
[0117] The target anchor node binds the distributed identity of the target agent and the distributed document to establish a correspondence between the distributed identity and the distributed document, the target anchor node performs on-chain processing on the distributed document to store the distributed document in a blockchain corresponding to the anchor blockchain network, and the target anchor node sends the distributed identity to the target agent, and the target agent stores the distributed identity.
[0118] In the embodiments of the present disclosure, the anchor blockchain network is responsible for the generation and storage of the distributed identity and the distributed document of the target agent, and the identity data uniqueness, verifiability and trusted evidence are guaranteed by the tamper-proof nature of the blockchain, which builds a solid identity trust foundation. The business blockchain network is only responsible for the interaction of services, without bearing the additional load of identity management, thereby clarifying the business division, avoiding the mutual occupation of resources of identity management and service interaction, and making the trust guarantee of the anchor blockchain network and the efficient processing of the business chain complementary, achieving a precise balance between security and performance optimization of the double-chain network, and further supporting the smooth interaction of agents across systems and platforms.
[0119] In some optional embodiments, before step S100, the present disclosure can further include: in response to receiving the service registration information sent by the target agent, the target business node adds the distributed identity of the target agent and the service description information to the service registration list to register the target agent to the service registration list.
[0120] The service registration information includes the service description information of the distributed identity of the target agent.
[0121] For example, a service registration smart contract (Service Registry contract) is also deployed in the double-chain network. The service registration smart contract is a decentralized service directory running on a blockchain, which allows agents providing services to register their service information (distributed identity and service description information) in an unalterable manner to the service registration list. The target agent generates a service description information, and the data format of the service description information can be, for example, a JSON file. The service description information is used to describe the relevant information of the service provided by the target agent. The target agent uses the SDK deployed thereon to generate service registration information including the service description information of the target agent, the distributed identity and the service endpoint address information, and the hash value of the service description information, and sends the service registration information to the target business node. The target business node uses the service registration smart contract to add the service description information and the distributed identity of the target agent to the service registration list to register the service provided by the target agent to the service registration list.
[0122] When the service provided by the target agent is registered in the service registration list, a registration transaction is generated in the business blockchain network, and the target business node generates service information of the transaction (such as a distributed identifier of the target agent, a hash value of the service description information, etc.) and stores the service information in the corresponding blockchain of the business blockchain network.
[0123] The embodiments of the present disclosure can be applied in an Internet of Things scenario, can support secure interconnection of device agents of smart home, Internet of Vehicles and the like, and guarantee data privacy and device collaboration reliability. Exemplarily, Figure 8 A flowchart of a blockchain-based agent interaction method according to an application example of the present disclosure is shown. The present example is an application of the blockchain-based agent interaction method according to the embodiments of the present disclosure in an Internet of Things. As shown in the figure, Figure 8 As shown, agent A (first agent) is a demander of a target service, and agent B (second agent) is a provider of the target service. Both agent A and agent B are Internet of Things entities (such as an autonomous vehicle, a roadside sensing unit, a traffic signal controller). In the present example, it is assumed that agent A is an autonomous vehicle, and agent B is a roadside unit (RSU). Agent A needs real-time fusion sensing data of a front road for beyond-visual-range decision-making while driving, and agent B can provide a hundred-meter-level real-time fusion sensing (target service). Agent A and agent B interact using a double-chain network. The double-chain network includes a business blockchain network (referred to as a business chain) and an anchor blockchain network (referred to as an anchor chain). The business blockchain network includes a plurality of business nodes, and a target business node is any one of the plurality of business nodes. The anchor blockchain network includes a plurality of anchor nodes, and a target anchor node is any one of the plurality of anchor nodes.
[0124] First stage: identity registration and service registration; In the first stage, the identity registration and service registration of agent B are taken as an example for illustration. The identity registration and service registration of agent A are the same as those of agent B, and can be referred to the identity registration and service registration of agent B, which will not be described herein again.
[0125] 1. SDK generates an SM2 (national secret) key pair: Agent B uses the SDK deployed thereon to generate a key pair (including a public key PK_B and a private key SK_B) of the second agent using a national secret algorithm (SM2). 2. Register DID identity: the agent B registers the DID identity on the anchor chain, specifically including: the agent B generates an identity generation request, sends the identity generation request to the anchor chain, the identity generation request includes the DID (Distributed Identity) of the agent B, the service endpoint URL, PK_B, the basic information of the agent B (such as the creator name), the hash value of the VC and the required registration fee; 3. Return DID: the target anchor node generates the DID (Distributed Identity) of the agent B and the DID document (Distributed Document), and returns the DID of the agent B to the agent B; 4. Register service: the agent B generates service registration information including service description information, DID and service endpoint URL of the agent B, and the hash value of the service description information by using the SDK deployed thereon, and sends the service registration information to the business chain, and the target business node adds the distributed identity and service description information of the agent B to the service registration list based on the service registration smart contract, so as to register the service provided by the agent B to the service registration list.
[0126] Second stage: service discovery and verification; 5. Query service: the agent A sends the service type (image recognition) to the business chain; 6. Return service list (including DID of agent B): the target business node determines the target service list based on the service characteristics and the service registration list, and sends the target service list to the agent A, the target service list including: the DID and service description information of a plurality of candidate agents, and the plurality of candidate agents can all provide image recognition service; 7. Analyze the DID of the agent B: the agent A determines the DID of the agent B in the target service registration list, and sends the DID to the anchor chain, and the target anchor node determines the DID document of the agent B based on the DID of the agent B; 8. Return the public key / endpoint of the agent B: the target anchor node sends the DID document to the agent A, and the DID document includes: the service endpoint URL and the public key PK_B of the agent B; Third stage: on-chain agreement; 9. Create transaction proposal: the agent A calls the transaction negotiation smart contract, and sends the transaction request and service fee to the business chain through the transaction negotiation smart contract, and the target business node performs signature verification on the first signature information; 10. Trigger on-chain transaction event: when the first signature information passes the signature verification, the target business node generates an on-chain transaction event for the target service, and the agent B obtains the on-chain transaction event when listening to the on-chain transaction event; 11. Receive proposal (signature): the agent B sends the second signature information to the business chain (target business node); 12, state update, fund lock: the target business node performs signature verification on the second signature information, and when the second signature information passes the signature verification, the target business node generates a transaction contract, freezes the service fee, and sends the transaction contract to the first agent and the second agent; The fourth stage: off-chain execution; 13, establish secure passage: agent A generates a session key, encrypts the session key using the public key of the key pair of agent B, obtains an encrypted session key, and sends the encrypted session key to agent B based on the service endpoint URL; agent B decrypts the encrypted session key using the private key of the key pair of agent B to obtain the session key; 14, send encrypted task data: agent A encrypts the perception data of agent A (such as RGB images around agent A, 3D point cloud, and current position information and speed information of agent A, etc.) using the session key to obtain encrypted data, and then transmits the encrypted data to agent B; 15, execute local calculation: agent B decrypts the encrypted data using the session key to obtain the perception data, and then agent B generates environment description information (perception fusion result) based on the perception data using a fusion algorithm, which may include, for example: a list of traffic participants (such as vehicles, pedestrians, and non-motor vehicles) in front of agent A, road situation and event data, wherein the list of traffic participants may include the ID, precise global coordinates, speed vector, heading angle, size (length, width, and height), and confidence of each participant, the road situation information may include lane lines, curbs, traffic signs, signal light states, drivable areas, construction zones, and other information described in semantic segmentation or vector form, and the event data may include specific traffic events detected, such as traffic accidents (location), traffic jams (starting point and length), road foreign objects (type and location), and abnormal parking; 16, return encrypted result: agent B encrypts the perception fusion result using the session key to obtain encrypted perception fusion result, and then transmits the encrypted perception fusion result to agent A; The fifth stage: on-chain calculation and evidence storage; 17, submit completion proof: after agent A verifies that the perception fusion result is correct, it generates a transaction completion message using its SDK, then signs the transaction completion information using the private key of the key pair of agent A to obtain signed transaction information, and then sends the signed transaction completion message to the business chain; 18, signature verification, automatic calculation: the target business node performs signature verification on the signed transaction completion message, and when the signed transaction completion message passes the signature verification, the service fee is unfrozen based on the payment settlement smart contract, and then the service fee is transferred to the account of agent B. 19, updating reputation: the target business node updates the reputation information of the agent B, and generates transaction deposit information; 20, synchronizing deposit hash: the target business node stores the hash value of the transaction deposit information into the blockchain corresponding to the business blockchain network respectively, synchronizes the hash value of the transaction deposit information to the blockchain corresponding to the anchor blockchain network through cross-chain technology for permanent deposit, that is, the target business node sends the hash value of the transaction deposit information to the target anchor node, and the target anchor node stores the hash value of the transaction deposit information into the blockchain corresponding to the anchor blockchain network.
[0127] Figure 9 A block diagram of a blockchain-based agent interaction system in an embodiment of the present disclosure is shown. As shown in the figure, the blockchain-based agent interaction system of this embodiment includes a first agent 500, a second agent 600, and a double-chain network 700, which includes an anchor blockchain network 710 and a business blockchain network 720, the business blockchain network 720 includes a plurality of business nodes, and the anchor blockchain network 710 includes a plurality of anchor nodes. Figure 9
[0128] The target business node is configured to determine a target service list based on the service characteristics and a service registration list in response to receiving the service characteristics of the target service sent by the first agent 500, the target service list including distributed identity and service description information of at least one candidate agent capable of providing the target service, the target business node being one of the plurality of business nodes; The first agent 500 is configured to generate the service characteristics, determine the distributed identity of the second agent 600 in the target service registration list upon receiving the target service registration list, obtain a distributed document of the second agent 600 from the anchor blockchain network 710 based on the distributed identity of the second agent 600, the distributed document including service endpoint address information of the second agent 600, and interact with the second agent 600 based on the service endpoint address information to obtain the target service provided by the second agent 600.
[0129] In some optional embodiments, the distributed document further includes a public key in a key pair of the second agent; The first agent 500 is further configured to obtain a session key, encrypt the session key using the public key in the key pair of the second agent 600 to obtain an encrypted session key, and send the encrypted session key to the second agent 600 based on the service endpoint address information; The second agent 600 is further configured to decrypt the encrypted session key by using the private key in the key pair to obtain the session key, so that the second agent 600 and the first agent 500 perform encrypted communication based on the session key.
[0130] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The first agent 500 is further configured to send a transaction request for the target service and a service fee to the target service node, the transaction request comprising first signature information obtained by signing first preset information by using a private key in a key pair of the first agent; and when receiving a transaction contract for the target service, perform the operation of obtaining the session key. The target service node is further configured to perform signature verification on the first signature information; when the first signature information passes the signature verification, the target service node generates an on-chain transaction event for the target service. The second agent 600 is configured to send second signature information to the target service node in response to listening to the on-chain transaction event, the second signature information being obtained by signing second preset information by using a private key in a key pair of the second agent. The target service node is further configured to perform signature verification on the second signature information; when the second signature information passes the signature verification, the target service node generates a transaction contract for the target service, and sends the transaction contract to the first agent and the second agent, the transaction contract comprising a transaction identifier of the on-chain transaction event.
[0131] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The first agent 500 is further configured to obtain a verifiable credential of the second agent 600, and perform verification on the verifiable credential; in response to the verifiable credential passing the verification, perform the operation of sending the transaction request and the service fee to the target service node.
[0132] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The target service node is configured to send an identity verification request for the first agent 500 to a target anchor node, the target anchor node being any anchor node in the plurality of anchor nodes; and in response to an identity verification result of the first agent identity indicating that the first agent passes the identity verification, perform the operation of performing signature verification on the first signature information. A target anchor node, configured to obtain a verifiable credential of the first agent 500, verify the identity of the first agent 500 based on the verifiable credential of the first agent 500, and obtain an identity verification result of whether the identity of the first agent 500 is verified.
[0133] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The first agent 500 is configured to, in response to monitoring an abnormality of the business blockchain network, send a transaction request for the target service and a service fee to a target anchor node; and in response to receiving the transaction contract, perform an operation of obtaining the session key. The target anchor node is configured to perform signature verification on first signature information in the transaction request; and when the first signature information passes the signature verification, generate an on-chain transaction event for the target service. The second agent 600 is configured to, in response to listening to the on-chain transaction event, send second signature information to the target anchor node. The target anchor node is configured to perform signature verification on the second signature information; and when the second signature information passes the signature verification, generate a transaction contract for the target service, and send the transaction contract to the first agent 500 and the second agent 600.
[0134] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The target business node is configured to, in response to receiving the signed transaction completion message sent by the first agent 500, perform signature verification on the signed transaction completion message, wherein the signed transaction completion message is obtained by signing a transaction completion message with the private key of the first agent's key pair, and the transaction completion message includes the transaction identifier and transaction status information; in response to the signed transaction completion message passing the signature verification, send the service fee to the second agent; update the reputation information of the second agent, generate transaction evidence information for the on-chain transaction event, and store the transaction evidence information into the blockchains corresponding to the anchor blockchain network and the business blockchain network respectively.
[0135] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The target anchor node is configured to receive an identity generation request sent by a target agent, the target agent being the first agent or any agent in the service registration list, the identity generation request including a public key in a key pair of the target agent and service end address information; generate a distributed identity and a distributed document of the target agent based on the identity generation request; and feed back the distributed identity to the target agent and store the distributed document into a blockchain corresponding to the anchor blockchain network.
[0136] In some optional embodiments, in the blockchain-based agent interaction system in the embodiments of the present disclosure: The target service node is further configured to, in response to receiving the service registration information sent by the target agent, add the distributed identity and the service description information of the target agent into the service registration list, so as to register the service provided by the target agent to the service registration list.
[0137] The blockchain-based agent interaction system of the present disclosure corresponds to the embodiments of the blockchain-based agent interaction method of the present disclosure, and related contents can be referred to each other, which will not be repeated here.
[0138] The beneficial technical effects of the exemplary embodiments of the blockchain-based agent interaction system of the present disclosure can be referred to the corresponding beneficial technical effects of the above-mentioned exemplary method, which will not be repeated here.
[0139] In addition, the embodiments of the present disclosure further provide an electronic device, comprising: a memory configured to store a computer program; a processor configured to execute the computer program stored in the memory, and when the computer program is executed, implement the blockchain-based agent interaction method of any one of the embodiments of the present disclosure.
[0140] Figure 10 The structure schematic diagram of an application embodiment of the electronic device of the present disclosure is shown in the following figure. Figure 8 The electronic device according to the embodiments of the present disclosure will be described below with reference to the following figure. The electronic device can be any one or both of the first device and the second device, or a single device independent of them, which can communicate with the first device and the second device to receive the input signals collected therefrom.
[0141] As shown in the figure, Figure 10 the electronic device comprises one or more processors and a memory.
[0142] The processor can be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction executing capabilities, and can control other components in the electronic device to perform desired functions.
[0143] The memory can include one or more computer program products that can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, can include random access memory (RAM), cache memory, and / or the like. The non-volatile memory, for example, can include read only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program instructions can be stored on the computer-readable storage media, and the processor can execute the program instructions to implement the blockchain-based agent interaction method according to various embodiments of the present disclosure and / or other desired functions described above.
[0144] In one example, the electronic device can further include an input device and an output device, which are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0145] In addition, the input device can further include, for example, a keyboard, a mouse, and / or the like.
[0146] The output device can output various information, including determined distance information, direction information, and / or the like, to the outside. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and / or the like.
[0147] Of course, in order to simplify, Figure 10 In FIG. 1, only some of the components related to the present disclosure among the components in the electronic device are illustrated, and components such as buses, input / output interfaces, and / or the like are omitted. In addition, the electronic device can further include any other appropriate components according to a specific application case.
[0148] In addition to the above-described method and device, an embodiment of the present disclosure can be a computer program product including computer program instructions that, when executed by a processor, cause the processor to perform steps of the blockchain-based agent interaction method according to various embodiments of the present disclosure described in the above parts of the specification.
[0149] The computer program product can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server.
[0150] In addition, the embodiments of the present disclosure can also be a computer readable storage medium, which stores computer program instructions, and the computer program instructions make the processor execute the steps in the method for agent interaction based on blockchain according to various embodiments of the present disclosure described in the above part of the specification when the processor runs.
[0151] The computer readable storage medium can take the form of one or more combinations of any type of readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0152] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the aforementioned program can be stored in a computer readable storage medium, and the program executes the steps of the above-mentioned method embodiments when executed; and the aforementioned storage medium includes ROM, RAM, magnetic disc or optical disc and various storage medium that can store program code.
[0153] The above describes the basic principles of the present disclosure in combination with specific embodiments, but it should be pointed out that the advantages, advantages, effects and the like mentioned in the present disclosure are only examples and are not limited, and these advantages, advantages, effects and the like cannot be considered as the various embodiments of the present disclosure must have. In addition, the above specific details are only for the purpose of example and for the purpose of understanding, and the above details do not limit the present disclosure to the above specific details.
[0154] The various embodiments described in this specification are intended to be illustrative only and in no way limit the scope of the application. One skilled in the art will readily recognize from the disclosure herein, possible variations of the embodiments described herein. For example, the principles and applications are useful in systems other than the systems of choice or the application of choice to accomplish measurements of the performance of various aspects. Therefore, the application as claimed is intended to be as broad as possible and will encompass all changes and modifications of the application herein disclosed and equivalents thereof within the scope of the application. Accordingly, the specification and drawings are to be regarded in an illustrative manner and results to be achieved are intended to be within the scope of the application.
[0155] The block diagrams of devices, apparatuses, equipment, systems referred to in the present disclosure are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations shown in the block diagrams are required. As will be realized by one skilled in the art, the devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include," "contain," "have," etc., are to be construed as open-ended terms meaning "including, but not limited to," and are to be interpreted in the same manner. The words "or" and "and" as used herein are to be interpreted as the word "and / or" and are to be interpreted in the same manner. The word "such as" as used herein is to be interpreted as the phrase "such as but not limited to" and is to be interpreted in the same manner.
[0156] The methods and apparatuses of the present disclosure can be implemented in a number of ways. For example, the methods and apparatuses of the present disclosure can be implemented using software, hardware, firmware, or any combination of these. The order of any steps of the methods described above is merely exemplary and the steps of the methods of the present disclosure are not limited to the order described above unless otherwise specifically stated. Furthermore, in some embodiments, the present disclosure can also be implemented as a program recorded in a recording medium, which includes machine readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.
[0157] It is also important to note that the devices, equipment and methods of the present disclosure can be embodied in a variety of ways. These variations are contemplated as being equivalent to what is described but within the scope of the present disclosure.
[0158] The above description of the disclosed aspects is intended to be illustrative only and not limiting of the scope of the application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other aspects without departing from the scope of the application. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0159] The foregoing description has been presented for the purposes of illustration and description. Furthermore, the description is not intended to limit the embodiments of the disclosure to the forms disclosed herein. Although the various example aspects and embodiments have been described herein with regard to particular aspects and embodiments, those skilled in the art will recognize that certain modifications, changes, substitutions, additions and sub-combinations can be made without departing from the spirit of the disclosure.
Claims
1. A blockchain-based method for interaction of agents, the method comprising: The method is applied to a double-chain network, the double-chain network comprising an anchor blockchain network and a service blockchain network, the service blockchain network comprising a plurality of service nodes, and the anchor blockchain network comprising a plurality of anchor nodes, and the method comprises: In response to receiving service features of a target service sent by a first agent, a target service node determines a target service list based on the service features and a service registration list, the target service list comprising distributed identifiers and service description information of at least one candidate agent capable of providing the target service, the target service node being one of the plurality of service nodes; The first agent determines a distributed identifier of a second agent in the target service registration list; The first agent obtains a distributed document of the second agent from the anchor blockchain network based on the distributed identifier of the second agent, the distributed document comprising service endpoint address information of the second agent; The first agent interacts with the second agent based on the service endpoint address information to obtain the target service provided by the second agent.
2. The method of claim 1, wherein, The distributed document further comprises a public key in a key pair of the second agent; The first agent interacts with the second agent based on the service endpoint address information, comprising: The first agent obtains a session key, encrypts the session key by using the public key in the key pair of the second agent to obtain an encrypted session key, and sends the encrypted session key to the second agent based on the service endpoint address information; The second agent decrypts the encrypted session key by using a private key in the key pair to obtain the session key, so that the second agent and the first agent perform encrypted communication based on the session key.
3. The method of claim 2, wherein, Before the first agent obtains the session key, the method further comprises: The first agent sends a transaction request and a service fee for the target service to the target service node, the transaction request comprising first signature information obtained by signing first preset information by using a private key in a key pair of the first agent; The target service node performs signature verification on the first signature information; When the first signature information passes the signature verification, the target service node generates an on-chain transaction event for the target service; In response to the second agent listening to the on-chain transaction event, the second agent sends second signature information to the target service node, the second signature information being obtained by signing second preset information by using a private key in a key pair of the second agent; The target service node performs signature verification on the second signature information; When the second signature information passes the signature verification, the target service node generates a transaction contract for the target service and sends the transaction contract to the first agent and the second agent, the transaction contract comprising a transaction identifier of the on-chain transaction event; in response to receiving the transaction contract, the first agent performs the operation of obtaining the session key.
4. The method of claim 3, wherein, The first agent further includes, before sending the transaction request and the service fee for the target service to the target business node: The first agent obtains the verifiable credential of the second agent, and verifies the verifiable credential; In response to the verifiable credential passing the verification, the first agent performs the operation of sending the transaction request and the service fee to the target business node.
5. The method of claim 3, wherein, The target business node further includes, before performing the signature verification on the first signature information: The target business node sends an identity verification request for the first agent to a target anchor node, which is any anchor node in the plurality of anchor nodes; The target anchor node obtains the verifiable credential of the first agent, verifies the identity of the first agent based on the verifiable credential of the first agent, and obtains an identity verification result indicating whether the identity of the first agent passes the verification; In response to the identity verification result indicating that the first agent passes the identity verification, the target business node performs the operation of performing the signature verification on the first signature information.
6. The method of claim 2, wherein, Further includes: In response to monitoring the abnormality of the business blockchain network, the first agent sends a transaction request and a service fee for the target service to a target anchor node; The target anchor node performs signature verification on the first signature information in the transaction request; When the first signature information passes the signature verification, the target anchor node generates an on-chain transaction event for the target service; in response to the second agent listening to the on-chain transaction event, the target anchor node sends second signature information to the target anchor node; The target anchor node performs signature verification on the second signature information; When the second signature information passes the signature verification, the target anchor node generates a transaction contract for the target service and sends the transaction contract to the first agent and the second agent; In response to receiving the transaction contract, the first agent performs the operation of obtaining the session key.
7. The method of claim 2, wherein, The first agent interacts with the second agent based on the service endpoint address information, further including: In response to receiving the signed transaction completion message sent by the first agent, the target business node performs signature verification on the signed transaction completion message, the signed transaction completion message being obtained by signing a transaction completion message with the private key of the first agent's key pair, and the transaction completion message including a transaction identifier and transaction status information of the on-chain transaction event; In response to the signed transaction completion message passing the signature verification, the target business node sends a service fee to the second agent; the target business node updates the reputation information of the second agent, generates transaction evidence information for the on-chain transaction event, and stores the transaction evidence information into the blockchains corresponding to the anchor blockchain network and the business blockchain network, respectively.
8. The method according to any of claims 1 to 7, characterized in that Further includes: The target anchor node receives an identity generation request sent by a target agent, the target agent being the first agent or any agent in the service registration list, the identity generation request including a public key in a key pair of the target agent and service end address information; The target anchor node generates a distributed identity and a distributed document of the target agent based on the identity generation request; The target anchor node feeds back the distributed identity to the target agent and stores the distributed document into a blockchain corresponding to the anchor blockchain network.
9. The method of claim 8, wherein, Further comprising: In response to receiving the service registration information sent by the target agent, the target business node adds the distributed identity and service description information of the target agent into the service registration list to register the service provided by the target agent to the service registration list. 10.A blockchain-based agent interaction system, characterized in that, The system comprises a first agent, a second agent and a double-chain network, the double-chain network comprising an anchor blockchain network and a business blockchain network, the business blockchain network comprising a plurality of business nodes, and the anchor blockchain network comprising a plurality of anchor nodes; A target business node is configured to, in response to receiving service characteristics of a target service sent by the first agent, determine a target service list based on the service characteristics and a service registration list, the target service list comprising distributed identities and service description information of at least one candidate agent capable of providing the target service, the target business node being one of the plurality of business nodes; The first agent is configured to generate the service characteristics, determine a distributed identity of the second agent in the target service registration list upon receiving the target service registration list, obtain a distributed document of the second agent from the anchor blockchain network based on the distributed identity of the second agent, the distributed document comprising service end point address information of the second agent, and interact with the second agent based on the service end point address information to obtain the target service provided by the second agent.
11. An electronic device, comprising: Further comprising: A memory is configured to store a computer program; A processor is configured to execute the computer program stored in the memory, and when the computer program is executed, the method in any one of claims 1-9 is implemented.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1-9.
13. A computer program product comprising computer program instructions, characterised in that, The computer program instructions are executed by the processor to implement the method in any one of claims 1-9.
Citation Information
Patent Citations
Service registration method, block chain total system, edge node, medium and product
CN119561673A
Multi-Agent cooperative communication method and device based on block chain, equipment and storage medium
CN119788681A
Supply chain full-process traceability system based on digital twinning and block chain
CN120338832A
System for realizing trusted authentication of financial agent based on distributed digital identity
CN120811758A
Multi-agent cooperation system and method capable of realizing cross-domain mutual trust
CN120915496A