Component unpacking method and device, storage medium and electronic device
By determining the appropriate component unpacking method based on the component's binary files and target pre-installation systems in different systems, the problems of component redundancy and high error rates are solved, and the multi-target system adaptability and system security of component installation packages are improved.
Patent Information
- Application Number
- CN202311433706.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, the problem of using the same unpacking method for the same component in different systems has not been effectively solved.
By determining the binary file corresponding to the component and determining the target pre-installation system to which the component belongs based on the binary file, the component unpacking method corresponding to the target identification variable of the target pre-installation system is determined from the corresponding relationship between the identification variable and the component unpacking method, and then the component is customized unpacked.
It solves the problems of component redundancy and high error rate, realizes the multi-target system adaptability of component installation packages, reduces storage space consumption and improves system security.
Smart Images

Figure CN119917153A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and in particular, to a component unpacking method and device, a storage medium, and an electronic device. Background Art
[0002] In a system that requires simplicity and security, package management tools are essential, as they can provide users with more convenient package installation, update, and uninstall services.
[0003] Common open source package managers provide users with a quick way to manage packages. However, these package managers do not provide customized functions. Users cannot completely independently select and customize the required components. The default open source software packages usually contain redundant files that users do not need, thereby wasting storage space. Redundant files may increase the attack surface of the system and reduce the security of the system.
[0004] There are many mainstream package managers in the industry, and their main purpose is to make installation, uninstallation and other operations convenient and fast. Although the current mainstream package managers have the characteristics of convenient operation and powerful functions, many package management tools do not consider diversified application scenarios, and there are still problems such as component redundancy and increased error rate caused by using the same unpacking method for the same component in different systems.
[0005] In the prior art, there is no effective solution to the problem of component redundancy and increased error rate caused by using the same unpacking method for the same component in different systems. Summary of the invention
[0006] Embodiments of the present invention provide a component unpacking method and device, a storage medium, and an electronic device to at least solve the problem of component redundancy and increased error rate caused by using the same unpacking method for the same component in different systems in the related art.
[0007] According to one embodiment of the present invention, a component unpacking method is provided, comprising: determining a binary file corresponding to a component, and determining a target pre-installation system to which the component belongs based on the binary file; determining a component unpacking method corresponding to a target identification variable of the target pre-installation system from a correspondence between identification variables and component unpacking methods; and unpacking the component according to the component unpacking method corresponding to the target identification variable.
[0008] In an exemplary embodiment, before determining the component unpacking method corresponding to the target identification variable of the target preinstallation system from the correspondence between the identification variable and the component unpacking method, the method also includes: determining the build system to which the target preinstallation system belongs; obtaining preset information corresponding to different preinstallation systems included in the build system, wherein the preset information includes at least one of the following: the name of the preinstallation system, the architecture information of the preinstallation system; for any preinstallation system in the build system, converting the preset information of any preinstallation system into a corresponding binary code according to a preset algorithm; and determining the binary code as the identification variable of any preinstallation system.
[0009] In an exemplary embodiment, after converting the preset information of any pre-installed system into a corresponding binary code according to a preset algorithm, the method further includes: determining a recognizable code range of any pre-installed system; and determining that the binary code of any pre-installed system is valid if the binary code is within the recognizable code range.
[0010] In an exemplary embodiment, after unpacking the component according to the component unpacking method corresponding to the target identification variable, the method further includes: compiling the unpacked component to generate multiple files corresponding to the component; classifying the multiple files according to preset conditions; packaging the classified multiple files to generate component installation packages in a preset format; and storing the component installation package in the component source.
[0011] In an exemplary embodiment, after storing the component installation package in the component source, the method further includes: sending an installation request to the component source, wherein the installation request is used to request installation of the component in the pre-installation system; obtaining the component installation package of the component corresponding to the installation request if the component installation package of the component corresponding to the installation request exists in the component source; and installing the component installation package of the component corresponding to the installation request in the pre-installation system.
[0012] In an exemplary embodiment, after unpacking the component according to the component unpacking method corresponding to the target identification variable, the method further includes: determining the correspondence between multiple components according to the dependency characteristics between the multiple components; binding the multiple components into a component set according to the correspondence; and packaging the component set into a component set installation package in a target format.
[0013] In an exemplary embodiment, after packaging the component set into a component set installation package in a target format, the method further includes: constructing a component set installation package with dependency features based on the dependency features and the component set installation package; and storing the component set installation package with dependency features in the component source.
[0014] According to another embodiment of the present invention, a device for determining a component splitting method is provided, comprising: a first determination module, used to determine a binary file corresponding to a component, and determine a target pre-installation system to which the component belongs based on the binary file; a second determination module, used to determine the component unpacking method corresponding to a target identification variable of the target pre-installation system from a correspondence between identification variables and component unpacking methods; and an unpacking module, used to unpack the component according to the component unpacking method corresponding to the target identification variable.
[0015] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.
[0016] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0017] Through the present invention, since the target pre-installation system to which the component belongs is determined according to the binary file corresponding to the component, there is a certain correspondence between the identification variable and the component unpacking method, and the component unpacking method corresponding to the target identification variable of the target pre-installation system can be determined from the correspondence, and the unpacking is performed according to the component unpacking method corresponding to the target identification variable. Therefore, the problem of component redundancy and increased error rate caused by using the same unpacking method for the same component in different systems in the prior art can be solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a hardware structure block diagram of a computer terminal according to a component unpacking method of an embodiment of the present application;
[0019] Figure 2 is a flow chart of a component unpacking method according to an embodiment of the present invention;
[0020] Figure 3 is a flow chart of a customized package management method according to an embodiment of the present application;
[0021] Figure 4 4 is a structural block diagram of a device for determining a component splitting method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0024] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal according to a component unpacking method of an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0025] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the component unpacking method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0026] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0027] In this embodiment, a component unpacking method running on the above-mentioned computer terminal is provided. Figure 2 is a flow chart of a component unpacking method according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0028] Step S202, determining a binary file corresponding to a component, and determining a target pre-installation system to which the component belongs according to the binary file;
[0029] It is understandable that before determining the binary file corresponding to the component, the build system can be initialized, that is, the build system can be configured according to the target pre-installation system of the component. Specifically, the build system can be configured through the following steps: 1) Compilation architecture: determine the target architecture of the target pre-installation system, such as x86, ARM, etc. The target compiler and tool chain can be determined by compiling the target architecture; 2) Compilation tool chain, download and install the corresponding compilation tool chain according to the target architecture. Most operating systems provide pre-compiled tool chains, and of course, you can also compile the tool chain yourself. Furthermore, the build system can be configured according to different compilation architectures and compilation tool chains to prepare for the compilation of components to generate corresponding binary files.
[0030] Step S204, determining the component unpacking method corresponding to the target identification variable of the target pre-installed system from the correspondence between the identification variable and the component unpacking method;
[0031] Step S206, unpacking the component according to the component unpacking method corresponding to the target identification variable.
[0032] Through the above steps, since the target pre-installation system to which the component belongs is determined according to the binary file corresponding to the component, there is a certain correspondence between the identification variable and the component unpacking method. From the correspondence, the component unpacking method corresponding to the target identification variable of the target pre-installation system can be determined, and the component unpacking method corresponding to the target identification variable is unpacked, which solves the problem of component redundancy and increased error rate caused by using the same unpacking method for the same component in different systems in the prior art.
[0033] Optionally, before determining the component unpacking method corresponding to the target identification variable of the target preinstallation system from the correspondence between the identification variable and the component unpacking method, the method also includes: determining the build system to which the target preinstallation system belongs; obtaining preset information corresponding to different preinstallation systems included in the build system, wherein the preset information includes at least one of the following: the name of the preinstallation system, architecture information of the preinstallation system; for any preinstallation system in the build system, converting the preset information of any preinstallation system into a corresponding binary code according to a preset algorithm; and determining the binary code as the identification variable of any preinstallation system.
[0034] It is understandable that the build system may include multiple pre-installation systems, and therefore, different pre-installation systems may belong to different build systems. Therefore, before determining the component unpacking method corresponding to the target identification variable of the target pre-installation system, the first thing to do is to clarify the build system to which the target pre-installation system belongs. The build system contains preset information corresponding to different pre-installation systems, such as: the name of the pre-installation system, the architecture information of the pre-installation system, etc. The preset information of the pre-installation system can be converted into the corresponding binary code, and the identification variable of the pre-installation system can be determined according to the binary code.
[0035] In other words, the identification variable can be determined according to the different requirements of different pre-installed systems and different application scenarios for the same component. The main function of the identification variable is to complete the feature extraction of the pre-installed system through multiple descriptive variables. In other words, multiple descriptive variables can be determined according to the different requirements of different pre-installed systems and different application scenarios for the same component, and then the identification variable can be determined by continuing to extract features from multiple descriptive variables. Therefore, the identification variable is not a specific variable, but a collection of multiple variables related to the description information of the pre-installed system.
[0036] Optionally, after converting the preset information of any pre-installed system into a corresponding binary code according to a preset algorithm, the method further includes: determining a recognizable code range for any pre-installed system; and determining that the binary code of any pre-installed system is valid when the binary code is within the recognizable code range.
[0037] It is understandable that after converting the preset information of any pre-installed system into corresponding binary codes according to the preset algorithm, the identification variable can continue to be assigned a value, and the value of the identification variable is limited to the range of codes recognizable by the construction system to ensure the validity of the assignment.
[0038] Optionally, after unpacking the component according to the component unpacking method corresponding to the target identification variable, the method also includes: compiling the unpacked component to generate multiple files corresponding to the component; classifying the multiple files according to preset conditions; packaging the classified multiple files to generate component installation packages in a preset format; and storing the component installation package in the component source.
[0039] It is understandable that after unpacking the components according to the component unpacking method corresponding to the target identification variable, the components need to be compiled to generate multiple binary files (that is, the above-mentioned files). In order to facilitate subsequent operations and improve the efficiency of component unpacking, the above-mentioned files can be classified, for example: static link files, dynamic link files, description document type files, etc. are classified, and the number of classification types and the list of files in each category are determined by the unpacking configuration. Files are classified to intuitively determine different file types, and then there is no need for a file list of different types of files mixed together, but only a file list in each category is needed. Therefore, it can achieve the effect of providing the target system (equivalent to the target pre-installed system) with the application function deployment while making the file list more streamlined. The classified multiple files continue to be packaged to generate a component installation package in the required format, and the component installation package is stored in the component source for subsequent extraction and calling.
[0040] Optionally, after storing the component installation package in the component source, the method further includes: sending an installation request to the component source, wherein the installation request is used to request installation of a component in a pre-installation system; obtaining the component installation package of the component corresponding to the installation request if the component installation package of the component corresponding to the installation request exists in the component source; and installing the component installation package of the component corresponding to the installation request in the pre-installation system.
[0041] It can be understood that after the component installation package is stored in the component source, an installation request can also be sent to the component source. The component source searches whether it has a component installation package of the component corresponding to the installation request. If there is a component installation package of the component corresponding to the installation request, the above-mentioned component installation package is obtained, and then the component installation package of the component corresponding to the request is installed in the pre-installation system according to the installation request.
[0042] Optionally, after unpacking the component according to the component unpacking method corresponding to the target identification variable, the method also includes: determining the correspondence between multiple components according to the dependency characteristics between the multiple components; binding the multiple components into a component set according to the correspondence; and packaging the component set into a component set installation package in a target format.
[0043] It is understandable that after unpacking the components, the corresponding relationship between the components can be determined according to the dependency characteristics between the multiple components, and the multiple components can be bound into a component set according to the corresponding relationship. The component set is a collection of components that are interrelated and together constitute a specific function. In other words, the component set is a collection of multiple components. For example, in the openssh server (open secure shell server), the component set openssh server is defined as audit (audit component), bash (basic component), openssh-sftp-server (open secure shell file transfer protocol server), openssh-server-common (open secure shell server common component), openssh-server (open secure shell server), openssh-keygen (open secure shell key generation tool), etc., which are a collection of 16 component packages that have been customized and unpacked.
[0044] Furthermore, the component set can be packaged into a component set installation package in a target format.
[0045] Optionally, after packaging the component set into a component set installation package in a target format, the method further includes: constructing a component set installation package with dependency features based on the dependency features and the component set installation package; and storing the component set installation package with dependency features in the component source.
[0046] It is understandable that the dependency features can be written into the corresponding component set installation package, and then the component set installation package with dependency features can be constructed. Similar to the component installation package, the component set installation package with dependency features can also be stored in the component source for subsequent calls.
[0047] In order to better understand the process of the above-mentioned component unpacking method, the implementation process of the above-mentioned component unpacking method is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0048] The embodiment of the present application is directed to the existing package management method which has only one set of management methods for the same component, that is, the unpacking logic and unpacking results of the same component in different target scenarios are always the same, but different target systems have different requirements for components. Using the same set of component installation packages in different target systems will inevitably lead to file redundancy in the target system, which violates the target system's requirements for lightweight and secure versions or components, and proposes a customized package management method.
[0049] Figure 3 is a flow chart of a customized package management method according to an embodiment of the present application, such as Figure 3 As shown:
[0050] 1) Customized component unpacking method based on package management.
[0051] Step S301, initializing the build system: configuring the build system according to the target pre-installation system of the component (hereinafter referred to as the target system), including the compilation architecture, compilation tool chain, etc., to prepare for component compilation.
[0052] Step S302, initialize the target system identification variable: the target system identification variable is designed for different target systems and different application scenarios with different requirements for the same component. The embodiment of the present application uses the target system identification variable to perform customized unpacking of components for different target systems, and the identification variable (that is, the target system identification variable) can be set according to the build system and application scenario. The main function of the identification variable is to complete the feature extraction of the pre-installed system through multiple descriptive variables. In other words, multiple descriptive variables can be determined according to the different requirements of different pre-installed systems and different application scenarios for the same component, and then the feature extraction of multiple descriptive variables is continued to determine the identification variable. Therefore, the identification variable is not a specific variable, but a collection of multiple variables related to the description information of the pre-installed system.
[0053] In addition, the target system information should be clarified and the identification variables should be initialized before the component is compiled. That is, the identification variables should be assigned values before the component is compiled. The values of the variables should be limited to the range that can be recognized by the build system to ensure the validity of the assignment.
[0054] Step S303, component compilation: when the construction system has completed the preparation work before component compilation, the component is compiled and constructed according to the above configuration to generate a corresponding binary file.
[0055] Step S304, identify the target system identification variable: after the component is compiled and before the component is unpacked, the component will identify the target system identification variable during the construction process to clarify the compilation options, configuration and other related information. The embodiment of the present application identifies the target system identification variable after the component is compiled, so that the output component package is more targeted and applicable to a variety of scenarios. Specifically: after completing the initial identification variable assignment, the values of the identification variables composed of multiple descriptive variables are identified one by one, and the validity of the assignment is first verified to confirm the correctness of the identification variable value for the target system. Subsequently, the unpacking configuration specific to the target system is enabled according to the value of the identification variable. The unpacking configuration is a configuration file adapted to the package management tool and the build system environment, so as to achieve the same set of Figure 3 The build system shown has different unpacking methods configured according to different target systems.
[0056] Step S305, corresponding unpacking method: according to the above identification results, the construction system will use different unpacking methods according to the values of different target system identification variables. The construction system will perform specific moves or copies of the compiled files according to the unpacking configuration completed in step S304, and complete the classification of the generated files. The classification of the generated files can be: static link files, dynamic link files, description document type files, etc. The number of classification types and the list of files in each category are determined by the unpacking configuration. The files are classified and different file types are intuitively determined, so there is no need for a file list of different types of files mixed together, but only a file list in each category. Therefore, it can achieve the effect of making the file list more streamlined while providing the target system (equivalent to the target pre-installed system) to meet the application function deployment.
[0057] Step S306, complete the compilation and unpacking of the component: The last step of the construction is to package the generated classified binary files into an installation package format that can be recognized by the package manager. According to the guidance of the above-mentioned identification variables, the compiled binary files are customized and split and packaged to ensure the simplicity of component installation to the target system.
[0058] The customized component unpacking method optimizes the component unpacking process of the existing package manager, making the generated component installation package more adaptable to multiple target systems and solving the problem of different requirements for the same component in different target systems.
[0059] Furthermore, the above scheme can clarify the unpacking method of the components, and a series of components that are interrelated and together constitute a specific function constitute a component set. Therefore, after the components are unpacked, a series of components can also be combined together to generate a component set. The method of constituting a component set installation package defined in the above claims 6 and 7 will be described below, but it is not used to limit the technical solution of the embodiment of the present application.
[0060] Before that, we must first clarify the definition of a component set. A component set is a collection of components that are interrelated and together form a specific function. For example, on the openssh server, the component set openssh server is defined as a collection of 16 customized unpacked component packages, including audit, bash, openssh-sftp-server, openssh-server-common, openssh-server, and openssh-keygen.
[0061] 2) Customized component set based on package management.
[0062] At present, in order to complete customized function deployment, target system users mostly need manual intervention in the existing technologies to sort out the dependencies of multiple components for specific functions. This cumbersome deployment process not only reduces the efficiency of version building, but also increases the error rate of version building. In order to simplify the process of manually sorting out the component list required to implement functions and improve the work efficiency of user development and deployment, the embodiment of the present application proposes a customized component set based on package management.
[0063] Step S307, define component sets and clarify deployment functions: When building the system, you first need to clarify the functions that need to be deployed in the target system. By clarifying the functions that need to be deployed, you can determine the hardware devices, operating systems and network environments for the installation, configuration and operation of each component set, thereby completing the setting of the component set according to the deployment function.
[0064] Step S308, initializing the build system: configuring the build system according to the target system of the component to prepare for component compilation.
[0065] Step S309, bind components and create compiled files: The embodiment of the present application optimizes the process of customized function deployment of the current mainstream package management tools, and considers customizing multiple components according to different functional requirements. Specifically: bind multiple components according to the target deployment function, bind multiple components into a component set with dependency features, thereby generating a compiled file that can be recognized by the package management tool of the component set, and completing the configuration of the component set.
[0066] Step S310, complete the compilation and construction of the component set: based on the above-mentioned pre-compilation preparation work that has been completed, compile and build the component set in the construction system, complete the compilation and packaging of the components, and when packaging the component set into an installation package format that is compatible with the package management tool, write the binding dependencies into the installation package at the same time.
[0067] 3) Customized component / component set deployment.
[0068] Step S311, component source: storing the component installation package generated by the customized component unpacking method based on package management and the component set installation package generated by the customized component set method based on package management into the component source.
[0069] Step S312, deploying the package management tool in the target environment: deploying the package management tool in the target environment to complete the necessary configuration of the package management tool.
[0070] Step S313, input the component installation instruction or component set installation instruction: input the component installation instruction or component set installation instruction in the target environment, at which time the package management tool will send a request to the component source, and when the request is responded to, the component unpacking or component set installation package in the installation instruction can be obtained.
[0071] Step S314, complete customized deployment: install the obtained installation package into the target environment. For example, when the target system inputs the command to install the openssh server, the above 16 customized unpacked component packages such as openssh-server and openssh-keygen will be deployed and installed into the target system, thus completing the customized function deployment.
[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory (ROM / RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0073] The embodiment of the present application automatically performs customized splitting and combination of component packages according to the deployment environment, thereby achieving the goal of satisfying user functions in the environment while maximizing the streamlining of environment files, reducing unnecessary storage space consumption, optimizing the component function deployment process, and improving the development efficiency and quality of environment deployment.
[0074] In the present embodiment, a device for determining a component splitting mode is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0075] Figure 4 is a structural block diagram of a device for determining a component splitting method according to an embodiment of the present invention, such as Figure 4 As shown, the device includes: a first determination module 42, used to determine the binary file corresponding to the component, and determine the target pre-installation system to which the component belongs based on the binary file; a second determination module 44, used to determine the component unpacking method corresponding to the target identification variable of the target pre-installation system from the correspondence between the identification variable and the component unpacking method; and an unpacking module 46, used to unpack the component according to the component unpacking method corresponding to the target identification variable.
[0076] Through the present invention, since the target pre-installation system to which the component belongs is determined according to the binary file corresponding to the component, there is a certain correspondence between the identification variable and the component unpacking method, and the component unpacking method corresponding to the target identification variable of the target pre-installation system can be determined from the correspondence, and the unpacking is performed according to the component unpacking method corresponding to the target identification variable. Therefore, the problem of component redundancy and increased error rate caused by using the same unpacking method for the same component in different systems in the prior art can be solved.
[0077] In an exemplary embodiment, the device also includes: a third determination module, used to determine the build system to which the target preinstalled system belongs; obtaining preset information corresponding to different preinstalled systems contained in the build system, wherein the preset information includes at least one of the following: the name of the preinstalled system, the architecture information of the preinstalled system; for any preinstalled system in the build system, converting the preset information of any preinstalled system into a corresponding binary code according to a preset algorithm; and determining the binary code as an identification variable of any preinstalled system.
[0078] The third determination module is further configured to determine a recognizable code range for any pre-installed system; and determine that the binary code for any pre-installed system is valid when the binary code is within the recognizable code range.
[0079] In an exemplary embodiment, the device also includes: a compilation module, which is used to compile the unpacked components to generate multiple files corresponding to the components; classify the multiple files according to preset conditions; package the classified multiple files to generate component installation packages in a preset format; and store the component installation packages in the component source.
[0080] In an exemplary embodiment, the compilation module is also used to send an installation request to the component source, wherein the installation request is used to request the installation of a component in a pre-installation system; if a component installation package of the component corresponding to the installation request exists in the component source, the component installation package of the component corresponding to the installation request is obtained; and the component installation package of the component corresponding to the installation request is installed in the pre-installation system.
[0081] In an exemplary embodiment, the device also includes: a fourth determination module, which is used to determine the correspondence between multiple components based on the dependency characteristics between the multiple components; bind the multiple components into a component set according to the correspondence; and package the component set into a component set installation package in a target format.
[0082] In an exemplary embodiment, the fourth determining module is further used to construct a component set installation package with dependency characteristics according to the dependency characteristics and the component set installation package; and store the component set installation package with dependency characteristics in the component source.
[0083] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0084] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0085] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0086] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0087] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0088] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0089] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A component unpacking method, characterized in that: include: Determine a binary file corresponding to a component, and determine a target pre-installation system to which the component belongs based on the binary file; Determining the component unpacking method corresponding to the target identification variable of the target pre-installed system from the correspondence between the identification variable and the component unpacking method; The component is unpacked according to the component unpacking method corresponding to the target identification variable.
2. The method according to claim 1, characterized in that Before determining the component unpacking method corresponding to the target identification variable of the target pre-installed system from the correspondence between the identification variable and the component unpacking method, the method further includes: Determining the build system to which the target pre-installed system belongs; Acquire preset information corresponding to different pre-installed systems included in the build system, wherein the preset information includes at least one of the following: a name of the pre-installed system, and architecture information of the pre-installed system; For any pre-installed system in the construction system, converting the preset information of any pre-installed system into a corresponding binary code according to a preset algorithm; The binary code is determined as an identification variable of any one of the pre-installed systems.
3. The method according to claim 2, characterized in that After converting the preset information of any pre-installed system into corresponding binary code according to a preset algorithm, the method further includes: Determining a recognizable code range of any of the pre-installed systems; In the case where the binary code is within the recognizable code range, it is determined that the binary code of any pre-installed system is valid.
4. The method according to claim 1, characterized in that After unpacking the component according to the component unpacking mode corresponding to the target identification variable, the method further includes: Compiling the unpacked components to generate multiple files corresponding to the components; Classifying the multiple files according to preset conditions; Packing the classified multiple files to generate component installation packages in a preset format; The component installation package is stored in the component source.
5. The method according to claim 4, characterized in that After storing the component installation package in the component source, the method further includes: Sending an installation request to the component source, wherein the installation request is used to request installation of a component in a pre-installed system; If the component installation package of the component corresponding to the installation request exists in the component source, obtaining the component installation package of the component corresponding to the installation request; The component installation package of the component corresponding to the installation request is installed in the pre-installation system.
6. The method according to claim 1, characterized in that After unpacking the component according to the component unpacking mode corresponding to the target identification variable, the method further includes: Determine the corresponding relationship between multiple components according to the dependency characteristics between the multiple components; Binding the multiple components into a component set according to the corresponding relationship; The component set is packaged into a component set installation package in a target format.
7. The method according to claim 6, characterized in that After packaging the component set into a component set installation package in a target format, the method further includes: Constructing a component set installation package with dependency features according to the dependency features and the component set installation package; The component set installation package with dependency features is stored in the component source.
8. A device for determining a component disassembly method, characterized in that: include: A first determination module, configured to determine a binary file corresponding to a component, and determine a target pre-installation system to which the component belongs according to the binary file; A second determination module is used to determine the component unpacking method corresponding to the target identification variable of the target pre-installed system from the correspondence between the identification variable and the component unpacking method; The unpacking module is used to unpack the components according to the component unpacking method corresponding to the target identification variable.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.