Heterogeneous cooperative computing method and device based on distributed shared memory objects
Patent Information
- Application Number
- CN202511956512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2045-12-23
AI Technical Summary
[0005]本发明提供一种基于分布式共享内存对象的异构协同计算方法、装置,解决了现有技术中OLAP系统与AI计算系统间因跨进程、跨节点数据交换而产生的“I/O墙”与分布式调度割裂问题,实现了基于数据位置感知与共享内存的、无冗余网络传输的异构计算协同
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the heterogeneous collaborative computing method based on distributed shared memory objects as described above.
Smart Images

Figure CN121792540B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed computing, and in particular to a heterogeneous collaborative computing method and apparatus based on distributed shared memory objects. Background Technology
[0002] With the deep integration of big data and artificial intelligence technologies, enterprise data intelligence applications are facing a new paradigm shift. In typical scenarios such as real-time data intelligence analysis, AI-enhanced business decision-making, and large-scale vector retrieval and reasoning, it is often necessary to first perform rapid online analytical processing (OLAP) on massive amounts of structured data, and then use the intermediate results as input to deliver them to large language models or other deep learning models for reasoning, prediction, or deep analysis. This continuous processing flow of "OLAP query + AI model computation" constitutes a typical heterogeneous collaborative computing task.
[0003] Currently, the industry generally uses two independent systems to handle the above tasks: high-performance OLAP databases such as ClickHouse and StarRocks are used to perform data queries, while AI computing frameworks such as Ray and PyTorch on Kubernetes are used to perform model inference. Data collaboration between the two relies on traditional cross-system data exchange methods, mainly achieved through two paths: one is to transmit the OLAP query result set to the AI computing node through network protocols such as Java Database Connectivity / Open Database Connectivity (JDBC / ODBC); the other is to persist the results to distributed storage such as S3 / HDFS first, and then have the AI computing framework read them.
[0004] However, these existing collaborative methods expose a series of severe technical bottlenecks when dealing with high-throughput, low-latency converged computing scenarios. First, data needs to be frequently moved between different processes and even different physical nodes, undergoing a lengthy chain of "memory serialization, network transmission, deserialization, and loading into the AI computing environment," forming a significant "I / O wall" and cross-process communication overhead, which often accounts for the majority of the total task time. Second, OLAP's distributed query results are themselves scattered across cluster nodes in a sharded manner, and the AI computing scheduler cannot perceive this data distribution, often leading to computations being scheduled to nodes without data, triggering a large amount of unnecessary network data fetching, causing not only network congestion but also a high risk of single-point memory overflow. Furthermore, when OLAP tasks and AI tasks share node resources, the lack of effective collaboration and isolation mechanisms leads to resource competition between them, causing system performance fluctuations and affecting overall service stability. Summary of the Invention
[0005] This invention provides a heterogeneous collaborative computing method and apparatus based on distributed shared memory objects, which solves the "I / O wall" and distributed scheduling fragmentation problems caused by cross-process and cross-node data exchange between OLAP systems and AI computing systems in the prior art, and realizes heterogeneous computing collaboration based on data location awareness and shared memory with no redundant network transmission.
[0006] This invention provides a heterogeneous collaborative computing method based on distributed shared memory objects, comprising the following steps: In response to a received collaborative computing request, the collaborative computing request includes at least a data query instruction and an artificial intelligence computing instruction; the data query instruction is executed to generate data shards distributed across multiple physical computing nodes; Each data shard is written into the local shared memory of the corresponding physical computing node, generating object identification information and physical node location information corresponding to each data shard; Based on the object identification information and physical node location information, the task corresponding to the artificial intelligence computing instruction is controlled to perform parallel computing on multiple physical computing nodes.
[0007] According to the present invention, a heterogeneous collaborative computing method based on distributed shared memory objects is provided. The method involves controlling the parallel computation of tasks corresponding to the artificial intelligence computing instructions on multiple physical computing nodes based on the object identification information and physical node location information. This includes: parallelly splitting the artificial intelligence task corresponding to the artificial intelligence computing instructions based on the object identification information and physical node location information to generate multiple artificial intelligence subtasks associated with the data shards; scheduling each artificial intelligence subtask to the physical computing node where its associated data shard is located based on the principle of data locality priority; and on the scheduled physical computing node, directly reading its associated data shard from the local shared memory through memory mapping, and calculating the corresponding artificial intelligence subtask based on the associated data shard.
[0008] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, the step of writing each data fragment into the local shared memory of the corresponding physical computing node includes: at each physical computing node, determining whether the memory data format inside the online analytical processing system is consistent with a preset binary format; if consistent, directly associating the data fragment with the local shared memory in the preset binary format through pointer mapping; if inconsistent, formatting and rearranging the data fragment in the local memory to conform to the preset binary format before writing it into the local shared memory.
[0009] According to the present invention, a heterogeneous collaborative computing method based on distributed shared memory objects is provided. The method, based on the principle of data locality priority, schedules each artificial intelligence subtask to the physical computing node where its associated data shard resides. This includes: constructing a scheduling objective function, the scheduling objective function aiming to minimize global cross-node data transmission overhead; and determining the corresponding target physical computing node for each artificial intelligence subtask using the scheduling objective function based on the object identification information, the size of each data shard, and the cluster network bandwidth; wherein the target physical computing node is a physical computing node that stores the data shards required by the artificial intelligence subtask.
[0010] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, after determining the target physical computing node, the method further includes: obtaining the current load status of the target physical computing node; and dynamically determining, based on the current load status, the size of the data shard, and the cluster network bandwidth, whether to wait for the resource release of the target physical computing node, or to migrate the data shard to other idle physical computing nodes and schedule artificial intelligence subtasks to be executed on the other idle physical computing nodes.
[0011] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, the dynamic judgment step includes: if the estimated local resource waiting time is less than the network transmission time required to migrate the data shard to other physical computing nodes, and the current load of the target physical computing node is lower than a preset threshold, then wait and execute the artificial intelligence subtask locally on the target physical computing node; if the estimated local resource waiting time is not less than the network transmission time required to migrate the data shard to other physical computing nodes, then trigger object migration, migrate the data shard to other idle physical computing nodes, and schedule the corresponding artificial intelligence subtask to be executed on the other idle physical computing nodes.
[0012] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, after writing each data shard into the local shared memory of the corresponding physical computing node, the method further includes: the online analytical processing system releasing the locking state of the data shard in the shared memory and transferring the management right of the data shard to the shared memory manager; and setting a time-to-live threshold and a reference count for each data shard object written to the shared memory.
[0013] According to the present invention, a heterogeneous collaborative computing method based on distributed shared memory objects is provided. The method further includes: periodically checking data shard objects in each shared memory; if the reference count of a data shard object is greater than zero, or its lifespan is less than its lifespan threshold, then keeping the data shard object in an active state; if the reference count of a data shard object is zero, and its lifespan reaches or exceeds its lifespan threshold, then marking the data shard object as reclaimable and reclaiming the shared memory space it occupies.
[0014] The present invention also provides a heterogeneous collaborative computing device based on distributed shared memory objects, comprising the following modules: A distributed production module is used to respond to a received collaborative computing request, the collaborative computing request including at least a data query instruction and an artificial intelligence computing instruction; execute the data query instruction to generate data shards distributed across multiple physical computing nodes; The memory write module is used to write each data slice into the local shared memory of the corresponding physical computing node, and generate object identification information and physical node location information corresponding to each data slice. The computing module is used to control the task corresponding to the artificial intelligence computing instruction to perform parallel computing on multiple physical computing nodes based on the object identification information and physical node location information.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the heterogeneous collaborative computing method based on distributed shared memory objects as described above.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the heterogeneous collaborative computing method based on distributed shared memory objects as described above.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the heterogeneous collaborative computing method based on distributed shared memory objects as described above.
[0018] This invention provides a heterogeneous collaborative computing method and apparatus based on distributed shared memory objects, which has the following beneficial effects: By directly writing data fragments generated by online analytical processing queries into the local shared memory of each physical computing node, artificial intelligence computing tasks can directly read local data through memory mapping during execution. This eliminates the cross-process and cross-network data serialization, transmission, and deserialization steps between data query results and model calculations, fundamentally solving the "I / O wall" problem caused by frequent data movement and significantly reducing data interaction latency. Since the parallel computing process of artificial intelligence tasks is directly controlled based on the object identification information of data fragments and their physical node location information, the system can naturally perceive the distributed storage location of data, and then schedule computing tasks to the node where the data is located or distribute tasks according to the data location. This avoids the large amount of invalid network data retrieval caused by the mismatch between computing and data storage locations in traditional methods, reduces network bandwidth consumption, alleviates single-point memory pressure caused by data aggregation, and improves the resource utilization and system stability of the distributed cluster. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention.
[0021] Figure 2 This is a schematic diagram of the architecture of the heterogeneous collaborative computing system based on distributed shared memory objects provided by the present invention.
[0022] Figure 3 This is a schematic diagram of the heterogeneous collaborative computing device based on distributed shared memory objects provided by the present invention.
[0023] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] The following is combined with Figures 1-4 The embodiments of the present invention are described in detail.
[0026] The heterogeneous collaborative computing method based on distributed shared memory objects provided in this embodiment of the invention is executed by a heterogeneous collaborative computing device based on distributed shared memory objects. This device can be configured in a computer, which can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and no specific limitation is made here.
[0027] Figure 1 This is a flowchart illustrating the heterogeneous collaborative computing method based on distributed shared memory objects provided by this invention, as shown below. Figure 1 As shown, the method includes the following steps: S110. Responding to the received collaborative computing request. The collaborative computing request includes at least a data query instruction and an artificial intelligence computing instruction. Execute the data query instruction to generate data shards distributed across multiple physical computing nodes.
[0028] Specifically, a collaborative computing request is a unified instruction encapsulation initiated by an external application or user interface, explicitly containing two core sub-instructions: a data query instruction and an artificial intelligence computing instruction. For example, the request format could be a JSON structure: {"query": "SELECT user i d, features FROM user_table WHERE date='2023-10-01'", "ai_task": "inference", "model": "model_v2"}.
[0029] When the collaborative computing system of this invention receives the request, its front-end parser first parses the request, identifies the data query part and the artificial intelligence calculation part, and routes the parsed instructions to the system's query processing subsystem and task planning subsystem, respectively. The query processing subsystem then drives the online analytical processing engine to execute the data query instructions. The online analytical processing engine starts a distributed query job in the cluster. This query job is pushed down to multiple physical computing nodes for parallel execution, with each node executing a partial query operator based on its stored data shards. Finally, each node independently generates a partial result set of the query locally, and these result sets logically constitute multiple data shards of the complete query result. Each data shard contains a structured data subset filtered and aggregated from the original massive data, and is still temporarily stored in the memory of each node in columnar storage format (or the efficient format inside the online analytical processing engine). At this point, the network aggregation operation of traditional solutions has not yet occurred; these data shards are distributed across multiple physical computing nodes executing the query according to their computational generation location.
[0030] This embodiment encapsulates business scenarios requiring data querying and AI computation into an atomic collaborative computing request. The system achieves unified definition and parsing of instructions at the entry point, laying the foundation for subsequent deep collaborative processing. This not only simplifies the programming interface for application developers but, more importantly, provides clear input for the system's internal planning, scheduling, and optimization of online analytical processing (OLAP) queries and AI computation tasks in an integrated manner. Specifically, when executing query instructions to generate data shards, the data is ready directly in shard form on the physical computing node that generated it, avoiding the traditional overhead of first aggregating intermediate results to a single node before distribution. This creates the necessary preconditions for subsequent steps to directly schedule AI computation tasks to the node where the data resides, achieving a "computation finds data" affinity parallel processing mode, thereby maximizing the utilization of data locality and minimizing cross-system data movement from the source of the process.
[0031] S120. Write each data shard into the local shared memory of the corresponding physical computing node, and generate object identification information and physical node location information corresponding to each data shard.
[0032] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, each data fragment is written into the local shared memory of the corresponding physical computing node. The method includes: at each physical computing node, determining whether the memory data format inside the online analytical processing system is consistent with a preset binary format; if consistent, the data fragment is directly associated with the local shared memory in the preset binary format through pointer mapping; if inconsistent, the data fragment is formatted and rearranged in the local memory to conform to the preset binary format before being written into the local shared memory.
[0033] Specifically, after receiving a mixed query request, the OLAP engine pushes down the execution of Structured Query Language (SQL) operators. During the result output phase, OLAP nodes no longer aggregate results over the network, but instead request space from the local shared memory manager.
[0034] If the OLAP internal memory layout is consistent with the shared format, then pointer mapping is performed directly; otherwise, a quick format and reformatting is performed in local memory, followed by writing to the shared memory pool to generate a list of object identifiers. , ,…, }
[0035] The performance advantage of this solution compared to the traditional JDBC / network transmission mode can be demonstrated through a heterogeneous data interaction cost model, which is expressed as follows: Cost total T represents the total cost of the task. query Online analytical processing (OLAP) query time; T inference The time required for AI inference; The data interaction overhead of this application scheme is m; the total number of data fragments is m; S i B is the size of the i-th data segment; mem α is the node memory bandwidth; α is the format conversion coefficient (0 ≤ α < 1).
[0036] This model indicates that the total overhead of data interaction is determined only by "local memory bandwidth" and "format conversion coefficient," and is independent of network bandwidth. In existing technologies, the interaction overhead is... Due to memory bandwidth Much greater than network bandwidth And format conversion coefficient Much smaller than the serialization coefficient This solution achieves an order-of-magnitude performance improvement.
[0037] Specifically, after completing the computation of local data shards, the Online Analytical Processing (OLAP) engine immediately triggers the write operation to the shared memory pool. This process is performed independently on each physical compute node. First, on each node, the local executor responsible for data plane operations (e.g., an adapted C++ backend) invokes a format checker to determine whether the memory layout format of the data shards currently held within the OLAP system is completely consistent with the system-wide preset standard binary format used for cross-process sharing (e.g., the Apache Arrow columnar memory format). This check can be performed by comparing memory data structure descriptors or specific format flags.
[0038] If the determination result is consistent, it means that the data is already in a format that can be directly shared. At this point, the local executor will not perform any actual data copying, but will directly request a shared memory region of the same size from the local shared memory manager. After obtaining the address of this region, the engine uses a "pointer mapping" or "memory remapping" mechanism to directly reassociate (or redirect) a series of native pointers pointing to their column data buffers within the data fragment to the newly allocated shared memory address range, thereby completing the logical "write" of the data fragment with almost zero overhead. This process is equivalent to performing a logical ownership transfer, rather than a physical copy.
[0039] If the determination result is inconsistent (for example, the online analytical processing engine uses a custom row or compressed format internally), the local executor will initiate a fast "format rearrangement" process within its own process memory space. This process takes the original data fragments as input, reorganizes them column-wise in memory, and encodes them into a standard binary format, forming a temporary copy conforming to a preset format. This rearrangement process introduces certain computational overhead, which is reflected in the interaction cost model as a format conversion coefficient α (0 < α < 1). After the rearrangement is complete, this temporary copy is written to the physical memory area requested from the shared memory manager via memory copy. Regardless of the path taken, when the data fragment is finally available in the shared memory pool, the system will generate a unique object identifier for the fragment and record its physical computing node ID. These two pieces of information together constitute the "object identification information and physical node location information" in the claims.
[0040] This embodiment achieves a balance between performance optimization and flexibility in the critical stage of data persistence to shared memory by introducing a format-aware write strategy. When the format within the online analytical processing system is consistent with the shared standard format, a pointer mapping method is used to avoid unnecessary large-scale physical copying of memory data, greatly reducing the latency and CPU overhead of writing data to the shared memory pool. This makes the format conversion coefficient α in the interaction cost model approach zero, and the total overhead is mainly limited by memory bandwidth, achieving write efficiency close to the theoretical limit. When the two formats are inconsistent, the system actively performs local memory rearrangement to ensure that all data written to shared memory has a unified and efficient standardized format. This provides a consistent and user-friendly memory data interface for subsequent artificial intelligence computing tasks, avoiding messy format parsing during task execution, thereby improving the execution efficiency of artificial intelligence computing. The entire mechanism ensures that data exchange across heterogeneous computing components no longer depends on low-speed network bandwidth and complex serialization / deserialization processes, but is limited to the scope of high-speed memory operations on the node itself. This fundamentally reduces the main performance bottlenecks caused by cross-process and cross-protocol data exchange in traditional solutions.
[0041] S130. Based on object identification information and physical node location information, control the tasks corresponding to artificial intelligence computing instructions to perform parallel computing on multiple physical computing nodes.
[0042] According to the present invention, a heterogeneous collaborative computing method based on distributed shared memory objects controls the parallel computation of tasks corresponding to artificial intelligence computing instructions on multiple physical computing nodes based on object identification information and physical node location information. The method includes: parallelly splitting the artificial intelligence tasks corresponding to the artificial intelligence computing instructions based on object identification information and physical node location information to generate multiple artificial intelligence subtasks associated with data shards; scheduling each artificial intelligence subtask to the physical computing node where its associated data shard is located based on the principle of data locality priority; and on the scheduled physical computing node, directly reading its associated data shard from local shared memory through memory mapping, and calculating the corresponding artificial intelligence subtask based on the associated data shard.
[0043] According to the present invention, a heterogeneous collaborative computing method based on distributed shared memory objects schedules each artificial intelligence subtask to the physical computing node where its associated data shards are located based on the principle of data locality priority. The method includes: constructing a scheduling objective function, the scheduling objective function aiming to minimize the global cross-node data transmission overhead; determining the target physical computing node corresponding to each artificial intelligence subtask using the scheduling objective function based on object identification information, the size of each data shard, and the cluster network bandwidth; wherein, the target physical computing node is a physical computing node that stores the data shards required by the artificial intelligence subtask.
[0044] Specifically, the OLAP engine returns a list of object identifiers and their corresponding physical node location information to the global scheduler. The scheduler does not launch individual AI tasks, but rather based on the number of shards. Instantiation The system consists of several parallel AI inference sub-tasks. The scheduler iterates through each sub-task. Force it to be scheduled to the corresponding data shard. The physical node This creates an execution model where "computation follows data".
[0045] Specifically, after the global scheduler obtains the list of object identifiers and the physical node location information of each object returned by the Online Analytical Processing (OLAP) system, it first instantiates a corresponding number of logically parallel AI inference subtasks. To make the optimal scheduling decision, the scheduler dynamically constructs a scheduling objective function J, with the following form: Where the summation range is k=1 to m, m is the total number of data fragments, and D k Represents the k-th data shard object, Loc(D k ) represents the physical node ID where the data shard actually resides, Node(Task) k ) is the k-th AI subtask Task k The assigned physical computing node ID, I(·) is an indicator function (when Loc(D k ) ≠ Node(Task k The value is 1 when the condition is met, and 0 otherwise. |D k | is the size of the data partition, B net It is the available bandwidth of the internal network of the cluster, C latency It is a fixed latency overhead for cross-node access.
[0046] The physical meaning of the scheduling objective function J is to minimize the total penalty for global cross-node data transmission. The scheduler uses this function for optimization calculations, and its core input is the object identification information (implying |D...). k | Size information) and physical node location information (i.e., Loc(D) k ), and real-time B data obtained from the cluster monitoring system. net The scheduler finds the node allocation scheme (Node(Task)) that minimizes the J value by solving (e.g., using a greedy algorithm or constraint solver). kThis allows for the determination of the corresponding target physical computing node for each AI subtask. According to the definition of the objective function, the optimal solution will tend to make the indicator function value 0 in most cases, i.e., force the Node(Task) to... k ) = Loc(D k Therefore, the final target physical computing node, in ideal circumstances (without constraints such as resource contention), is the physical computing node itself that stores the data shards required for the AI subtask, thus achieving precise scheduling of "computation following data".
[0047] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, after determining the target physical computing node, the current load status of the target physical computing node is obtained; based on the current load status, the size of the data shards and the cluster network bandwidth, it is dynamically determined whether to wait for the resource release of the target physical computing node, or to migrate the data shards to other idle physical computing nodes and schedule artificial intelligence subtasks to other idle physical computing nodes for execution.
[0048] Specifically, when the data resides in the node Although it exists, forced local scheduling can cause system jitter when the computing resources (GPU / CPU) or memory bandwidth load is too high.
[0049] This application introduces a dynamic decision-making mechanism: the scheduler collects the load factor of nodes in real time. The execution strategy is determined by comparing the "local waiting cost" with the "cross-node migration cost".
[0050] Specifically, after identifying the target physical computing node, the scheduler does not immediately enforce affinity scheduling. Instead, it first obtains the real-time current load status of the target physical computing node through the cluster monitoring agent. This status is determined by a comprehensive load factor L. local Quantitative representation is derived by weighting metrics such as CPU utilization, memory bandwidth utilization, and GPU utilization of the node. Simultaneously, the scheduler knows the size |D| of the data fragments to be processed. k |and the currently available network bandwidth B obtained from the cluster network monitoring module. net Based on these inputs, the scheduler executes a dynamic decision-making process. This process makes logical judgments based on a predefined resource contention decision inequality, the logical form of which is: Among them, T wait L is the estimated local resource queue waiting time based on the target node's task queue length and resource processing speed. thresh It is a preset load threshold used to ensure system stability. The comprehensive load factor for local nodes (weighted calculation of CPU utilization and memory bandwidth utilization). Set the size of the data slice.
[0051] The scheduler will collect T in real time wait |D k |、B net and L local The inequality is substituted into the equation for calculation. If the result is "local wait," the scheduler places the corresponding AI subtask into the local execution queue of the target node, waiting for resources to be released before execution. If the result is "overflow and migration," the scheduler triggers an object migration operation: it first selects another idle physical computing node in the cluster that meets the resource requirements, then migrates the target data shards (i.e., data objects identified by IDs) from the original target node to the idle node via the network, and finally reschedules the AI subtask that should have been scheduled to the original target node to the idle node for execution, thereby bypassing the resource bottleneck of the original target node.
[0052] This embodiment addresses the potential performance degradation issues that simple affinity scheduling might cause in resource contention scenarios by introducing a dynamic decision-making layer based on real-time load and transmission costs after determining the target node with optimal data locality. By comparing local queuing time with the time cost of migrating data across nodes and considering the overall node load status, this embodiment intelligently makes the optimal choice between "waiting for local resources" and "migrating data to idle nodes." This effectively prevents long-tail latency caused by AI subtasks "waiting indefinitely" when the target node is overloaded, and also avoids unnecessary network overhead caused by blindly migrating small-scale data shards. By adhering to the principle of prioritizing data locality while enhancing overall system stability and resource utilization efficiency, the collaborative computing system can maintain high performance and high reliability when facing dynamic and heterogeneous cluster loads, avoiding global performance fluctuations caused by local resource contention.
[0053] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, the dynamic judgment step includes: if the estimated local resource waiting time is less than the network transmission time required to migrate the data shards to other physical computing nodes, and the current load of the target physical computing node is lower than a preset threshold, then wait and execute the artificial intelligence subtask locally on the target physical computing node; if the estimated local resource waiting time is not less than the network transmission time required to migrate the data shards to other physical computing nodes, then trigger object migration, migrate the data shards to other idle physical computing nodes, and schedule the corresponding artificial intelligence subtask to other idle physical computing nodes for execution.
[0054] Specifically, the global scheduler first calculates two key costs. The first is the estimated local resource wait time T. wait It predicts based on the number of AI tasks currently queued on the target physical computing node, the average execution time of each task, and the node's computing resource utilization model. Secondly, it predicts the network transmission time required to migrate data shards to other physical computing nodes, which can be expressed by the formula |D k | / B net Estimate, where |D k | is the size of the data fragment to be processed, B net This is the currently available network bandwidth obtained from the cluster monitoring system. Simultaneously, the scheduler obtains the current load of the target physical computing node, which is determined by a comprehensive load factor L. local This indicates that it quantifies the overall utilization rate of key resources such as CPU, memory bandwidth, and GPU of a node.
[0055] The scheduler compares the above parameters with a preset threshold L. thresh The threshold is compared to ensure a safe load for system stability. The final decision is based on a clear resource contention decision inequality: if condition T is satisfied... wait <( |D k | / B net And L local <L thresh If the conditions are met, the system waits and executes the AI subtask locally on the target physical computing node. At this point, the subtask enters the local execution queue of that node. Otherwise (i.e., if none of the conditions are met), object migration is triggered. In the migration operation, the scheduler selects a suitable other idle physical computing node from the cluster, transfers the data shard object (located by its object identifier) from the original target node to the idle node via the network, and then reschedules the originally planned AI subtask to the idle node for execution.
[0056] This embodiment introduces a quantitative, real-time cost-based dynamic decision-making mechanism, achieving intelligent and refined scheduling strategies in resource contention scenarios. By accurately comparing "local queuing time" with "cross-node data migration time," and combining this with a comparison of node real-time load and safety thresholds, it effectively avoids two extreme situations: first, it prevents unnecessary network overhead and latency caused by blindly migrating data when the target node is only briefly busy; second, it prevents severe latency and system throughput degradation caused by infinite queuing for AI subtasks when the target node is continuously under high load. While ensuring that the vast majority of tasks still enjoy the performance advantages of data locality, it significantly improves the overall resource utilization efficiency and task execution efficiency of the system in dynamic, heterogeneous load environments, enhances the system's resilience and stability, and avoids the blocking effect of local resource bottlenecks on the global task flow.
[0057] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, after each data shard is written to the local shared memory of the corresponding physical computing node, the online analytical processing system releases the locking state of the data shards in the shared memory and transfers the management rights of the data shards to the shared memory manager; and sets a time-to-live threshold and reference count for each data shard object written to the shared memory.
[0058] Specifically, to address the issue of inconsistent lifecycles of heterogeneous processes, this application adopts a "write-as-handover" mechanism. After the OLAP engine completes the write, it immediately releases the lock on the shared object and transfers management control to the shared memory manager, while simultaneously setting the time-to-live (TTL).
[0059] Specifically, after each data fragment is written to the local shared memory of its corresponding physical computing node, the local executor of the Online Analytical Processing (OLAP) system immediately performs an ownership transfer operation. It releases any locks on the data fragment in the shared memory region, changing it from a "writing" state to a "readable" state. Next, the system transfers complete management rights of the data fragment object (including memory reclamation decisions and access control) from the OLAP engine process to an independent and resident shared memory manager. Simultaneously, the system configures key management attributes for the data fragment object: one is the time-to-live threshold T. TTL First, there's a preset time length (e.g., 300 seconds), representing the maximum survival time of the object in an ownerless state; second, there's the reference count R. Ref Its initial value is set to 0, which is used to track the number of AI computing tasks currently using the object.
[0060] These attributes, along with the object identifier and physical node location information, are recorded and maintained as metadata by the shared memory manager. Subsequently, the lifecycle of this data shard object will no longer depend on the online analytical processing (OLAP) process that created it, but will be determined and managed by the shared memory manager based on the object's liveness determination logic.
[0061] This embodiment implements a "write-as-handover" mechanism and sets time-to-live and reference counts to achieve effective and secure lifecycle management of data sharded objects in shared memory. It decouples the runtime dependencies between data producers (OLAP) and consumers (AI). Even if the online analytical processing (OLAP) terminates prematurely or restarts unexpectedly after completing the write operation, the data written to shared memory remains accessible to AI tasks, improving the system's robustness and fault tolerance. The combined logic of reference counting and time-to-live thresholds effectively prevents accidental data deletion and memory leaks caused by AI task startup delays or crashes, as long as the task holds a reference (R). Ref If the reference count is greater than 0, the data is protected; even if the task exits abnormally and the reference count is not cleared, the lifetime threshold can ensure that "zombie objects" will eventually be automatically reclaimed. This ensures the effective recycling of shared memory resources, avoids resource exhaustion caused by poor object management, and thus provides a stable and reliable foundation for memory data sharing for large-scale, long-running heterogeneous collaborative computing tasks.
[0062] According to the heterogeneous collaborative computing method based on distributed shared memory objects provided by the present invention, the data shard objects in each shared memory are periodically checked; if the reference count of a data shard object is greater than zero, or its lifespan is less than its lifespan threshold, the data shard object is kept in an active state; if the reference count of a data shard object is zero, and its lifespan reaches or exceeds its lifespan threshold, the data shard object is marked as reclaimable, and the shared memory space it occupies is reclaimed.
[0063] Specifically, the periodic inspection of data shard objects in shared memory is performed by a background memory reclamation service. This service iterates through the shared memory manager on each physical compute node at fixed time intervals (e.g., per second), scanning all registered data shard objects. For each object, the reclamation service reads its current reference count R. Ref (i.e., the number of tasks in the currently executing AI subtasks that use this object as an input source) and its elapsed time T_elapsed (calculated from the object's creation timestamp), and compared with the preset elapsed time threshold T for this object. TTL The comparison is then performed. The service then determines the object's state based on a clearly defined object liveness determination logic, which is expressed as follows: in, The number of AI tasks currently referencing this object; The time elapsed since the object was created; The preset time-to-live threshold.
[0064] If the determination result is "active," the recycling service does not perform any operation on the object, and the shared memory space it occupies remains. If the determination result is "reclaimable," the recycling service first marks the object as "reclaimable," then removes it from the active object table of the shared memory manager, and finally asynchronously (to avoid blocking foreground tasks) releases the physical memory space it occupies back to the operating system's shared memory pool or the node's free memory list for subsequent data sharding writes or other uses for reallocation. This process ensures fine-grained management of memory space.
[0065] This embodiment provides automatic, safe, and efficient lifecycle termination management for shared memory objects by implementing a periodic asynchronous garbage collection mechanism based on precise rules. It effectively prevents two common problems by strictly determining the state based on a combination of reference count and lifespan logic: firstly, it prevents active data from being prematurely reclaimed, because as long as AI tasks are still referencing (R... Ref >0), regardless of its lifespan, the data remains active; secondly, it ensures the eventual cleanup of "zombie objects," even if the reference count never reaches zero due to a task crash (R... Ref (Memory with more than 0 references but no actual references) will still be considered reclaimable once its lifespan exceeds the preset TTL threshold, thus avoiding memory leaks. This mechanism automatically reclaims idle memory resources while ensuring data availability, improving the utilization and turnover rate of the shared memory pool, and ensuring that large-scale, long-running heterogeneous collaborative computing systems can run stably and continuously without resource exhaustion or performance degradation due to poor memory management.
[0066] The heterogeneous collaborative computing system based on distributed shared memory objects proposed in this invention is deployed on a cluster consisting of multiple physical computing nodes. For example... Figure 2 As shown, the core design of the entire system lies in fundamentally reshaping the collaborative working mode between Online Analytical Processing (OLAP) systems and Artificial Intelligence (AI) computing systems through shared memory and data location-aware scheduling. The architecture is clearly divided into a control plane and a data plane, achieving decoupling and efficient collaboration between computational logic and data storage.
[0067] The control plane is responsible for the coordination, scheduling, and management of the entire collaborative computing process. It consists of two main components: first, the OLAP local executor, which is responsible for parsing and executing distributed SQL query fragments and is the direct initiator of data production tasks; second, the collaborative scheduling agent, which is responsible for receiving data metadata generated by OLAP and intelligently splitting and precisely scheduling AI computing tasks accordingly. These two components work closely together through an efficient inter-process communication mechanism to jointly decide the timing, location, and method of executing computing tasks.
[0068] The data plane provides a unified, efficient, and cross-process data storage and access layer. Its core is a distributed shared memory object pool, a logically unified but physically distributed storage pool located in the local memory of each node. Data in the pool uses Apache Arrow as the standard binary columnar memory format, ensuring unambiguous and efficient interpretation by both OLAP and AI systems. Simultaneously, the data is designed to be immutable; once written, it is read-only for its entire lifecycle. This effectively eliminates lock contention during concurrent access and simplifies the memory management model.
[0069] The workflow of the heterogeneous collaborative computing system follows an optimized "producer-consumer" model. During the data production and writing phase, the OLAP C++ engine backend, acting as the producer, stores the generated data shards (e.g., shard_ID_1) directly into the local shared memory object pool of its physical node in Arrow format via a "direct write" operation after completing distributed query computation. This process completely avoids cross-network data transmission. During the computation scheduling and consumption phase, the scheduling agent in the control plane strictly adheres to the "data locality priority" principle based on the data shard's metadata (identifier and physical location). It breaks down AI tasks into subtasks corresponding to the data shards and forces each subtask to be scheduled to the physical node where its required data resides. Finally, the LLM / AI inference process, acting as the consumer, directly maps its virtual address space to the target data shard in local shared memory using the operating system's "memory-mapped read" technology, thereby reading data and performing computations with zero-copy access via pointers.
[0070] In summary, the heterogeneous collaborative computing system architecture, by introducing a distributed shared memory object pool as a unified data exchange layer and combining it with data location-aware affinity scheduling, successfully shifts the data interaction overhead of heterogeneous computing collaboration from being constrained by network bandwidth to being limited by memory bandwidth, achieving an order-of-magnitude performance improvement. Through the "computation follows data" paradigm, unnecessary network transmission and single-point bottlenecks are eliminated, and the lifecycle dependency between production and consumption processes is decoupled through an ownership transfer mechanism. This provides a high-performance, highly scalable underlying system solution for high-frequency, real-time fusion scenarios of big data analytics and artificial intelligence model computation.
[0071] The heterogeneous collaborative computing device based on distributed shared memory objects provided by the present invention is described below. The heterogeneous collaborative computing device based on distributed shared memory objects described below can be referred to in correspondence with the heterogeneous collaborative computing method based on distributed shared memory objects described above.
[0072] like Figure 3 The image shows a heterogeneous collaborative computing device based on distributed shared memory objects provided by the present invention, comprising: The distributed production module 310 is used to respond to a received collaborative computing request, the collaborative computing request including at least a data query instruction and an artificial intelligence computing instruction; execute the data query instruction to generate data shards distributed across multiple physical computing nodes; The memory writing module 320 is used to write each data slice into the local shared memory of the corresponding physical computing node, and generate object identification information and physical node location information corresponding to each data slice. The computing module 330 is used to control the task corresponding to the artificial intelligence computing instruction to perform parallel computing on multiple physical computing nodes based on the object identification information and physical node location information.
[0073] Specifically, the functions of each module in the user account management system provided in this embodiment of the invention correspond one-to-one with the operation flow of each step in the above method-like embodiments, and the achieved effects are also the same. For details, please refer to the above embodiments, and this will not be repeated in this embodiment of the invention.
[0074] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a heterogeneous collaborative computing method based on distributed shared memory objects. The method includes: responding to a received collaborative computing request, the collaborative computing request including at least a data query instruction and an artificial intelligence computing instruction; executing the data query instruction to generate data fragments distributed across multiple physical computing nodes; writing each data fragment into the local shared memory of the corresponding physical computing node to generate object identification information and physical node location information corresponding to each data fragment; and controlling the task corresponding to the artificial intelligence computing instruction to perform parallel computing on multiple physical computing nodes based on the object identification information and physical node location information.
[0075] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, 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 of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the heterogeneous collaborative computing method based on distributed shared memory objects provided by the above methods. The method includes: responding to a received collaborative computing request, the collaborative computing request including at least a data query instruction and an artificial intelligence computing instruction; executing the data query instruction to generate data fragments distributed across multiple physical computing nodes; writing each data fragment into the local shared memory of the corresponding physical computing node to generate object identification information and physical node location information corresponding to each data fragment; and controlling the task corresponding to the artificial intelligence computing instruction to perform parallel computing on multiple physical computing nodes based on the object identification information and physical node location information.
[0077] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the heterogeneous collaborative computing method based on distributed shared memory objects provided by the above methods. The method includes: responding to a received collaborative computing request, the collaborative computing request including at least a data query instruction and an artificial intelligence computing instruction; executing the data query instruction to generate data fragments distributed across multiple physical computing nodes; writing each data fragment into the local shared memory of the corresponding physical computing node to generate object identification information and physical node location information corresponding to each data fragment; and controlling the task corresponding to the artificial intelligence computing instruction to perform parallel computing on multiple physical computing nodes based on the object identification information and physical node location information.
[0078] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0079] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for heterogeneous co-computing based on distributed shared memory objects, characterized in that, include: In response to a received collaborative computing request, the collaborative computing request includes at least a data query instruction and an artificial intelligence computing instruction; Execute the data query command to generate data shards distributed across multiple physical computing nodes; Each data shard is written into the local shared memory of the corresponding physical computing node, generating object identification information and physical node location information corresponding to each data shard; Based on the object identification information and physical node location information, the artificial intelligence task corresponding to the artificial intelligence calculation instruction is controlled to perform parallel computation on multiple physical computing nodes, including: based on the object identification information and physical node location information, the artificial intelligence task corresponding to the artificial intelligence calculation instruction is split into multiple artificial intelligence subtasks associated with the data shards; based on the principle of data locality priority, each artificial intelligence subtask is scheduled to the physical computing node where its associated data shard is located; on the scheduled physical computing node, the associated data shard is directly read from the local shared memory through memory mapping, and the corresponding artificial intelligence subtask is calculated according to the associated data shard; Based on the principle of data locality priority, each artificial intelligence subtask is scheduled to the physical computing node where its associated data shard is located. This includes: constructing a scheduling objective function, which aims to minimize the global cross-node data transmission overhead; and using the scheduling objective function to determine the target physical computing node for each artificial intelligence subtask based on the object identification information, the size of each data shard, and the cluster network bandwidth. The target physical computing node is a physical computing node that stores the data shards required by the artificial intelligence subtask.
2. The method of claim 1, wherein, The step of writing each data shard into the local shared memory of the corresponding physical computing node includes: At each physical computing node, it is determined whether the memory data format inside the online analytical processing system is consistent with the preset binary format; If they match, the data fragments are directly associated with the local shared memory in a preset binary format via pointer mapping. If there is a discrepancy, the data fragments are formatted and rearranged in local memory to conform to a preset binary format before being written to the local shared memory.
3. The method of claim 1, wherein the method further comprises: After determining the target physical computing node, the method further includes: Obtain the current load status of the target physical computing node; Based on the current load status, the size of the data shard, and the cluster network bandwidth, dynamically determine whether to wait for the resource release of the target physical computing node, or to migrate the data shard to other idle physical computing nodes and schedule the artificial intelligence subtask to be executed on the other idle physical computing nodes.
4. The method of claim 3, wherein the method further comprises: The steps of the dynamic determination include: If the estimated local resource waiting time is less than the network transmission time required to migrate the data shards to other physical computing nodes, and the current load of the target physical computing node is lower than a preset threshold, then the AI subtask is executed locally on the target physical computing node. If the estimated local resource waiting time is not less than the network transmission time required to migrate the data shard to other physical computing nodes, then object migration is triggered to migrate the data shard to other idle physical computing nodes, and the corresponding artificial intelligence subtask is scheduled to be executed on the other idle physical computing nodes.
5. The heterogeneous collaborative computing method based on distributed shared memory objects according to claim 1, characterized in that, After writing each data shard to the local shared memory of the corresponding physical computing node, the process also includes: The online analytical processing system unlocks the data fragment in shared memory and transfers management of the data fragment to the shared memory manager; Set a time-to-live threshold and reference count for each data shard object written to shared memory.
6. The heterogeneous collaborative computing method based on distributed shared memory objects according to claim 5, characterized in that, The method further includes: Periodically check the data fragment objects in each shared memory; If the reference count of a data shard object is greater than zero, or its lifespan is less than its lifespan threshold, then the data shard object remains active. If a data shard object has a reference count of zero and its lifespan has reached or exceeded its lifespan threshold, the data shard object is marked as reclaimable, and the shared memory space it occupies is reclaimed.
7. A heterogeneous collaborative computing device based on distributed shared memory objects, characterized in that, include: A distributed production module is used to respond to a received collaborative computing request, which includes at least a data query instruction and an artificial intelligence computing instruction; Execute the data query command to generate data shards distributed across multiple physical computing nodes; The memory write module is used to write each data slice into the local shared memory of the corresponding physical computing node, and generate object identification information and physical node location information corresponding to each data slice. The computing module is used to control the artificial intelligence task corresponding to the artificial intelligence computing instruction to perform parallel computing on multiple physical computing nodes based on the object identification information and physical node location information. This includes: splitting the artificial intelligence task corresponding to the artificial intelligence computing instruction into multiple artificial intelligence subtasks associated with the data shards based on the object identification information and physical node location information; scheduling each artificial intelligence subtask to the physical computing node where its associated data shard is located based on the principle of data locality priority; and on the scheduled physical computing node, directly reading its associated data shard from local shared memory through memory mapping, and calculating the corresponding artificial intelligence subtask based on the associated data shard. Based on the principle of data locality priority, each artificial intelligence subtask is scheduled to the physical computing node where its associated data shard is located. This includes: constructing a scheduling objective function, which aims to minimize the global cross-node data transmission overhead; and using the scheduling objective function to determine the target physical computing node for each artificial intelligence subtask based on the object identification information, the size of each data shard, and the cluster network bandwidth. The target physical computing node is a physical computing node that stores the data shards required by the artificial intelligence subtask.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the heterogeneous collaborative computing method based on distributed shared memory objects as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Calculation task scheduling method and calculation task execution method
CN116185578A
Multi-core cooperative computing method and device for matrix decomposition, computing platform and medium
CN117892049A