Component deployment method and apparatus, electronic device, and storage medium
By obtaining component deployment instructions and preset global information, the target component is prohibited from creating an initial RAM disk without the creation subject, which solves the time-consuming problem of initial RAM disk creation during component deployment and improves deployment efficiency.
Patent Information
- Application Number
- PCT/CN2024/076368
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2024-02-06
- Publication Date
- 2024-09-06
AI Technical Summary
In the operating system, during the deployment process of multiple component packages, the initial RAM disk creation and overwriting operations take a long time, resulting in increased time for rapid installation of the operating system and large-scale component deployment.
By obtaining component deployment instructions, determining the target component and performing deployment operations, obtaining preset global information to indicate the creation subject of the initial RAM disk, and prohibiting the target component from creating and overwriting the initial RAM disk if the creation subject is not the target component, thereby jumping Go through unnecessary disk creation and overwriting operations.
It reduces the number of initial RAM disk creations and overwrites, saves the total component deployment time, and improves deployment efficiency in multiple component deployment scenarios.
Smart Images

Figure CN2024076368_06092024_PF_FP
Abstract
Description
Component deployment method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to patent application No. 202310209280.6 filed with the China Patent Office on February 27, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application relates to, but is not limited to, the field of computer technology. Background Art
[0004] In some operating systems, the initial RAM (random access memory) disk is a crucial component and a crucial step in the operating system's boot process. In these operating systems, the initial RAM disk is a globally shared file. Creating this file is time-consuming, and can be created and overwritten multiple times independently by individual components, programs, or people, so only the most recent result is applied.
[0005] However, current operating systems have thousands or even tens of thousands of component packages. Deploying multiple component packages (installation, upgrade, and uninstallation) can double the time required, hindering fast new installations and large-scale component deployments. Component deployment in these scenarios can also take a significant amount of time.
[0006] Summary of the Invention
[0007] Embodiments of the present application provide a component deployment method, device, electronic device, and storage medium.
[0008] In a first aspect, an embodiment of the present application provides a component deployment method, the method comprising: obtaining a component deployment instruction, and determining a target component indicated by the component deployment instruction for deployment; executing a target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operations of an initial random access memory RAM disk; obtaining preset global information from a system where the target component is located, wherein the preset global information is used to indicate a creation subject of the initial RAM disk; and prohibiting the target component from creating and overwriting the initial RAM disk if the creation subject is not the target component.
[0009] In a second aspect, an embodiment of the present application provides a component deployment device, comprising: a first acquisition unit, configured to acquire a component deployment instruction, and determine a target component indicated for deployment by the component deployment instruction; a first execution unit, configured to execute a target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operations of an initial random access memory RAM disk; a second acquisition unit, configured to acquire preset global information from the system where the target component is located, wherein the preset global information is used to indicate the creation subject of the initial RAM disk; a control unit, configured to prohibit the target component from creating and overwriting the initial RAM disk when the creation subject is not the target component.
[0010] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory configured to store a computer program; a processor configured to execute the computer program stored in the memory, and when the computer program is executed, any component deployment method described herein is implemented.
[0011] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements any component deployment method described herein.
[0012] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code is run on a device, the processor in the device implements any component deployment method described herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] FIG1 is a schematic diagram of a flow chart of a component deployment method provided in an embodiment of the present application;
[0014] FIG2 is a flow chart of another component deployment method provided in an embodiment of the present application;
[0015] FIG3A is a flow chart of another component deployment method provided in an embodiment of the present application;
[0016] FIG3B is a flow chart of another component deployment method provided in an embodiment of the present application;
[0017] FIG3C is a flow chart of another component deployment method provided in an embodiment of the present application;
[0018] FIG4 is a schematic structural diagram of a component deployment device provided in an embodiment of the present application;
[0019] FIG5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application.
[0021] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and neither represent any specific technical meaning nor indicate the logical order between them.
[0022] It should also be understood that in this embodiment, “a plurality of” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0023] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0024] In addition, the term "and / or" in this application is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the related objects are in an "or" relationship.
[0025] It should also be understood that the description of each embodiment in this application focuses on the differences between the embodiments, and the same or similar aspects can be referenced with each other. For the sake of brevity, they will not be described one by one.
[0026] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0027] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered part of the specification.
[0028] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0029] It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other. To facilitate understanding of the embodiments of this application, the application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0030] Figure 1 is a flow chart of a component deployment method provided by an embodiment of the present application. This method can be applied to one or more electronic devices such as smart phones, laptops, desktop computers, portable computers, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. No special limitation is made here.
[0031] As shown in FIG. 1 , the method may include steps 101 to 104 .
[0032] Step 101: Obtain a component deployment instruction, and determine a target component to be deployed as instructed by the component deployment instruction.
[0033] In this embodiment, the above-mentioned component deployment instruction can be used to indicate the deployment target component.
[0034] The target component can be the primary packaging format for the kernel, driver, or user-mode program before deployment. For example, the target component can be a component package in a management format such as rpm or deb. For example, the target component can be ixgbe, megaraid_sas, i40e, smartpqi, mpt3sas, ixgbevf, or igb.
[0035] In addition, the target component can be a component in various systems. As an example, the target component can be a component in any of the following systems: Windows operating system, Linux operating system, Android operating system, etc.
[0036] Step 102: Execute the target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operation of the initial random access memory RAM disk.
[0037] In this embodiment, the target deployment operation may be any deployment operation other than the creation and overwriting operations of the RAM disk among the target deployment operations indicated by the component deployment instruction. Alternatively, the component deployment instruction may also be used to instruct: to perform any deployment operation other than the creation and overwriting operations of the RAM disk.
[0038] In the Linux operating system, the initial RAM disk is a complete root file system, which contains the necessary components of a Linux operating system (such as drivers, user-mode processes, dynamic libraries, etc.) in addition to the kernel.
[0039] Initial RAM disk creation is based on the files and configurations in the local root file system. The configuration of the creation tool (such as dracut or mkinitrd) is used as the basis for file screening and supplementation. The system collects relevant files, packages them according to the initial RAM disk format, and places them in a specified location for global use.
[0040] From a Linux operating system perspective, the main components are grub, the kernel, drivers, the initial RAM disk, the local root file system, and user-mode programs. Prior to deployment, the kernel, drivers, and user-mode programs are primarily packaged as component packages (e.g., target components), such as those in RPM and deb package management formats. From a functional perspective, during the Linux operating system startup phase, grub boots the kernel. The kernel then loads the initial RAM disk as the root file system, loads the drivers, and executes related programs. The kernel then switches to the local root file system and starts related programs, ultimately completing the operating system startup.
[0041] It should be noted that the initial RAM disk is closely related to the kernel. If multiple different kernels are deployed on a Linux system at the same time, each kernel will have a corresponding initial RAM disk to adapt to the kernel and serve as the initial RAM disk shared by the system when the kernel is running.
[0042] In some optional implementations of this embodiment, the target deployment operation includes at least one of the following: signature verification of the target component, checking dependent components of the target component, file deployment and configuration, and updating record information indicating that the target component has been deployed.
[0043] It can be understood that in the above optional implementation, the target component can perform at least one deployment operation of signature verification of the target component, checking dependent components of the target component, file deployment and configuration, and updating record information indicating that the target component has been deployed.
[0044] Step 103: Acquire preset global information from the system where the target component is located, wherein the preset global information is used to indicate a creation subject of the initial RAM disk.
[0045] In this embodiment, the system where the target component is located can be any one of the following: Windows operating system, Linux operating system, Android operating system, etc.
[0046] The preset global information may be stored in a storage space other than the target component in the above system. In addition, in some cases, the preset global information may include a subject identifier for indicating the subject that created the initial RAM disk, or the preset global information may also include a keyword and a value to indicate whether the component (e.g., the target component) decides to create the initial RAM disk (e.g., create_initrd=yes, create_initrd=no).
[0047] Step 104 : If the creation subject is not the target component, prohibit the target component from creating and overwriting the initial RAM disk.
[0048] In this embodiment, if the creation entity of the initial RAM disk indicated by the preset global information is not the above-mentioned target component, then after executing the target deployment operation indicated by the component deployment instruction, the target component can skip the operation of creating and overwriting the initial RAM disk, thereby prohibiting the target component from creating and overwriting the initial RAM disk.
[0049] In some optional implementations of this embodiment, after executing step 103 above, the following step may also be executed: when the creation subject is the target component, the initial RAM disk is created and overwritten by the target component.
[0050] It can be understood that in the above optional implementation method, the initial RAM disk is created and overwritten by the target component only when the creation subject is the target component. In this way, by presetting global information to control whether the initial RAM disk is created and overwritten by the target component, more effective control of the total component deployment time in multiple component deployment scenarios is achieved.
[0051] The component deployment method provided in the embodiment of the present application can obtain a component deployment instruction and determine the target component to be deployed indicated by the component deployment instruction. After that, the target deployment operation indicated by the component deployment instruction is executed through the target component, wherein the target deployment operation does not include the creation and overwriting operation of the initial random access memory RAM disk. Then, preset global information is obtained from the system where the target component is located, wherein the preset global information is used to indicate the creation subject of the initial RAM disk. Finally, when the creation subject is not the target component, the target component is prohibited from creating and overwriting the initial RAM disk. Thus, the preset global information indicating the creation subject of the initial RAM disk can be obtained from the system where the target component is located, and when the creation subject is not the target component, the target component is prohibited from creating and overwriting the initial RAM disk. In this way, some components do not need to create and overwrite the initial RAM disk, which reduces the number of times the initial RAM disk is created and overwritten, thereby reducing the loss of the initial RAM disk and saving the total component deployment time in multiple component deployment scenarios.
[0052] FIG2 is a flow chart of another component deployment method provided by an embodiment of the present application. As shown in FIG2 , the method may include steps 201 to 206 .
[0053] Step 201: Obtain a component deployment instruction, and determine a target component to be deployed as instructed by the component deployment instruction.
[0054] In this embodiment, step 201 is substantially the same as step 101 in the corresponding embodiment of FIG. 1 , and will not be described in detail here.
[0055] Step 202: Execute the target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operation of the initial random access memory RAM disk.
[0056] In this embodiment, step 202 is substantially the same as step 102 in the corresponding embodiment of FIG. 1 , and will not be described in detail here.
[0057] Step 203: Acquire preset global information from the system where the target component is located, wherein the preset global information is used to indicate a creation subject of the initial RAM disk.
[0058] In this embodiment, step 203 is substantially the same as step 103 in the corresponding embodiment of FIG. 1 , and will not be described in detail here.
[0059] Step 204 : If the creation subject is not the target component, prohibit the target component from creating and overwriting the initial RAM disk.
[0060] In this embodiment, step 204 is substantially the same as step 104 in the corresponding embodiment of FIG. 1 , and will not be described in detail here.
[0061] Step 205: When the operating environment of the target component does not match the system environment of the system, a component external object is determined as the creation subject.
[0062] In this embodiment, whether the operating environment of the target component matches the system environment of the system may be determined by determining whether the target component can be successfully deployed or run normally in the system environment.
[0063] The component external object may be any object (such as a program or toolkit) included in the above system except the target component, or a user.
[0064] Step 206: Create and overwrite the initial RAM disk using the component external object.
[0065] In this embodiment, when the creation subject is the target component and the target component's operating environment does not match the system environment of the system, the initial RAM disk can be created and overwritten via the component's external object. However, when the target component's operating environment matches the system environment of the system (i.e., the target component can be successfully deployed or run normally in the system environment), the creation and overwriting of the initial RAM disk may not be performed.
[0066] In some optional implementations of this embodiment, the following method can be used to obtain the preset global information from the system where the target component is located: obtain the preset global information from the system where the target component is located through the target component.
[0067] On this basis, the following method can be used to create and overwrite the initial RAM disk through the component external object: the first step is to obtain the preset global information from the system where the target component is located through the component external object; the second step is to create and overwrite the initial RAM disk through the component external object when the creation subject is not the target component.
[0068] It can be understood that in the above optional implementation, preset global information is obtained respectively through the target component and the component external object, and then the judgment of the creation subject can be performed twice, which reduces the probability of erroneous creation of the creation subject of the initial RAM disk.
[0069] In some application scenarios of the above optional implementation manner, before executing the above first step, it is also possible to determine whether the target component has a deployment anomaly through the component external object.
[0070] Furthermore, if a deployment anomaly occurs in a target component, the target component can be controlled to be redeployed or repaired.
[0071] It can be understood that in the above application scenario, whether there is a deployment anomaly in the target component can be determined through a component external object to ensure that the target component is deployed normally.
[0072] In some optional implementations of this embodiment, the following method can be adopted to create and overwrite the initial RAM disk through the component external object: the creation and overwriting operation of the initial RAM disk is performed once through the component external object to create and overwrite the initial RAM disk for at least two target components.
[0073] Here, after each deployment target component, the operating environment information of the component can be recorded. When creating and deploying the initial RAM disk, the intersection of the default operating environment information and the recorded operating environment information can be used as the content of creating and deploying the initial RAM disk.
[0074] It can be understood that in the above optional implementation method, by performing the creation and overwriting operation of the initial RAM disk once, the initial RAM disk can be created and deployed for at least two target components, thereby reducing the number of times the initial RAM disk is created and overwritten, thereby reducing the loss of the initial RAM disk and saving the total component deployment time in multiple component deployment scenarios.
[0075] It should be noted that, in addition to the contents recorded above, this embodiment may also include the corresponding technical features described in the embodiment corresponding to Figure 1, thereby realizing the technical effects of the component deployment method shown in Figure 1. For details, please refer to the relevant description of Figure 1. For the sake of brevity, it will not be elaborated here.
[0076] The component deployment method provided in the embodiment of the present application creates and overwrites the initial RAM disk through the external object of the component only when the creation subject is the above-mentioned target component and the operating environment of the target component does not match the system environment of the system. Therefore, when the operating environment of the target component matches the system environment of the system, there is no need to create and overwrite the initial RAM disk, which further reduces the number of times the initial RAM disk is created and overwritten, thereby reducing the loss of the initial RAM disk and saving the total component deployment time in multiple component deployment scenarios.
[0077] FIG3A is a flow chart of another component deployment method provided in an embodiment of the present application.
[0078] As shown in FIG. 3A , the method may include steps 301 to 305 .
[0079] Step 301: Obtain a component deployment instruction, and determine a target component to be deployed as instructed by the component deployment instruction, wherein the system where the target component is located is a Linux operating system.
[0080] In this embodiment, the above-mentioned component deployment instruction can be used to indicate the deployment target component.
[0081] The target component can be the primary packaging format for the kernel, driver, or user-mode program before deployment. For example, the target component can be a component package in a management format such as rpm or deb. For example, the target component can be ixgbe, megaraid_sas, i40e, smartpqi, mpt3sas, ixgbevf, or igb.
[0082] Furthermore, the target component may be a component in a Linux operating system.
[0083] In this embodiment, step 301 is substantially the same as step 101 in the corresponding embodiment of FIG. 1 , and will not be described in detail here.
[0084] Step 302: Execute the target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operation of the initial random access memory RAM disk.
[0085] In this embodiment, step 302 is substantially the same as step 102 in the corresponding embodiment of FIG. 1 , and will not be described in detail here.
[0086] Step 303: Determine a pre-set global configuration file from the Linux operating system where the target component is located.
[0087] In this embodiment, a global configuration file can be used to record configuration values in the Linux operating system. This configuration file can include information indicating the entity that creates the initial RAM disk. For example, the path of the global configuration file in the Linux operating system can be / etc / yum / extra.conf. Keywords and values can be set in the file to indicate whether the creation of the initial RAM disk is determined by an external component object (e.g., create_initrd = yes).
[0088] Step 304: Query preset global information from the global configuration file, wherein the preset global information is used to indicate the creation subject of the initial RAM disk.
[0089] In this embodiment, when deploying (installing, upgrading, uninstalling) the target component, in the internal stage of the target component, the value in the above-mentioned global configuration file is queried and judged. If it is determined by an external object of the component (for example, create_initrd=yes), the judgment and operations related to the creation of the initial RAM disk of this target component are skipped; if it is not determined by an external object of the component (for example, create_initrd=no, or there is no global configuration file, or the global configuration file does not record the creation subject of the initial RAM disk), no existing operations will be skipped.
[0090] Step 305: If the creation subject is not the target component, prohibit the target component from creating and overwriting the initial RAM disk.
[0091] In this embodiment, the system where the target component is located may be a Linux operating system.
[0092] The preset global information may be stored in a storage space other than the target component in the above system. In addition, in some cases, the preset global information may include a subject identifier for indicating the subject that created the initial RAM disk, or the preset global information may also include a keyword and a value to indicate whether the component (e.g., the target component) decides to create the initial RAM disk (e.g., create_initrd=yes, create_initrd=no).
[0093] The following is an illustrative description of the embodiments of the present application, but it should be noted that the embodiments of the present application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of the present application.
[0094] As shown in Figure 3B, Figure 3B is a flow chart of another component deployment method provided in an embodiment of the present application. The method includes the following steps 1 to 9.
[0095] Step 1. A person or program (ie, the above-mentioned component external object) sets the information "whether to make the initial RAM disk is determined by the outside of the component package" (ie, the above-mentioned preset global information) outside the component package (ie, the above-mentioned target component).
[0096] Step 2: When a person or program starts to deploy (install, upgrade, or uninstall) a component package, several actions are first performed within the component package (i.e., the target deployment operations described above, such as component package signature verification and dependent component checking).
[0097] Step 3: Deploy and configure files within the component package, that is, perform the above-mentioned target deployment operation.
[0098] Step 4: The component package queries the external decision information of the component package (ie, the above-mentioned preset global information). If it is determined by the outside (ie, the above-mentioned component external object) to make the initial RAM disk, jump to step 6; if not, continue to execute step 5.
[0099] Step 5: If the component package determines that an initial RAM disk needs to be created, the initial RAM disk is created and overwritten with the initial RAM disk shared by the entire system; if it does not need to be created, the initial RAM disk is not created.
[0100] Step 6: Finishing actions within the component package (i.e., the target deployment operations mentioned above, such as updating the record information of the installed component packages in the entire system).
[0101] After all the component packages (1 or N, N>1) of this deployment have completed the above steps in sequence, proceed to step 8 below.
[0102] Step 8: Post-deployment inspection, for example, a person or program checks whether there are any abnormalities in the component package deployment.
[0103] Step 9: A person or program queries the external decision information. If the initial RAM disk creation is not determined by an external decision, no initial RAM disk creation is performed. If the initial RAM disk creation is determined by an external decision, an initial RAM disk is created and overwrites the initial RAM disk shared by the entire system. It is important to note that in special scenarios (e.g., in a virtual machine environment, even if a driver component is deployed, the environment does not have a device corresponding to the driver), a person or program may decide not to create an initial RAM disk. Alternatively, a person or program may create multiple initial RAM disks based on their specific needs.
[0104] The following describes the above steps using the rpm component package management format as an example:
[0105] First, set up a global configuration file in the system, such as / etc / yum / extra.conf, and set keywords and values therein to indicate whether "the creation of the initial RAM disk is determined by the external component package (i.e. the above-mentioned component external object)" (e.g. create_initrd=yes).
[0106] Secondly, a person or program (that is, the external object of the above-mentioned component) deploys (installs, upgrades, uninstalls) the RPM component package. At this time, in the "%post" and "%postun" stages inside RPM, the value in the above-mentioned global configuration file is queried and judged. If it is determined by an external factor (for example, create_initrd = yes), the judgment and operation related to the creation of the initial RAM disk by this RPM package are skipped; if it is not determined by an external factor (for example, create_initrd = no, or there is no global configuration file), no existing actions are skipped.
[0107] Then, after all RPM component packages are deployed (installed, upgraded, uninstalled), a person or program checks the deployment results (for example, whether there are any errors).
[0108] Finally, a person or program queries the value in the above-mentioned global configuration file and judges. If it is determined by an external party (for example, create_initrd = yes), the person or program executes the initial RAM disk creation tool to create an initial RAM disk and overwrite it (for example, dracut -f / boot / initramfs-3.10.0-693.el7.x86_64.img); if it is not determined by an external party (for example, create_initrd = no, or there is no global configuration file), the person or program does not perform any operation on the initial RAM disk.
[0109] Next, please continue to refer to Figure 3C. As shown in Figure 3C, Figure 3C is a flow chart of another component deployment method provided in an embodiment of the present application.
[0110] The differences between the component deployment method shown in FIG. 3C and the component deployment method shown in FIG. 3B lie in the following two points.
[0111] First, instead of directly querying external decision information within the component package, the initial RAM disk creation tool is called within the component package, and the creation tool queries and determines it internally. For example, the creation tool can be dracut or mkinitrd.
[0112] Second, add a judgment in the creation tool. If it is used by the component package, it is controlled by external decisions. If it is not used by the component package, the existing actions remain unchanged.
[0113] Therefore, in the operating system, global information "whether the creation of the initial RAM disk is determined by an external component package" is provided. Within the component package, after completing the "file deployment and configuration" action, the above global information can be queried. Within the component package, after completing the "file deployment and configuration" action, the above global information can be judged to determine whether the component package itself can create the initial RAM disk. Outside the component package, in the tool for creating the initial RAM disk, the above global information can be queried. Outside the component package, in the tool for creating the initial RAM disk, the above global information can be judged to determine whether the creation tool itself can create the initial RAM disk. Outside the component package, a person can query the above global information. Outside the component package, a person can judge the above global information to determine whether the person himself can create the initial RAM disk. Therefore, the operating system interface is not deleted, and a global query interface is added for querying whether the creation of the initial RAM disk is determined by an external component package, which can be queried by the component package, program, or person.
[0114] This solution can greatly reduce the time spent on new installation of Linux systems and batch deployment of component packages.
[0115] It should be noted that, in addition to the contents recorded above, this embodiment may also include the technical features described in the above embodiments, thereby achieving the technical effects of the component deployment method shown above. Please refer to the above description for details. For the sake of brevity, no further details will be given here.
[0116] The component deployment method provided in the embodiment of the present application can configure a global configuration file from the Linux operating system where the target component is located, and set global information therein, so that some components in the Linux operating system do not need to create and overwrite the initial RAM disk, thereby reducing the number of times the initial RAM disk is created and overwritten, thereby reducing the loss of the initial RAM disk, and saving the total time for component deployment that depends on the Linux operating system in multiple component deployment scenarios.
[0117] FIG4 is a schematic diagram of the structure of a component deployment device provided by an embodiment of the present application. As shown in FIG4 , the device may include: a first acquisition unit 401, configured to acquire a component deployment instruction and determine a target component to be deployed as indicated by the component deployment instruction; a first execution unit 402, configured to execute a target deployment operation indicated by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting of an initial random access memory RAM disk; a second acquisition unit 403, configured to acquire preset global information from the system where the target component is located, wherein the preset global information is used to indicate the creation subject of the initial RAM disk; and a control unit 404, configured to prohibit the target component from creating and overwriting the initial RAM disk if the creation subject is not the target component.
[0118] In one possible embodiment, after the target deployment operation represented by the component deployment instruction is executed by the target component, the device further includes: a first determination unit, configured to determine a component external object as the creation subject when the operating environment of the target component does not match the system environment of the system; and a first creation unit, configured to create and overwrite the initial RAM disk through the component external object.
[0119] In one possible embodiment, obtaining preset global information from the system where the target component is located includes: obtaining preset global information from the system where the target component is located through the target component; and creating and overwriting the initial RAM disk through the component external object includes: obtaining the preset global information from the system where the target component is located through the component external object; and creating and overwriting the initial RAM disk through the component external object when the creation subject is not the target component.
[0120] In one possible implementation, before obtaining the preset global information from the system where the target component is located through the component external object, the device further includes: a second determination unit configured to determine whether there is a deployment anomaly in the target component through the component external object.
[0121] In one possible embodiment, the creation and overwriting of the initial RAM disk through the component external object includes: a second execution unit, configured to perform the creation and overwriting operation of the initial RAM disk once through the component external object, so as to create and overwrite the initial RAM disk for at least two target components.
[0122] In one possible embodiment, the system where the target component is located is a Linux operating system; and obtaining preset global information from the system where the target component is located includes: determining a preset global configuration file from the Linux operating system where the target component is located; and querying the preset global information from the global configuration file.
[0123] In one possible embodiment, after obtaining the preset global information from the system where the target component is located, the device also includes: a second creation unit, configured to create and overwrite the initial RAM disk through the target component when the creation subject is the target component.
[0124] In one possible implementation, the target deployment operation includes at least one of the following: signature verification of the target component, checking dependent components of the target component, file deployment and configuration, and updating record information indicating that the target component has been deployed.
[0125] The component deployment device provided in this embodiment can be a component deployment device as shown in Figure 4, which can execute all steps of the component deployment methods described above, and thus achieve the technical effects of the component deployment methods described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0126] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 500 shown in FIG5 includes: at least one processor 501, a memory 502, at least one network interface 504, and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in FIG5, all various buses are labeled as bus system 505.
[0127] The user interface 503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touchpad, or a touch screen).
[0128] It is understood that the memory 502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0129] In some embodiments, the memory 502 stores the following elements, executable units, or data structures, or a subset thereof, or an extended set thereof: an operating system 5021 and application programs 5022 .
[0130] Among them, the operating system 5021 includes various system programs, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and handle hardware-based tasks. The application 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program that implements the method of the embodiment of the present application can be included in the application 5022.
[0131] In this embodiment, by calling the program or instruction stored in the memory 502, exemplarily, it can be the program or instruction stored in the application 5022, the processor 501 is used to execute the method steps provided by each method embodiment, for example, including: obtaining a component deployment instruction, and determining the target component indicated for deployment by the component deployment instruction; executing the target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operation of the initial random access memory RAM disk; obtaining preset global information from the system where the target component is located, wherein the preset global information is used to indicate the creation subject of the initial RAM disk; and when the creation subject is not the target component, prohibiting the target component from creating and overwriting the initial RAM disk.
[0132] The methods disclosed in the above embodiments of the present application can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in processor 501 or by software instructions. The above processor 501 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software units in the decoding processor. The software units can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 502 , and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.
[0133] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in 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), general-purpose processors, controllers, microcontrollers, microprocessors, or other electronic units or combinations thereof for performing the above-mentioned functions of the present application.
[0134] For software implementation, the techniques described above can be implemented by a unit that performs the functions described above. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0135] The electronic device provided in this embodiment can be an electronic device as shown in Figure 5, which can execute all steps of the component deployment method described above, and thus achieve the technical effects of the component deployment method described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0136] The present application also provides a storage medium (computer-readable storage medium). The storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and the memory may also include a combination of the aforementioned types of memory.
[0137] When one or more programs in the storage medium can be executed by one or more processors, the component deployment method executed on the electronic device side can be implemented.
[0138] The above-mentioned processor is used to execute the component deployment program stored in the memory to implement the following steps of the component deployment method performed on the electronic device side: obtaining a component deployment instruction, and determining the target component indicated for deployment by the component deployment instruction; executing the target deployment operation represented by the component deployment instruction through the target component, wherein the target deployment operation does not include the creation and overwriting operation of the initial random access memory RAM disk; obtaining preset global information from the system where the target component is located, wherein the preset global information is used to indicate the creation subject of the initial RAM disk; and prohibiting the target component from creating and overwriting the initial RAM disk when the creation subject is not the target component.
[0139] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0140] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0141] The exemplary embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above is only an exemplary embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. In addition, for the sake of simplicity of description, the aforementioned embodiments are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
Claims
1. A component deployment method, comprising: Obtaining a component deployment instruction, and determining a target component that the component deployment instruction indicates to be deployed; Executing, by the target component, a target deployment operation represented by the component deployment instruction, wherein the target deployment operation does not include a creation and overwriting operation of an initial random access memory RAM disk; Acquire preset global information from the system where the target component is located, wherein the preset global information is used to indicate a creation subject of the initial RAM disk; In the case where the creation subject is not the target component, the target component is prohibited from creating and overwriting the initial RAM disk.
2. The method according to claim 1, wherein: After executing the target deployment operation represented by the component deployment instruction through the target component, the method further includes: In the case that the operating environment of the target component does not match the system environment of the system, determining a component external object as the creation subject; The initial RAM disk is created and overwritten by the component external object.
3. The method according to claim 2, wherein: The obtaining of preset global information from the system where the target component is located includes: Obtaining preset global information from the system where the target component is located through the target component; and The creating and overwriting the initial RAM disk by the component external object comprises: Acquiring the preset global information from the system where the target component is located through the component external object; In the case where the creation subject is not the target component, the initial RAM disk is created and overwritten by the component external object.
4. The method according to claim 3, wherein: Before acquiring the preset global information from the system where the target component is located through the component external object, the method further includes: It is determined whether the target component has a deployment anomaly through the component external object.
5. The method according to claim 2, wherein: The creating and overwriting the initial RAM disk by the component external object comprises: The creation and overwriting operations of the initial RAM disk are performed once through the component external object so as to create and overwrite the initial RAM disk for at least two of the target components.
6. The method according to claim 1, wherein: The system where the target component is located is a Linux operating system; as well as The obtaining of preset global information from the system where the target component is located includes: Determine a pre-set global configuration file from the Linux operating system where the target component is located; The preset global information is queried from the global configuration file.
7. The method according to claim 1, wherein: After acquiring the preset global information from the system where the target component is located, the method further includes: In the case where the creation subject is the target component, the initial RAM disk is created and overwritten by the target component.
8. The method according to any one of claims 1 to 7, wherein: The target deployment operation includes at least one of the following: Perform signature verification on the target component, check dependent components, file deployment and configuration of the target component, and update record information indicating that the target component has been deployed.
9. A component deployment device, comprising: The first acquisition unit is configured to acquire a component deployment instruction and determine the component deployment instruction. The deployment instruction indicates the target component to be deployed; A first execution unit is configured to execute, through the target component, a target deployment operation represented by the component deployment instruction, wherein the target deployment operation does not include a creation and overwriting operation of an initial random access memory RAM disk; A second acquisition unit is configured to acquire preset global information from a system where the target component is located, wherein the preset global information is used to indicate a creation subject of the initial RAM disk; The control unit is configured to prohibit the target component from creating and overwriting the initial RAM disk when the creation subject is not the target component.
10. An electronic device comprising: a memory configured to store a computer program; The processor is configured to execute the computer program stored in the memory, and when the computer program is executed, the method described in any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Operating system deployment method, device, computer equipment and storage medium
CN110399159A
Software deployment method and device, server and storage medium
CN112148315A
Operating system deployment method and device, electronic equipment and storage medium
CN113656049A
Scheme deployment method and device and computer readable storage medium
CN114356345A
Product visual deployment method, device and system and storage medium
CN114610334A
