Multi-chain public chain address label collection method based on dynamic adaptive flow limiting

By adopting a dynamic adaptive rate-limiting method for collecting public blockchain address tags, the problem of rate limiting and blocking in public blockchain address tag collection is solved. This method achieves efficient and stable collection and storage of active address tag information, adapts to the heterogeneity of different public blockchains, and reduces development and operation costs.

CN123185152APending Publication Date: 2026-11-27HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610969882.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing methods for collecting public blockchain address tags are prone to triggering rate limiting and blocking when calling third-party intelligence platform API interfaces, causing the request rate to exceed the threshold and making it impossible to continuously and efficiently collect active addresses and their tag information.

Method used

A dynamic adaptive rate-limiting multi-chain public blockchain address tag collection method is adopted. By calling the corresponding address collection adapter, active addresses are extracted from the public blockchain block data. The external intelligence interface is called to query tag information at a dynamically adjusted request rate. The asymmetric rate adjustment method is used to converge the request rate to below the rate-limiting threshold. Shared global delay variables and CAS spin operations ensure request stability.

Benefits of technology

Without triggering rate limiting or blocking, it maximizes request throughput, achieves efficient collection and storage of active address tag information, adapts to the heterogeneity of different public chains, reduces development and operation and maintenance costs, and supports various business scenarios such as historical backtracking, real-time monitoring, and batch supplementary queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185152A_ABST
    Figure CN123185152A_ABST
Patent Text Reader

Abstract

The application relates to a multi-chain public chain address label collection method based on dynamic adaptive flow limiting, which comprises the following steps: according to the type of a current public chain to be collected, calling a corresponding address collection adapter to extract active addresses from block data of the public chain to be collected; acquiring the active addresses, calling an external intelligence interface to query label information of the active addresses at a dynamically adjusted request rate; wherein, in the calling process, the request rate is adjusted in an asymmetric rate adjustment mode according to response feedback returned by the external intelligence interface, so that the request rate converges below a flow limiting threshold of the external intelligence interface; and the label information obtained through the query is stored. Through the application, the request rate can dynamically adapt to the flow limiting strategy of the interface, and the request throughput is maximized under the premise of ensuring that flow limiting and banning are not triggered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a method for collecting multi-chain public blockchain address tags based on dynamic adaptive rate limiting. Background Technology

[0002] In applications such as blockchain data analysis, on-chain tracking, and on-chain financial risk control, obtaining active public blockchain addresses and their corresponding tag information (including the name of the entity to which the address belongs, entity type, and tag category) is a fundamental prerequisite. Currently, the number of active addresses generated daily by various mainstream public blockchains reaches millions. In actual business operations, it is necessary to continuously collect these active addresses and obtain their corresponding tag information, ultimately forming an address tag database covering hundreds of millions of addresses and encompassing dozens of tag types.

[0003] Current address tag collection solutions generally utilize third-party intelligence platforms (such as Arkham Intelligence) to obtain tag information of active addresses. However, the API interfaces of third-party intelligence platforms generally have undisclosed rate limits. When the request rate exceeds the threshold, the interface will return a rate-limiting status code or even temporarily block the request source.

[0004] Therefore, how to design a data collection method that can adaptively adjust the request rate of calling external interfaces has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] In view of this, this application provides a method for collecting address tags of multi-chain public chains based on dynamic adaptive rate limiting, which can adaptively adjust the request rate of calling external interfaces to make it approach its rate limiting threshold.

[0006] Firstly, this embodiment provides a method for collecting multi-chain public chain address tags based on dynamic adaptive rate limiting, including:

[0007] Based on the type of public chain to be collected, active addresses are extracted from the block data of the public chain to be collected by calling the corresponding address collection adapter;

[0008] The active address is obtained, and the tag information of the active address is queried by calling an external intelligence interface at a dynamically adjusted request rate; wherein, during the call, the request rate is adjusted in an asymmetric rate adjustment manner according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface.

[0009] The retrieved tag information is stored.

[0010] Secondly, this embodiment provides a multi-chain public chain address tag collection device based on dynamic adaptive rate limiting, including:

[0011] The address extraction module is used to extract active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter, based on the type of the public chain to be collected.

[0012] The tag acquisition module is used to acquire the active address and call the external intelligence interface to query the tag information of the active address at a dynamically adjusted request rate; wherein, during the call, the request rate is adjusted in an asymmetric rate adjustment manner according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface.

[0013] The tag storage module is used to store the tag information obtained from the query.

[0014] Thirdly, this embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the multi-chain public chain address tag acquisition method based on dynamic adaptive rate limiting described in the first aspect above.

[0015] Compared with related technologies, the multi-chain public chain address tag collection method based on dynamic adaptive rate limiting provided in this embodiment extracts active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter according to the type of the public chain to be collected; obtains the active addresses, and calls an external intelligence interface to query the tag information of the active addresses at a dynamically adjusted request rate; wherein, during the call, the request rate is adjusted in an asymmetric rate adjustment manner according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface; and stores the queried tag information; in this way, it is not necessary to obtain the external interface rate limiting threshold in advance, and the rate limiting strategy of the interface can be dynamically adapted, maximizing the request throughput while ensuring that rate limiting and blocking are not triggered.

[0016] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A flowchart of an embodiment of the multi-chain public blockchain address tag collection method based on dynamic adaptive rate limiting provided in this application;

[0019] Figure 2 Architecture diagram of the multi-chain public blockchain address tag collection system based on dynamic adaptive rate limiting provided in this application;

[0020] Figure 3 A flowchart of Embodiment 2 of the Multi-Chain Public Chain Address Tag Collection Method Based on Dynamic Adaptive Rate Limiting provided in this application;

[0021] Figure 4 A flowchart of Embodiment 3 of the Multi-Chain Public Chain Address Tag Collection Method Based on Dynamic Adaptive Rate Limiting provided in this application;

[0022] Figure 5 A hardware structure diagram of the computer device containing the multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting provided in this application;

[0023] Figure 6 The structural block diagram of the multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting provided in this application. Detailed Implementation

[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0025] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0026] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0027] The following specific embodiments are given to illustrate the technical solution of this application in detail.

[0028] Figure 1 This is a flowchart of an embodiment of the multi-chain public blockchain address tag collection method based on dynamic adaptive rate limiting provided in this application. (Refer to...) Figure 1 The method provided in this embodiment may include:

[0029] Step S101: Based on the type of public chain to be collected, extract active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter.

[0030] Before introducing the multi-chain public blockchain address tag collection method based on dynamic adaptive rate limiting provided in this application, a brief introduction to the application scenarios of this application will be given first. Specifically, Figure 2 This is an architecture diagram of the multi-chain public blockchain address tag collection system based on dynamic adaptive rate limiting provided in this application. (Refer to...) Figure 2 The system comprises: a multi-chain address acquisition layer, an active address pool management layer, a tag acquisition layer, a data storage layer, and a scheduling and monitoring layer. Implemented in Go, the system utilizes lightweight goroutines for high concurrency, communicates between goroutines via channels, and uses atomic operations (using the `atomic` package) to ensure thread safety during rate-limited operation. The five layers interact through clearly defined interface protocols, enabling scalable address acquisition across chains, adaptive rate-controlled tag querying, incremental persistent storage, and end-to-end operational monitoring.

[0031] The multi-chain address acquisition layer is deployed on the RPC (Remote Procedure Call) node connections of each public chain, responsible for extracting active addresses from the block data of each chain. This layer adopts an adapter pattern design, implementing an independent address acquisition adapter for each chain, with all adapters adhering to a unified interface specification. This interface includes at least the following methods: connecting to the RPC node, obtaining the latest block number, obtaining specified block data, extracting the address list from the block data, obtaining the polling interval for the chain, and returning the chain identifier. For each type of public chain, adapters for different types of digital resources are provided. After each adapter independently completes address extraction, it submits the address list (with chain identifier) ​​to the active address pool management layer.

[0032] The active address pool management layer is implemented using a relational database (MySQL) and maintains an active address table (active_addresses). The active address table stores active addresses collected from each chain, along with their chain identifiers, entry times, and query status flags (checked_ark).

[0033] The tag acquisition layer is the core processing engine of the system, consisting of a worker pool composed of multiple goroutine concurrent data acquisition units (Workers). Each worker is responsible for retrieving the address to be queried (checked_ark=0) from the active address pool, calling the API interface (external intelligence interface) of the third-party intelligence platform (Arkham Intelligence) to obtain the tag information of that address, and writing the result into the address tag table. The tag acquisition layer uses a dynamic adaptive rate limiting engine to control the request rate, and all workers share a global delay variable of type atomic.Int64.

[0034] The Arkham Intelligence Platform's tag collection module, within the tag collection layer, is responsible for calling ArkhamIntelligence's RESTful API to obtain address tag information. The core technology of this module lies in reverse engineering the Arkham API request signature mechanism. The Arkham API employs a dual SHA-256 hash signature verification mechanism, requiring the client to include two custom header fields in the request header: X-Timestamp (current Unix timestamp) and X-Payload (signature value).

[0035] The signature generation algorithm is as follows: First, concatenate the Path part of the request URL (excluding the domain name and query parameters), the current Unix timestamp, and the client key (clientKey) into a string in the format "path:timestamp:clientKey". Perform a SHA-256 hash operation on this string to obtain the hexadecimal string hash1Hex of the first-level hash value. Second, concatenate the client key and hash1Hex into a new string in the format "clientKey:hash1Hex". Perform a second SHA-256 hash operation on this string to obtain the final signature value payload. Third, in the HTTP GET request, set the X-Timestamp header to the current Unix timestamp (string format) and the X-Payload header to the calculated payload value. Simultaneously, include standard browser spoofing request headers: Accept set to "application / json, text / plain, * / *", Origin set to "https: / / intel.arkm.com", Referer set to "https: / / intel.arkm.com / ", and User-Agent set to the standard Chrome browser identifier.

[0036] The API response is in JSON format and contains the following core fields: address (query address), chain (chain identifier), arkhamEntity (entity information object, containing fields such as name and type), arkhamLabel (label information object, containing a name field), and isUserAddress (a boolean flag indicating whether it is a personal address). When no matching label information is found for the address, the arkhamEntity and arkhamLabel fields are null. Upon receiving the response, the module parses and extracts the three fields: entity_name (from arkhamEntity.name), entity_type (from arkhamEntity.type), and label (from arkhamLabel.name), and writes them to the address label table.

[0037] The data storage layer is implemented using a MySQL database, supporting master-slave and read-write separation. An address label table (address_labels) is maintained, storing label information obtained from third-party intelligence platforms (external intelligence interfaces). Both the active address table and the address label table are configured with appropriate indexes (such as composite unique indexes and query status flag indexes like `checked_ark`) to ensure query performance with hundreds of millions of data entries. The database regularly performs index optimization and data archiving. The system also supports optional storage engine replacements, such as PostgreSQL or ClickHouse (improving analytical query performance through columnar storage and high compression ratios).

[0038] The scheduling and monitoring layer is the central coordination hub of the entire system, comprising the scheduler (ChainScheduler) and the monitor (Monitor). The scheduler is responsible for task scheduling and supports the following three operating modes:

[0039] Historical backtracking mode: Starting from a specified initial block number, it processes blocks sequentially up to the latest block, suitable for initial system deployment. The scheduler maintains a pointer to the currently processed block number, retrieves data for each block in turn, and submits it to the address retrieval adapter.

[0040] Batch query mode: Retrieves the address to be queried from the database in rounds (query status flag checked_ark=0), and retrieves a fixed number of addresses in each round. It waits for all data collection units to complete before entering the next round. It is suitable for centralized supplementary queries of historically unqueried addresses.

[0041] Real-time monitoring mode: The polling interval is configured according to the block production speed of each chain, continuously monitoring and processing new blocks. The scheduling strategy is as follows: the first type of adapter polls once every 600 seconds (about 10 minutes / block), the second type of adapter batches blocks every 30 seconds (about 3 seconds / block), and the third type of adapter is configured with 5-15 seconds depending on the chain.

[0042] The monitor uses Go's sync.Map and atomic.Int64 to implement lock-free statistics, providing real-time statistics on metrics such as the number of blocks processed, the number of addresses extracted, the number of new addresses added to the database, the number of successful API requests, the number of rate limiting attempts, and the current latency value for each chain. It also outputs statistical reports periodically (e.g., every 60 seconds) to help operations and maintenance personnel monitor the system's operating status.

[0043] The method provided in this application is described below. Specifically, the type of public blockchain to be collected (such as various digital resources) is first obtained. Each public blockchain pre-registers an address collection adapter. All adapters implement the same interface, but their internal logic is implemented based on the underlying data model of the blockchain.

[0044] The extracted active addresses, along with their associated chain identifiers (such as the identifiers of various digital resources), are output in a uniform format (e.g., address and chain identifier).

[0045] Optionally, as a possible embodiment, the above-mentioned extraction of active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter, based on the type of the public chain to be collected, may include:

[0046] When the public chain to be collected is a Type 1 public chain, the address collection adapter extracts active addresses from the public key field of the output script of the block transaction of the Type 1 public chain;

[0047] When the public chain to be collected is a second-type public chain, the address collection adapter extracts active addresses from the sender address field and / or receiver address field of the block transactions of the second-type public chain.

[0048] When the public chain to be collected is a third-type public chain, the address collection adapter first extracts the first-format address from the block transaction data of the third-type public chain, and then converts the first-format address into an active address in Base58 format.

[0049] Specifically, the address collection adapter includes adapters for various digital resources, and obtains the corresponding address collection adapter instance from the registry based on the identifier of the public chain to be collected.

[0050] The public blockchain to be collected is a Type 1 public blockchain using the UTXO (Unspent Transaction Output) model. The Type 1 adapter calls the RPC interface getblock to obtain the complete transaction data of the block; for each transaction, it iterates through its vout array; for each vout array, it extracts the address from the scriptPubKey.address field. This field may be a string or an array of strings (such as multi-signature); the extracted addresses are deduplicated and returned.

[0051] If the public chain to be collected is a second-type public chain that adopts the account model, the second-type adapter calls the eth_getBlockByNumber interface with the block number (hexadecimal) and true as parameters to obtain complete transaction details; iterates through the transactions array; extracts the from field of each transaction (which always exists); if the to field is not null, it also extracts the field; and returns the extracted addresses after removing duplicates.

[0052] If the public chain to be collected is a third-type public chain that adopts the account model and has an address in Base58Check format, the third-type adapter calls the / wallet / getblockbynum interface to obtain block data; iterates through the transactions array, and extracts the first format (hexadecimal format) address owner_address (sender) from raw_data.contract[0].parameter.value for each transaction; extracts the receiver according to the contract type: extract to_address for Transfer contract; extract contract_address for TriggerSmartContract contract; converts the extracted hexadecimal address to Base58Check format: removes the "41" prefix at the beginning, performs Base58 encoding, and adds the letter "T" at the beginning; returns the converted address after deduplication.

[0053] Optionally, the external intelligence interface of each adapter is defined as the ChainAdapter interface. Table 1 includes the core methods contained in the external intelligence interface, as well as the corresponding function descriptions, input parameters, and return values. As shown in Table 1, the core methods include: Connect(rpcURL) to connect to the RPC node, GetLatestBlockNumber() to get the latest block number, FetchBlock(num) to get the data of a specified block, ExtractAddresses(blockData) to extract the address from the block data, PollIntervalSeconds() to get the polling interval, and ChainName() to get the chain identifier.

[0054] Table 1

[0055]

[0056] In this embodiment, an adapter with a unified interface definition is used in the multi-chain address acquisition layer to provide an independent address extraction implementation for each public chain. To support a new chain, only the address extraction logic of that chain needs to be implemented. Other core modules such as rate limiting algorithms, worker pools, database management, and scheduling monitoring can be fully reused, greatly reducing the development workload and ensuring the accuracy of address extraction.

[0057] Step S102: Obtain active addresses and call the external intelligence interface to query the tag information of active addresses at a dynamically adjusted request rate; wherein, during the call, the request rate is adjusted in an asymmetric rate adjustment manner according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface.

[0058] Specifically, the system retrieves tag information by calling the API (i.e., external intelligence interface) of a third-party intelligence platform (such as Arkham Intelligence). During the call, the system dynamically adjusts the rate of subsequent requests based on the HTTP status code returned by the API.

[0059] The system maintains a global current latency variable (initially set to the preset minimum latency, with a default value of 0 milliseconds), and the request rate is inversely proportional to this variable value. It queries the entire process, monitors the interface response status in real time, and dynamically adjusts the global request rate based on asymmetric rate adjustment rules, continuously converging it below the actual interface rate limiting threshold, thus avoiding the risks of HTTP 429 status code rate limiting errors and IP blocking.

[0060] Asymmetric rate adjustment means that decreasing the step size is much smaller than increasing the step size, so that the request rate rises slowly and then falls, quickly bringing the request rate automatically below the API's actual rate limiting threshold, ensuring system stability and eliminating the need to know the threshold in advance.

[0061] Step S103: Store the retrieved tag information.

[0062] Specifically, for a successful response, the interface provides the entity name, entity type, and specific tag for the address. The system stores this information along with the address, chain identifier, data source, and timestamp, and performs incremental storage and data updates according to preset database rules to form a standardized address tag database.

[0063] This embodiment uses an adapter to uniformly adapt to public chains with different underlying data models, eliminating the need to develop separate collection programs for each chain and significantly reducing development and maintenance costs. Furthermore, it eliminates the need to obtain external interface rate limiting thresholds in advance, allowing for dynamic adaptation to interface rate limiting strategies. This maximizes API request throughput while ensuring that rate limiting and blocking are not triggered, thus adapting to the business scenarios of the collection addresses. Finally, it enables full automation of the address collection, tag query, and data storage process, supporting multiple scenarios such as historical backtracking, real-time monitoring, and batch supplementary queries, adapting to the business requirements for long-term stable operation.

[0064] Optionally, as a possible embodiment, the above-mentioned method of obtaining active addresses and querying the tag information of active addresses by calling an external intelligence interface at a dynamically adjusted request rate may include:

[0065] Multiple concurrently executing data acquisition units are launched, each acquiring an active address and concurrently calling external intelligence interfaces according to the current request rate.

[0066] Specifically, the system uses Go's goroutines to create N concurrently executing data acquisition units (Workers, also known as worker goroutines). The value of N can be set according to the number of CPU cores and network bandwidth, with a typical value of 10-100. Each data acquisition unit runs independently, and its main loop is as follows: obtain an address to be queried from the address pool, read the current request rate (i.e., the global current latency variable), wait for the corresponding time, and then call the external intelligence interface.

[0067] Before calling the external intelligence interface, each data acquisition unit reads the globally shared current latency variable and executes the corresponding wait (if the latency variable is greater than 0). Each unit calls the external intelligence interface concurrently without blocking the others. This high concurrency significantly improves address processing throughput, and the shared global latency variable ensures that all units coordinate their response to rate limiting, preventing a single unit from being blocked while other units continue to apply high pressure, thus avoiding a complete shutdown.

[0068] Optionally, as a possible implementation, adjusting the request rate in an asymmetric rate adjustment manner based on the response feedback returned by the external intelligence interface during the invocation process may include:

[0069] All data acquisition units share a global current latency variable, and the request rate is inversely proportional to the value of the global current latency variable. When any data acquisition unit receives a successful response, it decreases the global current latency variable by the first step size. When any data acquisition unit receives a rate-limiting response, it increases the global current latency variable by the second step size. The second step size is greater than the first step size.

[0070] Specifically, the system defines a global current delay variable `currentDelayMs` (in milliseconds) of atomic integer type, initialized to 0, and this variable is shared by all data acquisition units. The request rate is inversely proportional to the global current delay variable: the larger the global current delay variable, the lower the request rate.

[0071] When any data acquisition unit receives an HTTP 200 success response, it reads the current value of the global current delay variable. If the current value is greater than the preset minimum delay (usually 0 milliseconds), it subtracts the first step length (e.g., 20 milliseconds) to obtain the updated value. If the updated value is less than the minimum delay, it sets the updated value to the minimum delay and finally writes the updated value back to the global current delay variable to improve the rate of subsequent requests.

[0072] Optionally, after any data acquisition unit receives an HTTP 200 success response, the speedUp() function can be called. This function uses a CAS (Compare-And-Swap) spin operation to ensure thread safety. Specifically, it reads the current value of the global current delay variable; if the current value is greater than the preset minimum delay, it subtracts the first step length from the current value to obtain the updated value; it then checks whether the global current delay variable is still equal to the current value. If so, it updates the global current delay variable to the updated value; otherwise, it rereads the current value of the global current delay variable and performs the judgment operation again.

[0073] Specifically, when the data acquisition unit performs the reduction operation, it first reads the current value of the global current delay variable through the atomic loading function. If the current value is greater than the preset minimum delay (e.g., 0 milliseconds), the current value is subtracted from the first step length (e.g., 20 milliseconds) to obtain the updated value; if the updated value is less than the minimum delay, the updated value is set to the minimum delay. If the current value is already equal to the minimum delay, it returns directly (no update required).

[0074] Further check if the global current delay variable is still equal to its current value. If they are equal, update it to the updated value, and the process ends upon successful update. If they are not equal (indicating that other data acquisition units have modified the variable during this period), reread the current value and retry until the update is successful.

[0075] In this embodiment, the CAS spin lockless operation avoids the performance loss of traditional mutex locks and ensures performance under high concurrency; at the same time, it ensures that when multiple data acquisition units succeed at the same time, the delay variable will not be excessively reduced and will always remain within the legal range.

[0076] When any data acquisition unit receives an HTTP 429 rate limiting response or a network anomaly, it triggers the deceleration logic, reads the current value of the global current delay variable, and increases the global current delay variable in a second step (e.g., 1000 milliseconds) to quickly reduce the request rate; if the updated value exceeds the preset maximum delay (e.g., 5000 milliseconds), the global current delay variable is forcibly corrected to the maximum delay.

[0077] In this embodiment, all data acquisition units share the same state. If any unit encounters rate limiting, it can notify all units to slow down. Furthermore, the asymmetric step size design allows for both rapid recovery from rate limiting (by slowly increasing speed) and immediate deceleration when rate limiting occurs, avoiding further blocking. During normal requests, it slowly increases speed to maximize the use of interface bandwidth, solving the problem of traditional solutions being unable to balance throughput and stability, and achieving better request throughput.

[0078] Figure 3 This is a flowchart of Embodiment 2 of the multi-chain public blockchain address tag collection method based on dynamic adaptive rate limiting provided in this application. (Refer to...) Figure 3 Based on the above embodiments, the method may further include:

[0079] Step S301: Set a query status flag for each extracted active address; the query status flag can have at least a first status and a second status, where the first status indicates pending query and the second status indicates completed query.

[0080] Specifically, a query status flag is maintained for each extracted active address. This flag can have at least the following values: First status (pending query): indicating that the address has not yet successfully obtained a tag, or the previous retrieval failed and needs to be retried; Second status (completed): indicating that the tag information for the address has been successfully stored and does not need to be queried again. The query status flag, along with the active address and chain identifier, is stored in the active address table.

[0081] Step S302: When an active address is recorded for the first time, its query status flag is initialized to the first state; when the tag information of the active address is successfully queried and stored, its query status flag is updated to the second state; when the tag information of the active address fails to be queried, its query status flag is kept in the first state.

[0082] Specifically, when the address acquisition adapter first extracts an active address and records it in the address set, the system initializes the query status of that address to the first state (to be queried).

[0083] Once the data acquisition unit successfully obtains the tag information of the address from the external intelligence interface and stores the result, the system updates the query status of the address to the second status (completed).

[0084] If rate limiting (HTTP 429 response), network timeout, or other temporary errors occur during the query process, the system will not modify the status flag of that address, i.e., it will remain in the first state. In subsequent data collection rounds, this address will be retrieved again and retried.

[0085] By setting query status flags in this embodiment, the incremental anti-loss collection strategy based on query status flags enables the system to automatically distinguish active addresses that have been queried, not queried, and failed during long-term operation, achieving accurate incremental collection. Furthermore, this strategy embeds query status management into atomic database operations (such as INSERTIGNORE statement for deduplication and ON DUPLICATE KEY UPDATE statement for updating tags), avoiding duplicate or missed queries caused by memory status loss. At the same time, it automatically reduces system load over time, achieving natural attenuation of resource consumption.

[0086] Optionally, as a possible implementation, when writing the first recorded active address and its chain identifier, if the combination of the active address and chain identifier already exists, the writing is abandoned; when writing the queried tag information, if the combination of the active address, chain identifier and data source already exists, the existing tag information is overwritten using the latest queried tag information.

[0087] Specifically, when the system needs to write the first recorded active address and its chain identifier, it checks whether the combination of address and chain identifier already exists in storage. If it already exists, the write operation is abandoned (no modifications are made); if it does not exist, a new record is inserted, and the query status flag is initialized to the first state. In actual execution, this can be achieved using database unique constraints in conjunction with the MySQL database's INSERT IGNORE statement, or by querying first and then inserting at the application layer.

[0088] When the system needs to write the tag information (including entity name, entity type, tag, etc.) obtained from the query, it checks whether the combination of address, chain identifier, and data source already exists in the tag table. If it does not exist, a new record is inserted; if it already exists, the existing tag information is overwritten using the latest queried tag information (i.e., the entity name, entity type, and tag fields are updated). Specifically, this can be achieved using the ON DUPLICATE KEY UPDATE statement in MySQL, the MERGE statement in SQL Server, or the UPSERT statement in PostgreSQL.

[0089] This embodiment achieves deduplication from the storage layer, avoiding duplicate address storage and saving storage resources. At the same time, it supports dynamic iterative updates of tag data and synchronizes tag iteration information from third-party intelligence platforms to ensure the timeliness and accuracy of existing data.

[0090] Optionally, as a possible embodiment, the above method also includes a batch address backtracking query mechanism, used to centrally perform supplementary queries on addresses that have been entered into the database but whose tag queries have not yet been completed (checked_ark=0), specifically including:

[0091] (1) Set the upper limit of the number of active addresses obtained in each round and the maximum number of rounds.

[0092] Specifically, the system sets two configuration parameters: the maximum number of addresses retrieved per round and the maximum number of rounds. The maximum number of addresses retrieved per round (e.g., 1000) limits the number of addresses retrieved from storage in a single operation to prevent memory overflow. The maximum number of rounds (e.g., 100 rounds or 0 indicates unlimited) limits the total number of backtracking rounds to prevent infinite loops caused by some permanently failed addresses.

[0093] (2) Obtain active addresses marked as first state in rounds, and the number of addresses obtained in each round shall not exceed the upper limit.

[0094] Specifically, for each query, the addresses marked as first status are retrieved from the address set in the database, and the number returned is limited to a set upper limit.

[0095] If the query result for a certain round is empty, it indicates that there are no more addresses to be queried, and the batch backtracking will automatically terminate.

[0096] (3) After each round of address acquisition, wait for all data acquisition units to complete the tag information query for all addresses in the current round before proceeding to the next round.

[0097] Specifically, the active addresses obtained in this round are distributed to each data collection unit for tag querying. The system waits for all data collection units to complete the query of all addresses in the current round (regardless of success or failure) before continuing to the next round and obtaining addresses marked as the first state.

[0098] (4) When the number of rounds executed reaches the maximum number of rounds, or when the number of addresses marked as first state in a certain round is zero, the batch backtracking is terminated.

[0099] Specifically, if the number of rounds executed reaches the set maximum number of rounds, or if the query result for a certain round is empty, then the batch backtracking will be terminated.

[0100] The batch backtracking mechanism provided in this embodiment can centrally process historical backlog data, and the batch processing avoids memory pressure caused by loading a large number of addresses at once. During the execution of the batch backtracking mechanism, the dynamic adaptive rate limiting mechanism continues to run, so that the system can maintain a stable request rate in the batch backtracking scenario.

[0101] Figure 4 This is a flowchart of Embodiment 3 of the multi-chain public blockchain address tag collection method based on dynamic adaptive rate limiting provided in this application. (Refer to...) Figure 4 This method is applied to, for example Figure 2 The multi-chain public blockchain address tag collection system based on dynamic adaptive rate limiting shown herein may include the following methods:

[0102] Step S401: Register corresponding address collection adapters for each type of public blockchain, with all adapters following a unified interface specification.

[0103] In step S402, during the initial deployment of the system, the scheduler sets the polling interval according to the block production speed of each chain, and extracts active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter according to the type of the public chain to be collected.

[0104] In step S403, after receiving the address, the active address pool management layer sets a query status flag for each extracted active address; the value of the query status flag includes at least a first status and a second status, where the first status indicates that the query is pending and the second status indicates that the query has been completed.

[0105] Step S404: Start multiple concurrently executing data acquisition units. Each data acquisition unit obtains the active address and concurrently calls the external intelligence interface according to the current request rate. All data acquisition units share a global current delay variable.

[0106] Step S405: When any data acquisition unit receives a successful response, a CAS spin operation is used to decrease the global current delay variable by the first step length; when any data acquisition unit receives a current limiting response, the global current delay variable is increased by the second step length; wherein the second step length is greater than the first step length.

[0107] In step S406, when writing the first recorded active address and its chain identifier, if the combination of the active address and chain identifier already exists, the writing is abandoned; when writing the queried tag information, if the combination of the active address, chain identifier and data source already exists, the existing tag information is overwritten using the latest queried tag information.

[0108] Step S407: After the system has been offline for a long time, the active addresses marked as first state are obtained in rounds. After each round of address acquisition, the system waits for all data acquisition units to complete the query of tag information for all addresses in the current round before proceeding to the next round. This continues until the number of rounds executed reaches the preset maximum number of rounds, or the number of addresses marked as first state obtained in a certain round is zero, at which point the batch backtracking is terminated.

[0109] Specifically, the implementation principles and processes of steps S401 to S407 can be found in the descriptions in the previous embodiments, and will not be repeated here.

[0110] This embodiment uses an adapter pattern to uniformly collect active addresses from multiple heterogeneous public blockchains. Furthermore, by leveraging a shared global latency variable and an asymmetric step-size request rate adjustment mechanism across all data collection units, it automatically approaches the rate-limiting limit without requiring prior knowledge of the API rate-limiting threshold, thereby improving collection throughput. Additionally, incremental collection and failure retries are implemented based on query status markers to ensure no data loss or duplication, and the system load decreases as it runs longer. A batch backtracking mode is also provided to safely and efficiently handle historical backlogged addresses.

[0111] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0112] Corresponding to the aforementioned embodiment of a multi-chain public chain address tag collection method based on dynamic adaptive rate limiting, this application also provides an embodiment of a multi-chain public chain address tag collection device based on dynamic adaptive rate limiting.

[0113] This application discloses an embodiment of a multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting, which can be applied to computer devices. The device embodiment can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of the computer device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 5 The diagram shown is a hardware structure diagram of the computer device housing the multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting in this application. Except for... Figure 5 In addition to the processor, memory, network interface, and non-volatile memory shown, the computer device in which the device is located in the embodiment may also include other hardware depending on the actual function of the multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting, which will not be described in detail here.

[0114] Figure 6 The structural block diagram of the multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting provided in this application is shown below. Figure 6 The apparatus provided in this embodiment includes:

[0115] Address extraction module 10 is used to extract active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter, based on the type of the public chain to be collected.

[0116] The tag acquisition module 20 is used to obtain active addresses and call the external intelligence interface to query the tag information of the active addresses at a dynamically adjusted request rate. During the call, the request rate is adjusted in an asymmetric way according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface.

[0117] The tag storage module 30 is used to store the queried tag information.

[0118] The apparatus of this embodiment can be used to perform... Figure 1 The steps of the method embodiment shown are similar in principle and process, and will not be repeated here.

[0119] Optionally, as one possible embodiment, the tag acquisition module 20 is also used for:

[0120] Multiple concurrently executing data acquisition units are launched, each acquiring an active address and concurrently calling external intelligence interfaces according to the current request rate.

[0121] Optionally, as one possible embodiment, the tag acquisition module 20 is also used for:

[0122] All data acquisition units share a global current latency variable, and the request rate is inversely proportional to the value of the global current latency variable.

[0123] When any data acquisition unit receives a successful response, the global current delay variable is decreased by the first step size; when any data acquisition unit receives a rate limiting response, the global current delay variable is increased by the second step size; wherein the second step size is greater than the first step size.

[0124] Optionally, as one possible embodiment, the tag acquisition module 20 is also used for:

[0125] Read the current value of the global current delay variable;

[0126] If the current value is greater than the preset minimum delay, subtract the first step length from the current value to obtain the updated value;

[0127] Determine if the current global delayed variable is still equal to its current value. If yes, update the current global delayed variable to the updated value. If not, reread the current value of the current global delayed variable and perform the judgment operation.

[0128] Optionally, as one possible embodiment, the tag storage module 30 is also used for:

[0129] Set a query status flag for each extracted active address; the query status flag can have at least a first status and a second status, where the first status indicates pending query and the second status indicates completed query.

[0130] When an active address is recorded for the first time, its query status flag is initialized to the first state.

[0131] Once the tag information of an active address is successfully queried and stored, its query status is updated to the second status.

[0132] When the query for tag information of an active address fails, its query status is kept marked as the first state.

[0133] Optionally, as one possible embodiment, the tag storage module 30 is also used for:

[0134] When writing the first recorded active address and its chain identifier, if the combination of active address and chain identifier already exists, the writing is abandoned.

[0135] When writing the tag information obtained from the query, if the combination of the active address, chain identifier, and data source already exists, the existing tag information will be overwritten using the latest tag information obtained from the query.

[0136] Optionally, as one possible embodiment, the tag acquisition module 20 is also used for:

[0137] Set the maximum number of active addresses to be obtained per round and the maximum number of rounds;

[0138] Active addresses marked as first status are retrieved in rounds, with the number of addresses retrieved in each round not exceeding the upper limit.

[0139] After each round of address acquisition, wait for all data collection units to complete the tag information query for all addresses in the current round before proceeding to the next round;

[0140] Batch backtracking terminates when the maximum number of rounds has been executed, or when the number of addresses marked as first state in a certain round is zero.

[0141] Optionally, as one possible embodiment, the address extraction module 10 is further configured to:

[0142] When the public chain to be collected is a Type 1 public chain, the address collection adapter extracts active addresses from the public key field of the output script of the block transaction of the Type 1 public chain;

[0143] When the public chain to be collected is a second-type public chain, the address collection adapter extracts active addresses from the sender address field and / or receiver address field of the block transactions of the second-type public chain.

[0144] When the public chain to be collected is a third-type public chain, the address collection adapter first extracts the first-format address from the block transaction data of the third-type public chain, and then converts the first-format address into an active address in Base58 format.

[0145] Please continue to refer to Figure 5 This application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method in any of the embodiments provided in this application.

[0146] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the methods in any of the embodiments provided in this application.

[0147] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0148] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0149] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0150] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for collecting address tags of multi-chain public blockchains based on dynamic adaptive rate limiting, characterized in that, include: Based on the type of public blockchain to be collected, active addresses are extracted from the block data of the public blockchain by calling the corresponding address collection adapter. The active address is obtained, and the tag information of the active address is queried by calling an external intelligence interface at a dynamically adjusted request rate; wherein, during the call, the request rate is adjusted in an asymmetric rate adjustment manner according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface. The retrieved tag information is stored.

2. The method according to claim 1, characterized in that, The step of obtaining the active address and querying the tag information of the active address by calling an external intelligence interface at a dynamically adjusted request rate includes: Multiple concurrently executing data acquisition units are started, each of which obtains the active address and concurrently calls the external intelligence interface according to the current request rate.

3. The method according to claim 2, characterized in that, The step of adjusting the request rate in an asymmetric rate adjustment manner based on the response feedback returned by the external intelligence interface during the invocation process includes: All the data acquisition units share a global current latency variable, and the request rate is inversely proportional to the value of the global current latency variable. When any data acquisition unit receives a successful response, the global current delay variable is decreased by a first step length; when any data acquisition unit receives a rate limiting response, the global current delay variable is increased by a second step length; wherein the second step length is greater than the first step length.

4. The method according to claim 3, characterized in that, The step of reducing the global current delay variable by the first step length also includes: Read the current value of the global current delay variable; If the current value is greater than the preset minimum delay, then the current value is subtracted from the first step length to obtain the updated value; Determine whether the global current delay variable is still equal to the current value. If yes, update the global current delay variable to the updated value. If no, reread the current value of the global current delay variable and perform the determination operation.

5. The method according to claim 1, characterized in that, The method further includes: A query status flag is set for each extracted active address; the value of the query status flag includes at least a first status and a second status, where the first status indicates pending query and the second status indicates completed query. When the active address is recorded for the first time, its query status flag is initialized to the first status; Once the tag information of the active address is successfully queried and stored, its query status is updated to the second status. When the query for the tag information of the active address fails, its query status is kept marked as the first status.

6. The method according to claim 5, characterized in that, The method further includes: When writing the first recorded active address and its chain identifier, if the combination of active address and chain identifier already exists, the writing is abandoned. When writing the tag information obtained from the query, if the combination of the active address, chain identifier, and data source already exists, the existing tag information will be overwritten using the latest tag information obtained from the query.

7. The method according to claim 5, characterized in that, The method further includes: Set the maximum number of active addresses to be obtained per round and the maximum number of rounds; Active addresses marked as first state in the query are obtained in rounds, and the number of addresses obtained in each round does not exceed the upper limit of the number; After each round of address acquisition, wait for all data collection units to complete the tag information query for all addresses in the current round before proceeding to the next round; When the number of rounds executed reaches the maximum number of rounds, or when the number of addresses marked as first state in a certain round is zero, the batch backtracking is terminated.

8. The method according to claim 1, characterized in that, The step of extracting active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter, based on the type of the public chain to be collected, includes: When the public chain to be collected is a first type of public chain, the address collection adapter extracts active addresses from the public key field of the output script of the block transaction of the first type of public chain; When the public chain to be collected is a second type of public chain, the address collection adapter extracts active addresses from the sender address field and / or receiver address field of the block transactions of the second type of public chain; When the public chain to be collected is a third type of public chain, the address collection adapter first extracts the address in the first format from the block transaction data of the third type of public chain, and then converts the address in the first format into an active address in Base58 format.

9. A multi-chain public chain address tag acquisition device based on dynamic adaptive rate limiting, characterized in that, include: The address extraction module is used to extract active addresses from the block data of the public chain to be collected by calling the corresponding address collection adapter, based on the type of the public chain to be collected. The tag acquisition module is used to acquire the active address and call the external intelligence interface to query the tag information of the active address at a dynamically adjusted request rate; wherein, during the call, the request rate is adjusted in an asymmetric rate adjustment manner according to the response feedback returned by the external intelligence interface, so that the request rate converges to below the rate limiting threshold of the external intelligence interface. The tag storage module is used to store the tag information obtained from the query.

10. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to execute the multi-chain public chain address tag acquisition method based on dynamic adaptive rate limiting as described in any one of claims 1 to 8.