Database memory recovery method, electronic device, and storage medium

By determining the nodes to be reclaimed in the database based on the node identifier and version identifier of the transaction block, and dynamically adjusting the target nodes and distributing the load when the node load is too high, the problem of low efficiency in database memory resource reclamation is solved, and efficient memory resource management and load balancing are achieved.

CN121233348BActive Publication Date: 2026-03-03JIANGSU HUAKU DATA TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511803367.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-03-03
Estimated Expiration
2045-12-03

AI Technical Summary

Technical Problem

Database memory resource reclamation efficiency is low, making it difficult to manage efficiently.

Method used

The nodes to be reclaimed are determined based on the node identifier and version identifier of the transaction block. A preset number threshold is used to determine whether memory resources are reclaimable. When the node load is too high, the target node is dynamically adjusted and the load is shared by auxiliary nodes to reduce the global scan cost.

Benefits of technology

It improves the efficiency of memory resource reclamation, reduces the impact of excessive node load on reclamation, and enables rapid location of nodes to be reclaimed and load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233348B_ABST
    Figure CN121233348B_ABST
Patent Text Reader

Abstract

The application provides a database memory recycling method, an electronic device and a storage medium, and is applied to the technical field of computers. The method comprises the following steps: determining a to-be-recycled node for recycling at least one to-be-recycled memory resource according to the node identifier included in each target transaction block in at least one transaction chain, wherein the to-be-recycled memory resource is determined according to the node identifier and the version identifier included in the target transaction block; and recycling, for any to-be-recycled node in the at least one to-be-recycled node, the at least one to-be-recycled memory resource corresponding to the to-be-recycled node by using the to-be-recycled node in the case where the number of to-be-recycled memory resources of the to-be-recycled node is less than or equal to a preset number threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically, to a database memory reclamation method, an electronic device, and a storage medium. Background Technology

[0002] The database has multiple nodes, and different nodes are used to execute different transactions. During the execution process, memory resources will be consumed, and the occupied memory resources need to be reclaimed.

[0003] In related technologies, memory resource reclamation efficiency is low, making it difficult to manage database resources efficiently. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a database memory reclamation method, an electronic device, and a storage medium.

[0005] One aspect of this invention provides a database memory reclamation method, comprising: determining a reclaimable node for reclaiming at least one memory resource to be reclaimed, based on node identifiers included in at least one target transaction block in at least one transaction chain, wherein the memory resource to be reclaimed is determined based on the node identifier and version identifier included in the target transaction block; and for any one of the at least one reclaimable node, if the number of memory resources to be reclaimed in the reclaimable node is less than or equal to a preset number threshold, reclaiming at least one memory resource to be reclaimed corresponding to the reclaimable node using the reclaimable node.

[0006] According to an embodiment of the present invention, the method further includes: generating a transaction block corresponding to each of the at least one process transaction based on at least one process transaction obtained by executing a first process transaction using a target node, wherein the transaction block includes a transaction identifier of the first process transaction, a version identifier of the process transaction, and a node identifier of the target node; and for any of the at least one transaction blocks, determining a matching transaction identifier that matches the transaction identifier included in the transaction block from the transaction identifiers of the second process transactions included in the head of each of the at least one transaction chains, and adding the transaction block to the transaction chain corresponding to the matching transaction identifier.

[0007] According to an embodiment of the present invention, the method further includes: determining a target node from a plurality of first candidate nodes based on the performance evaluation values ​​of each of a plurality of first candidate nodes that meet a first predetermined condition; wherein the first predetermined condition includes at least one of node idle rate being greater than or equal to a first preset idle rate threshold or bandwidth utilization being less than or equal to a first preset utilization threshold, and the performance evaluation value includes at least one of the following: node idle rate, bandwidth utilization, or node load rate.

[0008] According to an embodiment of the present invention, the method further includes: in the process of executing a first transaction to be executed using a target node, in response to at least one of the target node’s node idle rate being less than or equal to a second preset idle rate threshold or its bandwidth utilization being greater than or equal to a second preset utilization rate threshold, determining a new target node from a plurality of second candidate nodes for continuing to execute the first transaction to be executed, wherein the second candidate nodes are other nodes besides the target node among the plurality of nodes.

[0009] According to an embodiment of the present invention, determining a new target node from a plurality of second candidate nodes for continuing the execution of a first pending transaction includes: selecting candidate nodes from the plurality of second candidate nodes whose second performance evaluation values ​​satisfy a second preset condition and whose node distance is the target node distance, based on the second performance evaluation values ​​and node distance of each of the plurality of second candidate nodes; wherein, the second preset condition includes a node idle rate greater than or equal to a third preset idle rate threshold or a bandwidth utilization rate less than or equal to a third preset utilization rate threshold, and the node distance characterizes the distance between the second candidate node and the target node.

[0010] According to an embodiment of the present invention, the method further includes: when the number of memory resources to be reclaimed in the node to be reclaimed is greater than a preset threshold, determining at least one auxiliary reclaiming node from a plurality of nodes; reclaiming a first memory resource to be reclaimed using the node to be reclaimed and reclaiming a second memory resource to be reclaimed using at least one auxiliary reclaiming node, wherein the at least one memory resource to be reclaimed corresponding to the node to be reclaimed includes the first memory resource to be reclaimed and the second memory resource to be reclaimed; or reclaiming at least one memory resource to be reclaimed corresponding to the node to be reclaimed using at least one auxiliary reclaiming node.

[0011] According to an embodiment of the present invention, determining at least one auxiliary node from a plurality of nodes includes: determining nodes from the plurality of nodes whose node idle rate is greater than or equal to a fourth preset idle rate threshold as third candidate nodes, thereby obtaining a plurality of third candidate nodes; and determining at least one auxiliary reclamation node from the plurality of third candidate nodes based on the number of memory resources to be reclaimed by each of the plurality of third candidate nodes.

[0012] According to an embodiment of the present invention, the method further includes: determining at least one target version identifier from the version identifiers included in each of the plurality of transaction blocks in the transaction chain; and taking the transaction block corresponding to each of the at least one target version identifier as at least one target transaction block.

[0013] Another aspect of the present invention provides a database memory reclamation apparatus, comprising: a first determining module, configured to determine, based on node identifiers included in at least one target transaction block in at least one transaction chain, a node to be reclaimed for reclaiming at least one memory resource to be reclaimed, wherein the memory resource to be reclaimed is determined based on the node identifier and version identifier included in the target transaction block; and a first reclamation module, configured to, for any one of the at least one node to be reclaimed, reclaim at least one memory resource to be reclaimed corresponding to the node to be reclaimed, if the number of memory resources to be reclaimed in the node to be reclaimed is less than or equal to a preset number threshold.

[0014] Another aspect of the present invention provides an electronic device, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method described above.

[0015] Another aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the method described above.

[0016] Another aspect of the present invention provides a computer program product including computer-executable instructions that, when executed, implement the method described above.

[0017] According to an embodiment of the present invention, when a target transaction block exists in the transaction chain, the node identifier of the target transaction block is obtained, and the node identifier of the target transaction block is compared with the node identifiers of each node to determine the node to be reclaimed indicated by the node identifier of the target transaction block among multiple nodes. This eliminates the need for a global scan of the resources stored on all nodes, enabling rapid location of the node to be reclaimed and saving the resource costs incurred by a global scan. Furthermore, the number of memory resources to be reclaimed in the node to be reclaimed is determined to ascertain whether the number of memory resources to be reclaimed is less than or equal to a preset threshold, thereby determining the load status of the node to be reclaimed, reducing the impact of excessive node load on the reclamation of memory resources to be reclaimed, and improving the reclamation efficiency of the node to be reclaimed. Attached Figure Description

[0018] The above-described features, other objects, and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:

[0019] Figure 1A The diagram illustrates application scenarios of the database memory reclamation method, apparatus, device, medium, and program product according to embodiments of the present invention.

[0020] Figure 1BThis diagram illustrates another application scenario of the database memory reclamation method, apparatus, device, medium, and program product according to embodiments of the present invention.

[0021] Figure 2 A flowchart of a database memory reclamation method according to an embodiment of the present invention is shown.

[0022] Figure 3 A schematic diagram illustrating the process of identifying nodes to be recycled according to an embodiment of the present invention is shown.

[0023] Figure 4 A schematic diagram illustrating the determination of a transaction chain according to an embodiment of the present invention is shown.

[0024] Figure 5 A schematic diagram illustrating the recycling efficiency according to an embodiment of the present invention is shown.

[0025] Figure 6 A structural block diagram of a database memory reclamation device according to an embodiment of the present invention is shown.

[0026] Figure 7 A block diagram of an electronic device suitable for implementing a database memory reclamation method according to an embodiment of the present invention is shown. Detailed Implementation

[0027] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0029] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0030] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0031] Figure 1A The diagram illustrates application scenarios of the database memory reclamation method, apparatus, device, medium, and program product according to embodiments of the present invention. Figure 1B This diagram illustrates another application scenario of the database memory reclamation method, apparatus, device, medium, and program product according to embodiments of the present invention.

[0032] like Figure 1A As shown, the application scenario according to this embodiment may include multiple nodes, scheduling nodes, transaction chains, and databases.

[0033] The scheduling node interacts with the database, receiving the first pending transaction associated with the database and feeding back the execution result of the first pending transaction to the database.

[0034] After receiving the first transaction to be executed, the scheduling node creates the head of the transaction chain associated with the first transaction to be executed, in order to construct the transaction chain.

[0035] The scheduling node obtains data such as node idle rate, bandwidth utilization, or node load rate from each of the n nodes to determine the target node among the n nodes. For example, Figure 1A In the process, the scheduling node determines node 1 as the target node 1 and sends the first transaction to be executed to node 1.

[0036] During the execution of the first pending transaction, the target node generates a corresponding transaction block based on the transaction identifier of the first pending transaction, the version identifier of the process transaction, and the node identifier of the target node, and sends it to the transaction chain. For example, Figure 1A In the process, target node 1 executes the first transaction to be executed, and the generated transaction block matches the corresponding transaction chain 1 based on the transaction identifier of the first transaction to be executed.

[0037] The scheduling node monitors each transaction chain. If it determines that a transaction chain contains the target transaction block, it identifies a node from among the n nodes to be reclaimed, and then utilizes this node to reclaim the memory resources to be reclaimed. For example, Figure 1A In the process, the scheduling node determines that node 2 is node 1 to be reclaimed, and sends the reclamation task associated with the memory resources to be reclaimed to node 2.

[0038] For a target node among multiple nodes, the target node receives and executes the first pending transaction. During the execution of the first pending transaction, the target node monitors the node idle rate, bandwidth utilization, or node load rate, and sends the node idle rate, bandwidth utilization, or node load rate to the scheduling node. If the node idle rate of the target node is less than or equal to the second preset idle rate threshold or the bandwidth utilization is greater than or equal to the second preset utilization rate threshold, the scheduling node determines a new target node among other nodes.

[0039] like Figure 1B As shown, data transmission can occur between each node. The scheduling node determines a new target node among multiple nodes based on the second performance evaluation value of each node and the node distance. The second performance evaluation value is determined based on the node idle rate, bandwidth utilization, or node load rate of each node, and the node distance is the physical distance between each node and the target node.

[0040] For example, Figure 1B If node 1 is the target node, and the scheduling node confirms that the node idle rate of node 1 is less than or equal to the second preset idle rate threshold or the bandwidth utilization rate is greater than or equal to the second preset utilization rate threshold, the scheduling node obtains the second performance evaluation value and node distance of each of node 2, node 3, ..., node n, and determines that the second performance evaluation values ​​of node 2 and node 3 meet the second preset condition. Then, node 3, which is closer to node 1, is taken as the new target node.

[0041] At this point, node 1 sends the process transaction associated with the first transaction to be executed to node 3 through the data transmission link between node 1 and node 3, and node 3 continues to execute it as the new target node.

[0042] Furthermore, during the reclamation process of the memory resources to be reclaimed, if the scheduling node determines that the number of memory resources to be reclaimed of the node to be reclaimed is greater than a preset threshold, at least one auxiliary reclamation node is used to reclaim at least one memory resource corresponding to the node to be reclaimed through the data transmission link between each node.

[0043] The following will be based on Figure 1A and Figure 1B The described scene, through Figures 2-5 The database memory reclamation method according to embodiments of the present invention will be described in detail.

[0044] Figure 2 A flowchart of a database memory reclamation method according to an embodiment of the present invention is shown.

[0045] like Figure 2 As shown, the database memory reclamation method of this embodiment includes operation S210 and operation S220.

[0046] In operation S210, based on the node identifiers included in at least one target transaction block in at least one transaction chain, a node to be reclaimed for reclaiming at least one memory resource to be reclaimed is determined.

[0047] In operation S220, for any one of the at least one reclaimable node, if the number of reclaimable memory resources of the reclaimable node is less than or equal to a preset threshold, the reclaimable node is used to reclaim at least one reclaimable memory resource corresponding to the reclaimable node.

[0048] A transaction chain can be a data chain that stores transactions. This data chain can include multiple transaction blocks. Transaction blocks can be used to record the transaction versions updated as the first transaction to be executed progresses, as well as the nodes executing different transaction versions.

[0049] The target transaction block can be one of multiple transaction blocks that indicates the memory resources to be reclaimed. The version identifier of the target transaction block can be used to indicate the transaction version corresponding to the target transaction block. The node identifier of the target transaction block can be used to indicate the target node for executing the transaction version corresponding to the target transaction block.

[0050] The first pending transaction can be a transaction issued to various nodes associated with the database. Examples include data query tasks, data storage tasks, or data computation tasks. The database is associated with multiple nodes. These nodes are used to execute the first pending transaction and to reclaim at least one memory resource awaiting reclamation.

[0051] The memory resources to be reclaimed are generated during the execution of the first pending transaction and can be determined based on the node identifier and version identifier included in the target transaction block. By using the node identifier and version identifier included in the target transaction block, it is possible to determine which target node the memory resources to be reclaimed for the corresponding transaction version of the target transaction block are located on, thereby confirming the node to be reclaimed.

[0052] Since the memory access latency of the same node is lower than that of different nodes, using the target node corresponding to the target transaction block as the node to be reclaimed for the memory resources to be reclaimed can reduce cross-node operations, thereby reducing memory access latency and improving reclamation efficiency.

[0053] The target transaction block can be determined in the following way.

[0054] One implementation involves determining at least one target version identifier from the version identifiers included in each of the multiple transaction blocks in the transaction chain. The transaction block corresponding to each of these at least one target version identifier is then designated as at least one target transaction block.

[0055] The version identifiers included in each of the multiple transaction blocks in the transaction chain can be traversed. If the transaction chain is found to meet the preset reclamation conditions, at least one target version identifier can be determined from the version identifiers included in each of the multiple transaction blocks.

[0056] The preset reclamation condition can be to reclaim multiple transaction blocks in the transaction chain based on a preset period. Specifically, when the time indicated by the preset period is reached, the version identifiers of all transaction blocks generated within the corresponding period are traversed and identified as the target version identifier. Alternatively, the version identifiers of all transaction blocks within the period can be randomly extracted, and the version identifier indicated by the extraction result is identified as the target version identifier.

[0057] The preset reclamation condition can also be based on a preset version number threshold to reclamate multiple transaction blocks in the transaction chain. Specifically, the version numbers indicated by the version identifiers of multiple transaction blocks are generated in ascending order. For example, the first generated version identifier indicates a version number of 1, the second generated version identifier indicates a version number of 2, and the version identifiers indicated by version numbers that do not meet the preset version number threshold are determined as target version identifiers. After determining the target version identifiers, since the version number values ​​gradually increase and smaller values ​​are not repeatedly generated, the preset version number threshold needs to be updated. For example, if the preset version number threshold is set to 3 when the target version identifier is first determined, then after the first determination of the target version identifier, the preset version number threshold is updated to 6.

[0058] The preset reclamation condition can also be based on a preset number of transaction blocks to reclaim multiple transaction blocks in the transaction chain. Specifically, when the number of transaction blocks stored in the transaction chain reaches the preset number of transaction blocks, the version identifier indicating the old version is determined as the target version identifier. This old version can be a transaction block near the head of the transaction chain, or it can be a randomly selected specified number of version identifiers as the target version identifier. Regarding how to determine the nodes to be reclaimed, the following section will discuss... Figure 3 Please provide an explanation.

[0059] Figure 3 A schematic diagram illustrating the process of identifying nodes to be recycled according to an embodiment of the present invention is shown.

[0060] like Figure 3 As shown, the current transaction chain stores transaction blocks 1 to 5, where the version identifier of transaction block 1 is 1.0, the version identifier of transaction block 2 is 1.1, the version identifier of transaction block 3 is 1.2, the version identifier of transaction block 4 is 1.3, and the version identifier of transaction block 5 is 1.4. Assuming the preset number of transaction blocks in the preset reclamation conditions is 3, meaning the current transaction chain meets the preset reclamation conditions, based on the version identifiers included in each of the multiple transaction blocks, the version identifiers indicating the old version are determined as the target version identifiers, i.e., 1.0 to 1.2.

[0061] Furthermore, transaction blocks 1 to 3 corresponding to versions 1.0 to 1.2 are designated as target transaction blocks. Based on the node identifiers of transaction blocks 1 to 3, the memory resources to be reclaimed indicated by transaction blocks 1 to 3 are located on node 1 and node 2 to be reclaimed, respectively.

[0062] In addition, a recycling queue is used to distribute at least one recycling task associated with the target transaction block to each node to be recycled.

[0063] According to an embodiment of the present invention, when a node to be reclaimed has been determined, for any node to be reclaimed, the number of memory resources to be reclaimed stored in the node to be reclaimed is determined, and it is determined whether the number is less than or equal to a preset number threshold, so as to determine whether the current load of the node to be reclaimed can reclaim the memory resources below the specified number.

[0064] The preset threshold number can be determined by the following operation: Count the number of memory resources currently stored on all nodes that are awaiting reclamation, to determine a statistical value of the number of memory resources awaiting reclamation stored on each node, and use n times the statistical value as the preset threshold number. The statistical value can be the average of the number of memory resources awaiting reclamation stored on multiple nodes, or it can be the median of the number of memory resources awaiting reclamation stored on multiple nodes. n can be a value greater than 1, such as 1.5.

[0065] In addition to the above operations, the value of the preset number threshold indicator can be adjusted according to actual needs.

[0066] If the number of memory resources to be reclaimed on the node to be reclaimed is less than or equal to a preset threshold, it is determined that the current load of the node to be reclaimed is sufficient to reclaim the memory resources to be reclaimed, so that the node to be reclaimed can be used to complete the reclamation of the memory resources to be reclaimed.

[0067] According to an embodiment of the present invention, when a target transaction block exists in the transaction chain, the node identifier of the target transaction block is obtained, and the node identifier of the target transaction block is compared with the node identifiers of each node to determine the node to be reclaimed indicated by the node identifier of the target transaction block among multiple nodes. This eliminates the need for a global scan of the resources stored on all nodes, enabling rapid location of the node to be reclaimed and saving the resource costs incurred by a global scan. Furthermore, the number of memory resources to be reclaimed in the node to be reclaimed is determined to ascertain whether the number of memory resources to be reclaimed is less than or equal to a preset threshold, thereby determining the load status of the node to be reclaimed, reducing the impact of excessive node load on the reclamation of memory resources to be reclaimed, and improving the reclamation efficiency of the node to be reclaimed.

[0068] According to an embodiment of the present invention, the method further includes: generating a transaction block corresponding to each of the at least one process transaction based on at least one process transaction obtained by executing a first process transaction using a target node, wherein the transaction block includes a transaction identifier of the first process transaction, a version identifier of the process transaction, and a node identifier of the target node; and for any of the at least one transaction blocks, determining a matching transaction identifier that matches the transaction identifier included in the transaction block from the transaction identifiers of the second process transactions included in the head of each of the at least one transaction chains, and adding the transaction block to the transaction chain corresponding to the matching transaction identifier.

[0069] According to an embodiment of the present invention, a process transaction can be obtained by updating the first transaction to be executed during the execution of the first transaction to be executed. For example, if the first transaction to be executed is a data query task, after the first round of query is completed, the transaction version of the first transaction to be executed is updated to obtain a process transaction, and correspondingly, the version identifier of the process transaction is also updated.

[0070] For example, if the version identifier of the first transaction to be executed is 1.0, after the first round of queries, the first transaction to be executed is updated to a process transaction, and the version identifier of the process transaction is updated to 2.0. If after the second round of queries, the process transaction is updated to a new process transaction, and the version identifier of the new process transaction is updated to 3.0.

[0071] In addition, when the target node receives the first transaction to be executed, it generates a transaction block corresponding to the first transaction to be executed; when the first transaction to be executed is updated to a process transaction, it generates a transaction block corresponding to the process transaction.

[0072] For example, when the target node (node ​​1) receives the first transaction to be executed, it generates transaction block 1, which includes node identifier 1 and version identifier 1.0. After the first round of queries, the first transaction to be executed is updated to a process transaction, generating transaction block 2, which includes node identifier 1 and version identifier 2.0.

[0073] According to an embodiment of the present invention, after a transaction block is generated, multiple transaction chains are traversed according to the transaction identifier of the first transaction to be executed included in the transaction block. The transaction identifier of the transaction block is matched with the transaction identifier of the second transaction to be executed included in the head of the transaction chain. If the matching result indicates that the transaction identifier of the transaction block is consistent with the transaction identifier of the second transaction to be executed included in the head of the transaction chain, then the transaction identifier is determined as the matching transaction identifier, and the transaction block is added to the transaction chain corresponding to the matching transaction identifier.

[0074] The second pending transaction can be a task that was sent to the scheduling node but not yet assigned to the node, and is recorded by the head of the transaction chain. The head of the transaction chain is constructed by the scheduling node when it receives the second pending transaction.

[0075] Regarding how transaction chains are determined for transaction blocks, the following section will discuss this further. Figure 4 Please provide an explanation.

[0076] Figure 4 A schematic diagram illustrating the determination of a transaction chain according to an embodiment of the present invention is shown.

[0077] For example, such as Figure 4 As shown, when the target node receives the first transaction to be executed, it generates transaction block 1 corresponding to the first transaction to be executed. The transaction identifier of transaction block 1 is transaction A. The transaction identifier of the second transaction to be executed included in the head of transaction chain 1 is transaction A. The transaction identifier of the second transaction to be executed included in the head of transaction chain 2 is transaction B. The transaction identifier of the second transaction to be executed included in the head of transaction chain 3 is transaction C. The transaction identifier of transaction block 1 is matched with the transaction identifiers of transaction chain 1, transaction chain 2 and transaction chain 3 respectively. Transaction A is determined to be the matching transaction identifier, and the transaction block is added to transaction chain 1 corresponding to transaction A. The target node continues to execute the first transaction to be executed, obtaining a process transaction, and generates transaction block 2 of the process transaction accordingly. Based on the above operations, it is determined that transaction block 2 is added to transaction chain 1. At this time, transaction chain 1 includes the head 1 and transaction block 1, and transaction block 2 is connected after transaction block 1.

[0078] According to an embodiment of the present invention, since a transaction block is generated during the execution of the first transaction to be executed, and the transaction block includes the transaction identifier of the first transaction to be executed, the version identifier of the process transaction, and the node identifier of the target node, the generated transaction block can be matched with the transaction identifier of the second transaction to be executed included in the head of the transaction chain, thereby quickly locating the transaction chain, so as to efficiently track and manage different transaction versions using the transaction chain, and improve the management efficiency of the scheduling node for multiple nodes.

[0079] According to an embodiment of the present invention, the method further includes: determining a target node from a plurality of first candidate nodes based on the performance evaluation values ​​of each of a plurality of first candidate nodes that meet a first predetermined condition; wherein the first predetermined condition includes at least one of node idle rate being greater than or equal to a first preset idle rate threshold or bandwidth utilization being less than or equal to a first preset utilization threshold, and the performance evaluation value includes at least one of the following: node idle rate, bandwidth utilization, or node load rate.

[0080] According to an embodiment of the present invention, the node idle rate, bandwidth utilization rate and node load rate of each node are collected in real time.

[0081] For a node whose idle rate is greater than or equal to a first preset idle rate threshold or whose bandwidth utilization is less than or equal to a first preset utilization threshold (which can be: idle rate ≥ 60% or bandwidth utilization ≤ 80%), if a node meets this first preset condition, the node is marked as a low-load node and is selected as the first candidate node. The first preset idle rate threshold and the first preset utilization threshold can be selected according to actual needs and are not limited here.

[0082] The performance evaluation value of the first candidate node can be obtained by processing the node idle rate, bandwidth utilization, and node load rate based on preset weights. For example, the performance evaluation value Score = (CpuIdleRatio×0.4) + ((1 -MemBandwidthUsage)×0.3) + ((1 / LoadAvg)×0.3), where CpuIdleRatio is the node idle rate, MemBandwidthUsage is the bandwidth utilization, LoadAvg is the node load rate, and 0.4, 0.3, and 0.3 are the preset weights of the node idle rate, bandwidth utilization, and node load rate, respectively. The value of the preset weight can be selected according to actual needs and is not limited here.

[0083] Given that the performance evaluation values ​​of multiple first candidate nodes have been determined, the first candidate node with the higher performance evaluation value is selected as the target node compared to other performance evaluation values.

[0084] In addition, when the database receives a new first transaction to be executed, it re-determines multiple first candidate nodes and updates the performance evaluation values ​​of each of the multiple first candidate nodes.

[0085] According to an embodiment of the present invention, by determining the target node based on the performance evaluation values ​​of multiple first candidate nodes, the performance of each first candidate node can be accurately evaluated in multiple dimensions such as node idle rate, bandwidth utilization rate and node load rate, so as to select the low-load node among multiple first candidate nodes, thereby providing reasonable resources for the execution of the first transaction to be executed, and improving the execution efficiency of the first transaction to be executed.

[0086] According to an embodiment of the present invention, the method further includes: in the process of executing a first transaction to be executed using a target node, in response to at least one of the target node’s node idle rate being less than or equal to a second preset idle rate threshold or its bandwidth utilization being greater than or equal to a second preset utilization rate threshold, determining a new target node from a plurality of second candidate nodes for continuing to execute the first transaction to be executed, wherein the second candidate nodes are other nodes besides the target node among the plurality of nodes.

[0087] According to an embodiment of the present invention, when a target node has been determined, a first transaction to be executed is performed using the target node, wherein, during the execution of the first transaction to be executed using the target node, the node idle rate and bandwidth utilization of the target node are monitored in real time.

[0088] If the idle rate of the target node is less than or equal to the second preset idle rate threshold or the bandwidth utilization rate is greater than or equal to the second preset utilization rate threshold, and it is determined that the current load of the target node is insufficient to continue executing the process transaction associated with the first pending transaction, a new target node needs to be determined from multiple second candidate nodes in order to utilize the second candidate node with a lower load to continue executing the process transaction associated with the first pending transaction.

[0089] The target node's idle rate is less than or equal to a second preset idle rate threshold, or its bandwidth utilization is greater than or equal to a second preset utilization threshold. For example, the idle rate can be ≤60% or the bandwidth utilization can be ≥80%. The second preset idle rate threshold and the second preset utilization threshold can be selected according to actual needs and are not limited here.

[0090] According to an embodiment of the present invention, by monitoring the idle rate and bandwidth utilization of the target node in real time, the load of the target node can be determined in a timely manner. This allows a new target node to be determined from multiple second candidate nodes when the load of the target node is too high. The process transaction associated with the first transaction to be executed can then be continued using a node with a lower load. This solves the problem that the transaction execution efficiency will be low due to the high load of the target node, thereby improving the transaction execution efficiency.

[0091] According to an embodiment of the present invention, determining a new target node from a plurality of second candidate nodes for continuing the execution of a first pending transaction includes: selecting a second candidate node from the plurality of second candidate nodes whose second performance evaluation value satisfies a second preset condition and whose node distance is the target node distance, based on the second performance evaluation value and node distance of each of the plurality of second candidate nodes; wherein, the second preset condition includes a node idle rate greater than or equal to a third preset idle rate threshold or a bandwidth utilization rate less than or equal to a third preset utilization rate threshold, and the node distance characterizes the distance between the second candidate node and the target node.

[0092] The second preset condition includes a node idle rate greater than or equal to a third preset idle rate threshold or a bandwidth utilization rate less than or equal to a third preset utilization rate threshold. For example, a node idle rate ≥ 45% or a bandwidth utilization rate ≤ 60%. The third preset idle rate threshold and the third preset utilization rate threshold can be selected according to actual needs and are not limited here.

[0093] The node distance is the physical distance between the target node and multiple second candidate nodes. The target node distance can be the node distance with the smallest distance among the multiple node distances.

[0094] Candidate nodes that meet the following criteria will be selected as new target nodes for continuing the execution of the first pending transaction: node idle rate ≥ 45% or bandwidth utilization ≤ 60% and distance equal to the target node.

[0095] According to an embodiment of the present invention, a new target node is determined by a second performance evaluation value and node distance. The node with lower load can be determined among a plurality of second candidate nodes based on the second performance evaluation value, and the node with lower cross-node access latency can be determined among a plurality of second candidate nodes based on node distance, thereby achieving efficient resource utilization with lower cross-node access latency among a plurality of nodes.

[0096] According to an embodiment of the present invention, the method further includes: when the number of memory resources to be reclaimed in the node to be reclaimed is greater than a preset threshold, determining at least one auxiliary reclaiming node from a plurality of nodes; reclaiming a first memory resource to be reclaimed using the node to be reclaimed and reclaiming a second memory resource to be reclaimed using at least one auxiliary reclaiming node, wherein the at least one memory resource to be reclaimed corresponding to the node to be reclaimed includes the first memory resource to be reclaimed and the second memory resource to be reclaimed; or reclaiming at least one memory resource to be reclaimed corresponding to the node to be reclaimed using at least one auxiliary reclaiming node.

[0097] If the number of memory resources to be reclaimed on a node exceeds a preset threshold, at least one auxiliary reclamation node needs to be selected from multiple nodes. The auxiliary reclamation node is used to distribute the reclamation tasks associated with the memory resources to be reclaimed on the node, achieving load balancing across multiple nodes in the database.

[0098] The second set of memory resources to be reclaimed can be a portion of the memory resources associated with the reclamation tasks received by the auxiliary reclamation nodes. The first set of memory resources to be reclaimed is the remaining set of memory resources to be reclaimed by the reclamation nodes.

[0099] For example, half of the memory resources to be reclaimed by the node to be reclaimed are designated as the second set of memory resources to be reclaimed and reclaimed by at least one auxiliary node, while the remaining half are designated as the first set of memory resources to be reclaimed and reclaimed by the node to be reclaimed. The number of memory resources to be reclaimed by the first set and the second set can be selected according to actual needs and is not limited here.

[0100] Alternatively, all memory resources of the nodes to be reclaimed can be reclaimed by at least one auxiliary reclaiming node.

[0101] According to an embodiment of the present invention, by utilizing auxiliary recycling nodes to reclaim at least one memory resource to be reclaimed corresponding to the node to be reclaimed, the load on the node to be reclaimed can be reduced when the node to be reclaimed is overloaded, thereby improving the processing efficiency of the node to be reclaimed. At the same time, the situation where the auxiliary nodes are too idle is reduced, so as to achieve load balancing among multiple nodes.

[0102] According to an embodiment of the present invention, determining at least one auxiliary node from a plurality of nodes includes: determining nodes from the plurality of nodes whose node idle rate is greater than or equal to a fourth preset idle rate threshold as third candidate nodes, thereby obtaining a plurality of third candidate nodes; and determining at least one auxiliary reclamation node from the plurality of third candidate nodes based on the number of memory resources to be reclaimed by each of the plurality of third candidate nodes.

[0103] A node's idle rate must be greater than or equal to a fourth preset idle rate threshold. For example, a node's idle rate must be ≥50%. Nodes that meet this threshold will be considered as third candidate nodes. The fourth preset idle rate threshold can be selected based on actual needs and is not limited here.

[0104] Based on the number of memory resources to be reclaimed by each of the multiple third candidate nodes, the node with the fewest number of memory resources to be reclaimed among the multiple third candidate nodes is selected as the auxiliary reclamation node.

[0105] For example, if the number of memory resources to be reclaimed stored in the third candidate node A is 4, the number of memory resources to be reclaimed stored in the third candidate node B is 2, and the number of memory resources to be reclaimed stored in the third candidate node C is 3, then the third candidate node B is designated as an auxiliary reclamation node.

[0106] According to an embodiment of the present invention, by selecting a third candidate node that is idle and has a small number of memory resources to be reclaimed as an auxiliary reclamation node, the data processing efficiency of the auxiliary reclamation node is not too low when reclaiming the memory resources to be reclaimed of the target node, so as to improve the reclamation efficiency of the node to be reclaimed and the auxiliary reclamation node.

[0107] Figure 5 A schematic diagram illustrating the recycling efficiency according to an embodiment of the present invention is shown.

[0108] According to an embodiment of the present invention, the database memory reclamation method of the present invention is compared with related technologies. The related technologies utilize 8 processor cores to perform the reclamation of memory resources to be reclaimed, while the present invention's database memory reclamation method utilizes 4 processor cores to perform the reclamation of memory resources to be reclaimed. Figure 5As shown, the recycling efficiency of related technologies can reach 440,000, while the database memory recycling method of the present invention can achieve a recycling efficiency of 720,000 by utilizing a smaller number of processor cores, which is a significant improvement in efficiency compared to related technologies.

[0109] Based on the above-described database memory reclamation method, this invention also provides a database memory reclamation device. The following will be combined with... Figure 6 The device is described in detail.

[0110] Figure 6 A structural block diagram of a database memory reclamation device according to an embodiment of the present invention is shown.

[0111] like Figure 6 As shown, the database memory reclamation device 600 of this embodiment includes a first determining module 610 and a first reclamation module 620.

[0112] The first determining module 610 is used to determine, based on the node identifiers included in at least one target transaction block in at least one transaction chain, a node to be reclaimed for each of at least one memory resource to be reclaimed, wherein the memory resource to be reclaimed is determined based on the node identifier and version identifier included in the target transaction block. In one embodiment, the first determining module 610 may be used to perform the operation S210 described above, which will not be repeated here.

[0113] The first recycling module 620 is used to reclaim at least one memory resource corresponding to any of the at least one nodes to be reclaimed, provided that the number of memory resources to be reclaimed in the node to be reclaimed is less than or equal to a preset threshold. In one embodiment, the first recycling module 620 may be used to perform the operation S220 described above, which will not be repeated here.

[0114] According to an embodiment of the present invention, when a target transaction block exists in the transaction chain, the node identifier of the target transaction block is obtained, and the node identifier of the target transaction block is compared with the node identifiers of each node to determine the node to be reclaimed indicated by the node identifier of the target transaction block among multiple nodes. This eliminates the need for a global scan of the resources stored on all nodes, enabling rapid location of the node to be reclaimed and saving the resource costs incurred by a global scan. Furthermore, the number of memory resources to be reclaimed in the node to be reclaimed is determined to ascertain whether the number of memory resources to be reclaimed is less than or equal to a preset threshold, thereby determining the load status of the node to be reclaimed, reducing the impact of excessive node load on the reclamation of memory resources to be reclaimed, and improving the reclamation efficiency of the node to be reclaimed.

[0115] According to embodiments of the present invention, any plurality of modules in the first determining module 610 and the first recycling module 620 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the first determining module 610 and the first recycling module 620 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the first determining module 610 and the first recycling module 620 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0116] According to an embodiment of the present invention, the database memory reclamation device 600 further includes a first generation module and a second determination module.

[0117] The first generation module is used to generate transaction blocks corresponding to each of the at least one process transaction obtained by executing the first process transaction using the target node. The transaction block includes the transaction identifier of the first process transaction, the version identifier of the process transaction, and the node identifier of the target node.

[0118] The second determining module is used to determine, for any transaction block in at least one transaction block, a matching transaction identifier that matches the transaction identifier included in the transaction block from the transaction identifiers of the second transaction to be executed included in the head of at least one transaction chain, and add the transaction block to the transaction chain corresponding to the matching transaction identifier.

[0119] According to an embodiment of the present invention, the database memory reclamation device 600 further includes a third determining module.

[0120] The third determining module is used to determine the target node from the multiple first candidate nodes based on the performance evaluation values ​​of each of the multiple first candidate nodes that meet the first predetermined conditions. The first predetermined conditions include at least one of the following: node idle rate is greater than or equal to a first preset idle rate threshold or bandwidth utilization is less than or equal to a first preset utilization threshold. The performance evaluation values ​​include at least one of the following: node idle rate, bandwidth utilization, or node load rate.

[0121] According to an embodiment of the present invention, the database memory reclamation device 600 further includes a fourth determining module.

[0122] The fourth determining module is used to determine a new target node from a plurality of second candidate nodes to continue executing the first transaction during the execution of the first transaction using the target node, in response to at least one of the target node’s idle rate being less than or equal to a second preset idle rate threshold or its bandwidth utilization being greater than or equal to a second preset utilization rate threshold. The second candidate nodes are other nodes besides the target node among the plurality of nodes.

[0123] According to an embodiment of the present invention, the fourth determining module includes a first determining submodule.

[0124] The first determining submodule is used to determine, based on the second performance evaluation values ​​and node distances of multiple second candidate nodes, a candidate node whose second performance evaluation value satisfies a second preset condition and whose node distance is the target node distance, as a new target node for continuing the execution of the first pending transaction. The second preset condition includes a node idle rate greater than or equal to a third preset idle rate threshold or a bandwidth utilization rate less than or equal to a third preset utilization rate threshold, and the node distance represents the distance between the second candidate node and the target node.

[0125] According to an embodiment of the present invention, the database memory reclamation device 600 further includes a fifth determining module and a second reclamation module.

[0126] The fifth determining module is used to determine at least one auxiliary reclamation node from multiple nodes when the number of memory resources to be reclaimed in the node to be reclaimed is greater than a preset threshold.

[0127] The second recycling module is used to recycle the first memory resource to be recycled using the recycling node and to recycle the second memory resource to be recycled using at least one auxiliary recycling node, wherein the at least one resource to be recycled corresponding to the recycling node includes the first memory resource to be recycled and the second memory resource to be recycled; or to recycle the at least one memory resource to be recycled corresponding to the recycling node using at least one auxiliary recycling node.

[0128] According to an embodiment of the present invention, the fifth determining module includes a second determining submodule and a third determining submodule.

[0129] The second determination submodule is used to determine the nodes with idle rates greater than or equal to a fourth preset idle rate threshold from multiple nodes as third candidate nodes, thereby obtaining multiple third candidate nodes.

[0130] The third determination submodule is used to determine at least one auxiliary reclamation node from multiple third candidate nodes based on the number of memory resources to be reclaimed by each of the multiple third candidate nodes.

[0131] According to an embodiment of the present invention, the database memory reclamation device 600 further includes a sixth determining module and a first acting module.

[0132] The sixth determining module is used to determine at least one target version identifier based on the version identifiers included in each of the multiple transaction blocks in the transaction chain.

[0133] The first module is used to identify at least one target transaction block as a corresponding transaction block to at least one target version identifier.

[0134] Figure 7 A block diagram of an electronic device suitable for implementing a database memory reclamation method according to an embodiment of the present invention is shown.

[0135] like Figure 7 As shown, an electronic device 700 according to an embodiment of the present invention includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a ROM 702 (read-only memory) or a program loaded from a storage portion 708 into a RAM 703 (random access memory). The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0136] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.

[0137] According to an embodiment of the present invention, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0138] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.

[0139] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.

[0140] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the database memory reclamation method provided in the embodiments of the present invention.

[0141] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0142] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0143] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0144] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0146] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.

[0147] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.

Claims

1. A database memory reclamation method, characterized by, The method comprises: determining, according to the node identifiers included in each of the at least one target transaction block in the at least one transaction chain, a to-be-reclaimed node for reclaiming each of the at least one to-be-reclaimed memory resource, wherein the to-be-reclaimed memory resource is determined according to the node identifier and the version identifier included in the target transaction block; and for any to-be-reclaimed node in the at least one to-be-reclaimed node, if the number of to-be-reclaimed memory resources of the to-be-reclaimed node is less than or equal to a preset number threshold, reclaiming, by the to-be-reclaimed node, at least one to-be-reclaimed memory resource corresponding to the to-be-reclaimed node.

2. The method of claim 1, wherein, The method further comprises: generating, according to at least one process transaction obtained by executing a first to-be-executed transaction by a target node, a transaction block corresponding to each of the at least one process transaction, wherein the transaction block comprises a transaction identifier of the first to-be-executed transaction, a version identifier of the process transaction, and a node identifier of the target node; and for any transaction block in the at least one transaction block, determining, from a transaction identifier of a second to-be-executed transaction included in a chain header of each of the at least one transaction chain, a matching transaction identifier matching the transaction identifier included in the transaction block, and adding the transaction block to a transaction chain corresponding to the matching transaction identifier.

3. The method of claim 2, wherein, The method further comprises: determining, according to a performance evaluation value of each of a plurality of first candidate nodes satisfying a first predetermined condition in a plurality of nodes, the target node from the plurality of first candidate nodes; wherein the first predetermined condition comprises at least one of a node idle rate greater than or equal to a first preset idle rate threshold or a bandwidth usage rate less than or equal to a first preset usage rate threshold, and the performance evaluation value comprises at least one of a node idle rate, a bandwidth usage rate, or a node load rate.

4. The method according to claim 2 or 3, characterized in that, The method further comprises: during execution of the first to-be-executed transaction by the target node, in response to at least one of a node idle rate of the target node being less than or equal to a second preset idle rate threshold or a bandwidth usage rate being greater than or equal to a second preset usage rate threshold, determining, from a plurality of second candidate nodes, a new target node for continuing execution of the first to-be-executed transaction, wherein the second candidate nodes are nodes other than the target node in the plurality of nodes.

5. The method of claim 4, wherein, The determining, from the plurality of second candidate nodes, a new target node for continuing execution of the first to-be-executed transaction comprises: determining, from the plurality of second candidate nodes, a candidate node having a second performance evaluation value satisfying a second preset condition and a node distance being a target node distance as the new target node for continuing execution of the first to-be-executed transaction, according to the second performance evaluation value of each of the plurality of second candidate nodes and the node distance; wherein the second preset condition comprises a node idle rate greater than or equal to a third preset idle rate threshold or a bandwidth usage rate less than or equal to a third preset usage rate threshold, and the node distance represents a distance between the second candidate node and the target node.

6. The method of any one of claims 1-3, wherein, The method further comprises: in the case where the number of to-be-reclaimed memory resources of the to-be-reclaimed node is greater than the preset number threshold, determining at least one auxiliary recovery node from the plurality of nodes; and recovering, by the to-be-recovered node, first to-be-recovered memory resources and recovering, by at least one of the auxiliary recovery nodes, second to-be-recovered memory resources, wherein the at least one to-be-recovered resource corresponding to the to-be-recovered node includes the first to-be-recovered memory resources and the second to-be-recovered memory resources; or recovering, by at least one of the auxiliary recovery nodes, the at least one to-be-recovered memory resource corresponding to the to-be-recovered node.

7. The method of claim 6, wherein, The determining at least one auxiliary node from the plurality of nodes includes: determining, as third candidate nodes, nodes with a node idle rate greater than or equal to a fourth preset idle rate threshold from the plurality of nodes, to obtain a plurality of third candidate nodes; and determining at least one auxiliary recovery node from the plurality of third candidate nodes according to the number of to-be-recovered memory resources of each of the plurality of third candidate nodes.

8. The method of any one of claims 1-3, wherein, The method further includes: determining at least one target version identifier from the version identifiers included in each of the plurality of transaction blocks in the transaction chain; and taking, as at least one target transaction block, a transaction block corresponding to each of the at least one target version identifier.

9. An electronic device, comprising: includes: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of any one of claims 1-8.

10. A computer-readable storage medium having stored thereon executable instructions that cause a processor-based system to perform steps comprising: The instruction, when executed by the processor, causes the processor to implement the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Method and system for recycling database resources

    CN103593449A

  • Space recovery method and device, electronic equipment and computer storage medium

    CN113419844A