Cross-operating system general task delegation execution method, system and computer-readable storage medium

By using a lightweight single-binary just-in-time compiler executor and peer-to-peer decentralized scheduling, the problems of bloated architecture and high latency in existing technologies are solved, enabling efficient task delegation execution across operating systems and collaborative computing power of heterogeneous terminals, thereby reducing computing latency and operation and maintenance costs.

CN123114677APending Publication Date: 2026-11-17谢成鸿
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611354250.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing distributed scheduling schemes suffer from problems such as bloated architecture, coarse task granularity, high startup latency, and inability to delegate a single computation function at low cost across heterogeneous terminals, resulting in a waste of terminal computing resources.

Method used

It employs a lightweight single-binary just-in-time (JIT) compiler executor, point-to-point decentralized scheduling, and function-level fine-grained task delegation. It generates native machine code adapted to the target device's hardware architecture through the JIT compiler and executes tasks within a software fault isolation sandbox, supporting cross-operating system task delegation execution.

Benefits of technology

It reduces task startup latency to the millisecond level, supports heterogeneous terminal computing power collaboration, reduces the deployment and maintenance costs of distributed computing, and ensures execution performance and security through multi-level compilation caching and security verification mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114677A_ABST
    Figure CN123114677A_ABST
Patent Text Reader

Abstract

This application discloses a cross-operating system general task delegation execution method, system, and computer-readable storage medium. The method includes: deploying binary task executors encapsulated by a just-in-time (JIT) compiler on each heterogeneous operating system terminal; dynamically electing a scheduling terminal on each heterogeneous operating system terminal, with the scheduling terminal distributing task source code or intermediate representation data carrying a function to be executed to each online terminal via an encrypted point-to-point channel based on the device status of each heterogeneous operating system terminal; the task executor on each online terminal receiving the task source code or intermediate representation data carrying the function to be executed, extracting the function to be executed, and locally compiling it on JIT to generate native machine code adapted to the target device's hardware architecture, then executing the function to be executed within a software fault isolation sandbox. This application embodiment reduces task startup latency to the millisecond level, significantly lowering the deployment and maintenance costs of distributed computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to heterogeneous multi-terminal distributed computing, cross-platform just-in-time compilation and point-to-point task scheduling technologies, and in particular to a cross-operating system general task delegation execution method, system and computer-readable storage medium. Background Technology

[0002] In multi-terminal heterogeneous computing power collaboration scenarios, the industry typically employs solutions such as container orchestration, cloud functions, and dedicated distributed frameworks to distribute tasks across multiple devices. Taking Kubernetes container orchestration as an example, it relies on container runtime to isolate computing tasks and can schedule computing power across multiple servers. However, this solution suffers from a core flaw: its heavy-duty architecture. Container creation and startup can take seconds, and the smallest execution unit for a task only supports processes or container instances. It cannot distribute and execute individual computation functions as independent units across multiple terminals, and in fine-grained computing scenarios, the overhead of container startup exceeds the computation time of the function itself. On the other hand, the computing power of idle heterogeneous terminals such as mobile phones, laptops, and workstations cannot be collaboratively reused at low cost, resulting in a significant waste of terminal computing resources. Summary of the Invention

[0003] This application provides a cross-operating system universal task delegation execution method, system, and computer-readable storage medium to solve one or more technical problems of existing distributed scheduling schemes, such as bloated architecture, coarse task granularity, high startup latency, and inability to delegate a single computation function at low cost between heterogeneous terminals.

[0004] On one hand, embodiments of this application provide a cross-operating system general task delegation execution method, the method comprising: Deploy binary task executors, which are encapsulated by just-in-time compilers, on various heterogeneous operating system terminals; Each heterogeneous operating system terminal dynamically elects a scheduling terminal, and the scheduling terminal distributes the task source code or intermediate representation data carrying the function to be executed to each online terminal through an encrypted point-to-point channel according to the device status of each heterogeneous operating system terminal; Each online terminal's task executor receives the task source code or intermediate representation data carrying the function to be executed, extracts the function to be executed from it, and compiles it locally in real time to generate native machine code adapted to the target device's hardware architecture, and executes the function to be executed within a software fault isolation sandbox.

[0005] Preferably, the method further includes: The scheduling terminal receives a batch data processing request, reads the online terminal hardware computing power index, and calculates the task allocation weight. The scheduling terminal splits the batch of raw data into multiple sub-tasks according to the task allocation weight, and distributes them in parallel to each online terminal through a point-to-point channel. The scheduling terminal collects the subtask execution results returned by each online terminal and merges and outputs them according to the original data input order.

[0006] Preferably, the method further includes: When the task executor of each online terminal receives the task source code or intermediate representation data, it calculates a hash identifier for the complete content of the task source code or intermediate representation data as a cache retrieval index. Based on the cache retrieval index, the memory cache, local disk cache, and nearby terminal network cache are queried layer by layer; When the cache retrieval index is found in the cache, the compiled native machine code is loaded directly, skipping the complete compilation process; when it is not found, a complete just-in-time compilation is performed, and the compiled artifacts are stored in the caches at each level.

[0007] Preferably, each of the heterogeneous operating system terminal dynamic election and scheduling terminals specifically includes: Each of the heterogeneous operating system terminals periodically broadcasts its online status and globally unique device identifier; When the original dispatch terminal loses connection, all online terminals initiate election messages and compare device identifiers with each other; The online terminal with the highest device identifier value is automatically updated to the new scheduling terminal, and any tasks not assigned en route are resubmitted to the new scheduling terminal.

[0008] Preferably, the method further includes: After receiving the intermediate representation data, the task executor performs a standardized structure integrity check. Configure two types of hard limits for the compilation process: maximum memory usage and maximum compilation time. If either hard limit is exceeded, the compilation thread will be terminated directly. During task execution, verify the resource permissions declared in the task declaration and intercept unauthorized system interface calls.

[0009] Preferably, the software fault isolation sandbox allocates an independent memory region for each task, restricts memory access boundaries using masking operations, and releases the isolated memory after the task is completed.

[0010] Preferably, the device status includes device computing power, device load, and network status.

[0011] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned method.

[0012] Furthermore, embodiments of this application also provide a cross-operating system for general task delegation execution, the system comprising: an executor deployment module, a terminal election module, and a task execution module, wherein: The executor deployment module is used to deploy binary task executors encapsulated by a just-in-time compiler in various heterogeneous operating system terminals. The terminal election module is used to dynamically elect a scheduling terminal among the heterogeneous operating system terminals. The elected scheduling terminal distributes the task source code or intermediate representation data carrying the function to be executed to each online terminal through an encrypted point-to-point channel according to the device status of each heterogeneous operating system terminal. The task execution module is used to receive the task source code or intermediate representation data carrying the function to be executed, extract the function to be executed from it, and compile it locally in real time to generate native machine code adapted to the hardware architecture of the target device, and execute the function to be executed in a software fault isolation sandbox.

[0013] Preferably, the terminal election module includes a broadcast submodule, a message initiation submodule, and a terminal update submodule, wherein: The broadcast submodule is used to periodically broadcast its own online status and globally unique device identifier; The message initiation submodule is used to initiate election messages and compare device identifiers among all online terminals when the original scheduling terminal loses connection. The terminal update submodule is used to automatically update the online terminal with the largest device identifier value to the new scheduling terminal, and to resubmit the queued tasks that have not yet been distributed to the new scheduling terminal.

[0014] This application encapsulates the complete just-in-time compiler into a lightweight, dependency-free independent executor, freeing it from the constraints of heavy runtime environments such as containers and virtual machines. It supports using a single function as the smallest task distribution unit and leverages a decentralized peer-to-peer scheduling architecture to enable the collaborative use of idle computing power across heterogeneous terminals such as mobile phones, computers, and workstations. Compared to existing technologies, task startup latency is reduced to the millisecond level, significantly lowering the deployment and maintenance costs of distributed computing. Furthermore, the accompanying sandbox memory isolation, multi-level compilation caching, task fault tolerance, and multi-layered security verification mechanisms in this application effectively balance execution performance, computing power reuse, and terminal operational security. Attached Figure Description

[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of a cross-operating system general task delegation execution method according to an embodiment of this application; Figure 2This is a flowchart of the batch task fragmentation parallel processing optimization scheme in an embodiment of this application; Figure 3 This is a flowchart illustrating the multi-level compiler caching acceleration optimization scheme of this application embodiment; Figure 4 This is a flowchart of the decentralized scheduling node automatic election optimization scheme in an embodiment of this application; Figure 5 This is a flowchart illustrating the compilation and execution multi-layer security restriction optimization scheme of this application embodiment; Figure 6 This is a block diagram of a cross-operating system general task delegation execution system according to an embodiment of this application. Detailed Implementation

[0016] The technical solution of this application will be clearly and completely described below with reference to the concepts in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0017] The background technology section mentions technologies for multi-device distributed computing. Currently, the mainstream technologies fall into three main categories: The first is container orchestration systems like Kubernetes. These systems require a complete container runtime environment deployment, and creating a new task container can take more than one second. They can only use processes as the smallest scheduling unit, and when small computational functions are distributed individually, the container startup overhead far exceeds the computation time of the function itself. The second category is cloud functions such as AWS Lambda and DenoDeploy, which only support running on cloud servers and cannot utilize the idle computing power of local mobile phones, laptops, or other terminals. Cold start latency reaches the hundreds of milliseconds level. The third category is distributed computing frameworks such as Ray and BOINC, which are only compatible with specific programming languages, require pre-compiled binary files, and do not support runtime just-in-time compilation to adapt to different CPU architectures. These existing technologies share common drawbacks, including: first, a cumbersome operating environment, requiring complex deployment and configuration for ordinary terminals to access the computing network; second, coarse task distribution granularity, making it impossible to distribute a single computation function; third, reliance on centralized scheduling services, resulting in a single point of failure in the overall task chain after the device goes offline; and fourth, a lack of runtime cross-architecture compilation capabilities, requiring separate compilation of programs for different operating systems and CPU architectures, making it difficult to achieve low-cost collaboration of heterogeneous terminal computing power.

[0018] Based on the problems existing in the prior art, this application proposes a solution based on core concepts such as a lightweight single-binary just-in-time compiler executor, point-to-point decentralized scheduling, and function-level fine-grained task delegation, aiming to overcome one or all of the aforementioned technical defects. The technical solution of this application is described in detail below with reference to the accompanying drawings. See also... Figure 1 The figure shows a detailed flowchart of a cross-operating system general task delegation execution method according to an embodiment of this application. The specific steps of this technical solution include: Step S11: Deploy a binary task executor encapsulated by a just-in-time compiler on each heterogeneous operating system terminal; This step involves executing the firmware or system installers for various heterogeneous operating system terminals, including Windows, macOS, Linux, and Android. The Just-In-Time (JIT) compiler here refers to a compiler that converts source code into native machine code adapted to the local CPU during program execution. The "executor" in this step packages the JIT compiler into a single, cross-platform binary executor. It does not rely on containers, virtual machines, or third-party runtime libraries, and can be installed on any operating system (Windows / Linux / macOS / Android). Any terminal running this operating system can directly launch and run it, providing the underlying runtime environment for subsequent task reception, compilation, and execution.

[0019] Step S12: Each heterogeneous operating system terminal dynamically elects a scheduling terminal, which distributes the task source code or intermediate representation data carrying the function to be executed to each online terminal through an encrypted point-to-point channel according to the device status of each heterogeneous operating system terminal. This step employs a peer-to-peer (P2P) communication mode, eliminating the need for a centralized relay server. The local area network (LAN) automatically identifies nearby online terminals using a device discovery protocol, while wide area network (WAN) scenarios support manual network access. After discovering online terminal devices, all heterogeneous terminals within the network participate in the election of the scheduling terminal, without the need for a separate third-party central server to intervene in the election process. Once elected, the scheduling terminal runs the exact same executor program as the other terminals that only perform tasks. There are no hardware restrictions; Android phones, macOS laptops, and Linux workstations can all be elected. These elected scheduling terminals are not permanent but dynamically switched. If a terminal subsequently goes offline, the remaining terminals will re-elect a new scheduling node. Compared to other terminals, the scheduling terminal possesses both task scheduling and distribution capabilities, as well as local task execution capabilities. When its own CPU load is low and idle computing power is sufficient, the scheduling terminal receives the functions to be executed assigned to it and completes the delegated task computation locally through JIT just-in-time compilation and SFI sandbox. When its load is high and there are no idle computing resources, it only undertakes task sharding, cross-device distribution, and result aggregation coordination, without executing any delegated functions locally. Since there is no fixed central node, scheduling comprehensively considers factors such as the number of hardware cores, device computing power, current CPU load, and network round-trip latency to make a comprehensive score, and automatically selects the optimal idle device to execute the current function, thereby making full use of the idle computing power of multiple terminals.

[0020] Step S13: The task executor of each heterogeneous operating system terminal receives the task source code or intermediate representation data carrying the function to be executed, extracts the function to be executed from it, and compiles it locally in real time to generate native machine code adapted to the target device hardware architecture, and executes the function to be executed in the software fault isolation sandbox. After deployment on each terminal device in step S11, the task executor in the ready state can call its built-in just-in-time compilation module (function) to start work upon receiving a task. The "Intermediate Representation" (IR) mentioned in this and previous steps is a standardized cross-platform code intermediate form that is not bound to a specific CPU architecture. "Software Fault Isolation" (SFI) restricts memory access range through bitmasking operations, isolating the memory spaces of different tasks. Through the executor's built-in multi-layered code optimization logic, the native machine code compiled in this step can outperform the standard optimization level of general compilers. The sandbox, as an independent memory region allocated to the current task, can prevent tasks from reading and writing outside their bounds and polluting the terminal system memory. After the code execution ends, the isolated memory can be completely reclaimed, thus avoiding memory leaks.

[0021] Compared with existing solutions such as containers and cloud functions, this application's embodiments do not require a heavy runtime environment, and the startup latency of a single function delegate can be reduced to the millisecond level, supporting collaborative computing power from heterogeneous devices such as mobile phones and workstations. Moreover, this application's embodiments adopt a decentralized architecture, eliminating single points of failure, and achieving near-native code execution performance through runtime just-in-time compilation, significantly reducing the deployment and operational overhead of multi-terminal distributed computing.

[0022] The solutions described in the foregoing embodiments of this application (hereinafter referred to as the basic solutions) can be optimized according to actual conditions to achieve better technical results. To illustrate the extensibility of the technical solutions, several optimization directions and the resulting technical solutions are exemplarily given below.

[0023] One exemplary optimization scheme: Batch task partitioning and parallel processing scheme The aforementioned embodiments only support a point-to-point delegation mode with a single function and a single set of parameters, suitable for scattered, small-scale computing needs. However, in business scenarios such as batch image rendering, massive numerical statistics, batch log parsing, and simulation iteration, users often submit tens of thousands of raw data items to be processed at once. If the method of distributing single tasks one by one is still adopted, each set of data must independently complete the entire process of network handshake, data packet encapsulation, transmission, compilation, and complete execution, generating a massive number of small network data packets, consuming a large amount of bandwidth and network connection resources, and significantly increasing the overall computing time. Based on this efficiency shortcoming, the optimization direction of this application embodiment is to rely on the scheduling terminal capabilities already possessed by the aforementioned scheme to design a complete processing logic scheme of weighted automatic sharding of computing power, parallel computing of multiple devices, and redistribution of offline tasks. See also Figure 2 The diagram illustrates the detailed process of the batch task partitioning parallel processing optimization scheme, including the following steps: Step S21: The scheduling terminal receives a batch data processing request, reads the online terminal hardware computing power index, and calculates the task allocation weight; The execution entity for this step can be the aforementioned scheduling terminal. This scheduling terminal can be equipped with a computing power scoring and scheduling module to respond to batch delegation request data packets submitted by the user-end engine. The delegation request data packet can contain the complete dataset to be processed, the target computation function, and operational constraints. Upon receiving the request, the scheduling terminal will traverse all online terminal devices in the current network, collecting hardware operation (computing power) indicators (device status information) for each device, such as the number of CPU cores, real-time load, free memory size, whether it has a graphics processor, and network round-trip latency. Then, it will uniformly convert these hardware indicators into corresponding task allocation weights according to a preset computing power conversion formula (the specific conversion method is not limited in this application embodiment, and other methods known to those skilled in the art can also be adopted). A higher weight value indicates a larger data processing capacity for the device. After completing the weight calculation, a task allocation weight lookup table corresponding to the online terminals will be generated. This lookup table will serve as the basis for data sharding in the next step.

[0024] Step S22: The scheduling terminal splits the batch of raw data into multiple sub-tasks according to the task allocation weight, and distributes them to each online terminal in parallel through the point-to-point channel; This step follows the terminal task allocation weight lookup table output by S21. It is executed by the batch fragmentation and distribution module (function) of the scheduling terminal. The total number of batch data entries is used as the calculation base. The independent data intervals are divided based on the proportion of each terminal's task allocation weight in the total weight. Each segment of data corresponds to an independent subtask. Each subtask is bound to a unified target calculation function and a unique task identifier. After the splitting is completed, the system can use the QUIC (Fast UDP Internet Connection Protocol) point-to-point communication multi-stream channel to synchronously push the corresponding subtask data packets to the online terminals. The multi-stream transmission does not block or wait for each other. After each terminal receives its own subtask data, it can enter the local compilation and calculation process.

[0025] Step S23: The scheduling terminal collects the subtask execution results returned by each online terminal, merges and outputs them according to the original data input order, and redistributes the unfinished subtasks to the remaining available devices when a terminal is detected to be offline. The inputs for this step are the subtask execution results asynchronously returned by each terminal and the real-time online heartbeat signals of the terminals. The execution entity is the result aggregation and fault tolerance module (function) of the scheduling terminal. The scheduling terminal will continuously listen to the result return messages of all execution terminals on the network. Each time a set of subtask results is received, the original data arrangement order is restored according to the data interval marked during fragmentation and temporarily stored in the result buffer. At the same time, the terminal heartbeat broadcast information is continuously read. If a device does not send a heartbeat for more than a certain predetermined time (for example, 30 seconds), the system determines that the device is offline. It will extract all unfinished subtasks under the name of the device, re-fragment and distribute them based on the weight of the remaining online terminals. After all subtasks are processed, the scheduler will uniformly return the ordered and integrated complete batch calculation results to the user terminal that initiated the entrustment.

[0026] This optimization approach in this embodiment is incorporated into the entire batch processing flow. It relies on the scheduling terminal generated in step S12 to operate. Only three sub-logic types—sharding, aggregation, and fault tolerance—need to be added within the scheduling terminal. The underlying core capabilities, such as point-to-point transmission, SFI sandbox isolation, and JIT compilation, are all reused without altering the original architecture of the basic solution. Therefore, the optimization scheme in this embodiment does not require individual delegation of massive batch data, significantly reducing the transmission overhead caused by small network packets. Furthermore, multiple terminals can perform calculations synchronously and in parallel, increasing the overall processing speed in tandem with the number of available devices. In addition, it includes an offline fault tolerance mechanism, ensuring that the failure of a single device will not cause the failure of the entire batch of calculation tasks, effectively guaranteeing the stable operation of batch data processing services.

[0027] Second exemplary optimization approach: Multi-level compiler caching acceleration solution In the aforementioned basic embodiment of this application, step S13 executes the entire JIT compilation optimization pipeline each time function source code or intermediate representation data is received. Even if the user delegates the exact same calculation function multiple times, the system will still repeatedly execute the entire process of lexical analysis, type verification, multi-level optimization, and native code generation. However, repeated compilation will continuously consume the terminal's CPU computing resources. In scenarios such as real-time frame calculation in games and dynamic chart rendering, where the same function is frequently reused, the latency caused by repeated compilation will continuously affect the smoothness of interaction. To address this issue, this embodiment of the application considers adding cache retrieval logic at the forefront of the original compilation process, building a three-level hierarchical content addressing cache system, reusing the previously compiled native machine code, and saving the time consumed by repeated compilation. See also Figure 3 The diagram illustrates the detailed process of a multi-level compiler caching acceleration scheme, including the following steps: Step S31: When the task executor of each heterogeneous operating system terminal receives the task source code or intermediate representation data, it calculates a hash identifier for the complete content of the source code as a cache retrieval index. This step is executed by the terminal's task executor's built-in cache preprocessing module (function). The input is either the complete function source code or intermediate binary data sent externally. In this step, after the task executor reads all the code content, it can use hash algorithms such as Blake3 (hash digest algorithm) to perform an irreversible digest operation on the complete data, generating a unique hash string as a cache retrieval index. As long as any character or value inside the code is modified, the generated hash identifier will be completely different. Generating the index based on the content can avoid cache mismatch problems caused by code with the same name but different logic. The calculated hash index will be passed to the next cache query step.

[0028] Step S32: Based on the cache retrieval index, query the memory cache, local disk cache, and nearby terminal network cache layer by layer; This step uses the cache retrieval index (hash index) output by S31 as the query keyword. The task executor's cache retrieval module executes the query operation layer by layer, and the query order can proceed from fast to slow. For example, it can proceed as follows: The first layer retrieves the hash cache table resident in memory. The memory query only takes microseconds. If the corresponding index is matched in memory, the subsequent query process is terminated directly. If no match is found, it proceeds to the second layer. The second layer reads the local disk persistent cache directory to retrieve the compiled artifacts. If the disk query has no results, it proceeds to the third layer. The third layer broadcasts the hash query message to other online executors in the local area network and attempts to pull the compiled machine code from nearby terminals. The matching results of each layer's query will directly flow into the next step for judgment.

[0029] Step S33: When the query is found, the compiled native machine code is loaded directly, skipping the complete compilation process. When the query is not found, a complete just-in-time compilation is performed, and the compilation artifacts are stored in the caches at each level. This step, based on the S32 cache matching results, is handled collaboratively by the task executor's JIT compilation module and cache writing module (function). If any of the three cache layers finds a match, the system will directly read the pre-compiled native machine code and send it directly to the SFI sandbox for computation, completely skipping the entire compilation process. If no matching record is found in any of the three cache layers, the system will start a complete just-in-time compilation pipeline to generate native machine code. After compilation, the machine code is synchronously written to the memory cache and local disk cache, and the cache data is synchronized to nearby terminals on the local area network to facilitate subsequent reuse by other devices. Finally, the system outputs directly executable machine code for the sandbox to execute.

[0030] The cache retrieval logic in steps S31 to S33 of this application embodiment can be embedded at the very beginning of the compilation step S13 in the aforementioned basic embodiment. A cache retrieval is performed before each compilation operation is initiated. If a cache hit occurs, the compilation artifact is directly reused, completely reusing the sandbox execution logic of step S12. Only when the cache is missing is the original complete compilation process executed, and the core compilation and execution logic of the original technical solution remains unchanged. In scenarios where the same computation function is called repeatedly with high frequency, this application embodiment can completely eliminate the entire compilation process, significantly reducing the overall latency of a single task. Multiple terminals within a local area network can also share compilation artifacts, reducing the CPU computing power consumption caused by independent compilation by each device.

[0031] Third exemplary optimization scheme: Automatic election of decentralized scheduling nodes In the aforementioned basic embodiment, a scheduling terminal was elected. If a single device is manually designated as a fixed scheduling terminal for an extended period, it creates a single point of failure in the centralized architecture. If this device loses power, goes into hibernation, or experiences a network outage, the entire task delegation and distribution process across the network will immediately halt. This deficiency is even more pronounced in scenarios where mobile devices like smartphones and tablets frequently go online and offline. To eliminate the instability caused by centralized scheduling, this embodiment's optimized process considers a combination of continuous heartbeat monitoring and an automatic election mechanism. This allows for the real-time generation of available scheduling terminals without manual intervention, continuously ensuring the smooth operation of the entire network's task distribution channels. See also... Figure 4 The figure illustrates the flow of the decentralized scheduling node automatic election optimization scheme according to an embodiment of this application. The specific steps include: Step S41: Each terminal periodically broadcasts its own online status and globally unique device identifier; This step is executed independently by the heartbeat module built into each terminal on the entire network. After the terminal starts up, it generates a globally unique device identifier based on hardware information. During the operation of the device, it broadcasts a heartbeat message every five seconds. The message carries its own online status and unique device identifier. The local area network automatically spreads the heartbeat data through the mDNS broadcast protocol, while the wide area network pushes it through the established QUIC long connection. After receiving the heartbeat message, other terminals will update their local online device list in real time. If a heartbeat is not received from a certain device for a predetermined period of time (for example, thirty seconds), the device will be marked as an offline device. The real-time updated online device list will be used as the basis for subsequent election judgment.

[0032] Step S42: When the original scheduling terminal loses connection, all online terminals initiate an election message and compare device identifiers with each other; This step is triggered by the online device list continuously maintained in step S41. When any terminal detects that the original scheduled device has not sent a heartbeat message for a predetermined time, all currently online terminals will synchronously send election messages. All terminals receive each other's election messages, compare the global device identifier string carried in the message one by one, distinguish the identifier priority by character dictionary order, and determine the online terminal with the highest priority in the entire network after completing all identifier comparisons. This comparison result will be passed to the next step to perform scheduling switchover.

[0033] Step S43: The online terminal with the largest device identifier value is automatically updated to the new scheduling terminal, and the undistributed queued tasks are resubmitted to the new scheduling terminal; This step receives the highest priority device identifier obtained from the comparison in step S42 as input. The terminal determined to be the highest priority will automatically start the scheduling and coordination working mode, load the full set of computing power scoring and task sharding distribution functions, and all other online terminals will simultaneously clear their local old scheduling device records, re-register their devices with the new scheduling terminal, and resubmit all locally cached and unissued queued tasks to the new scheduling node. After receiving the resubmitted tasks, the new scheduling terminal will re-initiate computing power allocation and restore the normal task distribution process across the entire network.

[0034] The entire heartbeat and election logic of the optimized scheme in this application embodiment can be set as the underlying support module for the scheduling function in step S13 of the aforementioned basic scheme. The premise for step S13 to carry out task distribution and computing power allocation is the existence of available scheduling terminals. This process continuously maintains the effective status of scheduling nodes across the entire network. The underlying point-to-point communication and function delegation logic completely reuse the original content of the basic scheme. This application embodiment can completely eliminate the single point of failure risk of centralized scheduling architecture. In scenarios where devices are offline or networks are partitioned, scheduling nodes can be quickly switched without manual intervention, greatly improving the long-term stable operation capability of multi-terminal computing power networks.

[0035] Fourth exemplary optimization scheme: Multi-layered security restrictions during compilation and execution As mentioned earlier, the scheduling terminal needs to receive task source code and intermediate representation data. However, task source code and intermediate representation data transmitted from external networks may pose security risks, such as maliciously constructed malformed code, infinite loops, excessively large computation graphs, and unauthorized system call instructions. These can cause security issues such as infinite loops in the compilation thread, memory overflows, and unauthorized reading of terminal privacy files. The aforementioned basic solution relies solely on the SFI sandbox for runtime memory isolation, lacking pre-compilation protection, resulting in vulnerabilities in the security protection system. Therefore, this optimization direction considers adding a multi-layered verification and restriction process covering the entire compilation and runtime lifecycle to intercept various malicious operations from the source of code reception. Specific steps include: Step S51: After receiving the external intermediate representation data, the task executor performs a standardized structural integrity check; This step is a safety checkpoint before the compilation process. The execution body is the IR verification module built into the executor. When the intermediate representation data transmitted from the remote end arrives at the local executor, the module will verify the code structure line by line according to the preset standardized invariants. The specific verification content may include SSA dominance relationship, variable type matching, function input parameter consistency, reference count balance and other rules. If any verification rule is not met, the system will directly discard the intermediate data and return an illegal task error message. It will not be sent into the compilation pipeline. Only compliant intermediate representation data that passes all verifications will flow into the subsequent compilation steps.

[0036] Step S52: Configure two types of hard limits for the compilation process: maximum memory usage and maximum compilation time. If the resource limits are exceeded, the compilation thread will be terminated directly. This step takes the valid intermediate data verified by S51 and pre-configures two insurmountable resource thresholds before starting the compilation thread. The first threshold limits the maximum physical memory that the compilation process can occupy. If the memory usage during the compilation process exceeds the limit, the system can immediately force the termination of the compilation thread (process). The second threshold sets the maximum runtime for compilation, with a default upper limit of, for example, thirty seconds. Regardless of whether the code has been compiled, the compilation operation will stop directly when the time limit is reached. At the same time, the compilation thread runs in the exception handling isolation domain, so the thread (process) crash will not propagate upwards and damage the executor main process, thus preventing malicious code from exhausting terminal hardware resources.

[0037] Step S53: During the task execution phase, verify the resource permissions declared in the task declaration and intercept unauthorized system interface calls; This step applies to the complete execution phase of the task after machine code generation. The execution entity is the built-in permission verification module of the SFI sandbox. The system reads the resource permission list declared in advance for the task, covering permission types such as file read and write, GPU call, and network access. Every time the sandbox intercepts a system interface call, it checks whether the current call function is within the declared permission range. Once an unauthorized interface call is detected, the system will immediately terminate the task execution and throw a permission exception. In conjunction with the SFI memory mask isolation mechanism, this double-prevents the task from accessing terminal system resources beyond its boundaries.

[0038] Step S51 in this embodiment can be embedded at the very beginning of the compilation step S13 in the aforementioned embodiment. Step S52 operates on the complete compilation process of step S13. Step S53 is paired with the sandbox execution phase after machine code is generated in step S13. The three layers of security control logic cover the entire process before compilation, during compilation, and during execution, without altering the core functions of JIT compilation and SFI execution in the aforementioned basic scheme. The optimized scheme in this embodiment intercepts malformed malicious intermediate representations from the source of code reception, prevents resource exhaustion attacks through hard resource limits during the compilation phase, and intercepts unauthorized system calls during the runtime phase. Multi-layered protection collaboratively ensures that the terminal system is not damaged by malicious tasks, significantly improving the operational security of cross-device delegated execution scenarios.

[0039] The foregoing description details the method embodiments provided in this application. In fact, this application also provides corresponding system embodiments. See [link to relevant documentation]. Figure 6 This diagram illustrates a structural block diagram of an embodiment of a cross-operating system general task delegation execution system. The system U60 of this embodiment includes an executor deployment module U61, a terminal election module U62, and a task execution module U63, wherein: The executor deployment module U61 is used to deploy binary task executors encapsulated by a just-in-time compiler in various heterogeneous operating system terminals. The terminal election module U62 is used to dynamically elect and schedule a terminal among the heterogeneous operating system terminals. The elected scheduling terminal distributes the task source code or intermediate representation data carrying the function to be executed to each online terminal through an encrypted point-to-point channel according to the device status of each heterogeneous operating system terminal. The task execution module U63 is used to receive the task source code or intermediate representation data carrying the function to be executed, extract the function to be executed from it, and compile it locally on the fly to generate native machine code adapted to the target device hardware architecture, and execute the function to be executed in a software fault isolation sandbox.

[0040] Based on the same principle, the aforementioned system implementation can also be optimized. On the aforementioned basic system architecture, configuration optimization sub-modules can be added. For example, to achieve effective election of scheduling terminals, the terminal election module can be further refined to include a broadcast sub-module U621, a message initiation sub-module U622, and a terminal update sub-module U623, wherein: The broadcast submodule U621 is used to periodically broadcast its own online status and globally unique device identifier; The message initiation submodule U622 is used to initiate election messages and compare device identifiers among all online terminals when the original scheduling terminal loses connection. The terminal update submodule U623 is used to automatically update the online terminal with the largest device identifier value to the new scheduling terminal, and resubmit the queued tasks that have not been issued to the new scheduling terminal.

[0041] Of course, the embodiments of this application can also be optimized in the exemplary directions mentioned above, such as batch task fragmentation and parallel processing, multi-level compilation caching acceleration, and multi-layer security restrictions during compilation and execution. Both the aforementioned system embodiments and the further optimized technical functional modules can achieve the same technical effects as the aforementioned method embodiments; to avoid repetition, they will not be elaborated upon here.

[0042] Furthermore, the technical solution of this application can be formed on a computer-readable storage medium to form a computer program. The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

[0043] The embodiments of this application can achieve all the inventive objectives using the aforementioned software; therefore, the software portion has been primarily described. Those skilled in the art should understand that the embodiments of this application can be provided as an apparatus, system, or related computer program product. Therefore, this application can be implemented in some cases as a completely hardware embodiment, or as a completely software embodiment, or as an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0044] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0045] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0046] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0047] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0048] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0049] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0050] 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 a process, method, article, or apparatus. Without further limitation, 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 said element.

[0051] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A cross-operating system general task delegation execution method, characterized in that, The method includes: Deploy binary task executors, which are encapsulated by just-in-time compilers, on various heterogeneous operating system terminals; Each heterogeneous operating system terminal dynamically elects a scheduling terminal, and the scheduling terminal distributes the task source code or intermediate representation data carrying the function to be executed to each online terminal through an encrypted point-to-point channel according to the device status of each heterogeneous operating system terminal; Each online terminal's task executor receives the task source code or intermediate representation data carrying the function to be executed, extracts the function to be executed from it, and compiles it locally in real time to generate native machine code adapted to the target device's hardware architecture, and executes the function to be executed within a software fault isolation sandbox.

2. The method according to claim 1, characterized in that, The method further includes: The scheduling terminal receives a batch data processing request, reads the online terminal hardware computing power index, and calculates the task allocation weight. The scheduling terminal splits the batch of raw data into multiple sub-tasks according to the task allocation weight, and distributes them in parallel to each online terminal through a point-to-point channel. The scheduling terminal collects the subtask execution results returned by each online terminal and merges and outputs them according to the original data input order.

3. The method according to claim 1, characterized in that, The method further includes: When the task executor of each online terminal receives the task source code or intermediate representation data, it calculates a hash identifier for the complete content of the task source code or intermediate representation data as a cache retrieval index. Based on the cache retrieval index, the memory cache, local disk cache, and nearby terminal network cache are queried layer by layer; When the cache retrieval index is found in the cache, the compiled native machine code is loaded directly, skipping the complete compilation process; when it is not found, a complete just-in-time compilation is performed, and the compiled artifacts are stored in the caches at each level.

4. The method according to claim 1, characterized in that, Each of the aforementioned heterogeneous operating system terminal dynamic election and scheduling terminals specifically includes: Each of the heterogeneous operating system terminals periodically broadcasts its online status and globally unique device identifier; When the original dispatch terminal loses connection, each online terminal initiates an election message and compares the device identifiers with each other; The online terminal with the highest device identifier value is automatically updated to the new scheduling terminal, and any queued tasks that have not yet been issued are resubmitted to the new scheduling terminal.

5. The method according to claim 1, characterized in that, The method further includes: After receiving the intermediate representation data, the task executor performs a standardized structure integrity check. Configure two types of hard limits for the compilation process: maximum memory usage and maximum compilation time. If either hard limit is exceeded, the compilation thread will be terminated directly. During task execution, verify the resource permissions declared in the task declaration and intercept unauthorized system interface calls.

6. The method according to claim 1, characterized in that, The software fault isolation sandbox allocates an independent memory region for each task, restricts memory access boundaries using masking operations, and releases the isolated memory after the task is completed.

7. The method according to claim 1, characterized in that, The device status includes device computing power, device load, and network status.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 7.

9. A cross-operating system general-purpose task delegation execution system, characterized in that, The system includes: an executor deployment module, a terminal election module, and a task execution module, wherein: The executor deployment module is used to deploy binary task executors encapsulated by a just-in-time compiler in various heterogeneous operating system terminals. The terminal election module is used to dynamically elect a scheduling terminal among the heterogeneous operating system terminals. The elected scheduling terminal distributes the task source code or intermediate representation data carrying the function to be executed to each online terminal through an encrypted point-to-point channel according to the device status of each heterogeneous operating system terminal. The task execution module is used to receive the task source code or intermediate representation data carrying the function to be executed, extract the function to be executed from it, and compile it locally in real time to generate native machine code adapted to the hardware architecture of the target device, and execute the function to be executed in a software fault isolation sandbox.

10. The system according to claim 9, characterized in that, The terminal election module includes a broadcast submodule, a message initiation submodule, and a terminal update submodule, wherein: The broadcast submodule is used to periodically broadcast its own online status and globally unique device identifier; The message initiation submodule is used to initiate election messages and compare device identifiers with each other when the original scheduling terminal loses connection. The terminal update submodule is used to automatically update the online terminal with the largest device identifier value to the new scheduling terminal, and to resubmit the queued tasks that have not yet been distributed to the new scheduling terminal.