Memory operating system generation method and device, equipment, medium and program product

Through elemental design and phased management, automatic execution of operation elements is solved, the problem of low production efficiency of memory operating system is achieved, flexibility and scalability are achieved, and production efficiency and stability are improved.

CN119225854APending Publication Date: 2024-12-31CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411280863.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing technology is not efficient when making memory operating systems, it is difficult to achieve process automation and flexible adjustments, and adding new functions is cumbersome and difficult to expand.

Method used

By elementally designing the operations required during the production process, using the integration and staged management of multiple operation elements, we automatically perform specific operations, select elements according to user needs and assign them to each production stage, ensuring the operation sub-in-one of each stage Elements are executed correctly.

Benefits of technology

It improves the production efficiency of the memory operating system, is flexible and scalable, can be customized according to user needs, reduces repeated operations and unnecessary steps, has high stability, and reduces maintenance and update costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119225854A_ABST
    Figure CN119225854A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a memory operating system generation method and device, equipment, a medium and a program product. The method comprises the following steps: determining a plurality of operation elements required by system manufacturing according to a user manufacturing requirement; according to a plurality of preset production execution stages, determining operation elements in the same production execution stage from the plurality of operation elements as operation sub-elements; carrying out integration processing on the operation sub-elements in the same production and execution stage, and obtaining integrated operation elements in all the production and execution stages and script file names of all the operation sub-elements in the integrated operation elements; according to the execution sequence of the production and execution stages and the script file name of each operation sub-element in the integrated operation element, executing the script file in each production and execution stage, and generating the memory operation system. According to the method, the manufacturing efficiency of the memory operating system can be improved, and the method has flexibility and expandability and can be customized according to user requirements to adapt to different manufacturing requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, medium and program product for generating a memory operating system. Background Art

[0002] The memory operating system is an operating system that runs mainly in memory, and mainly includes two key components: the kernel and the memory file system (Ramfs). The system does not rely on hard disks and other persistent storage media, and can improve the system's startup speed and operating efficiency. By customizing the memory file system, the memory operating system can meet the needs of different scenarios.

[0003] In the prior art, a method for making a memory operating system that can realize a kernel + memory file system operating mode is provided, namely: installing an operating system that supports an alpha architecture (Alpha architecture) CPU (central processing unit) server, and obtaining a kernel file and an image file from the operating system; decompressing the image file to obtain a root file system; modifying corresponding files in the root file system according to the functions to be added; compressing the modified root file system to generate a new image file, and starting the operating system based on the kernel file and the new image file.

[0004] However, the existing technology has the problem of low production efficiency when producing the memory operating system. Summary of the invention

[0005] The embodiments of the present application provide a memory operating system generation method, apparatus, device, medium and program product to solve the problem of low production efficiency when producing a memory operating system in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a method for generating a memory operating system, comprising:

[0007] According to the production requirements of the user, multiple operation elements required for system production are determined, and the operation elements include script files and configuration files for the operations required for system production, wherein different operation elements correspond to different types of operations required for system production;

[0008] According to the preset multiple production execution stages, determining the operation elements in the same production execution stage from the multiple operation elements as the operation sub-elements;

[0009] Integrate the operation sub-elements of the same production execution stage, obtain the integrated operation elements of each production execution stage, and the script file name of each operation sub-element in the integrated operation element;

[0010] According to the execution order of the production execution phase and the script file name of each operation sub-element in the integrated operation element, the script files in each production execution phase are executed to generate a memory operating system.

[0011] In a possible implementation, multiple operation elements required for system production are determined according to user production requirements, including:

[0012] Determine the type of operation required for system production based on user production requirements;

[0013] According to the operation type, a query result corresponding to the operation type is obtained from a preset operation element library;

[0014] If the query result indicates that there is an operation element corresponding to the operation type, the operation element corresponding to the operation type is obtained as the operation element required for system production.

[0015] In a possible implementation, after obtaining a query result corresponding to the operation type from a preset operation element library according to the operation type, the method further includes:

[0016] If the query result indicates that there is no operation element corresponding to the operation type, then according to the preset element design rule, a custom script file and a custom configuration file corresponding to the operation type are determined;

[0017] According to the operation type and the preset production execution stage, the custom script file is named with a digital prefix;

[0018] Obtain the custom operation sub-element corresponding to the production execution phase, and the custom operation element corresponding to each custom operation sub-element;

[0019] Use customized operating elements as the operating elements required for system production.

[0020] In a possible implementation, after obtaining the custom operation sub-element corresponding to the production execution phase and the custom operation element corresponding to each custom operation sub-element, the method further includes:

[0021] Save custom operation elements to the preset operation element library.

[0022] In a possible implementation, the production execution phase includes a root file system initialization phase, a data copy phase, an installation phase, a cleaning phase, and a packaging phase. According to the execution order of the production execution phase and the script file name of each operation sub-element in the integrated operation element, the script files in each production execution phase are executed to generate a memory operating system, including:

[0023] According to the execution order of the production execution phase and the script file names of each operation sub-element in the integration operation element, the script file in the initialization root file system phase is executed, so that after the disk image of the newly created memory operating system is obtained according to the configured path, the root file system in the disk image is mounted to the specified working directory;

[0024] Execute the script file in the data copy phase to copy the installation data obtained from the host environment to the working directory, where the installation data includes the configuration files required for software installation;

[0025] Execute the script files in the installation phase and install the required software and services in the root file system of the working directory based on the operating environment;

[0026] Execute the script file in the cleanup phase to clear the installation cache information in the operating environment and exit the operating environment;

[0027] Execute the script file in the packaging stage, package and compress the file system in the working directory, and obtain the kernel and memory file system;

[0028] Generate a memory operating system based on the kernel and memory file system.

[0029] In a possible implementation, the production execution phase further includes a pre-installation phase. Before executing the script file in the installation phase, based on the operating environment, the method further includes:

[0030] Execute the script files in the pre-installation phase to complete the configuration work required in the installation phase and determine the installation environment information.

[0031] In a second aspect, an embodiment of the present application provides a memory operating system generating device, including:

[0032] A selection module is used to determine multiple operation elements required for system production according to user production requirements. The operation elements include script files and configuration files for the operations required for system production. Different operation elements correspond to different types of operations required for system production.

[0033] A determination module, used to determine, according to a plurality of preset production execution stages, operation elements in the same production execution stage from among a plurality of operation elements as operation sub-elements;

[0034] An integration module is used to integrate the operation sub-elements of the same production execution stage, obtain the integrated operation elements of each production execution stage, and the script file name of each operation sub-element in the integrated operation element;

[0035] The generation module is used to execute the script files in each production execution stage according to the execution order of the production execution stage and the script file names of each operation sub-element in the integration operation element, and generate a memory operating system.

[0036] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0037] Memory stores computer-executable instructions;

[0038] The processor executes the computer-executable instructions stored in the memory to implement the above first aspect and / or various possible implementations of the first aspect.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement the first aspect above and / or various possible implementation methods of the first aspect.

[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0041] The memory operating system generation method, apparatus, device, medium and program product provided in the embodiments of the present application determine multiple operation elements required for system production according to user production requirements, the operation elements include script files and configuration files for the operations required for system production, wherein different operation elements correspond to different types of operations required for system production; according to multiple preset production execution stages, determine the operation elements in the same production execution stage from multiple operation elements as operation sub-elements; integrate the operation sub-elements in the same production execution stage to obtain the integrated operation elements of each production execution stage and the script file names of each operation sub-elements in the integrated operation elements; according to the execution order of the production execution stages and the script file names of each operation sub-elements in the integrated operation elements, execute the script files in each production execution stage to generate the means of the memory operating system, design the operations required in the production process into elements, and utilize the integration and staged management of multiple operation elements to reduce repeated operations and unnecessary steps. At the same time, based on the script file names of each operation sub-element, it can be ensured that the operation sub-elements in each stage can be correctly executed, thereby improving the production efficiency of the memory operating system, and the memory operating system has flexibility and scalability, and can be customized according to user needs to adapt to different production needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] Figure 1 A flowchart of a method for generating a memory operating system provided in this application;

[0044] Figure 2 A flowchart of another method for generating a memory operating system provided by the present application;

[0045] Figure 3 A schematic diagram of the structure of the memory operating system generation device provided by this application;

[0046] Figure 4 A schematic diagram of the structure of the electronic device provided in this application.

[0047] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0049] In the prior art, there is provided a method for making a memory operating system that can realize the kernel + memory file system operation mode, namely: installing an operating system that supports an alpha architecture CPU server, and obtaining kernel files and image files from the operating system; decompressing the image file to obtain a root file system; modifying the corresponding files in the root file system according to the functions to be added; compressing the modified root file system to generate a new image file, and starting the operating system based on the kernel file and the new image file. However, the execution steps of this method need to be performed based on manual operations, and it is impossible to realize a process automation production system. In addition, the production process of this method is relatively fixed, and it is difficult to flexibly adjust and expand according to the needs of different users. When adding new functions, it is necessary to manually modify the corresponding files in the root file system. The process is cumbersome and difficult to expand, so there is a problem of low production efficiency.

[0050] In order to solve the above problems, the embodiments of the present application provide a memory operating system generation method, device, equipment, medium and program product, which designs the operations required in the production process in an element-by-element manner, and automatically executes the specific required operations in the form of script files in each element, so that when the user produces the system, they can select elements according to different needs and assign them to each production stage for automated production of the system; through the integration and staged management of multiple operation elements, repetitive operations and unnecessary steps can be reduced, and based on the script file name of each operation sub-element, it can be ensured that the operation sub-elements of each stage can be executed correctly with high stability, thereby improving production efficiency.

[0051] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0052] The execution subject of the memory operating system generation method provided in the embodiment of the present application can be a server. Among them, the server can be a mobile phone, a computer, a tablet and other devices. The embodiment of the present application does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can determine the multiple operation elements required for system production according to the user's production requirements, and the operation elements include script files and configuration files for the operations required for system production, wherein different operation elements correspond to different types of system production required operations; according to the preset multiple production execution stages, the operation elements in the same production execution stage are determined from the multiple operation elements as the operation sub-elements; the operation sub-elements of the same production execution stage are integrated and processed to obtain the integrated operation elements of each production execution stage, and the script file names of each operation sub-element in the integrated operation element; according to the execution order of the production execution stage and the script file names of each operation sub-element in the integrated operation element, the script files in each production execution stage are executed to generate the memory operating system.

[0053] Among them, a script file can be a text file containing a series of instructions, which can include python scripts and shell scripts, which are used to automate tasks and operations, such as system installation, software deployment, etc. A configuration file can be a file used to store settings and parameters of a system or application, allowing users or system administrators to customize the behavior of the system or application without modifying the source code.

[0054] Figure 1 The flowchart of a method for generating a memory operating system provided by the present application is shown in FIG. The execution subject of the method may be a server or other server storing the method for generating a memory operating system, and this embodiment is not particularly limited here. Figure 1 As shown, the method may include:

[0055] S101. Determine multiple operation elements required for system production according to user production requirements. The operation elements include script files and configuration files for operations required for system production. Different operation elements correspond to different types of operations required for system production.

[0056] Among them, user production requirements can refer to the specific requirements and expectations put forward by users for the memory operating system during the production process. These requirements include detailed descriptions of the functions, performance, interface design, user experience, configuration options, etc. that users want the system to have. Furthermore, according to the user production requirements, users can select or design operating elements in the human-computer interaction interface produced by the system, thereby determining the various operating elements required when the memory operating system is produced. These operating elements are necessary components or steps in the process of making the system.

[0057] In one example, each operation element corresponds to a specific type of operation. For example, a script file may be used to install a software package, and a configuration file may be used to set network parameters. Thus, the operation elements can be classified and managed according to the type of specific operation so that they can be executed in an orderly manner during the system production process.

[0058] Among them, in the embodiment of the present application, according to the user's production requirements, the method for determining multiple operating elements required for system production may include:

[0059] Determine the type of operation required for system production based on user production requirements;

[0060] According to the operation type, a query result corresponding to the operation type is obtained from a preset operation element library;

[0061] If the query result indicates that there is an operation element corresponding to the operation type, the operation element corresponding to the operation type is obtained as the operation element required for system production.

[0062] In this step, the operation type required for system production may refer to the category of operations required to be performed during the system production process, such as file operations, network configuration, user management, software installation, etc.

[0063] The preset operation element library can be a database or collection that predefines and stores various operation elements. The preset operation element library includes various script files, configuration files, etc. that may be required in the system production process. The preset operation element library can be set according to the actual needs of each operation or operator in the existing memory operating system production method.

[0064] The query result may refer to a result obtained after querying a preset operation element library according to the operation type, and the query result indicates whether there is an operation element corresponding to the operation type.

[0065] Among them, determining the operation types required for system production according to the user's production requirements may refer to analyzing the user's specific requirements and determining various operation types that need to be performed during the system production process. For example, if the user needs a file management system, the operation types may include file upload, file download, file deletion, etc.

[0066] Further, according to the determined operation type, a query is performed in the preset operation element library to find out whether there are operation elements corresponding to these operation types. For example, if the operation type is "file upload", the operation element library is searched to find out whether there are script files or configuration files of operation elements related to file upload.

[0067] Furthermore, if the query result indicates that there are operation elements corresponding to the operation type in the operation element library, these operation elements are extracted as the operation elements required for use in the system production process. For example, if there is a script file for file upload in the query result, the operation elements corresponding to the script file are extracted as the operation elements required for system production.

[0068] Therefore, according to the user's production requirements, the types of operations that need to be performed in the system production process can be determined, and the operation elements corresponding to these operation types can be obtained from the preset operation element library to ensure that all types of operation elements required in the system production process can be accurately and timely obtained and used. This method helps to improve the efficiency and accuracy of system production, while ensuring that the system can meet the specific needs of users.

[0069] In the embodiment of the present application, after obtaining the query result corresponding to the operation type from the preset operation element library according to the operation type, the method may further include:

[0070] If the query result indicates that there is no operation element corresponding to the operation type, then according to the preset element design rule, a custom script file and a custom configuration file corresponding to the operation type are determined;

[0071] According to the operation type and the preset production execution stage, the custom script file is named with a digital prefix;

[0072] Obtain the custom operation sub-element corresponding to the production execution phase, and the custom operation element corresponding to each custom operation sub-element;

[0073] Use customized operating elements as the operating elements required for system production.

[0074] In this step, the preset element design rules may refer to predefined rules and standards for designing and creating new operation elements (such as script files and configuration files), which ensure that the newly created operation elements meet the requirements and specifications of the system.

[0075] Custom script files can be script files created for specific operation types according to preset element design rules. These files contain instructions and parameters required to complete specific operations. Custom configuration files can refer to configuration files created for specific operation types according to preset element design rules. These files define specific parameters and options for system configuration.

[0076] The preset production execution stage can be a necessary step for producing a memory operating system, and the production process is divided into stages to obtain various production execution stages, each stage containing a group of related operations. For example, the preset production execution stage may include a root file system initialization stage, a data copy stage, a pre-installation stage, an installation stage, a cleanup stage, and a packaging stage.

[0077] A custom operation sub-element may be an operation element that is in a specific production execution stage and corresponds to a specific operation. Since the specific operation corresponding to each operation element may be executed in multiple production execution stages, when designing a custom operation element, the operation element may include an operation sub-element of one production execution stage or may include operation sub-elements of multiple production execution stages.

[0078] In one example, taking the file upload operation as an example, if the file upload script file is not found, a new file upload script file is created according to the design rules; the newly created custom script file is named according to the operation type and the production execution stage, and a digital prefix is ​​used to ensure the uniqueness and sequence of the file name. For example, the file upload script file can be named "01_file_upload.sh"; from each production execution stage, the custom operation sub-elements that require this operation type are determined, and these operation sub-elements are integrated into the custom operation elements corresponding to the operation type; finally, all determined custom operation elements (including custom script files and custom configuration files) are used as operation elements required in the system production process.

[0079] Through the above steps, when no suitable operation element is found in the preset operation element library, a new custom operation element can be created according to the preset element design rules, and these custom operation elements can be managed and named according to the production execution stage, ensuring that all kinds of operation elements required in the system production process can be accurately and timely obtained and used. This method helps to improve the flexibility and adaptability of system production, while ensuring that the system can meet the specific needs of users.

[0080] In the embodiment of the present application, after obtaining the custom operation sub-element corresponding to the production execution stage and the custom operation element corresponding to each custom operation sub-element, the method may further include:

[0081] Save custom operation elements to the preset operation element library.

[0082] Among them, adding the newly created custom operation elements (including custom script files and custom configuration files) to the preset operation element library can ensure that the newly created operation elements can be used in the subsequent system production process and can be reused in future production processes, thereby improving the efficiency and flexibility of system production, while ensuring that the contents of the operation element library are always up to date and complete.

[0083] S102. According to a plurality of preset production execution stages, determine, from a plurality of operation elements, operation elements in the same production execution stage as operation sub-elements.

[0084] The preset multiple production execution stages may refer to different predefined stages in the system production process, and each stage includes a group of related operations.

[0085] The operation sub-element may refer to selecting the operation elements in the same production execution stage from among multiple operation elements and using them as the operation sub-element of the production execution stage, so as to facilitate the sequential execution and management of the subsequent execution stages. Further, determining the operation elements in the same production execution stage from among multiple operation elements may refer to identifying and screening the operation elements belonging to the same production execution stage from among all operation elements. For example, in the configuration stage, all configuration-related operation elements need to be identified, and each identified operation element is stored as an operation sub-element in the folder corresponding to the configuration stage.

[0086] In this step, by determining the operation elements in the same production execution stage from multiple operation elements according to the preset multiple production execution stages, and using them as operation sub-elements, the system production process can be organized and managed more systematically, thereby ensuring that the operation elements in each stage can be executed correctly, thereby improving the efficiency and reliability of system production.

[0087] S103, integrating the operation sub-elements of the same production execution stage, obtaining the integrated operation elements of each production execution stage, and the script file name of each operation sub-element in the integrated operation element.

[0088] The integration process may refer to merging the operation sub-elements of the same production execution stage into the same folder and sorting the execution order so as to more effectively execute these operations. The integrated operation element may be a collection of operation sub-elements after the integration process, including all the operation sub-elements that need to be executed in a certain production execution stage.

[0089] The script file name may refer to the name of a specific script file in the operation sub-element, and the name may be a name named in a digital prefix manner.

[0090] It can be seen that obtaining the integrated operation elements of each production execution stage and the script file name of each operation sub-element in the integrated operation element can help improve the efficiency and reliability of system production and ensure that the operations at each stage can be executed correctly.

[0091] S104. Execute the script files in each production execution stage according to the execution order of the production execution stage and the script file names of each operation sub-element in the integrated operation element to generate a memory operating system.

[0092] Among them, the execution order of the production execution stage can be set when multiple production execution stages are predefined. For example, the initialization root file system stage, data copy stage, pre-installation stage, installation stage, cleanup stage, and packaging stage are executed in sequence. Furthermore, when executing each production execution stage in sequence, the operation sub-elements in each production execution stage are executed in sequence according to the corresponding script file name; by executing the script files of the operation sub-elements in each production execution stage, the system initialization, configuration, and deployment are completed, and finally an operating system running in the memory is generated.

[0093] Among them, in the embodiment of the present application, the production execution stage includes a root file system initialization stage, a data copy stage, an installation stage, a cleaning stage, and a packaging stage. According to the execution order of the production execution stage and the script file name of each operation sub-element in the integrated operation element, the script file in each production execution stage is executed, and the method for generating a memory operating system may include:

[0094] According to the execution order of the production execution phase and the script file names of each operation sub-element in the integration operation element, the script file in the initialization root file system phase is executed, so that after the disk image of the newly created memory operating system is obtained according to the configured path, the root file system in the disk image is mounted to the specified working directory;

[0095] Execute the script file in the data copy phase to copy the installation data obtained from the host environment to the working directory, where the installation data includes the configuration files required for software installation;

[0096] Execute the script files in the installation phase and install the required software and services in the root file system of the working directory based on the operating environment;

[0097] Execute the script file in the cleanup phase to clear the installation cache information in the operating environment and exit the operating environment;

[0098] Execute the script file in the packaging stage, package and compress the file system in the working directory, and obtain the kernel and memory file system;

[0099] Generate a memory operating system based on the kernel and memory file system.

[0100] In this step, the root file system may refer to the core file system of the operating system, which contains the basic files and directory structure required for the system to start and run. The newly created memory operating system may be the operating system that is the final goal of the entire production process. The working directory may refer to the directory used to temporarily store and operate files during the production process. The host environment may refer to the host environment for producing the memory operating system, providing the necessary tools and resources. Installation data may refer to the necessary files and configurations for software installation, including software packages, configuration files, etc. The operating environment may refer to the specific environment used in the system production process. In one example, the operating environment may be a chroot environment.

[0101] When all necessary files and configurations have been correctly packaged and the kernel and memory file system are obtained, the newly created memory operating system is run in the computer's memory, thereby ensuring that the creation of the memory operating system is complete.

[0102] By executing the script files in each stage in sequence according to the execution order of the production execution stages, the system production process can be effectively organized and managed, and ultimately an operating system running in memory is generated to ensure that the operations in each stage are executed correctly, thereby improving the efficiency and reliability of system production.

[0103] In the embodiment of the present application, the production execution phase also includes a pre-installation phase. Before executing the script file in the installation phase, based on the operating environment, the method may further include:

[0104] Execute the script files in the pre-installation phase to complete the configuration work required in the installation phase and determine the installation environment information.

[0105] In this step, after the data is copied and before the software is installed, the script files in the pre-installation phase are executed. These script files will complete the configuration work required in the installation phase and determine the installation environment information, such as the version of the dependent package, system path, etc.

[0106] By adding the pre-installation phase, the necessary configuration work and determination of environmental information can be completed before the installation phase is executed, thereby ensuring that the installation phase can proceed smoothly and improving the efficiency and reliability of system production.

[0107] The memory operating system generation method provided in the embodiment of the present application designs the operations required in the production process in an elemental manner, and automatically executes the specific required operations in the form of script files in each element, so that when the user produces the system, they can select elements according to different needs and assign them to each production stage to automatically produce the system; through the integration and staged management of multiple operation elements, it is possible to reduce repeated operations and unnecessary steps, and based on the script file names of each operation sub-element, it is possible to ensure that the operation sub-elements of each stage can be executed correctly with high stability, so as to improve production efficiency; the specific operations are designed in an elemental manner, and the elements have good repeatability. Existing elements can be used for repeated production, or some simple modifications can be made, so that the production has better flexibility and faster speed, thereby improving production efficiency and reducing maintenance and update costs.

[0108] Figure 2 A flowchart of another method for generating a memory operating system provided in an embodiment of the present application. Figure 2 As shown, the method may include:

[0109] S201. Design elements according to element design specifications.

[0110] Among them, elements are a collection of scripts (including python scripts and shell scripts) and configuration files required for a specific operation in the production process. For example, some elements can provide root file systems of different operating systems. These elements obtain image files through specified directories or links and mount their root file systems to specified directories; some elements can modify or install software services based on this root file system, such as modifying the root password, installing python software, etc.; and some elements can package the modified root file system into a memory file system. Customized memory operating systems can be automatically produced by designing different elements and specifying them.

[0111] S202. Provide all elements required for production.

[0112] Among them, the specific operation corresponding to an element may be executed at different steps in the production process. Therefore, the existing memory operating system production process can be divided into stages to obtain six execution stages: initialization of the root file system stage, data copy stage, pre-installation stage, installation stage, cleaning stage, and packaging stage, so as to standardize the execution and management of scripts in the element. Therefore, when designing elements in S201, an element may include sub-elements corresponding to one or more stages.

[0113] In one example, the existing memory operating system production process may be:

[0114] 1. Obtain the disk image of the Xinchuang operating system according to the configured path or address;

[0115] 2. Mount the root file system in the disk image to the specified working directory;

[0116] 3. Copy the software and service-related files to be installed to the working directory;

[0117] 4. Mount the host's proc, dev, devpts, and sysfs file systems to the working directory;

[0118] 5. Chroot to the working directory and install the required software and services;

[0119] 6. Clean the installation cache and exit chroot;

[0120] 7. Get the kernel from the boot directory;

[0121] 8. Use the cpio command to package the working directory and create a memory file system.

[0122] After the phase division, each execution phase can be used to:

[0123] 1. Initialize the root file system: obtain the disk image root file system and mount it to the working directory;

[0124] 2. Data copying stage: used to obtain additional data from the host environment, mainly configuration files and software packages required for software installation;

[0125] 3. Pre-installation stage: used for configuration work before software installation, such as updating the software package management tool, installing the Python basic environment, etc.;

[0126] 4. Installation phase: used to install the software and services required for the customized operating system;

[0127] 5. Cleaning phase: used to clean cache, etc.

[0128] 6. Packaging stage: used to obtain the kernel and memory file system.

[0129] S203, integrating all elements, integrating all elements according to the execution stage, and integrating scripts of different elements in the same execution stage.

[0130] In this step, the sub-elements in the same execution stage of each element are screened and integrated to ensure the accuracy of the sub-elements in the same execution stage during execution and improve the execution efficiency.

[0131] In one example, each execution stage is represented by a folder, which stores script files and configuration files that all elements need to run in that execution stage. The script files are named with numbers as prefixes. Therefore, in each execution stage, the number in the script file name can be used to represent the execution order of the script file.

[0132] S204. Automatically execute each stage in a stage sequence, and execute the scripts in each stage in a script numerical prefix sequence, wherein the stage sequence is the initialization root file system stage, the data copy stage, the pre-installation stage, the installation stage, the cleanup stage, and the packaging stage.

[0133] The automatic execution of each stage can be accomplished by executing the scripts in sequence according to the specifications through the main program, thereby completing the automatic production of the memory operating system. These scripts are managed by multiple elements and execution stages. Based on these elements, the steps for automatically executing each stage in the order of stages are as follows:

[0134] 1. Automatically execute the scripts for initializing the root file system in the order of the script numerical prefixes;

[0135] 2. Automatically execute the data copy phase scripts in the order of the script numerical prefixes;

[0136] 3. Automatically execute pre-installation scripts in the order of script numerical prefixes;

[0137] 4. Automatically execute the installation phase scripts in the order of script numerical prefixes;

[0138] 5. Automatically execute the cleanup phase scripts in the order of script numerical prefixes;

[0139] 6. Automatically execute the packaging phase scripts in the order of script numerical prefixes.

[0140] The memory operating system generation method provided in the embodiment of the present application produces a memory operating system based on a series of scripts and configuration files. The main program executes the scripts in sequence according to the specifications to complete the automated production. These scripts are managed by multiple elements and execution stages. All production steps can be fully automated and a good customization interface is provided. The interface can be configured according to the actual needs of the user and then automatically produced based on the configuration.

[0141] Figure 3 A schematic diagram of the structure of the memory operating system generation device provided in this application, such as Figure 3 As shown, the memory operating system generating device 30 provided in this embodiment includes:

[0142] The selection module 301 is used to determine multiple operation elements required for system production according to the production requirements of the user, and the operation elements include script files and configuration files for the operations required for system production, wherein different operation elements correspond to different types of operations required for system production;

[0143] A determination module 302, configured to determine, according to a plurality of preset production execution stages, operation elements in the same production execution stage from among a plurality of operation elements as operation sub-elements;

[0144] The integration module 303 is used to integrate the operation sub-elements of the same production execution stage, obtain the integrated operation elements of each production execution stage, and the script file name of each operation sub-element in the integrated operation element;

[0145] The generation module 304 is used to execute the script files in each production execution stage according to the execution order of the production execution stage and the script file names of each operation sub-element in the integrated operation element to generate a memory operating system.

[0146] In a possible implementation, the selection module 301 may also be used to:

[0147] Determine the type of operation required for system production based on user production requirements;

[0148] According to the operation type, a query result corresponding to the operation type is obtained from a preset operation element library;

[0149] If the query result indicates that there is an operation element corresponding to the operation type, the operation element corresponding to the operation type is obtained as the operation element required for system production.

[0150] In a possible implementation, the selection module 301 may also be used to:

[0151] If the query result indicates that there is no operation element corresponding to the operation type, then according to the preset element design rule, a custom script file and a custom configuration file corresponding to the operation type are determined;

[0152] According to the operation type and the preset production execution stage, the custom script file is named with a digital prefix;

[0153] Obtain the custom operation sub-element corresponding to the production execution phase, and the custom operation element corresponding to each custom operation sub-element;

[0154] Use customized operating elements as the operating elements required for system production.

[0155] In a possible implementation, the selection module 301 may also be used to:

[0156] Save custom operation elements to the preset operation element library.

[0157] In a possible implementation, the generating module 304 may also be used to:

[0158] According to the execution order of the production execution phase and the script file names of each operation sub-element in the integration operation element, the script file in the initialization root file system phase is executed, so that after the disk image of the newly created memory operating system is obtained according to the configured path, the root file system in the disk image is mounted to the specified working directory;

[0159] Execute the script file in the data copy phase to copy the installation data obtained from the host environment to the working directory, where the installation data includes the configuration files required for software installation;

[0160] Execute the script files in the installation phase and install the required software and services in the root file system of the working directory based on the operating environment;

[0161] Execute the script file in the cleanup phase to clear the installation cache information in the operating environment and exit the operating environment;

[0162] Execute the script file in the packaging stage, package and compress the file system in the working directory, and obtain the kernel and memory file system;

[0163] Generate a memory operating system based on the kernel and memory file system.

[0164] In a possible implementation, the generating module 304 may also be used to:

[0165] Execute the script files in the pre-installation phase to complete the configuration work required in the installation phase and determine the installation environment information.

[0166] The memory operating system generation device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0167] Figure 4 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 4 As shown, the electronic device 40 provided in this embodiment includes: at least one processor 401 and a memory 402. Optionally, the device 40 also includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus 404.

[0168] In a specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that at least one processor 401 executes the above method.

[0169] The specific implementation process of the processor 401 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0170] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0171] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0172] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0173] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0174] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0175] The above-mentioned readable storage medium can be implemented by 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 memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0176] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0177] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0179] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0180] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0181] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0182] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for generating a memory operating system, characterized in that: include: According to the production requirements of the user, multiple operation elements required for system production are determined, wherein the operation elements include script files and configuration files for the operations required for system production, wherein different operation elements correspond to different types of operations required for system production; According to the preset multiple production execution stages, determining the operation elements in the same production execution stage from the multiple operation elements as operation sub-elements; Integrate the operation sub-elements of the same production execution stage to obtain the integrated operation elements of each production execution stage and the script file name of each operation sub-element in the integrated operation element; According to the execution order of the production execution phases and the script file names of the various operation sub-elements in the integrated operation element, the script files in each production execution phase are executed to generate a memory operating system.

2. The method according to claim 1, characterized in that The multiple operating elements required for system production are determined according to the user's production requirements, including: Determine the type of operation required for system production according to the user production requirements; According to the operation type, obtaining a query result corresponding to the operation type from a preset operation element library; If the query result indicates that an operation element corresponding to the operation type exists, the operation element corresponding to the operation type is obtained as the operation element required for system production.

3. The method according to claim 2, characterized in that After acquiring a query result corresponding to the operation type from a preset operation element library according to the operation type, the method further includes: If the query result indicates that there is no operation element corresponding to the operation type, then determining a custom script file and a custom configuration file corresponding to the operation type according to a preset element design rule; According to the operation type and the preset production execution stage, the custom script file is named in a digital prefix manner; Acquire the custom operation sub-element corresponding to the production execution phase, and the custom operation element corresponding to each custom operation sub-element; The customized operating element is used as the operating element required for system production.

4. The method according to claim 3, characterized in that After obtaining the custom operation sub-element corresponding to the production execution stage and the custom operation element corresponding to each custom operation sub-element, the method further includes: The custom operation element is stored in the preset operation element library.

5. The method according to claim 1, characterized in that The production execution stage includes a root file system initialization stage, a data copy stage, an installation stage, a cleaning stage, and a packaging stage. The script files in each production execution stage are executed according to the execution order of the production execution stage and the script file names of each operation sub-element in the integrated operation element to generate a memory operating system, including: Execute the script file in the initialization root file system stage according to the execution order of the production execution stage and the script file name of each operation sub-element in the integration operation element, so that after the disk image of the newly created memory operating system is obtained according to the configured path, the root file system in the disk image is mounted to the specified working directory; Execute the script file in the data copying stage to copy the installation data obtained from the host environment to the working directory, wherein the installation data includes configuration files required for software installation; Execute the script file in the installation phase, and install the required software and services in the root file system of the working directory based on the operating environment; Executing the script file in the cleaning phase to clear the installation cache information in the operating environment and exiting the operating environment; Execute the script file in the packaging stage, package and compress the file system in the working directory, and obtain the kernel and memory file system; A memory operating system is generated according to the kernel and the memory file system.

6. The method according to claim 5, characterized in that The production execution phase also includes a pre-installation phase. Before the script file in the execution installation phase installs the required software and services in the root file system of the working directory based on the operating environment, the method further includes: The script file in the pre-installation phase is executed to complete the configuration work required in the installation phase and determine the installation environment information.

7. A memory operating system generating device, characterized in that: include: A selection module is used to determine multiple operation elements required for system production according to user production requirements, wherein the operation elements include script files and configuration files for the operations required for system production, wherein different operation elements correspond to different types of operations required for system production; A determination module, configured to determine, according to a plurality of preset production execution stages, operation elements in the same production execution stage from the plurality of operation elements as operation sub-elements; An integration module, used to integrate the operation sub-elements of the same production execution stage, obtain the integrated operation elements of each production execution stage, and the script file name of each operation sub-element in the integrated operation element; The generation module is used to execute the script files in each production execution stage according to the execution order of the production execution stage and the script file name of each operation sub-element in the integrated operation element to generate a memory operating system.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and equipment for realizing memory operating system

    CN111966423A

  • Operating system starting method and computing device

    CN113434205A

  • Root file system mounting method, device and equipment and readable storage medium

    CN118409960A

  • Method and device for installing server operating system, terminal equipment and medium

    CN118567664A

  • Content manufacturing system and content manufacturing program

    JP2010176383A