Intelligent agent behavior evidence storage method and device, equipment, storage medium and program product
By evaluating the comprehensive scores of candidate distributed ledgers through a multi-factor ledger decision algorithm, the high cost problem caused by the caller selecting the ledger by themselves is solved, and efficient evidence storage of agent behavior is achieved.
Patent Information
- Application Number
- CN202611100288.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-11-24
AI Technical Summary
In existing methods for storing evidence of agent behavior, the caller needs to understand and select information such as the transaction cost, time, and network availability of the distributed ledger, which results in high decision-making costs for the ledger and makes it difficult to make a reasonable choice.
A multi-factor ledger decision algorithm is used to determine the comprehensive score of candidate distributed ledgers, including factors such as ledger health, transaction costs, block production delay and confirmation time, remaining quota ratio and failure penalty score. The ledger with the highest comprehensive score is selected for evidence storage.
It reduces the ledger decision-making cost for the caller, quickly selects the optimal target distributed ledger, and realizes the reasonable selection and efficient storage of distributed ledgers.
Smart Images

Figure CN123159384A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, storage medium, and program product for storing evidence of intelligent agent behavior. Background Technology
[0002] An AI agent (or simply "intelligent agent") is a software entity capable of autonomously perceiving, planning, making decisions, and executing tasks. As intelligent agents operate autonomously at scale, the behavioral records generated by each of their decisions and executions need to be written into a distributed ledger to obtain immutable timestamps for auditing and third-party verification.
[0003] Currently, methods for storing agent behavior records mainly fall into three categories: single-ledger fixed anchoring, homogeneous multi-ledger anchoring, and manual multi-ledger anchoring. The single-ledger fixed anchoring method involves the caller writing the agent's behavior records to a single, fixed distributed ledger. The homogeneous multi-ledger anchoring method involves the caller manually selecting from multiple distributed ledgers within the same virtual machine ecosystem and writing the agent's behavior records to the selected ledger. The manual multi-ledger anchoring method involves the caller manually writing the agent's behavior records to multiple different distributed ledgers. In these methods, the caller for ledger storage typically refers to the agent or its operational service.
[0004] However, the above-mentioned evidence preservation methods require the caller to understand the fluctuation of evidence preservation transaction costs, evidence preservation time, network availability, and other information of different distributed ledgers, and select a suitable distributed ledger accordingly. The cost of selecting a distributed ledger is entirely borne by the caller, resulting in high ledger decision-making costs for the caller and making it difficult to achieve a reasonable selection of a distributed ledger. Summary of the Invention
[0005] This invention provides a method, apparatus, device, storage medium, and program product for storing evidence of intelligent agent behavior, which addresses the shortcomings of existing methods for storing evidence of intelligent agent behavior, such as high ledger decision-making costs for the caller and difficulty in making reasonable choices of distributed ledgers.
[0006] This invention provides a method for storing evidence of intelligent agent behavior, comprising: responding to a request for evidence storage from a caller, determining a candidate ledger set for the caller; the caller is a target intelligent agent or an operational service corresponding to the target intelligent agent, and the candidate ledger set includes at least two candidate distributed ledgers; determining a comprehensive score for each candidate distributed ledger based on a multi-factor ledger decision algorithm; selecting the candidate distributed ledger with the highest comprehensive score as the target distributed ledger; and writing the behavior record of the target intelligent agent into the target distributed ledger to generate the evidence storage result of the target intelligent agent.
[0007] According to the intelligent agent behavior evidence storage method provided by the present invention, the comprehensive score corresponding to a candidate distributed ledger is determined by a multi-factor ledger decision algorithm based on the following steps: determining the first scoring factor, second scoring factor, third scoring factor, fourth scoring factor, and fifth scoring factor of the candidate distributed ledger at the current time; performing a weighted aggregation operation based on the first scoring factor and its corresponding first weight, the second scoring factor and its corresponding second weight, the third scoring factor and its corresponding third weight, the fourth scoring factor and its corresponding fourth weight, and the fifth scoring factor and its corresponding fifth weight to generate the comprehensive score corresponding to the candidate distributed ledger; wherein, the first scoring factor is the ledger health score of the candidate distributed ledger, the second scoring factor is the normalized reciprocal of the transaction cost of the caller on the candidate distributed ledger, the third scoring factor is the normalized reciprocal of the ratio between the delay of the most recent block production of the candidate distributed ledger and the average confirmation time of the candidate distributed ledger, the fourth scoring factor is the remaining quota ratio of the caller on the candidate distributed ledger, and the fifth scoring factor is the failure penalty score of the candidate distributed ledger within the most recent time window.
[0008] According to the present invention, a method for storing evidence of intelligent agent behavior includes a storage request carrying the behavior record of the target intelligent agent, ledger identification information preferred by the caller, the caller's identity credentials, and the caller's storage billing method, which includes the caller's ledger subscription tier. In response to the caller's storage request, a candidate ledger set for the caller is determined, including: performing a comparison authentication based on the identity credentials to generate the caller's identity authentication result; if the identity authentication result is successful, determining the caller's remaining storage quota under the ledger subscription tier; and if the remaining storage quota is sufficient, determining the caller's candidate ledger set based on the caller's preferred ledger identification information.
[0009] According to the present invention, a method for storing evidence of intelligent agent behavior determines a candidate ledger set for the caller based on the ledger identifier information preferred by the caller, including: if the ledger identifier information preferred by the caller is a missing value, then determining a candidate ledger set for the caller based on the ledger subscription tier; if the ledger identifier information preferred by the caller is not a missing value, then determining the caller's preferred distributed ledger based on the ledger identifier information, and constructing a candidate ledger set for the caller based on the preferred distributed ledger.
[0010] According to the present invention, a method for storing evidence of intelligent agent behavior, after recording the behavior of the target intelligent agent and writing it into the target distributed ledger to generate the evidence storage result of the target intelligent agent, further includes: generating a comprehensive scoring decision log of the candidate ledger set; writing the comprehensive scoring decision log and the evidence storage result into an audit table; and returning evidence storage success information to the caller.
[0011] According to the present invention, a method for storing evidence of intelligent agent behavior includes, after recording the behavior of the target intelligent agent and writing it into a target distributed ledger to generate the evidence storage result of the target intelligent agent, the method further includes: if the evidence storage result is a failure, accumulating the failure count of the target distributed ledger and updating the fifth scoring factor corresponding to the target distributed ledger based on the failure count; repeatedly executing a preset iterative step to update the evidence storage result until the number of iterations reaches a preset number or the evidence storage result is updated to a successful evidence storage result; the iterative step includes: selecting a candidate distributed ledger with a comprehensive score second only to the target distributed ledger from the candidate ledger set and replacing it with the target distributed ledger; rewriting the behavior record of the target intelligent agent into the target distributed ledger and updating the evidence storage result of the target intelligent agent.
[0012] The method for storing evidence of intelligent agent behavior provided by the present invention further includes: if the number of iterations reaches a preset number and the storage result is storage failure, then returning storage failure information to the caller.
[0013] This invention also provides an intelligent agent behavior evidence storage device, comprising: a candidate ledger set construction module, used to determine the caller's candidate ledger set in response to the caller's evidence storage request; the caller is a target intelligent agent or an operation service corresponding to the target intelligent agent, and the candidate ledger set includes at least two candidate distributed ledgers; a multi-factor scoring module, used to determine the comprehensive score corresponding to each candidate distributed ledger based on a multi-factor ledger decision algorithm; a ledger filtering module, used to select the candidate distributed ledger with the highest comprehensive score as the target distributed ledger; and a behavior evidence storage module, used to write the behavior record of the target intelligent agent into the target distributed ledger and generate the evidence storage result of the target intelligent agent.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described methods for storing evidence of intelligent agent behavior.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for storing evidence of intelligent agent behavior.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for storing evidence of intelligent agent behavior.
[0017] The intelligent agent behavior evidence storage method, apparatus, device, storage medium, and program product provided by this invention, after receiving an evidence storage request from a caller, determines a candidate ledger set for the caller based on the request. The candidate ledger set includes at least two candidate distributed ledgers. Then, a multi-factor ledger decision algorithm is used to calculate the comprehensive score corresponding to each candidate distributed ledger, and the candidate distributed ledger with the highest comprehensive score is selected as the target distributed ledger. Finally, the behavior record of the target intelligent agent is written into the target distributed ledger to generate the evidence storage result of the target intelligent agent. This evidence storage method does not require the caller to collect information from different distributed ledgers for ledger decision-making, which can effectively reduce the ledger decision-making cost of the caller and facilitate the rapid selection of the optimal target distributed ledger, thus achieving reasonable decision-making of the distributed ledger. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is one of the flowcharts of the intelligent agent behavior evidence storage method provided by the present invention.
[0020] Figure 2 This is a schematic diagram of the AI Agent behavior evidence storage system provided by the present invention.
[0021] Figure 3 This is the second flowchart of the intelligent agent behavior evidence storage method provided by the present invention.
[0022] Figure 4 This is the third flowchart of the intelligent agent behavior evidence storage method provided by the present invention.
[0023] Figure 5 This is a schematic diagram of the intelligent agent behavior evidence storage device provided by the present invention.
[0024] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] Please see Figures 1 to 4 , Figure 1 This is one of the flowcharts illustrating the intelligent agent behavior evidence storage method provided by the present invention. Figure 2 This is a schematic diagram of the AI Agent behavior evidence storage system provided by the present invention. Figure 3 This is the second flowchart illustrating the intelligent agent behavior evidence storage method provided by the present invention. Figure 4 This is the third flowchart of the intelligent agent behavior evidence storage method provided by the present invention.
[0027] In this embodiment, the intelligent agent behavior evidence storage method is applied to the AI Agent behavior evidence storage system.
[0028] like Figure 2 As shown, the AI Agent behavior evidence storage system includes a unified API gateway module, a multi-ledger decision engine module, a cross-ledger adapter, a failover manager, a quota and receipt module, and an audit and observability module. Figure 2 (Not shown in the image).
[0029] like Figure 1 As shown, the method for storing evidence of agent behavior includes steps S110 to S140, and the specific steps are as follows: S110: In response to the caller's evidence storage request, determine the caller's candidate ledger set.
[0030] The caller is the target intelligent agent or the operation service corresponding to the target intelligent agent, and the candidate ledger set includes at least two candidate distributed ledgers.
[0031] Specifically, the caller of ledger notarization refers to the target intelligent agent or its operation service. When the caller needs to notarize behavior records, it can send a notarization request to the AI Agent behavior notarization system through a unified REST interface.
[0032] Alternatively, the evidence request can be an HTTP (Hypertext Transfer Protocol) request.
[0033] The evidence storage request includes the target intelligent agent's behavior records, the caller's preferred ledger identification information, the caller's identity credentials, and the caller's evidence storage billing method. The evidence storage billing method includes the caller's ledger subscription tier, the caller's subscription deduction method, the caller's own signature account, and the service provider's payment method.
[0034] Optionally, the evidence storage request includes the content field, chain field, apiKey field, and paymentMode field.
[0035] Optionally, the content field is used to record the behavior records of the target intelligent agent to be certified. The behavior records recorded in this field can be unencrypted plaintext behavior records or cryptographic digests of encrypted behavior records.
[0036] Optionally, in a multi-ledger environment, the caller may subscribe to one or more distributed ledgers of its preference. Different distributed ledgers have their corresponding ledger identifiers, and the `chain` field can be used to record all ledger identifier information preferred by the caller. The AI Agent behavior evidence storage system can make ledger decisions for the caller based on this ledger identifier information. The `chain` field is an optional field, meaning that the ledger identifier information preferred by the caller recorded in this field can be a missing value (represented by "auto") or a non-missing value. If the field is a non-missing value, it means that the field records valid ledger identifier information, and the caller has a ledger preference in the ledger decision. If the field is a missing value, it means that the field does not record valid ledger identifier information, and the caller does not have a ledger preference in the ledger decision.
[0037] Optionally, the apiKey field is used to record the caller's identity credentials.
[0038] Optionally, the paymentMode field is used to record the billing method for the caller's evidence storage.
[0039] Furthermore, the unified API gateway module of the AI Agent behavior evidence storage system can receive and respond to the caller's evidence storage request, read the caller's preferred ledger identification information and evidence storage billing method from the evidence storage request, and construct a candidate ledger set for the caller based on the caller's preferred ledger identification information and evidence storage billing method.
[0040] The candidate ledger set includes at least two candidate distributed ledgers.
[0041] Optionally, such as Figure 2 As shown, different distributed ledgers are configured on the public blockchain network. These distributed ledgers can be divided into EVM (Ethereum Virtual Machine) distributed ledgers and non-EVM distributed ledgers. The candidate distributed ledgers in the candidate ledger set can include both EVM and non-EVM distributed ledgers to support ledger calls across virtual machines.
[0042] Alternatively, EVM-based distributed ledgers include, but are not limited to, Polygon, Base, BSC, and Ethereum.
[0043] Alternatively, non-EVM-based distributed ledgers include, but are not limited to, Solana, Polkadot, Aptos, Sui, Algorand, and Cosmos.
[0044] Preferably, the candidate distributed ledgers in the candidate ledger set include at least one EVM-based distributed ledger and one non-EVM-based distributed ledger.
[0045] S120: Based on the multi-factor ledger decision algorithm, determine the comprehensive score corresponding to each candidate distributed ledger.
[0046] Specifically, after determining the candidate ledger set for the caller, the multi-ledger decision engine module can use a multi-factor ledger decision algorithm to calculate the corresponding comprehensive score for each candidate distributed ledger in the candidate ledger set.
[0047] S130: Select the candidate distributed ledger with the highest comprehensive score as the target distributed ledger.
[0048] Specifically, after calculating the comprehensive score for each candidate distributed ledger, the multi-ledger decision engine module can select the candidate distributed ledger with the highest comprehensive score from all candidate distributed ledgers as the currently selected target distributed ledger.
[0049] S140: Record the behavior of the target intelligent agent, write it into the target distributed ledger, and generate the evidence storage result of the target intelligent agent.
[0050] Specifically, after determining the target distributed ledger, the cross-ledger adapter can call the ledger protocol corresponding to the target distributed ledger through the cross-virtual machine adaptation layer, and use the adapter corresponding to the target distributed ledger to write the behavior record of the target intelligent agent into the target distributed ledger, generating the evidence storage result of the target intelligent agent.
[0051] Optionally, if the target distributed ledger is an EVM-based distributed ledger, the cross-ledger adapter can write the target agent's behavior records into the target distributed ledger by calling the anchor function of the smart contract (i.e., the ledger protocol) across the virtual machine adaptation layer.
[0052] Optionally, if the target distributed ledger is a non-EVM-based distributed ledger, the cross-ledger adapter can call a pre-deployed program across the virtual machine adaptation layer to write the target agent's behavior records into the target distributed ledger.
[0053] Optionally, the cross-virtual machine adaptation layer can shield the differences between different distributed ledgers in terms of signature algorithms, address formats, transaction serialization, etc. Regardless of the type of the final selected target distributed ledger, the quota and receipt module of the AI Agent behavior evidence storage system can return a unified ledger call receipt to the caller.
[0054] Optionally, the signature algorithm used by EVM-based distributed ledgers is ECDSA, while the signature algorithm used by non-EVM-based distributed ledgers is EdDSA.
[0055] Optionally, the ledger call receipt includes the txHash field, blockNumber field, chain field, anchorHash field, and timestamp field.
[0056] Optionally, the txHash field is used to record the hash value of the transaction record of this evidence storage transaction on the target distributed ledger.
[0057] Optionally, the blockNumber field is used to record the storage block number of the transaction information of this evidence-based transaction on the target distributed ledger.
[0058] Optionally, the chain field is used to record the target distributed ledger selected for this evidence storage transaction.
[0059] Optionally, the anchorHash field is used to record the hash value of the record of this notarization behavior. This hash value can be the cryptographic hash value of the content field of the notarization request.
[0060] Optionally, the timestamp field is used to record the timestamp of this evidence storage transaction.
[0061] Alternatively, to configure a new distributed ledger on a public blockchain network, one only needs to add the corresponding adapter to the cross-ledger adapter and register the adapter to the multi-ledger decision engine module. This eliminates the need to modify the AIAgent behavior evidence storage system program or add new external interfaces, enabling rapid expansion of the distributed ledger.
[0062] For the caller, it only needs to send a single evidence storage request to complete the evidence storage of multiple ledger behavior records without needing to understand the specific differences between different distributed ledgers. This effectively reduces the caller's ledger decision-making cost and is suitable for machine-level automatic invocation.
[0063] The agent behavior evidence preservation method provided in this embodiment, after receiving the evidence preservation request from the caller, determines the caller's candidate ledger set based on the request. The candidate ledger set includes at least two candidate distributed ledgers. Then, a multi-factor ledger decision algorithm is used to calculate the comprehensive score corresponding to each candidate distributed ledger, and the candidate distributed ledger with the highest comprehensive score is selected as the target distributed ledger. Finally, the behavior record of the target agent is written into the target distributed ledger to generate the evidence preservation result of the target agent. This evidence preservation method does not require the caller to collect information from different distributed ledgers for ledger decision-making, which can effectively reduce the caller's ledger decision-making cost and facilitate the rapid selection of the optimal target distributed ledger, thus achieving reasonable decision-making of the distributed ledger.
[0064] In some embodiments, the comprehensive score corresponding to a candidate distributed ledger is determined by a multi-factor ledger decision algorithm based on the following steps: determining the first, second, third, fourth, and fifth scoring factors of the candidate distributed ledger at the current time; performing a weighted aggregation operation based on the first scoring factor and its corresponding first weight, the second scoring factor and its corresponding second weight, the third scoring factor and its corresponding third weight, the fourth scoring factor and its corresponding fourth weight, and the fifth scoring factor and its corresponding fifth weight to generate the comprehensive score corresponding to the candidate distributed ledger; wherein, the first scoring factor is the ledger health score of the candidate distributed ledger, the second scoring factor is the normalized reciprocal of the transaction cost of the caller on the candidate distributed ledger, the third scoring factor is the normalized reciprocal of the ratio between the delay of the most recent block production of the candidate distributed ledger and the average confirmation time of the candidate distributed ledger, the fourth scoring factor is the remaining quota ratio of the caller on the candidate distributed ledger, and the fifth scoring factor is the failure penalty score of the candidate distributed ledger within the most recent time window.
[0065] For each candidate distributed ledger in the candidate ledger set, the multi-ledger decision engine module can use a multi-factor ledger decision algorithm to calculate the corresponding comprehensive score for that candidate distributed ledger.
[0066] Specifically, suppose the candidate ledger set is denoted as , Represents the candidate ledger set The first in A candidate distributed ledger.
[0067] For candidate distributed ledgers The multi-ledger decision engine module can calculate the candidate distributed ledger according to the following formula. At the present moment Corresponding overall score : ; in, For candidate distributed ledgers At the present moment The first scoring factor is the candidate distributed ledger. The health score of the ledger; For candidate distributed ledgers At the present moment The second scoring factor is the caller's ranking in the candidate distributed ledger. The normalized inverse of the transaction cost on the candidate distributed ledger. The lower the transaction costs, the higher this value. For candidate distributed ledgers At the present moment The third scoring factor, the third scoring factor is the candidate distributed ledger The delay of the most recent block production and candidate distributed ledgers The normalized reciprocal of the ratio between the average confirmation times, i.e., the third scoring factor is the normalized reciprocal of the confirmation delay; For candidate distributed ledgers At the present moment The fourth scoring factor is the caller's evaluation of the candidate distributed ledger. The remaining quota percentage; For candidate distributed ledgers At the present moment The fifth scoring factor, the fifth scoring factor is the candidate distributed ledger Penalty points for failures within the most recent time window; , , , and They are the first weight, the second weight, the third weight, the fourth weight, and the fifth weight, respectively.
[0068] Optionally, the first rating factor Its value can be determined based on candidate distributed ledgers. The sum of the success rate of the most recent N (N is a positive integer) heartbeat calls and the block update frequency is determined. After calculating the sum of the heartbeat call success rate and the block update frequency, it can be normalized to... Within the range.
[0069] Optionally, the fifth rating factor The value can be determined based on the candidate distributed ledger. The number of timeouts or candidate distributed ledgers The number of reverts is calculated; if a candidate distributed ledger experiences a timeout or rollback during the evidence storage process, the corresponding timeout or rollback count is accumulated, causing the failure penalty score to increase; if there are no failures, the fifth scoring factor decreases exponentially. This design ensures that candidate distributed ledgers that fail consecutively in a short period are downgraded in the comprehensive score calculation, while the fifth scoring factor of candidate distributed ledgers that have not failed for a long period can gradually recover.
[0070] Optionally, the audit and observability module can record the specific values of all scoring factors for each candidate distributed ledger and the final target distributed ledger, and publish them on the corresponding system page for later query or traceability.
[0071] Optionally, the caller's ledger subscription tiers, from lowest to highest, include Tier 1 (Free), Tier 2 (Pro), Tier 3 (Business), and Tier 4 (Enterprise). The higher the ledger subscription tier, the higher the quota ratio the caller has on candidate distributed ledgers, and the more candidate distributed ledgers the caller can choose from. The first weight... Second weight Third weight Fourth weight and the fifth weight It can be dynamically adjusted based on the subscription tier of the caller's ledger.
[0072] For example, callers subscribing to the fourth tier of the ledger typically prioritize the average confirmation time of candidate distributed ledgers, hence the third weight. It can be appropriately increased; callers with the first tier of ledger subscriptions typically prioritize transaction costs, therefore the second weighting is appropriate. This can be appropriately increased. This design allows callers with different ledger subscription tiers to still obtain different target distributed ledger choices even with the same set of candidate ledgers and the same scoring factor value, thus improving the diversity of distributed ledger selection.
[0073] The agent behavior evidence preservation method provided in this embodiment takes into account various factors such as the caller's transaction cost on the candidate distributed ledger, the latency and average confirmation time of the candidate distributed ledger, and the ledger health score in the comprehensive evaluation of the candidate distributed ledger, which is conducive to quickly screening out the target distributed ledger with the optimal evidence preservation cost.
[0074] In some embodiments, the evidence storage request carries the target agent's behavior record, the caller's preferred ledger identifier information, the caller's identity credentials, and the caller's evidence storage billing method, which includes the caller's ledger subscription tier. In response to the caller's evidence storage request, determining the caller's candidate ledger set includes: performing a comparison authentication based on the identity credentials to generate the caller's identity authentication result; if the identity authentication result is successful, determining the caller's remaining evidence storage quota under the ledger subscription tier; and if the remaining evidence storage quota is sufficient, determining the caller's candidate ledger set based on the caller's preferred ledger identifier information.
[0075] In this embodiment, the evidence storage request carries the target intelligent agent's behavior record, the caller's preferred ledger identification information, the caller's identity credentials, and the caller's evidence storage billing method. The evidence storage billing method includes the caller's ledger subscription tier, the caller's subscription deduction method, the caller's own signature account, and the service provider's payment method.
[0076] Optionally, the evidence storage request includes the content field, chain field, apiKey field, and paymentMode field.
[0077] Optionally, the content field is used to record the behavior records of the target intelligent agent to be certified. The behavior records recorded in this field can be unencrypted plaintext behavior records or cryptographic digests of encrypted behavior records.
[0078] Optionally, in a multi-ledger environment, the caller may subscribe to one or more distributed ledgers of its preference. Different distributed ledgers have their corresponding ledger identifiers, and the `chain` field can be used to record all ledger identifier information preferred by the caller. The AI Agent behavior evidence storage system can make ledger decisions for the caller based on this ledger identifier information. The `chain` field is an optional field, meaning that the ledger identifier information preferred by the caller recorded in this field can be a missing value (represented by "auto") or a non-missing value. If the field is a non-missing value, it means that the field records valid ledger identifier information, and the caller has a ledger preference in the ledger decision. If the field is a missing value, it means that the field does not record valid ledger identifier information, and the caller does not have a ledger preference in the ledger decision.
[0079] Optionally, the apiKey field is used to record the caller's identity credentials.
[0080] Optionally, the paymentMode field is used to record the billing method for the caller's evidence storage.
[0081] Specifically, such as Figure 3As shown, the unified API gateway module of the AI Agent behavior evidence storage system can receive and respond to the caller's evidence storage request, read the caller's identity credentials from the evidence storage request, perform a hash operation on the read identity credentials to obtain a hash value, and then compare the hash value with the pre-stored hash value of the caller's identity credentials to generate the caller's identity authentication result.
[0082] Optionally, the hash operation can use the SHA-256 hash algorithm.
[0083] Furthermore, if the identity authentication result is successful, the unified API gateway module can read the caller's ledger subscription level from the evidence storage request.
[0084] The ledger subscription tiers for the caller, from lowest to highest, include the first tier (Free), the second tier (Pro), the third tier (Business), and the fourth tier (Enterprise). The higher the ledger subscription tier, the higher the quota ratio of the caller on the candidate distributed ledgers, and the more candidate distributed ledgers the caller can choose from.
[0085] Furthermore, data is queried based on the caller's ledger subscription tier to determine the caller's remaining evidence storage quota under the current ledger subscription tier.
[0086] Among them, the remaining evidence storage quota refers to the quota count of each candidate distributed ledger that the caller can choose under the current ledger subscription tier.
[0087] Furthermore, it is determined whether the caller has sufficient remaining evidence storage quota under the current ledger subscription tier.
[0088] If the caller has sufficient remaining evidence storage quota under the current ledger subscription tier, the unified API gateway module can read the ledger identifier information preferred by the caller from the evidence storage request, and construct a candidate ledger set for the caller based on the ledger identifier information preferred by the caller.
[0089] If the authentication result is authentication failure, or the caller has insufficient remaining evidence storage quota under the current ledger subscription level, the corresponding error code will be returned to the caller, informing the caller of the reason for the evidence storage failure.
[0090] In some embodiments, determining a candidate ledger set for the caller based on the ledger identifier information preferred by the caller includes: if the ledger identifier information preferred by the caller is a missing value, then determining a candidate ledger set for the caller based on the ledger subscription tier; if the ledger identifier information preferred by the caller is not a missing value, then determining the caller's preferred distributed ledger based on the ledger identifier information, and constructing a candidate ledger set for the caller based on the preferred distributed ledger.
[0091] Specifically, such as Figure 3 As shown, if the identity authentication result is successful and the caller has sufficient remaining evidence storage quota under the current ledger subscription tier, the unified API gateway module can read the ledger identification information preferred by the caller from the evidence storage request.
[0092] Furthermore, it is determined whether the ledger identification information preferred by the caller is a missing value, that is, whether the chain field in the evidence storage request is "auto".
[0093] If the ledger identifier information preferred by the caller is missing, i.e. the chain field in the evidence request is "auto", then several candidate distributed ledgers are selected directly from the public chain network according to the caller's ledger subscription tier to construct a candidate ledger set.
[0094] If the ledger identifier information preferred by the caller is not a missing value, that is, the chain field in the evidence request is not "auto", then the caller's preferred distributed ledger is determined based on the ledger identifier information preferred by the caller, and it is determined whether the caller's preferred distributed ledger is within the set of distributed ledgers available for the current ledger subscription tier.
[0095] If the caller's preferred distributed ledger is within the set of distributed ledgers available for the current ledger subscription tier, then a candidate ledger set is constructed based on the caller's preferred distributed ledger.
[0096] The intelligent agent behavior evidence storage method provided in this embodiment prioritizes the use of the distributed ledger preferred by the caller to construct a candidate ledger set, which can adapt to the preference requirements of different callers.
[0097] In some embodiments, after recording the behavior of the target intelligent agent and writing it into the target distributed ledger to generate the evidence storage result of the target intelligent agent, the method further includes: generating a comprehensive scoring decision log of the candidate ledger set; writing the comprehensive scoring decision log and the evidence storage result into an audit table; and returning evidence storage success information to the caller.
[0098] Specifically, after selecting the target distributed ledger for the first time, writing the target agent's behavior records into the target distributed ledger, and generating the evidence storage result of the target agent, it is necessary to further determine whether the evidence storage was successful.
[0099] If the evidence storage result is successful, the quota and receipt module can atomically deduct the caller's quota count on the target distributed ledger from the caller's remaining evidence storage quota.
[0100] Furthermore, a comprehensive scoring decision log for the candidate ledger set during this evidence preservation process is generated. The comprehensive scoring decision log and the evidence preservation result of this process are written into the audit table for post-event traceability, and evidence preservation success information is returned to the caller.
[0101] Optionally, the successful notarization information can be an "anchor.created" event notification triggered asynchronously immediately after successful notarization, or an "anchor.confirmed" event notification triggered asynchronously after the number of notarization transactions in the target distributed ledger reaches a preset number of confirmations.
[0102] In some embodiments, after recording the behavior of the target agent in the target distributed ledger and generating the evidence storage result of the target agent, the method further includes: if the evidence storage result is a failure, accumulating the failure count of the target distributed ledger and updating the fifth scoring factor corresponding to the target distributed ledger based on the failure count; repeatedly executing preset iteration steps to update the evidence storage result until the number of iterations reaches the preset number or the evidence storage result is updated to a successful evidence storage result; the iteration steps include: selecting a candidate distributed ledger with a comprehensive score second only to the target distributed ledger from the candidate ledger set and replacing it with the target distributed ledger; rewriting the behavior record of the target agent into the target distributed ledger and updating the evidence storage result of the target agent.
[0103] Specifically, such as Figure 4 As shown, after selecting the target distributed ledger for the first time, writing the behavior records of the target intelligent agent into the target distributed ledger, and generating the evidence storage result of the target intelligent agent, it is necessary to further determine whether the evidence storage was successful.
[0104] If the evidence storage result is a failure, the failover manager can accumulate the failure count of the target distributed ledger and update the fifth scoring factor corresponding to the target distributed ledger based on the accumulated failure count, which is used for the comprehensive scoring calculation of the subsequent evidence storage process.
[0105] Meanwhile, the cumulative iteration count (i.e., the number of evidence storages) will be used. If the cumulative iteration count does not reach the preset number, the failover manager will select the candidate distributed ledger with the second-highest comprehensive score from the candidate ledger set and replace it with the new target distributed ledger.
[0106] Optionally, the preset number of attempts can be 2.
[0107] Further, return to the step of writing the target agent's behavior record into the target distributed ledger and generating the target agent's evidence storage result, until the number of iterations reaches the preset number or the evidence storage result is updated to evidence storage success.
[0108] In some embodiments, the method further includes: if the number of iterations reaches a preset number and the evidence storage result is evidence storage failure, then returning evidence storage failure information to the caller.
[0109] Specifically, if the number of iterations reaches the preset number and the evidence storage result is evidence storage failure, then evidence storage failure information is returned to the caller; at the same time, the evidence storage result of this time is written into the audit table for later traceability.
[0110] Among them, the evidence storage failure information is the corresponding standard error code.
[0111] The agent behavior evidence storage method provided in this embodiment can automatically perform failover when evidence storage fails, and reselect a new target distributed ledger for evidence storage, thereby automating the evidence storage process and meeting the high-frequency evidence storage needs of agents in unattended scenarios. At the same time, the evidence storage failure information and ledger decision process are completely transparent to the caller, and each decision process can be queried, which can adapt to the real-world needs of recording agent behavior in strongly compliant scenarios.
[0112] To facilitate understanding, some application examples of intelligent agent behavior evidence storage methods are provided here for reference.
[0113] Specifically, in the ledger decision-making scenario pursuing optimal notarization costs, assuming the caller is a target agent with a ledger subscription tier of 2 (denoted as Pro), and a monthly notarization quota of 1000 transactions, with 350 transactions already used this month, leaving a remaining quota of 650 transactions, the candidate ledger set for this notarization includes three candidate distributed ledgers: Polygon, Base, and BSC. Polygon has a first scoring factor of 0.98, a second scoring factor of 0.92 (meaning extremely low transaction costs), a third scoring factor of 0.85, a fourth scoring factor of 0.65, and a fifth scoring factor of 0.00; Base has a first scoring factor of 0.99, a second scoring factor of 0.78, a third scoring factor of 0.95, a fourth scoring factor of 0.65, and a fifth scoring factor of 0.00. The first scoring factor of BSC is 0.02; the second scoring factor is 0.97, the third scoring factor is 0.95, the fourth scoring factor is 0.80, the fifth scoring factor is 0.65, and the fifth scoring factor is 0.01; the first weight, second weight, third weight, fourth weight, and fifth weight are 0.20, 0.35, 0.20, 0.15, and 0.10, respectively; the final calculated comprehensive score of Polygon is 0.7855, the comprehensive score of Base is 0.7565, and the comprehensive score of BSC is 0.783. Since Polygon has the highest comprehensive score, it indicates that Polygon has lower transaction costs and balanced performance in terms of health, confirmation delay, and other factors. Therefore, Polygon with the highest comprehensive score can be selected as the target distributed ledger, and a ledger call receipt is returned.
[0114] In a failover scenario, assuming the caller is the target agent with a ledger subscription tier of 3 (denoted as Business), the candidate ledger set for this notarization includes two candidate distributed ledgers: Polygon and Base. If Polygon (with a comprehensive score of 0.84) is selected as the target distributed ledger initially, and its fifth weight is 0.1, but Polygon times out during notarization (e.g., exceeding 5 seconds), its corresponding fifth weight factor will increase from 0.10 to 0.20, causing its comprehensive score to drop to 0.83. Simultaneously, Base will be selected as the new target distributed ledger, and a ledger call receipt will be returned. For the caller, only one successful response will be seen during the notarization process, and the failure transfer will not be apparent. However, the audit table will record two call logs for the target distributed ledger for later traceability or querying.
[0115] In a ledger decision-making scenario influenced by ledger subscription tiers, assuming there are three callers for the same action record containing 1KB of information: the first caller is an agent with a ledger subscription tier of 1 (denoted as Free), a monthly evidence storage quota of 200 times, and a candidate ledger set containing only two test ledgers; the second caller is an agent with a ledger subscription tier of 2 (denoted as Pro), and a candidate ledger set including four candidate distributed ledgers: test ledger, Polygon, Base, and BSC; the third caller is an agent with a ledger subscription tier of 4. The agent (denoted as Enterprise) has a candidate ledger set including four candidate distributed ledgers: test ledger, Polygon, Base, and BSC. However, its third weight is adjusted to 0.40 (indicating that the caller pays more attention to the confirmation delay time of the ledger), and it usually prefers to select Base (because Base has the shortest proof time) as the target distributed ledger. Due to the influence of the ledger subscription tier, the candidate ledger sets of the three callers are different and the weights are not completely consistent. Therefore, the system will generate different optimal solutions for the three callers under the corresponding ledger subscription tier.
[0116] This invention also provides a device for storing evidence of intelligent agent behavior. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of the intelligent agent behavior evidence storage device provided by the present invention. In this embodiment, the intelligent agent behavior evidence storage device includes a candidate ledger set construction module 510, a multi-factor scoring module 520, a ledger filtering module 530, and a behavior evidence storage module 540.
[0117] The candidate ledger set construction module 510 is used to determine the candidate ledger set of the caller in response to the caller's evidence storage request.
[0118] The caller is the target intelligent agent or the operation service corresponding to the target intelligent agent, and the candidate ledger set includes at least two candidate distributed ledgers.
[0119] The multi-factor scoring module 520 is used to determine the comprehensive score corresponding to each candidate distributed ledger based on the multi-factor ledger decision algorithm.
[0120] Ledger filtering module 530 is used to select the candidate distributed ledger with the highest comprehensive score as the target distributed ledger.
[0121] The behavior evidence storage module 540 is used to record the behavior of the target intelligent agent, write it into the target distributed ledger, and generate the evidence storage result of the target intelligent agent.
[0122] In some embodiments, the comprehensive score corresponding to a candidate distributed ledger is determined by a multi-factor ledger decision algorithm based on the following steps: determining the first, second, third, fourth, and fifth scoring factors of the candidate distributed ledger at the current time; performing a weighted aggregation operation based on the first scoring factor and its corresponding first weight, the second scoring factor and its corresponding second weight, the third scoring factor and its corresponding third weight, the fourth scoring factor and its corresponding fourth weight, and the fifth scoring factor and its corresponding fifth weight to generate the comprehensive score corresponding to the candidate distributed ledger; wherein, the first scoring factor is the ledger health score of the candidate distributed ledger, the second scoring factor is the normalized reciprocal of the transaction cost of the caller on the candidate distributed ledger, the third scoring factor is the normalized reciprocal of the ratio between the delay of the most recent block production of the candidate distributed ledger and the average confirmation time of the candidate distributed ledger, the fourth scoring factor is the remaining quota ratio of the caller on the candidate distributed ledger, and the fifth scoring factor is the failure penalty score of the candidate distributed ledger within the most recent time window.
[0123] In some embodiments, the evidence storage request carries the target agent's behavior record, the caller's preferred ledger identifier information, the caller's identity credentials, and the caller's evidence storage billing method, which includes the caller's ledger subscription tier. In response to the caller's evidence storage request, determining the caller's candidate ledger set includes: performing a comparison authentication based on the identity credentials to generate the caller's identity authentication result; if the identity authentication result is successful, determining the caller's remaining evidence storage quota under the ledger subscription tier; and if the remaining evidence storage quota is sufficient, determining the caller's candidate ledger set based on the caller's preferred ledger identifier information.
[0124] In some embodiments, determining a candidate ledger set for the caller based on the ledger identifier information preferred by the caller includes: if the ledger identifier information preferred by the caller is a missing value, then determining a candidate ledger set for the caller based on the ledger subscription tier; if the ledger identifier information preferred by the caller is not a missing value, then determining the caller's preferred distributed ledger based on the ledger identifier information, and constructing a candidate ledger set for the caller based on the preferred distributed ledger.
[0125] In some embodiments, after recording the behavior of the target intelligent agent and writing it into the target distributed ledger to generate the evidence storage result of the target intelligent agent, the method further includes: generating a comprehensive scoring decision log of the candidate ledger set; writing the comprehensive scoring decision log and the evidence storage result into an audit table; and returning evidence storage success information to the caller.
[0126] In some embodiments, after recording the behavior of the target agent in the target distributed ledger and generating the evidence storage result of the target agent, the method further includes: if the evidence storage result is a failure, accumulating the failure count of the target distributed ledger and updating the fifth scoring factor corresponding to the target distributed ledger based on the failure count; repeatedly executing preset iteration steps to update the evidence storage result until the number of iterations reaches the preset number or the evidence storage result is updated to a successful evidence storage result; the iteration steps include: selecting a candidate distributed ledger with a comprehensive score second only to the target distributed ledger from the candidate ledger set and replacing it with the target distributed ledger; rewriting the behavior record of the target agent into the target distributed ledger and updating the evidence storage result of the target agent.
[0127] In some embodiments, the method further includes: if the number of iterations reaches a preset number and the evidence storage result is evidence storage failure, then returning evidence storage failure information to the caller.
[0128] The present invention also provides an electronic device. Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 6 As shown, the electronic device may include a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a method for storing evidence of intelligent agent behavior.
[0129] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0130] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the agent behavior evidence storage method provided by the above methods.
[0131] The present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the intelligent agent behavior evidence storage method provided by the above methods.
[0132] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0133] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for storing evidence of intelligent agent behavior, characterized in that, include: In response to the caller's request for evidence preservation, determine the caller's candidate ledger set; The caller is the target intelligent agent or the operation service corresponding to the target intelligent agent, and the candidate ledger set includes at least two candidate distributed ledgers; Based on the multi-factor ledger decision algorithm, the comprehensive score corresponding to each candidate distributed ledger is determined respectively; The candidate distributed ledger with the highest comprehensive score is selected as the target distributed ledger. The behavior records of the target intelligent agent are written into the target distributed ledger to generate the evidence storage result of the target intelligent agent.
2. The method for storing evidence of intelligent agent behavior according to claim 1, characterized in that, The comprehensive score corresponding to a candidate distributed ledger is determined by the multi-factor ledger decision algorithm based on the following steps: Determine the first, second, third, fourth, and fifth scoring factors of the candidate distributed ledger at the current time. Based on the first scoring factor and its corresponding first weight, the second scoring factor and its corresponding second weight, the third scoring factor and its corresponding third weight, the fourth scoring factor and its corresponding fourth weight, and the fifth scoring factor and its corresponding fifth weight, a weighted aggregation operation is performed to generate the comprehensive score corresponding to the candidate distributed ledger. Wherein, the first scoring factor is the ledger health score of the candidate distributed ledger, the second scoring factor is the normalized reciprocal of the transaction cost of the caller on the candidate distributed ledger, the third scoring factor is the normalized reciprocal of the ratio between the delay of the most recent block production of the candidate distributed ledger and the average confirmation time of the candidate distributed ledger, the fourth scoring factor is the remaining quota ratio of the caller on the candidate distributed ledger, and the fifth scoring factor is the failure penalty score of the candidate distributed ledger within the most recent time window.
3. The method for storing evidence of intelligent agent behavior according to claim 1, characterized in that, The evidence storage request carries the target intelligent agent's behavior record, the caller's preferred ledger identification information, the caller's identity credentials, and the caller's evidence storage billing method, which includes the caller's ledger subscription tier. The step of determining the caller's candidate ledger set in response to the caller's evidence storage request includes: In response to the caller's request for evidence storage, a comparison and authentication is performed based on the identity credentials to generate the caller's identity authentication result; If the identity authentication result is successful, determine the remaining evidence storage quota of the caller under the ledger subscription tier; If the remaining evidence storage quota is sufficient, the candidate ledger set of the caller is determined based on the ledger identification information preferred by the caller.
4. The method for storing evidence of intelligent agent behavior according to claim 3, characterized in that, The step of determining the candidate ledger set for the caller based on the ledger identifier information preferred by the caller includes: If the ledger identifier information preferred by the caller is a missing value, then the candidate ledger set of the caller is determined based on the ledger subscription tier. If the ledger identifier information preferred by the caller is not a missing value, then based on the ledger identifier information, the caller's preferred distributed ledger is determined, and based on the preferred distributed ledger, the caller's candidate ledger set is constructed.
5. The method for storing evidence of intelligent agent behavior according to claim 1, characterized in that, After recording the behavior of the target intelligent agent in the target distributed ledger and generating the evidence storage result of the target intelligent agent, the method further includes: Generate a comprehensive scoring decision log for the candidate ledger set; The comprehensive scoring decision log and the evidence storage result are written into the audit table, and evidence storage success information is returned to the caller.
6. The method for storing evidence of intelligent agent behavior according to claim 2, characterized in that, After recording the behavior of the target intelligent agent in the target distributed ledger and generating the evidence storage result of the target intelligent agent, the method further includes: If the evidence storage result is a failure, then the failure count of the target distributed ledger is accumulated, and the fifth scoring factor corresponding to the target distributed ledger is updated based on the failure count. Repeat the preset iterative steps to update the evidence storage result until the preset number of iterations is reached or the evidence storage result is updated to show that the evidence storage was successful. The iterative steps include: The candidate distributed ledger with the second-highest comprehensive score after the target distributed ledger is selected from the candidate ledger set and replaced with the target distributed ledger; The behavior record of the target intelligent agent is rewritten into the target distributed ledger, and the evidence storage result of the target intelligent agent is updated.
7. The method for storing evidence of intelligent agent behavior according to claim 6, characterized in that, Also includes: If the number of iterations reaches the preset number and the evidence storage result is evidence storage failure, then evidence storage failure information is returned to the caller.
8. A device for storing evidence of intelligent agent behavior, characterized in that, include: A candidate ledger set construction module is used to determine the candidate ledger set of the caller in response to the caller's evidence storage request; The caller is the target intelligent agent or the operation service corresponding to the target intelligent agent, and the candidate ledger set includes at least two candidate distributed ledgers; The multi-factor scoring module is used to determine the comprehensive score for each of the candidate distributed ledgers based on the multi-factor ledger decision algorithm. The ledger filtering module is used to select the candidate distributed ledger with the highest comprehensive score as the target distributed ledger; The behavior evidence storage module is used to record the behavior of the target intelligent agent, write it into the target distributed ledger, and generate the evidence storage result of the target intelligent agent.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the intelligent agent behavior evidence storage method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the agent behavior evidence storage method as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the agent behavior evidence storage method as described in any one of claims 1 to 7.
