A multi-dimensional resource asynchronous concurrent lock control and deadlock blocking system
Patent Information
- Application Number
- CN202610992887.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-06
- Publication Date
- 2026-09-22
AI Technical Summary
[0002]在现代计算机信息系统中,电子商务、社交网络及数字营销等应用场景面临着严峻的资源分配与并发控制挑战,这些系统需处理海量用户节点间错综复杂的推荐与锁定关系,尤其是在高并发环境下,如何精确分配奖励、佣金或权限成为关键,现有技术通常依赖关系型数据库的单线树状结构存储推荐关系,并利用数据库自带的事务与锁机制处理并发,针对多维交叉锁定,即同一资源被多维度实体同时锁定的情况,现有方案多通过增加关系表或简单优先级规则解决,但在面对日益复杂的商业模式时,这种基于传统数据库的技术架构在表达力与性能上均显现出局限性;
本发明从底层架构到高并发处理,再到业务分配与查询效率,全面提升复杂关系网络系统的综合性能,首先通过弹性关系链路与增量回溯机制,从根源上消解复杂网络中的循环依赖风险,确保底层数据结构的长期稳定,其次针对高并发场景,利用动态自适应锁池与预分配缓存的协同作用,有效解决热点锁争抢问题,大幅提升资源分配效率与响应速度,在多方锁定场景下,创新性地引入基于实时贡献因子的博弈仲裁机制,实现收益分配的动态精确与公平,彻底避免固定权重策略带来的分配争议,最后通过构建专用的内存递归树,将多层级关系链的查询复杂度降至极低水平,成功实现海量数据下近乎实时的链路回溯与资源定位,为系统的高效运行提供坚实保障。
Smart Images

Figure CN122795641A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer data processing and resource management technology, and in particular to a multi-dimensional resource asynchronous concurrent locking and deadlock prevention system. Background Technology
[0002] In modern computer information systems, e-commerce, social networks, and digital marketing applications face severe challenges in resource allocation and concurrency control. These systems need to handle the intricate recommendation and locking relationships among massive user nodes. Especially in high-concurrency environments, the precise allocation of rewards, commissions, or permissions becomes crucial. Existing technologies typically rely on the single-line tree structure of relational databases to store recommendation relationships and utilize the database's built-in transaction and locking mechanisms to handle concurrency. For multi-dimensional cross-locking, i.e., the situation where the same resource is locked by multiple entities at the same time, existing solutions mostly solve the problem by adding relational tables or simple priority rules. However, when faced with increasingly complex business models, this technical architecture based on traditional databases shows limitations in both expressiveness and performance. However, existing technologies have revealed significant shortcomings in practical applications. First, simple tree structures are difficult to effectively represent multidimensional cross-locking networks, and are prone to forming circular dependencies when establishing new relationships, leading to deadlocks and causing data processing to fall into an infinite loop. Second, in high-concurrency scenarios, the database's global lock or row lock mechanism is prone to serious lock waiting or even table locking when facing competition from hot nodes, severely restricting system performance. In addition, the benefit determination based on fixed priority lacks flexibility and cannot dynamically adapt to changes in the contributions of promoters, resulting in unfair distribution. At the same time, when relying on database multi-table join queries for deep fission links, its performance decreases exponentially with the increase of data volume, making it difficult to meet the needs of large-scale applications. Summary of the Invention
[0003] This invention provides a multi-dimensional resource asynchronous concurrent locking and deadlock prevention system to ensure efficient resource locking, fair allocation, and fast link query in a high-concurrency environment while maintaining data consistency and system stability.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources is provided, which includes: Constructing a resilient relationship graph: Obtain the initial user recommendation relationship and attach a survival time window to generate a resilient relationship link with a timestamp; When the window expires, incremental backtracking is performed to calculate the closed-loop probability. If the threshold is exceeded, the loop is eliminated, and finally a loop-free fixed relationship graph is generated. Dynamic lock pool management: Count the number of lock contention times during historical concurrent periods to calculate the node hotspot index, and dynamically adjust the lock granularity accordingly to generate an adaptive lock pool; Resource pre-allocation: When responding to a request, an adaptive lock pool is used to acquire a lock, and the hotspot index is used to determine whether to pre-fetch backend resources to the local cache, thus generating a pre-allocation state; Game payout distribution: Based on the acyclic graph and pre-allocated state, the contribution factor of the upper-level node is extracted, and the Nash equilibrium ratio is output after a finite number of game iterations as the basis for payout distribution; Efficient link query: Utilizes path compression and Bloom filter to construct an in-memory recursive tree, and outputs the complete upper-level link by recursively concatenating the links when responding to a query; Result persistence: The final allocation result is generated by combining the complete upper-level link and the Nash equilibrium ratio, and then written to the backend storage via an adaptive lock pool. Furthermore, the step of attaching a survival time window parameter to the initial recommendation relationship data to determine its effective period, and generating a set of timestamped resilient relationship links, includes: Obtain the creation timestamp of the initial recommendation relationship data; The expiration time of the initial recommendation relationship is obtained by arithmetically summing the creation timestamp with a system-level survival duration parameter used to define the validity period; The initial recommendation relationship data and the expiration time point are encapsulated into a single timestamp elastic link, and multiple single timestamp elastic links are aggregated to form the elastic relationship link set.
[0005] Furthermore, the step of performing incremental path backtracking based on the elastic relationship link set when the survival time window parameter expires, and calculating the closed-loop probability value characterizing the loop density in the elastic relationship link set, includes: Extract all timestamp elastic links that have expired at the current time from the set of elastic relationship links to form a temporary backtracking subgraph; In the backtracking subgraph, the total number of closed-loop paths discovered through breadth-first search is counted; The total number of completed search paths in the backtracking subgraph is counted, and the total number of closed-loop paths is divided by the total number of search paths to obtain the closed-loop probability value.
[0006] Furthermore, the step of dynamically adjusting the lock granularity parameters corresponding to each user node in the lock pool based on the hotspot index to generate a dynamic adaptive lock pool includes: Obtain a first threshold for triggering lock granularity upgrade and a second threshold for triggering lock granularity downgrade; The hotspot index of each user node is compared with the first threshold and the second threshold; When the hotspot index is greater than the first threshold, the lock granularity parameter corresponding to the user node is adjusted from coarse granularity to fine granularity. When the hotspot index is less than the second threshold, the lock granularity parameter corresponding to the user node is adjusted from fine granularity to coarse granularity, thereby forming the dynamic adaptive lock pool containing each user node and its corresponding lock granularity parameter.
[0007] Furthermore, the step of determining whether to pre-fetch resources from the backend resource pool to the local cache based on the hotspot index of the target user node, and generating pre-allocated cache state data containing cache availability, includes: Get a cache threshold to trigger cache operations; Compare the hotspot index of the target user node with the cache threshold; If the hotspot index is greater than the cache threshold, the number of resources to be prefetched this time is calculated based on the hotspot index, and the resources of the specified number are extracted from the backend resource pool and stored in the local cache. The remaining amount of resources in the local cache is recorded, and the pre-allocated cache status data is generated.
[0008] Furthermore, the steps of extracting contribution factor data of each parent node of the locked target user node, performing a finite number of game iterations on the contribution factor data, and outputting the Nash equilibrium allocation ratio as the result of the payout decision include: The actual transaction amount and user activity improvement value of each superior node within a specified time period are extracted from the transaction log and user behavior log to form the contribution factor data. The contribution factor data is normalized, and the initial contribution weight of each parent node is calculated by weighted summation. The initial contribution weight is used as the input for the game iteration. Within a preset number of iterations, the weight of each superior node in the next round is adjusted according to its relative weight advantage in the current iteration round until a stable weight combination is formed. The weights of each parent node in the stable weight combination are normalized to obtain the Nash equilibrium allocation ratio.
[0009] Furthermore, the step of generating a memory recursive tree containing path compression indexes and incremental index structures based on the acyclic solidified relationship graph through path compression and Bloom filter construction operations includes: For each user node in the acyclic solidified relationship graph, path compression is performed, and the paths of all its ancestor nodes are normalized into direct links pointing to a single root node, forming the path compression index; For each node in the path compression index, obtain the set of identifiers of all its direct child nodes, and use multiple hash functions to operate on the set of identifiers to generate a Bloom filter bitmap for quickly determining the membership of child nodes; The path compression index is associated with and stored with the Bloom filter bitmap to form the incremental index structure, and then organized into the memory recursive tree.
[0010] Furthermore, the step of using the memory recursive tree to perform recursive path concatenation and outputting complete upper-level link data containing the node sequence includes: Find the target user node of the upper-level link query request from the memory recursion tree, obtain its path compression index, and get its parent node identifier; Extract the Bloom filter bitmap associated with the parent node identifier, and use the bitmap to verify the connection relationship between the target user node and the parent node; If the connection relationship verification passes, the parent node identifier is used as the new query target, and the above search and verification steps are repeated until the root node is reached. All verified node identifiers are then concatenated in order to obtain the complete upper-level link data.
[0011] Furthermore, the step of generating the final resource allocation result based on the complete upstream link data and the Nash equilibrium allocation ratio, and writing the resource allocation result into the backend storage through the dynamic adaptive lock pool, includes: The Nash equilibrium allocation ratio is matched one by one with each upper-level node in the complete upper-level link data to generate a revenue allocation mapping table containing the revenue recipient and the corresponding share. The revenue distribution mapping table is encapsulated into a transactional write task and submitted to the dynamic adaptive lock pool. The dynamic adaptive lock pool applies corresponding lock granularity parameter control based on the user nodes involved in the transactional write task, and writes the contents of the revenue allocation mapping table into the backend storage.
[0012] Secondly, a substation protection pressure plate anti-misoperation intelligent monitoring and interlocking control system includes: The relationship link processing module is used to obtain the initial recommendation relationship data between user nodes, add a survival time window parameter to generate a set of elastic relationship links with timestamps, and perform incremental path backtracking when the survival time window parameter expires, calculate the closed loop probability value, and finally generate an acyclic solidified relationship graph. The dynamic concurrency control module is used to calculate the hotspot index of each user node based on the acyclic solidified relationship graph, generate and maintain a dynamic adaptive lock pool, and perform locking operations and local cache pre-allocation on resource allocation requests according to the lock pool, and generate pre-allocated cache status data. The revenue arbitration module is used to extract contribution factor data based on the acyclic fixed relationship graph and the pre-allocated cache state data, and output the Nash equilibrium allocation ratio as the result of the revenue attribution decision through a finite number of game iterations. The memory indexing module is used to generate and maintain a memory recursive tree based on the acyclic fixed relationship graph through path compression and Bloom filter construction operations; The query and execution module is used to respond to query requests, perform recursive path concatenation using the memory recursive tree to output complete upper-level link data, generate resource allocation results based on the complete upper-level link data and the Nash equilibrium allocation ratio, and finally write the resource allocation results to the backend storage through the dynamic adaptive lock pool.
[0013] Thirdly, an electronic device is provided, comprising: a processor and a memory; the memory is used to store a computer program, which, when executed by the processor, causes the electronic device to perform the multidimensional resource asynchronous concurrent locking and deadlock prevention system described in the first aspect.
[0014] In one possible design, the electronic device described in the third aspect may further include a transceiver. This transceiver may be a transceiver circuit or an interface circuit. The transceiver can be used for communication between the electronic device described in the third aspect and other electronic devices.
[0015] In the embodiments of the present invention, the electronic device described in the third aspect may be a terminal, or a chip (system) or other component or assembly disposed in the terminal, or a system containing the terminal.
[0016] Fourthly, a computer-readable storage medium is provided, comprising: a computer program or instructions; when the computer program or instructions are executed on a computer, the computer causes the computer to perform the multidimensional resource asynchronous concurrent locking and deadlock prevention system described in the first aspect.
[0017] In summary, the above methods and systems have the following technical effects: This invention comprehensively improves the overall performance of complex relationship network systems, from the underlying architecture to high-concurrency processing, and then to business allocation and query efficiency. First, by using elastic relationship links and incremental backtracking mechanisms, it eliminates the risk of circular dependencies in complex networks at the source, ensuring the long-term stability of the underlying data structure. Second, for high-concurrency scenarios, it effectively solves the problem of hot lock contention by utilizing the synergy of dynamic adaptive lock pools and pre-allocated caches, significantly improving resource allocation efficiency and response speed. In multi-party locking scenarios, it innovatively introduces a game arbitration mechanism based on real-time contribution factors to achieve dynamic, accurate, and fair distribution of benefits, completely avoiding allocation disputes caused by fixed-weight strategies. Finally, by constructing a dedicated in-memory recursive tree, it reduces the query complexity of multi-level relationship chains to an extremely low level, successfully achieving near real-time link backtracking and resource location under massive data, providing a solid guarantee for the efficient operation of the system. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of a control system provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0020] In this embodiment of the invention, "instruction" can include direct and indirect instructions, as well as explicit and implicit instructions. The information indicated by a certain piece of information is called the information to be instructed. In specific implementation, there are many ways to instruct the information to be instructed, such as, but not limited to, directly instructing the information to be instructed, such as the information to be instructed itself or its index. It can also indirectly instruct the information to be instructed by instructing other information, where there is a correlation between the other information and the information to be instructed. It can also instruct only a part of the information to be instructed, while the other parts are known or pre-agreed upon. For example, the instruction of specific information can be achieved by using a pre-agreed (e.g., protocol-defined) arrangement of various pieces of information, thereby reducing instruction overhead to some extent. Simultaneously, common parts of various pieces of information can be identified and uniformly indicated to reduce the instruction overhead caused by individually indicating the same information.
[0021] Furthermore, the specific indication method can also be any existing indication method, such as, but not limited to, the above-mentioned indication methods and their various combinations. Specific details of various indication methods can be found in existing technologies, and will not be elaborated upon here. As described above, for example, when multiple pieces of information of the same type need to be indicated, the indication methods for different pieces of information may differ. In specific implementation, the required indication method can be selected according to specific needs. This embodiment of the invention does not limit the selected indication method; therefore, the indication methods involved in this embodiment of the invention should be understood to cover various methods that enable the party to be indicated to obtain the information to be indicated.
[0022] It should be understood that the information to be indicated can be sent as a whole or divided into multiple sub-information messages sent separately, and the sending period and / or timing of these sub-information messages can be the same or different. The specific sending method is not limited in this embodiment of the invention. The sending period and / or timing of these sub-information messages can be predefined, for example, according to a protocol, or configured by the sending device by sending configuration information to the receiving device.
[0023] "Predefined" or "pre-configured" can be achieved by pre-saving corresponding codes, tables, or other means that can be used to indicate relevant information in the device. This embodiment of the invention does not limit the specific implementation method. "Saving" can refer to saving in one or more memories. These memories can be separate installations or integrated into the encoder, decoder, processor, or electronic device. Alternatively, some memories can be separately installed, while others are integrated into the decoder, processor, or electronic device. The type of memory can be any form of storage medium, and this embodiment of the invention does not limit this.
[0024] In the embodiments of this invention, the “protocol” may refer to a protocol family in the field of communication, a standard protocol with a similar protocol family frame structure, or a related protocol applied to a future multi-dimensional resource asynchronous concurrent locking and deadlock blocking system. The embodiments of this invention do not specifically limit this.
[0025] In this embodiment of the invention, descriptions such as "when," "under the circumstances," "if," and "if" all refer to the device making corresponding processing under certain objective circumstances, and are not limited to a specific time. They do not require the device to make a judgment action during implementation, nor do they imply any other limitations.
[0026] In the description of the embodiments of the present invention, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in the embodiments of the present invention is merely a description of the relationship between the related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of the embodiments of the present invention, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Additionally, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or order of execution, and that "first," "second," etc., are not necessarily different. Furthermore, in the embodiments of this invention, words such as "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this invention should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner for ease of understanding.
[0027] The network architecture and business scenarios described in the embodiments of this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.
[0028] The above combination Figure 1 The method provided by the embodiments of the present invention is described in detail below. A multi-dimensional resource asynchronous concurrent locking and deadlock prevention method for executing the method provided by the embodiments of the present invention is described in detail below. The method includes: Constructing a resilient relationship graph: Obtain the initial user recommendation relationship and attach a survival time window to generate a resilient relationship link with a timestamp; When the window expires, incremental backtracking is performed to calculate the closed-loop probability. If the threshold is exceeded, the loop is eliminated, and finally a loop-free fixed relationship graph is generated. Dynamic lock pool management: Count the number of lock contention times during historical concurrent periods to calculate the node hotspot index, and dynamically adjust the lock granularity accordingly to generate an adaptive lock pool; Resource pre-allocation: When responding to a request, an adaptive lock pool is used to acquire a lock, and the hotspot index is used to determine whether to pre-fetch backend resources to the local cache, thus generating a pre-allocation state; Game payout distribution: Based on the acyclic graph and pre-allocated state, the contribution factor of the upper-level node is extracted, and the Nash equilibrium ratio is output after a finite number of game iterations as the basis for payout distribution; Efficient link query: Utilizes path compression and Bloom filter to construct an in-memory recursive tree, and outputs the complete upper-level link by recursively concatenating the links when responding to a query; Result persistence: The final allocation result is generated by combining the complete upper-level link and the Nash equilibrium ratio, and then written to the backend storage via an adaptive lock pool. 2. Optionally, the step of attaching a survival time window parameter to the initial recommendation relationship data to determine its effective period, and generating a set of timestamped resilient relationship links, includes: Obtain the creation timestamp of the initial recommendation relationship data; The expiration time of the initial recommendation relationship is obtained by arithmetically summing the creation timestamp with a system-level survival duration parameter used to define the validity period; This calculation process can be represented by Formula 1; in, This represents the final calculated expiration time, marking the end of the effective window for this elastic relationship link. At that point, a decision must be made to either solidify or dissolve the relationship. This represents the creation timestamp when the system captured the initial recommendation relationship. It is typically a Unix timestamp, with millisecond-level precision, and is provided directly by the system clock. This represents the system's preset survival time. It is a configurable system parameter, and its value is usually between 10 and 60 seconds. It is used to balance the system's real-time response with the computational overhead of loop detection. The initial recommendation relationship data and the expiration time point are encapsulated into a single timestamp elastic link, and multiple single timestamp elastic links are aggregated to form the elastic relationship link set.
[0029] 3. Optionally, the step of performing incremental path backtracking based on the elastic relationship link set when the survival time window parameter expires, and calculating the closed-loop probability value characterizing the loop density in the elastic relationship link set, includes: Extract all timestamp elastic links that have expired at the current time from the set of elastic relationship links to form a temporary backtracking subgraph; In the backtracking subgraph, the total number of closed-loop paths discovered through breadth-first search is counted; The total number of completed search paths in the backtracking subgraph is counted, and the total number of closed-loop paths is divided by the total number of search paths to obtain the closed-loop probability value.
[0030] 4. Optionally, the step of dynamically adjusting the lock granularity parameters corresponding to each user node in the lock pool based on the hotspot index to generate a dynamic adaptive lock pool includes: Obtain a first threshold for triggering lock granularity upgrade and a second threshold for triggering lock granularity downgrade; The hotspot index of each user node is compared with the first threshold and the second threshold; When the hotspot index is greater than the first threshold, the lock granularity parameter corresponding to the user node is adjusted from coarse granularity to fine granularity. When the hotspot index is less than the second threshold, the lock granularity parameter corresponding to the user node is adjusted from fine granularity to coarse granularity, thereby forming the dynamic adaptive lock pool containing each user node and its corresponding lock granularity parameter. This calculation process is achieved through the following formula; In this formula, The hotspot index, representing the final calculated value of user node i, is normalized to between 0 and 1. This is the raw number of contention attempts for user node i, calculated from the logs. and These represent the minimum and maximum number of contentions among all monitored user nodes during the current statistical period. These two values are obtained by performing a traversal scan of the contention counts of all nodes in the current batch.
[0031] 5. Optionally, the step of determining whether to pre-fetch resources from the backend resource pool to the local cache based on the hotspot index of the target user node, and generating pre-allocated cache state data containing cache availability, includes: Get a cache threshold to trigger cache operations; Compare the hotspot index of the target user node with the cache threshold; If the hotspot index is greater than the cache threshold, the number of resources to be prefetched this time is calculated based on the hotspot index, and the resources of the specified number are extracted from the backend resource pool and stored in the local cache. The remaining amount of resources in the local cache is recorded, and the pre-allocated cache status data is generated.
[0032] 6. Optionally, the step of extracting contribution factor data of each parent node of the locked target user node, performing a finite number of game iterations on the contribution factor data, and outputting the Nash equilibrium allocation ratio as the result of the payout decision includes: The actual transaction amount and user activity improvement value of each superior node within a specified time period are extracted from the transaction log and user behavior log to form the contribution factor data. The contribution factor data is normalized, and the initial contribution weight of each parent node is calculated by weighted summation. The calculation process is represented by the following formula; In this formula, This represents the initial contribution weight of the parent node i. and These are the normalized actual transaction amount and activity increase value for that node, respectively. The calculation method typically uses maximum and minimum value normalization to ensure the values are between 0 and 1. and These are the system's preset weighting coefficients, and + The value is equal to 1, used to adjust the importance of transaction contribution and activity contribution in the final weight calculation. The initial contribution weight is used as the input for the game iteration. Within a preset number of iterations, the weight of each superior node in the next round is adjusted according to its relative weight advantage in the current iteration round until a stable weight combination is formed. The weights of each parent node in the stable weight combination are normalized to obtain the Nash equilibrium allocation ratio, and the adjustment process follows the following formula. In this formula, It is the new weight of the parent node i after the (k+1)th iteration. It is its weight at the k-th iteration. It is the sum of the weights of all participating parent nodes in the game at the k-th iteration, N is the total number of participating parent nodes, and c is a small adjustment factor, usually ranging from 0.1 to 0.3, used to control the magnitude of weight adjustment.
[0033] 7. Optionally, the step of generating a memory recursive tree containing path compression indexes and incremental index structures based on the acyclic solidified relationship graph through path compression and Bloom filter construction operations includes: For each user node in the acyclic solidified relationship graph, path compression is performed, and the paths of all its ancestor nodes are normalized into direct links pointing to a single root node, forming the path compression index; For each node in the path compression index, obtain the set of identifiers of all its direct child nodes, and use multiple hash functions to operate on the set of identifiers to generate a Bloom filter bitmap for quickly determining the membership of child nodes; The path compression index is associated with and stored with the Bloom filter bitmap to form the incremental index structure, and then organized into the memory recursive tree.
[0034] 8. Optionally, the step of using the memory recursive tree to perform recursive path concatenation and outputting complete upper-level link data containing the node sequence includes: Find the target user node of the upper-level link query request from the memory recursion tree, obtain its path compression index, and get its parent node identifier; Extract the Bloom filter bitmap associated with the parent node identifier, and use the bitmap to verify the connection relationship between the target user node and the parent node; If the connection relationship verification passes, the parent node identifier is used as the new query target, and the above search and verification steps are repeated until the root node is reached. All verified node identifiers are then concatenated in order to obtain the complete upper-level link data.
[0035] 9. Optionally, the step of generating the final resource allocation result based on the complete upstream link data and the Nash equilibrium allocation ratio, and writing the resource allocation result into the backend storage through the dynamic adaptive lock pool, includes: The Nash equilibrium allocation ratio is matched one by one with each upper-level node in the complete upper-level link data to generate a revenue allocation mapping table containing the revenue recipient and the corresponding share. The revenue distribution mapping table is encapsulated into a transactional write task and submitted to the dynamic adaptive lock pool. The dynamic adaptive lock pool applies corresponding lock granularity parameter control based on the user nodes involved in the transactional write task, and writes the contents of the revenue allocation mapping table into the backend storage.
[0036] This invention provides a schematic diagram of the structure of an electronic device. Exemplarily, the electronic device can be a network device, or a chip (system) or other component or assembly that can be disposed in a network device. As shown, the electronic device may include a processor. Optionally, the electronic device may also include a memory and / or a transceiver. The processor is coupled to the memory and transceiver, for example, by means of a communication bus connection.
[0037] The following section provides a detailed introduction to each component of the electronic device, with reference to the diagram: In this context, the processor is the control center of the electronic device. It can be a single processor or a collective term for multiple processing elements. For example, a processor can be one or more central processing units (CPUs), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).
[0038] Alternatively, the processor can perform various functions of the electronic device by running or executing software programs stored in memory and calling data stored in memory, such as executing a multi-dimensional resource asynchronous concurrent locking and deadlock prevention system as shown in the figure above.
[0039] In a specific implementation, as one example, the processor may include one or more CPUs, such as the CPU and CPU shown in the figure.
[0040] In a specific implementation, as one example, the electronic device may also include multiple processors. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0041] The memory is used to store the software program that executes the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.
[0042] Optionally, the memory can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory can be integrated with the processor or exist independently and coupled to the processor through the interface circuit of the electronic device; the embodiments of the present invention do not specifically limit this.
[0043] A transceiver is used for communication with other electronic devices. For example, if the electronic device is a terminal, the transceiver can be used to communicate with a network device or with another terminal device. Similarly, if the electronic device is a network device, the transceiver can be used to communicate with a terminal or with another network device.
[0044] Optionally, the transceiver may include a receiver and a transmitter (not shown separately in the figure). The receiver is used to implement the receiving function, and the transmitter is used to implement the sending function.
[0045] Optionally, the transceiver can be integrated with the processor or exist independently and coupled to the processor through the interface circuit of the electronic device. This embodiment of the invention does not specifically limit this.
[0046] It is understood that the structure of the electronic device shown in the figure does not constitute a limitation on the electronic device. The actual electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0047] Furthermore, the technical effects of the electronic device can be referred to the technical effects of the multi-dimensional resource asynchronous concurrent locking and deadlock prevention system described in the above method embodiments, which will not be repeated here.
[0048] It should be understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0049] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0050] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0051] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0052] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.
[0053] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0054] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0055] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0056] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0057] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0058] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0059] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0060] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources, characterized in that, include: Constructing a resilient relationship graph: Obtain the initial user recommendation relationship and attach a survival time window to generate a resilient relationship link with a timestamp; When the window expires, incremental backtracking is performed to calculate the closed-loop probability. If the threshold is exceeded, the loop is eliminated, and finally a loop-free fixed relationship graph is generated. Dynamic lock pool management: Count the number of lock contention times during historical concurrent periods to calculate the node hotspot index, and dynamically adjust the lock granularity accordingly to generate an adaptive lock pool; Resource pre-allocation: When responding to a request, an adaptive lock pool is used to acquire a lock, and the hotspot index is used to determine whether to pre-fetch backend resources to the local cache, thus generating a pre-allocation state; Game payout distribution: Based on the acyclic graph and pre-allocated state, the contribution factor of the upper-level node is extracted, and the Nash equilibrium ratio is output after a finite number of game iterations as the basis for payout distribution; Efficient link query: Utilizes path compression and Bloom filter to construct an in-memory recursive tree, and outputs the complete upper-level link by recursively concatenating the links when responding to a query; Result persistence: The final allocation result is generated by combining the complete upper-level link and the Nash balance ratio, and then written to the backend storage through an adaptive lock pool.
2. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of attaching a survival time window parameter to the initial recommendation relationship data to determine its effective period, and generating a set of timestamped elastic relationship links, includes: Obtain the creation timestamp of the initial recommendation relationship data; The expiration time of the initial recommendation relationship is obtained by arithmetically summing the creation timestamp with a system-level survival duration parameter used to define the validity period; The initial recommendation relationship data and the expiration time point are encapsulated into a single timestamp elastic link, and multiple single timestamp elastic links are aggregated to form the elastic relationship link set.
3. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of performing incremental path backtracking based on the elastic relationship link set when the survival time window parameter expires, and calculating the closed-loop probability value characterizing the loop density in the elastic relationship link set, includes: Extract all timestamp elastic links that have expired at the current time from the set of elastic relationship links to form a temporary backtracking subgraph; In the backtracking subgraph, the total number of closed-loop paths discovered through breadth-first search is counted; The total number of completed search paths in the backtracking subgraph is counted, and the total number of closed-loop paths is divided by the total number of search paths to obtain the closed-loop probability value.
4. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of dynamically adjusting the lock granularity parameters corresponding to each user node in the lock pool based on the hotspot index to generate a dynamic adaptive lock pool includes: Obtain a first threshold for triggering lock granularity upgrade and a second threshold for triggering lock granularity downgrade; The hotspot index of each user node is compared with the first threshold and the second threshold; When the hotspot index is greater than the first threshold, the lock granularity parameter corresponding to the user node is adjusted from coarse granularity to fine granularity. When the hotspot index is less than the second threshold, the lock granularity parameter corresponding to the user node is adjusted from fine granularity to coarse granularity, thereby forming the dynamic adaptive lock pool containing each user node and its corresponding lock granularity parameter.
5. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of determining whether to prefetch resources from the backend resource pool to the local cache based on the hotspot index of the target user node, and generating pre-allocated cache state data containing cache availability, includes: Get a cache threshold to trigger cache operations; Compare the hotspot index of the target user node with the cache threshold; If the hotspot index is greater than the cache threshold, the number of resources to be prefetched this time is calculated based on the hotspot index, and the resources of the specified number are extracted from the backend resource pool and stored in the local cache. The remaining amount of resources in the local cache is recorded, and the pre-allocated cache status data is generated.
6. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The steps of extracting contribution factor data of each parent node of the locked target user node, performing a finite number of game iterations on the contribution factor data, and outputting the Nash equilibrium allocation ratio as the result of the payout decision include: The actual transaction amount and user activity improvement value of each superior node within a specified time period are extracted from the transaction log and user behavior log to form the contribution factor data. The contribution factor data is normalized, and the initial contribution weight of each parent node is calculated by weighted summation. The initial contribution weight is used as the input for the game iteration. Within a preset number of iterations, the weight of each superior node in the next round is adjusted according to its relative weight advantage in the current iteration round until a stable weight combination is formed. The weights of each parent node in the stable weight combination are normalized to obtain the Nash equilibrium allocation ratio.
7. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of generating a memory recursive tree containing path compression indexes and incremental index structures based on the acyclic solidified relationship graph through path compression and Bloom filter construction operations includes: For each user node in the acyclic solidified relationship graph, path compression is performed, and the paths of all its ancestor nodes are normalized into direct links pointing to a single root node, forming the path compression index; For each node in the path compression index, obtain the set of identifiers of all its direct child nodes, and use multiple hash functions to operate on the set of identifiers to generate a Bloom filter bitmap for quickly determining the membership of child nodes; The path compression index is associated with and stored with the Bloom filter bitmap to form the incremental index structure, and then organized into the memory recursive tree.
8. The method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of using the memory recursive tree to perform recursive path concatenation and outputting complete upper-level link data containing the node sequence includes: Find the target user node of the upper-level link query request from the memory recursion tree, obtain its path compression index, and get its parent node identifier; Extract the Bloom filter bitmap associated with the parent node identifier, and use the bitmap to verify the connection relationship between the target user node and the parent node; If the connection relationship verification passes, the parent node identifier is used as the new query target, and the above search and verification steps are repeated until the root node is reached. All verified node identifiers are then concatenated in order to obtain the complete upper-level link data.
9. A method for asynchronous concurrent locking and deadlock prevention of multi-dimensional resources as described in claim 1, characterized in that, The step of generating the final resource allocation result based on the complete upstream link data and the Nash equilibrium allocation ratio, and writing the resource allocation result into the backend storage through the dynamic adaptive lock pool includes: The Nash equilibrium allocation ratio is matched one by one with each upper-level node in the complete upper-level link data to generate a revenue allocation mapping table containing the revenue recipient and the corresponding share. The revenue distribution mapping table is encapsulated into a transactional write task and submitted to the dynamic adaptive lock pool. The dynamic adaptive lock pool applies corresponding lock granularity parameter control based on the user nodes involved in the transactional write task, and writes the contents of the revenue allocation mapping table into the backend storage.
10. A multi-dimensional resource asynchronous concurrent locking and deadlock prevention system, applied to the multi-dimensional resource asynchronous concurrent locking and deadlock prevention method according to any one of claims 1-9, characterized in that: The relationship link processing module is used to obtain the initial recommendation relationship data between user nodes, add a survival time window parameter to generate a set of elastic relationship links with timestamps, and perform incremental path backtracking when the survival time window parameter expires, calculate the closed loop probability value, and finally generate an acyclic solidified relationship graph. The dynamic concurrency control module is used to calculate the hotspot index of each user node based on the acyclic solidified relationship graph, generate and maintain a dynamic adaptive lock pool, and perform locking operations and local cache pre-allocation on resource allocation requests according to the lock pool, and generate pre-allocated cache status data. The revenue arbitration module is used to extract contribution factor data based on the acyclic fixed relationship graph and the pre-allocated cache state data, and output the Nash equilibrium allocation ratio as the result of the revenue attribution decision through a finite number of game iterations. The memory indexing module is used to generate and maintain a memory recursive tree based on the acyclic fixed relationship graph through path compression and Bloom filter construction operations; The query and execution module is used to respond to query requests, perform recursive path concatenation using the memory recursive tree to output complete upper-level link data, generate resource allocation results based on the complete upper-level link data and the Nash equilibrium allocation ratio, and finally write the resource allocation results to the backend storage through the dynamic adaptive lock pool.