Dynamic distributed data structure management method and device based on token transfer

By dynamically allocating and managing the data structure storage space of a multi-core system through a token passing mechanism, the problems of remote memory access latency and scalability in traditional centralized management methods are solved, enabling efficient concurrent operation in a multi-core environment.

CN120950448APending Publication Date: 2025-11-14SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511002801.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In multi-core processor systems, traditional centralized management methods lead to increased latency in remote memory access, making it difficult to achieve efficient concurrent operations and good scalability.

Method used

A token-based dynamic distributed data structure management method is adopted. By detecting the kernel's token holding state and memory state, tokens are dynamically allocated to determine the target kernel to execute operation instructions, thereby realizing spiral storage and management of data elements.

Benefits of technology

It reduces remote memory access, supports efficient concurrent operations of global data structures in multi-core environments, and has good scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950448A_ABST
    Figure CN120950448A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic distributed data structure management method and device based on token transfer, the method and device are applied to a multi-core processor system, the multi-core processor system comprises at least two cores, and the method comprises the following steps: receiving an operation instruction, and responding to the operation instruction to detect the holding state of a token of each core; determining a first kernel according to the holding state; determining a memory state of the first kernel; determining an operation type according to the operation instruction; the operation type comprises insertion operation and deletion operation; token dynamic information is determined based on the memory state and the operation type; determining a target kernel according to the token dynamic information; and enabling the target kernel to execute the operation instruction. According to the method, the storage space of the data structure in the multi-core system is dynamically distributed and managed through the token mechanism, efficient insertion, deletion and other operations are supported, remote memory access can be reduced, and the mechanism has good expandability so as to support efficient concurrent operation on the global data structure in the multi-core environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed computer technology, and more specifically, to a method and apparatus for managing dynamic distributed data structures based on token passing. Background Technology

[0002] In multi-core processor systems, efficiently and concurrently managing shared global data structures (such as queues, stacks, deques, lists, etc.) is a key challenge. As the number of cores increases, the limitations of traditional centralized management methods become increasingly apparent. First, in centralized storage schemes, data typically resides in shared memory or the local memory of a specific kernel. This means that the kernel performing the operation often needs to make expensive remote memory accesses, significantly increasing operational latency. Second, existing distributed data structure implementations typically employ static memory allocation or centralized management, making it difficult to achieve high scalability under dynamic loads. Summary of the Invention

[0003] This invention provides a dynamic distributed data structure management method and apparatus based on token passing, which can reduce remote memory access and has a good scalability mechanism to support efficient concurrent operations on global data structures in a multi-core environment.

[0004] In a first aspect, the present invention provides a dynamic distributed data structure management method based on token passing, applied to a multi-core processor system, wherein the multi-core processor system includes at least two cores, and the method includes:

[0005] Receive operation instructions, and in response to the operation instructions, detect the holding status of the kernel's own token;

[0006] The first kernel is determined based on the holding status;

[0007] Determine the memory state of the first kernel;

[0008] The operation type is determined according to the operation instruction; the operation type includes insertion and deletion operations;

[0009] The token dynamic information is determined based on the memory state and the operation type;

[0010] The target kernel is determined based on the dynamic information of the token;

[0011] The target kernel executes the operation instructions.

[0012] Preferably, receiving the operation instruction and detecting the kernel's own token holding status in response to the operation instruction includes:

[0013] The operation instructions include insertion instructions and deletion instructions;

[0014] The tokens include insertion tokens and deletion tokens;

[0015] In response to the insert instruction, the kernel is checked to see if it has the insert token;

[0016] In response to the deletion instruction, the kernel is checked to see if it has the deletion token.

[0017] Preferably, determining the first kernel based on the holding state includes:

[0018] The kernel that has the insertion token or the deletion token is identified as the first kernel.

[0019] Preferably, determining the token dynamic information based on the memory state and the operation type includes:

[0020] If the operation type is the insertion operation and the memory state is full, then the token passing trigger condition is met, and the insertion token is passed to the next kernel in sequence.

[0021] If the operation type is the deletion operation and the memory state is empty, then the token passing trigger condition is met, and the deletion token is passed to the next kernel in sequence.

[0022] Preferably, it further includes:

[0023] If the token transfer triggering condition is met, new memory is allocated to the kernel currently holding the inserted token;

[0024] If the token transfer trigger condition is met, the memory of the kernel currently holding the deletion token is deleted.

[0025] Preferably, determining the target kernel based on the token dynamic information includes:

[0026] The first kernel where the current location of the token transmission stops is determined is the target kernel.

[0027] Preferably, it further includes:

[0028] The tokens are transmitted unidirectionally among the kernels in numerical order;

[0029] After each round of inter-kernel transfer is completed, the round increment signal is triggered once.

[0030] Secondly, the present invention provides a dynamic distributed data structure management device based on token passing, applied to a multi-core processor system, wherein the multi-core processor system includes at least two cores, and the device includes:

[0031] The holding status detection module is used to receive operation instructions and, in response to the operation instructions, detect the holding status of the kernel's own token;

[0032] The first kernel determination module is used to determine the first kernel based on the holding state;

[0033] A memory state determination module is used to determine the memory state of the first kernel;

[0034] An operation type determination module is used to determine the operation type based on the operation instruction;

[0035] A token dynamic information determination module is used to determine token dynamic information based on the memory state and the operation type;

[0036] The target kernel determination module is used to determine the target kernel based on the token dynamic information.

[0037] An operation instruction execution module is used to cause the target kernel to execute the operation instructions.

[0038] Thirdly, the present invention provides a readable medium including executable instructions, which, when executed by a processor of an electronic device, cause the electronic device to perform any of the methods described in the first aspect.

[0039] Fourthly, the present invention provides an electronic device including a processor and a memory storing execution instructions, wherein when the processor executes the execution instructions stored in the memory, the processor performs the method as described in any of the first aspects.

[0040] This invention provides a dynamic distributed data structure management method and apparatus based on token passing. It initially detects the holding status of the kernel's own tokens, performs logical control based on the holding status, rapidly executes operation instructions, and generates dynamic token information based on the memory state and operation type of the corresponding kernel. This determines the target kernel, causing it to execute the operation instructions, thus forming a spiral storage process of token passing and data elements. This achieves dynamic allocation and management of storage space for data structures in a multi-core system using a token mechanism, supports efficient insertion and deletion operations, reduces remote memory access, and possesses a highly scalable mechanism to support efficient concurrent operations on global data structures in a multi-core environment.

[0041] The further effects of the aforementioned non-conventional preferred method will be explained below in conjunction with specific embodiments. Attached Figure Description

[0042] To more clearly illustrate the embodiments of the present invention or the existing technical solutions, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 A schematic diagram of a dynamic distributed data structure management method based on token passing provided in an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the data insertion and data deletion process in one embodiment of the present invention;

[0045] Figure 3 A schematic diagram of another dynamic distributed data structure management method based on token passing provided in an embodiment of the present invention;

[0046] Figure 4 This is a schematic diagram of the token passing process in one embodiment of the present invention;

[0047] Figure 5 A schematic diagram of a dynamic distributed data structure management device based on token passing provided in an embodiment of the present invention;

[0048] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0050] With advancements in semiconductor technology, the number of processor cores integrated on a single chip has increased significantly, rapidly evolving from dual-core and quad-core to dozens or even hundreds of cores today (such as in server and high-end workstation processors). The goal of this architectural evolution is to dramatically improve the overall computational throughput of the system through parallel processing. However, the performance bottleneck has gradually shifted from the computing units themselves to data access and management. Shared global data structures (such as queues, stacks, deques, lists, hash tables, and trees) serve as the core mechanisms for task distribution, work-stealing, state sharing, and coordination in parallel programs, and their access efficiency directly determines whether parallel programs can effectively utilize the ever-increasing core resources.

[0051] In multi-core processor systems, efficiently and concurrently managing shared global data structures (such as queues, stacks, deques, lists, etc.) is a key challenge. As the number of cores increases, the limitations of traditional centralized management methods become increasingly apparent. First, in centralized storage schemes, data typically resides in shared memory or the local memory of a specific kernel. This means that the kernel performing the operation often needs to make expensive remote memory accesses, significantly increasing operational latency. Second, existing distributed data structure implementations typically employ static memory allocation or centralized management, making it difficult to achieve high scalability under dynamic loads.

[0052] For the reasons mentioned above, there is an urgent need for a mechanism that can reduce remote memory access and has good scalability to support efficient concurrent operations on global data structures in a multi-core environment.

[0053] In view of this, the present invention provides a dynamic distributed data structure management method based on token passing. See also Figure 1 The illustration shows a specific embodiment of a dynamic distributed data structure management method based on token passing provided by the present invention. This method is applied to a multi-core processor system, which includes at least two cores. The method includes:

[0054] Step 101: Receive an operation instruction and, in response to the operation instruction, detect the holding status of the kernel's own token;

[0055] This embodiment applies to a multi-core processor system. A multi-core processor integrates two or more complete computing engines (cores) into a single processor. In this case, the processor can support multiple processors on the system bus, with the bus controller providing all bus control and command signals. In a multi-core processor system, the elements of global data structures (stacks, queues, deques, lists, etc.) are distributed and stored in the local memory of each core. Each core can issue a request to insert or delete elements into the global data structure. The core that issues the insertion or deletion request is called the request initiator, and the core that receives these requests is called the request receiver.

[0056] In this embodiment, the request receiving end can receive operation instructions, which include insertion instructions and deletion instructions. The tokens include insertion tokens and deletion tokens. In this embodiment, the token is a logical control flag; only the kernel holding the token can perform specific operations (such as insertion and deletion). Specifically, the insertion token controls data insertion (such as enqueuing a queue or pushing data onto a stack); the deletion token controls data deletion (such as dequeuing a queue or popping data from a stack).

[0057] Specifically, before performing data operations, the multi-core processor system can be initialized by defining global data structures (such as queues and stacks) and two types of logical tokens related to operation instructions. For example, an insertion token controls data insertion operations (enqueue / push); a deletion token controls data deletion operations (dequeue / pop). Figure 4 As shown, the token is initially assigned to a specified kernel (e.g., kernel 0), and the round counter I is set to 0. An initial memory block is allocated in the kernel's local memory to store data elements. The kernel is checked for insert tokens in response to insert instructions, and for delete tokens in response to delete instructions.

[0058] Step 102: Determine the first kernel based on the holding status;

[0059] like Figure 2 As shown, the kernel with the insertion or deletion token is determined as the first kernel. Before the requesting end sends a request to insert or delete an element, it first determines whether it holds the corresponding token. If it holds the corresponding token, it directly stores the element in local memory (or releases the element from local memory). If it does not hold the corresponding token, it sends an insertion / deletion request to the next kernel until it finds a kernel that holds the corresponding token.

[0060] Step 103: Determine the memory state of the first kernel;

[0061] Although the first kernel may hold the corresponding token, since the operation of inserting or deleting elements is related to the memory owned by the kernel, it is also necessary to determine the memory state of the first kernel and whether the first kernel can perform the operation. If not, the corresponding token needs to be passed so that the qualified kernel can perform the corresponding operation.

[0062] Step 104: Determine the operation type as an insertion operation based on the operation instructions;

[0063] The operation type can be determined from the operation instructions. The operation type can be an insertion operation, which is generally an enqueue operation, a push operation onto a stack, or a linked list insertion operation.

[0064] Step 105: Determine the token's dynamic information based on memory state and operation type;

[0065] In this embodiment, the token dynamic information refers to the specific information of the token passing process, which may include the token passing order, the token passing termination position, and the token passing logic. When the operation type is an insertion operation and the memory state is full, the token passing trigger condition is met, and the inserted token is passed to the next kernel in sequence. At the same time, new memory is allocated to the kernel currently holding the inserted token. Figure 4As shown, taking the queue enqueue in the insertion operation as an example, the process of determining the dynamic information of the token, that is, the dynamic transfer process of the token, is explained in detail.

[0066] First, the requesting end issues a request to insert an element. Initially, the token is in kernel 0, round number I = 0. A memory block is allocated in the local memory space of kernel 0, and the element to be inserted is subsequently stored in this memory block. The request receiving end processes the insertion request. If it holds the insertion token, it checks the remaining space in the local memory block. If there is enough space, the element is written, and the operation is complete. If the space is full, and the kernel is not the last kernel, the insertion token is passed to the next kernel, and a new memory block is allocated in that kernel. The insertion token is passed unidirectionally between kernels in numerical order. After each round of inter-kernel passing, a round increment signal is triggered once. If the kernel is the last kernel, the token is passed to the first kernel, and a new memory block is allocated in that kernel, round number I = I + 1. The element to be inserted is subsequently stored in this memory block.

[0067] When the insertion token is passed back from the last kernel to the first kernel, the round increment signal is triggered once, and the round counter increments (I = I + 1), giving the newly allocated memory block a unique identifier. The round increment signal is a marker that the insertion token has completed a full kernel traversal, indicating that the storage path has entered a new spiral cycle. The round counter forces the insertion token to traverse all kernels before returning to the starting point through round operations, ensuring that no kernels are skipped for a long time (avoiding starvation) and ensuring uniform memory allocation.

[0068] Step 106: Determine the target kernel based on the token's dynamic information;

[0069] As can be seen from the above steps, the token dynamic information can reflect the termination position of the token transmission, and the first kernel where the token transmission stops is located is the target kernel. At this time, the target kernel not only has the insertion token corresponding to the insertion instruction, but its memory state also meets the requirements of the insertion operation.

[0070] Step 107: Make the target kernel execute the operation instructions.

[0071] If the target kernel has the corresponding insertion token and its memory is not full, the element to be inserted can be stored in the target kernel's memory, and the operation instructions can be executed.

[0072] As can be seen from the above technical solutions, the beneficial effects of this embodiment are: it dynamically allocates and manages the storage space of data structures in a multi-core system through a token mechanism, supports efficient insertion operations, reduces remote memory access, and has a mechanism with good scalability to support efficient concurrent operations on global data structures in a multi-core environment.

[0073] Figure 1The embodiments shown are merely basic examples of the method of the present invention. Other preferred embodiments of the method can be obtained by making certain optimizations and extensions based on them.

[0074] like Figure 3 The image shows another specific embodiment of a dynamic distributed data structure management method based on token passing according to the present invention. This embodiment further describes the method based on the foregoing embodiments, and includes the following steps:

[0075] Step 301: Receive an operation instruction and, in response to the operation instruction, detect the holding status of the kernel's own token;

[0076] This embodiment applies to a multi-core processor system. A multi-core processor integrates two or more complete computing engines (cores) into a single processor. In this case, the processor can support multiple processors on the system bus, with the bus controller providing all bus control and command signals. In a multi-core processor system, the elements of global data structures (stacks, queues, deques, lists, etc.) are distributed and stored in the local memory of each core. Each core can issue a request to insert or delete elements into the global data structure. The core that issues the insertion or deletion request is called the request initiator, and the core that receives these requests is called the request receiver.

[0077] In this embodiment, the request receiving end can receive operation instructions, which include insertion instructions and deletion instructions. The tokens include insertion tokens and deletion tokens. In this embodiment, the token is a logical control flag; only the kernel holding the token can perform specific operations (such as insertion and deletion). Specifically, the insertion token controls data insertion (such as enqueuing a queue or pushing data onto a stack); the deletion token controls data deletion (such as dequeuing a queue or popping data from a stack).

[0078] Specifically, before performing data operations, the multi-core processor system can be initialized by defining global data structures (such as queues and stacks) and two types of logical tokens related to operation instructions. For example, an insertion token controls data insertion operations (enqueue / push); a deletion token controls data deletion operations (dequeue / pop). Figure 4 As shown, the token is initially assigned to a specified kernel (e.g., kernel 0), and the round counter I is set to 0. An initial memory block is allocated in the kernel's local memory to store data elements. The kernel is checked for insert tokens in response to insert instructions, and for delete tokens in response to delete instructions.

[0079] Step 302: Determine the first kernel based on the holding status;

[0080] like Figure 2As shown, the kernel with the insertion or deletion token is determined as the first kernel. Before the requesting end sends a request to insert or delete an element, it first determines whether it holds the corresponding token. If it holds the corresponding token, it directly stores the element in local memory (or releases the element from local memory). If it does not hold the corresponding token, it sends an insertion / deletion request to the next kernel until it finds a kernel that holds the corresponding token.

[0081] Step 303: Determine the memory state of the first kernel;

[0082] Although the first kernel may hold the corresponding token, since the operation of inserting or deleting elements is related to the memory owned by the kernel, it is also necessary to determine the memory state of the first kernel and whether the first kernel can perform the operation. If not, the corresponding token needs to be passed so that the qualified kernel can perform the corresponding operation.

[0083] Step 304: Determine the operation type as a deletion operation based on the operation instructions;

[0084] The operation type can be determined from the operation instructions. The operation type can be a deletion operation, which generally includes dequeuing from a queue, popping from a stack, deleting from a linked list, etc.

[0085] Step 305: Determine the token's dynamic information based on memory state and operation type;

[0086] In this embodiment, the token dynamic information refers to the specific information of the token passing process, which may include the token passing order, the token passing termination position, and the token passing logic. When the operation type is a deletion operation and the memory state is empty, the token passing trigger condition is met, and the deletion token is passed sequentially to the next kernel. Simultaneously, memory is deleted for the kernel currently holding the deletion token. For example... Figure 4 As shown, the process of determining the dynamic information of the token, that is, the dynamic transfer process of the token, is specifically illustrated by taking the dequeue operation in the deletion operation as an example.

[0087] First, the requesting end issues a request to delete an element. Initially, the token is in kernel 0, round number I = 0. A memory block is allocated in the local memory space of kernel 0, and the element to be deleted is subsequently released from this memory block. The request receiving end processes the deletion request. If it holds a deletion token, it checks the local memory block space. If the space is not empty, the element is deleted, and the operation is complete. If the space is empty, and the kernel is not the last kernel, the memory block is released, and the deletion token is passed to the next kernel. The token is passed unidirectionally between kernels in numerical order. After each round of inter-kernel transmission, a round increment signal is triggered once. If the kernel is the last kernel, the token is passed to the first kernel, round number I = I + 1. Then, the element to be deleted is released from the memory block of that kernel.

[0088] When the delete token is passed back from the last kernel to the first kernel, a round increment signal is triggered, and the round counter increments (I = I + 1), marking the complete cycle of the spiral storage. This avoids memory block numbering conflicts and, in conjunction with the delete token propagation path, ensures that the worst-case operation latency has an upper limit (not exceeding the round value * number of kernels). It provides a global snapshot point for the delete operation, resolving the timing issues of distributed memory block reclamation. The round increment signal marks the completion of the delete token's traversal of all kernels, signifying that the storage path has entered a new spiral cycle. The round counter, through round operations, forces the delete token to traverse all kernels before returning to the starting point, ensuring that no kernels are skipped for extended periods (avoiding starvation) and ensuring even memory allocation.

[0089] Step 306: Determine the target kernel based on the token dynamic information;

[0090] As can be seen from the above steps, the token dynamic information can reflect the termination position of the token transmission, and the first kernel where the current position of the token transmission stops is determined is the target kernel. At this time, the target kernel not only has the deletion token corresponding to the deletion instruction, but its memory state also meets the requirements of the deletion operation.

[0091] Step 307: Make the target kernel execute the operation instructions.

[0092] The target kernel holds the corresponding delete token and the empty memory block has been freed, so the element to be deleted can be removed from the memory block, completing the execution of the operation instruction.

[0093] As can be seen from the above technical solutions, the beneficial effects of this embodiment are: it dynamically allocates and manages the storage space of data structures in a multi-core system through a token mechanism, supports efficient deletion operations, reduces remote memory access, and has a mechanism with good scalability to support efficient concurrent operations on global data structures in a multi-core environment.

[0094] like Figure 5 The image shows a specific embodiment of a token-based dynamic distributed data structure management device according to the present invention. This embodiment of the device is used to execute... Figures 1-4 The physical apparatus of the method. Its technical solution is essentially the same as the above embodiments, and the corresponding descriptions in the above embodiments also apply to this embodiment. The apparatus in this embodiment includes:

[0095] The holding status detection module 501 is configured to receive operation instructions and, in response to the operation instructions, detect the holding status of the kernel's own token.

[0096] The first kernel determination module 502 is configured to determine the first kernel based on the holding state;

[0097] The memory state determination module 503 is configured to determine the memory state of the first kernel;

[0098] The operation type determination module 504 is configured to determine the operation type based on the operation instruction; the operation type includes insertion and deletion operations.

[0099] The token dynamic information determination module 505 is configured to determine token dynamic information based on memory state and operation type.

[0100] The target kernel determination module 506 is configured to determine the target kernel based on token dynamic information;

[0101] Operation instruction execution module 507 is configured to cause the target kernel to execute operation instructions.

[0102] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may also include non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other services.

[0103] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0104] Memory is used to store instructions for execution. Specifically, instructions for execution are computer programs that can be executed. Memory can include main memory and non-volatile memory, and it provides the processor with execution instructions and data.

[0105] In one possible implementation, the processor reads the corresponding execution instructions from non-volatile memory into memory and then executes them. Alternatively, it may obtain the corresponding execution instructions from other devices to form a token-passing-based dynamic distributed data structure management device at the logical level. The processor executes the execution instructions stored in memory to implement the token-passing-based dynamic distributed data structure management method provided in any embodiment of the present invention.

[0106] The above is as described in the present invention. Figure 5 The method for managing a dynamic distributed data structure based on token passing, as provided in the illustrated embodiment, can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.

[0107] The steps of the method disclosed in the embodiments of this invention can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0108] This invention also proposes a readable medium storing execution instructions. When these instructions are executed by a processor of an electronic device, the device can perform a token-based dynamic distributed data structure management method provided in any embodiment of this invention, specifically for executing, for example... Figure 1 , Figure 3 The method shown.

[0109] The electronic devices in the foregoing embodiments may be computers.

[0110] Those skilled in the art will understand that embodiments of the present invention can be provided as methods or computer program products. Therefore, the present invention can be implemented in a completely hardware embodiment, a completely software embodiment, or a combination of software and hardware.

[0111] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0112] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0113] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A dynamic distributed data structure management method based on token passing, applied to a multi-core processor system, wherein the multi-core processor system includes at least two cores, characterized in that, The method includes: Receive operation instructions, and in response to the operation instructions, detect the holding status of the kernel's own token; The first kernel is determined based on the holding status; Determine the memory state of the first kernel; The operation type is determined according to the operation instruction; the operation type includes insertion and deletion operations. The token dynamic information is determined based on the memory state and the operation type; The target kernel is determined based on the dynamic information of the token; The target kernel executes the operation instructions.

2. The method according to claim 1, characterized in that, The receiving operation instruction, in response to the operation instruction, includes detecting the kernel's own token holding status, including: The operation instructions include insertion instructions and deletion instructions; The tokens include insertion tokens and deletion tokens; In response to the insert instruction, the kernel is checked to see if it has the insert token; In response to the deletion instruction, the kernel is checked to see if it has the deletion token.

3. The method according to claim 2, characterized in that, Determining the first kernel based on the holding state includes: The kernel that has the insertion token or the deletion token is identified as the first kernel.

4. The method according to claim 2, characterized in that, The determination of token dynamic information based on the memory state and the operation type includes: If the operation type is the insertion operation and the memory state is full, then the token passing trigger condition is met, and the insertion token is passed to the next kernel in sequence. If the operation type is the deletion operation and the memory state is empty, then the token passing trigger condition is met, and the deletion token is passed to the next kernel in sequence.

5. The method according to claim 4, characterized in that, Also includes: If the token transfer triggering condition is met, new memory is allocated to the kernel currently holding the inserted token; If the token transfer trigger condition is met, the memory of the kernel currently holding the deletion token is deleted.

6. The method according to claim 1, characterized in that, The step of determining the target kernel based on the token dynamic information includes: The first kernel where the current location of the token transmission stops is determined is the target kernel.

7. The method according to any one of claims 1-6, characterized in that, Also includes: The tokens are transmitted unidirectionally among the kernels in numerical order; After each round of inter-kernel transfer is completed, the round increment signal is triggered once.

8. A token-passing-based dynamic distributed data structure management device, applied to a multi-core processor system, the multi-core processor system comprising at least two cores, characterized in that, The device includes: The holding status detection module is used to receive operation instructions and, in response to the operation instructions, detect the holding status of the kernel's own token; The first kernel determination module is used to determine the first kernel based on the holding state; A memory state determination module is used to determine the memory state of the first kernel; An operation type determination module is used to determine the operation type based on the operation instruction; the operation type includes insertion operation and deletion operation. A token dynamic information determination module is used to determine token dynamic information based on the memory state and the operation type; The target kernel determination module is used to determine the target kernel based on the token dynamic information. An operation instruction execution module is used to cause the target kernel to execute the operation instructions.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 7.

10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 7.