Custom operation environment construction method and system for interactive development platform
By customizing the runtime environment construction method and system, the complexity of the interactive development platform environment migration process was solved, enabling rapid and reliable environment deployment and consistency management, and ensuring the normal operation of the intranet server.
Patent Information
- Application Number
- CN202511507236.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-02-27
AI Technical Summary
In existing technologies, the environment migration process of interactive development platforms is complex and error-prone, lacking an automated detection mechanism, which affects development efficiency.
This paper provides a method and system for building a custom runtime environment for an interactive development platform. By receiving archived files, decompressing and deploying them, remapping paths to update kernel metadata, registering new kernels and integrating them into the kernel selection list, it enables rapid deployment across network environments.
It enables rapid deployment of customized runtime environments across network environments, avoiding version conflicts and compilation failures, ensuring consistency of the environment on both internal and external networks, and guaranteeing the normal operation of internal network servers.
Smart Images

Figure CN121579418A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and more specifically, to a method and system for building a custom runtime environment for an interactive development platform. Background Technology
[0002] In fields such as data science and machine learning, interactive development platforms (such as Jupyter Notebook) have become mainstream development tools. Developers typically use environment management tools (such as Conda) to create isolated runtime environments on their local machines that meet the dependencies of specific projects. However, migrating these local environments to a server-side interactive development platform presents numerous challenges. Currently, most existing environment migration methods rely on manually exporting a list of environment dependencies and then re-downloading and installing all dependent packages on the target server based on that list. These methods are complex and error-prone, involve cumbersome kernel registration processes, lack automated detection mechanisms, and negatively impact development efficiency. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for building a custom runtime environment for an interactive development platform, thereby improving the aforementioned problems. To achieve the above objective, the technical solution adopted by this invention is as follows:
[0004] Firstly, this application provides a method for constructing a custom runtime environment for an interactive development platform, including:
[0005] Receive archive files from the target software runtime environment;
[0006] Unzip the archive file in an isolated directory of the local file system, and use the unzipped file to deploy the executable environment;
[0007] The kernel metadata of the executable environment is updated based on path remapping, and the interpreter entry point in the kernel metadata is pointed to the absolute path in the isolated directory;
[0008] Register the updated kernel metadata with the kernel manager of the interactive development platform to complete the injection of the new kernel;
[0009] The kernel perceptron is used to scan for injected new kernels and integrate the new kernels into the kernel selection list of the interactive development platform;
[0010] Obtain the kernel selected by the user from the kernel selection list, and schedule the code execution task to the custom runtime environment corresponding to the selected kernel.
[0011] Secondly, this application also provides a custom runtime environment building system for an interactive development platform, including:
[0012] Receiving module: Used to receive archive files from the target software runtime environment;
[0013] Deployment module: Used to decompress the archive files in an isolated directory of the local file system and deploy the executable environment using the decompressed files;
[0014] Configuration module: used to update the kernel metadata of the executable environment based on path remapping, pointing the interpreter entry point in the kernel metadata to the absolute path within the isolated directory;
[0015] Registration module: Used to register the updated kernel metadata with the kernel manager of the interactive development platform in order to complete the injection of the new kernel;
[0016] Integration module: Used to scan for injected new kernels using a kernel perceptron and integrate the new kernels into the kernel selection list of the interactive development platform;
[0017] Execution module: Used to obtain the kernel selected by the user from the kernel selection list and schedule the code execution task to the custom runtime environment corresponding to the selected kernel.
[0018] Thirdly, this application also provides a custom runtime environment building device for an interactive development platform, comprising:
[0019] Memory, used to store computer programs;
[0020] The processor is used to implement the steps of the custom runtime environment construction method of the interactive development platform when executing the computer program.
[0021] Fourthly, this application also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for constructing a custom runtime environment based on an interactive development platform.
[0022] The beneficial effects of this invention are as follows:
[0023] This invention enables the rapid deployment of custom runtime environments across network environments to interactive development platforms by constructing an integrated automated process. It completely avoids version conflicts, missing components, and compilation failures that may occur with traditional reinstallation methods based on dependency lists, ensuring high consistency of the environment on both internal and external networks and guaranteeing normal operation of the environment on internal network servers.
[0024] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of the process for constructing a custom runtime environment for the interactive development platform as described in this embodiment of the invention;
[0027] Figure 2 This is a schematic diagram of the Notebook kernel selection interface as described in an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of the system structure for building a custom runtime environment of the interactive development platform described in this embodiment of the invention;
[0029] Figure 4 This is a schematic diagram of the device structure for building a custom runtime environment of the interactive development platform described in this embodiment of the invention.
[0030] Marked in the image:
[0031] 800. Device for building a custom runtime environment for an interactive development platform; 801. Processor; 802. Memory; 803. Multimedia components; 804. I / O interface; 805. Communication components. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present 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 the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0033] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0034] Example 1:
[0035] This embodiment provides a method for building a custom runtime environment for an interactive development platform. This embodiment takes migrating the Conda environment data_science_env on an external network server to the Jupyter Notebook service on an internal network server as an example to describe the invention in detail.
[0036] See Figure 1 The figure shows that this method includes:
[0037] S0. Preprocess the runtime environment and export the files;
[0038] Specifically, step S0 includes:
[0039] S01. Verify whether kernel support components are installed in the runtime environment of the target software:
[0040] Specifically, the system first checks whether ipykernel is installed in the environment. If not, it automatically performs the installation operation to ensure that the Conda environment to be migrated is qualified to be registered as a Notebook kernel. ipykernel is a necessary condition for an environment to become a kernel.
[0041] S02. Call the environment packaging tool conda-pack to package the directories and configuration files of the runtime environment and generate an archive file .tar.gz file;
[0042] Specifically, step S02 includes:
[0043] S021. Configure the input parameters of the environment packaging tool conda-pack to determine the runtime environment to be packaged;
[0044] S022. The environment packaging tool traverses and collects all library files, executable files, and configuration files of the runtime environment;
[0045] S023. Compress all collected files and directory structures into the archive file .tar.gz.
[0046] Based on the above embodiments, this method further includes:
[0047] S1. Receive archive files of the target software runtime environment from an external network server;
[0048] Specifically, step S1 includes:
[0049] S11. Receive the archived file provided by a removable storage medium or a network file transfer service;
[0050] S12. Perform integrity verification and security scanning on the received archived files to verify their integrity and security, and ensure that the archived files have not been damaged during transmission.
[0051] S13. If the integrity verification and security scan pass, the archived file is transferred to a temporary directory of the local file system, such as / tmp / upload, to await subsequent processing.
[0052] S2. Decompress the archive file in the isolated directory of the local file system, and deploy the executable environment using the decompressed file to ensure that the environment runs normally on the intranet server;
[0053] Specifically, step S2 includes:
[0054] S21. Create a new directory in the local file system as the isolation directory; specifically, first create the isolation directory in the specified directory ( / opt / conda / envs / [environment name]).
[0055] S22. Decompress the received archive file into the isolated directory to generate a directory structure containing all library files, executable files and configuration files;
[0056] In this embodiment, the subdirectories such as bin / , lib / , and include / of the external network environment, along with all executable files, shared libraries, and header files, are completely restored to the internal network server.
[0057] S23. Obtain the kernel metadata file in the directory structure, read the original interpreter entry point declared in the kernel metadata file, and use it as the absolute path of the interpreter in the isolated directory to ensure that the Python interpreter and other executable scripts therein have execution permissions.
[0058] S3. Update the kernel metadata of the executable environment based on path remapping, and point the interpreter entry point in the kernel metadata to the absolute path in the isolated directory;
[0059] S4. Register the updated kernel metadata with the kernel manager of the interactive development platform to complete the injection of the new kernel Notebook;
[0060] Specifically, step S4 includes:
[0061] S41. Construct a kernel registration instruction, which encapsulates the kernel identifier and the absolute path of the interpreter after path remapping; specifically, the kernel registration instruction specifies the kernel name and the kernel display name seen by the user in the interface.
[0062] S42. Call the kernel registration application interface provided by the interactive development platform and submit the kernel registration instruction;
[0063] S43. The kernel manager creates or updates the kernel specification file in the kernel specification directory of the interactive development platform according to the kernel registration instructions, thereby injecting the new kernel.
[0064] S5. Use the kernel perceptron to scan for the injected new kernel and integrate the new kernel into the kernel selection list of the interactive development platform;
[0065] Specifically, step S5 includes:
[0066] S51. Configure the kernel sensor in the service layer of the interactive development platform. Specifically, in the base environment where the JupyterNotebook service is running, confirm that the nb_conda_kernels package has been installed.
[0067] S52. The kernel perceptron scans a predefined environment directory to identify all environments containing valid kernel configurations;
[0068] S53. The identified environment is dynamically updated as an available kernel option to the kernel selection list of the interactive development platform user interface. Specifically, the acquired environment information is dynamically added to the kernel resource pool of Jupyter Notebook.
[0069] S6. Obtain the kernel selected by the user from the kernel selection list, and schedule the code execution task to the custom runtime environment corresponding to the selected kernel;
[0070] For details, please refer to Figure 2 In the Notebook interface, the user selects "Python (DataScience)" as the execution kernel for the current document via a drop-down menu; after receiving the user's request, the Jupyter Notebook server's kernel manager routes all subsequent code execution unit scheduling tasks to the kernel named data_science_env.
[0071] Example 2:
[0072] like Figure 3As shown, this embodiment provides a custom runtime environment building system for an interactive development platform, the system comprising:
[0073] Receiving module: Used to receive archive files from the target software runtime environment;
[0074] Deployment module: Used to decompress the archive files in an isolated directory of the local file system and deploy the executable environment using the decompressed files;
[0075] Configuration module: used to update the kernel metadata of the executable environment based on path remapping, pointing the interpreter entry point in the kernel metadata to the absolute path within the isolated directory;
[0076] Registration module: Used to register the updated kernel metadata with the kernel manager of the interactive development platform in order to complete the injection of the new kernel;
[0077] Integration module: Used to scan for injected new kernels using a kernel perceptron and integrate the new kernels into the kernel selection list of the interactive development platform;
[0078] Execution module: Used to obtain the kernel selected by the user from the kernel selection list and schedule the code execution task to the custom runtime environment corresponding to the selected kernel.
[0079] Based on the above embodiments, a packaging module is also included before the receiving module:
[0080] Verification unit: Verifies whether kernel support components are installed in the runtime environment of the target software.
[0081] Packaging Unit: If so, the environment packaging tool is invoked to package the directory and configuration files of the runtime environment to generate the archive file.
[0082] Based on the above embodiments, the packaging unit includes:
[0083] Parameter configuration unit: Configures the input parameters of the environment packaging tool and determines the runtime environment to be packaged;
[0084] Traversal Unit: The environment packaging tool traverses and collects all library files, executable files, and configuration files of the runtime environment;
[0085] Compression unit: Compresses all collected files and directory structures into the archive file.
[0086] Based on the above embodiments, the receiving module includes:
[0087] Receiving unit: Receives the archived files provided by a removable storage medium or a network file transfer service;
[0088] Verification Unit: Performs integrity verification and security scanning on received archived files to verify their integrity and security;
[0089] Transfer unit: If the integrity check and security scan pass, the archived file is transferred to the temporary directory of the local file system.
[0090] Based on the above embodiments, the deployment module includes:
[0091] Creating a unit: Creating a new directory in the local file system as the isolated directory;
[0092] Decompression unit: Decompresses the received archive file into the isolated directory, generating a directory structure containing all library files, executable files, and configuration files;
[0093] Reading unit: Obtains the kernel metadata file in the directory structure, reads the original interpreter entry point declared in the kernel metadata file, and uses it as the absolute path of the interpreter in the isolated directory.
[0094] Based on the above embodiments, the registration module includes:
[0095] Construction unit: Constructs kernel registration instructions, which encapsulate the kernel identifier and the absolute path of the interpreter after path remapping;
[0096] Calling unit: Calls the kernel registration application interface provided by the interactive development platform and submits the kernel registration instruction;
[0097] Injection Unit: The kernel manager creates or updates the kernel specification file in the kernel specification directory of the interactive development platform according to the kernel registration instructions, thereby injecting the new kernel.
[0098] Based on the above embodiments, the integration module includes:
[0099] Configuration Unit: Configures the kernel perceptron at the service layer of the interactive development platform;
[0100] Identification unit: The kernel perceptron scans a predefined environment directory to identify all environments containing valid kernel configurations;
[0101] Update unit: Dynamically updates the kernel selection list of the interactive development platform user interface with the identified environment as available kernel options.
[0102] It should be noted that the specific methods by which each module performs operations in the system described in the above embodiments have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0103] Example 3:
[0104] Corresponding to the above method embodiments, this embodiment also provides a custom runtime environment building device for an interactive development platform. The custom runtime environment building device for an interactive development platform described below and the custom runtime environment building method for an interactive development platform described above can be referred to in correspondence.
[0105] Figure 4 This is a block diagram illustrating a custom runtime environment construction device 800 for an interactive development platform according to an exemplary embodiment. For example... Figure 4 As shown, the custom runtime environment building device 800 of the interactive development platform may include: a processor 801 and a memory 802. The custom runtime environment building device 800 of the interactive development platform may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0106] The processor 801 controls the overall operation of the custom runtime environment building device 800 of the interactive development platform to complete all or part of the steps in the aforementioned method for building the custom runtime environment of the interactive development platform. The memory 802 stores various types of data to support the operation of the custom runtime environment building device 800 of the interactive development platform. This data may include, for example, instructions for any application or method operating on the custom runtime environment building device 800 of the interactive development platform, as well as application-related data, such as contact data, sent and received messages, images, audio, video, etc. The memory 802 can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 802 or transmitted via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 805 is used for wired or wireless communication between the custom runtime environment building device 800 of this interactive development platform and other devices. Wireless communication includes, for example, Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 805 may include a Wi-Fi module, a Bluetooth module, and an NFC module.
[0107] In an exemplary embodiment, the custom runtime environment construction device 800 of the interactive development platform may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the custom runtime environment construction method of the interactive development platform described above.
[0108] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When executed by a processor, these program instructions implement the steps of the custom runtime environment construction method for the interactive development platform described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above. These program instructions may be executed by the processor 801 of the custom runtime environment construction device 800 for the interactive development platform to complete the custom runtime environment construction method for the interactive development platform described above.
[0109] Example 4:
[0110] Corresponding to the above method embodiments, this embodiment also provides a readable storage medium. The readable storage medium described below and the method for constructing a custom runtime environment for an interactive development platform described above can be referred to in correspondence.
[0111] A readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the method for constructing a custom runtime environment for an interactive development platform as described in the above method embodiments are implemented.
[0112] The readable storage medium can specifically be a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or any other readable storage medium capable of storing program code.
[0113] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0114] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for constructing a custom runtime environment for an interactive development platform, characterized in that, include: Receive archive files from the target software runtime environment; Unzip the archive file in an isolated directory of the local file system, and use the unzipped file to deploy the executable environment; The kernel metadata of the executable environment is updated based on path remapping, and the interpreter entry point in the kernel metadata is pointed to the absolute path in the isolated directory; Register the updated kernel metadata with the kernel manager of the interactive development platform to complete the injection of the new kernel; The kernel perceptron is used to scan for injected new kernels and integrate the new kernels into the kernel selection list of the interactive development platform; Obtain the kernel selected by the user from the kernel selection list, and schedule the code execution task to the custom runtime environment corresponding to the selected kernel.
2. The method for constructing a custom runtime environment for an interactive development platform according to claim 1, characterized in that... The receiving of archive files from the target software runtime environment includes: Receive the archived files provided by a removable storage medium or a network file transfer service; The received archived files undergo integrity verification and security scanning to confirm their integrity and security. If the integrity check and security scan pass, the archived files are transferred to the temporary directory of the local file system.
3. The method for constructing a custom runtime environment for an interactive development platform according to claim 1, characterized in that... The archive file is decompressed in an isolated directory of the local file system, and the executable environment is deployed using the decompressed archive file, including: Create a new directory in the local file system as the isolated directory; The received archive file is decompressed into the isolated directory to generate a directory structure containing all library files, executable files, and configuration files; Obtain the kernel metadata file in the directory structure, read the original interpreter entry point declared in the kernel metadata file, and use it as the absolute path of the interpreter in the isolated directory.
4. The method for constructing a custom runtime environment for an interactive development platform according to claim 1, characterized in that... The process of registering the updated kernel metadata with the kernel manager of the interactive development platform to complete the injection of the new kernel includes: Construct kernel registration instructions, which encapsulate the kernel identifier and the absolute path of the interpreter after path remapping; Call the kernel registration application interface provided by the interactive development platform to submit the kernel registration command; The kernel manager creates or updates the kernel specification file in the kernel specification directory of the interactive development platform according to the kernel registration instructions, thereby injecting the new kernel.
5. The method for constructing a custom runtime environment for an interactive development platform according to claim 4, characterized in that... The step of using a kernel perceptron to scan for injected new kernels and integrating the new kernels into the kernel selection list of the interactive development platform includes: Configure a kernel perceptron in the service layer of the interactive development platform. The kernel perceptron scans a predefined environment directory to identify all environments containing valid kernel configurations. The identified environment is dynamically updated as an available kernel option in the kernel selection list of the interactive development platform user interface.
6. A custom runtime environment building system for an interactive development platform, characterized in that, include: Receiving module: Used to receive archive files from the target software runtime environment; Deployment module: Used to decompress the archive files in an isolated directory of the local file system and deploy the executable environment using the decompressed files; Configuration module: used to update the kernel metadata of the executable environment based on path remapping, pointing the interpreter entry point in the kernel metadata to the absolute path within the isolated directory; Registration module: Used to register the updated kernel metadata with the kernel manager of the interactive development platform in order to complete the injection of the new kernel; Integration module: Used to scan for injected new kernels using a kernel perceptron and integrate the new kernels into the kernel selection list of the interactive development platform; Execution module: Used to obtain the kernel selected by the user from the kernel selection list and schedule the code execution task to the custom runtime environment corresponding to the selected kernel.
7. The custom runtime environment construction system for the interactive development platform according to claim 6, characterized in that, The receiving module includes: Receiving unit: Receives the archived files provided by a removable storage medium or a network file transfer service; Verification Unit: Performs integrity verification and security scanning on received archived files to verify their integrity and security; Transfer unit: If the integrity check and security scan pass, the archived file is transferred to the temporary directory of the local file system.
8. The custom runtime environment construction system for the interactive development platform according to claim 6, characterized in that, The deployment module includes: Creating a unit: Creating a new directory in the local file system as the isolated directory; Decompression unit: Decompresses the received archive file into the isolated directory, generating a directory structure containing all library files, executable files, and configuration files; Reading unit: Obtains the kernel metadata file in the directory structure, reads the original interpreter entry point declared in the kernel metadata file, and uses it as the absolute path of the interpreter in the isolated directory.
9. The custom runtime environment construction system for the interactive development platform according to claim 6, characterized in that, The registration module includes: Construction unit: Constructs kernel registration instructions, which encapsulate the kernel identifier and the absolute path of the interpreter after path remapping; Calling unit: Calls the kernel registration application interface provided by the interactive development platform and submits the kernel registration instruction; Injection Unit: The kernel manager creates or updates the kernel specification file in the kernel specification directory of the interactive development platform according to the kernel registration instructions, thereby injecting the new kernel.
10. The custom runtime environment construction system for the interactive development platform according to claim 9, characterized in that, The integrated module includes: Configuration Unit: Configures the kernel perceptron at the service layer of the interactive development platform; Identification unit: The kernel perceptron scans a predefined environment directory to identify all environments containing valid kernel configurations; Update unit: Dynamically updates the kernel selection list of the interactive development platform user interface with the identified environment as available kernel options.