Method for installing common component, electronic equipment and storage medium
By judging and managing the version number of public components, the problem of conflicts between public components in software installation is solved, ensuring the smooth progress of the installation process and the improvement of user experience.
Patent Information
- Application Number
- CN202410940396.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-12
AI Technical Summary
During the software installation process, different software has the same common components, resulting in conflicts in the installation of public components, resulting in software installation failure.
By judging the version number of the public component being installed and based on the version number, whether to end the installation process to avoid conflicts, core locks and registry records are used to manage the installation process to ensure the correct version of the public component.
It effectively avoids the installation conflicts of public components, ensures the smooth completion of the software installation process, and improves the installation success rate and user experience.
Smart Images

Figure CN118885185A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software installation, and in particular to a method for installing a common component, an electronic device, and a storage medium. Background Art
[0002] A computer is an electronic device that can receive data, process it, store it, and output the results. They accomplish these tasks by executing a series of instructions (called programs). Computers are widely used in various fields, including business, education, scientific research, entertainment, etc. The main components of a computer include hardware and software.
[0003] With the continuous development of information technology, more and more application software begins to appear. During the installation process of some software, since different software have the same common components, conflicts may occur during the installation of the same common components, resulting in the problem of software installation failure. Summary of the invention
[0004] The embodiment of the present application provides a method for installing a common component, an electronic device, and a storage medium, by determining whether there is a second common component being installed when the first common component is about to be installed. In the case where there is a second common component being installed, it is necessary to determine which common component needs to be installed based on the first version number of the first common component and the second version number of the second common component, to prevent conflicts caused by the simultaneous installation of the first common component and the second common component, so as to reduce the installation conflicts and errors caused by the simultaneous installation of the same common component.
[0005] In some embodiments, a method for installing a common component is provided, including: when a first common component is to be installed and a second common component is being installed, obtaining a first version number of the first common component and a second version number of the second common component; the first common component and the second common component are the same or different versions of the same common component, the first common component is located in a first installation package, the second common component is located in a second installation package, and the first installation package and the second installation package are installation packages of different applications; based on the first version number and the second version number, installing the first common component or the second common component.
[0006] The method for installing common components provided by the embodiment of the present application determines whether there is a second common component being installed when the first common component is about to be installed. If there is a second common component being installed, it is necessary to determine which common component needs to be installed based on the first version number of the first common component and the second version number of the second common component, thereby reducing the problem of conflicts and errors caused by installing the first common component and the second common component at the same time.
[0007] Optionally, based on the first version number and the second version number, installing the first common component or the second common component includes: when the first version number is greater than the second version number, ending the installation of the second common component and installing the first common component; or, when the first version number is less than or equal to the second version number, continuing to install the second common component.
[0008] In this embodiment, whether the first common component or the second common component needs to be installed is determined by the first version number and the second version number, so as to reduce conflicts and error problems caused by installing the first common component and the second common component at the same time.
[0009] Optionally, after completing the installation of the second public component, the method for installing the public component also includes: clearing the first record in the registry, the first record being a record of the second installation package starting up; deleting the first core lock on the second public component, the first core lock being used to mark the status of the second public component as being installed, and the first core lock is set for the second public component when the second public component is to be installed.
[0010] In this embodiment, the first record in the registry is deleted, and the first core lock on the second common component is deleted to end the relevant process of installing the second common component, so as to start installing the first common component.
[0011] Optionally, determining that the second common component is being installed includes: querying the first core lock; and determining that the second common component is being installed if the first core lock exists.
[0012] In this embodiment, since the first core lock is a mark used to mark that the second common component is being installed, it can be determined whether the second common component is currently being installed by querying the first core lock.
[0013] Optionally, before installing the first common component, the method for installing the common component also includes: adding a second record in the registry, the second record being a record of the first installation package starting up when the computer is turned on; when the first common component is about to be installed, setting a second core lock on the first common component, the second core lock being used to mark the status of the first common component as being installed.
[0014] In this embodiment, a second record is added to the registry to write the installation process of the first common component into the registry when it is automatically started. In addition, a second core lock is set on the first common component to mark that the first common component is in the state of being installed, thereby facilitating the start of the installation of the first common component.
[0015] Optionally, obtaining the first version number of the first common component includes: obtaining the storage address of the first common component; searching for a target file in the storage address based on a first target character, wherein the file name of the target file includes a first target field and a first version number, and the first target field includes a common name of the first common component; and extracting the first version number from the file name of the target file.
[0016] In this embodiment, the target file is searched in the storage address of the first common component so as to determine the version number of the first common component through the file name of the target file.
[0017] Optionally, obtaining the storage address of the first public component includes: adding an address interface in the target executable file, the address interface is used to obtain the storage address of the first public component; the target executable file is used to install the public component; when the first installation package starts to be installed, obtaining the storage address of the first public component through the address interface.
[0018] In this embodiment, an address interface is set in the target executable file to receive the storage address of the first common component sent by the installer of the first installation package through the address interface, thereby obtaining the storage address of the first common component, thereby facilitating determining the version number of the first common component.
[0019] Optionally, obtaining the second version number of the second common component includes: searching for a target process corresponding to the second common component in a registry based on a second target character, the process name of the target process including a second target field and a second version number, the second target field being a common name of the second common component; and extracting the second version number from the process name of the target process.
[0020] In this embodiment, the target process is the startup process of the installation program of the second common component written in the registry before the second common component starts to be installed, and the process name of the target process includes the second target field and the second version number. Therefore, the second version number of the second common component can be determined by searching the target process in the registry.
[0021] Optionally, determining that the first common component is to be installed includes: when the first installation package starts to be installed, the first common component is to be installed.
[0022] In this embodiment, when the first installation package starts to be installed, it is used as the node of "the first common component to be installed".
[0023] Optionally, when the first common component is to be installed and there is no common component being installed, the method for installing common components further includes: installing the first common component.
[0024] In this embodiment, when the first common component is about to be installed and there is no common component being installed, there will be no installation conflict problem if the first common component is directly installed, so the first common component can be directly installed.
[0025] In some embodiments, an electronic device is provided, including: a processor, a memory, and a touch screen; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the method for installing common components as described in any one of the above embodiments.
[0026] In some embodiments, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method for installing a common component as described in any one of the above embodiments.
[0027] In some embodiments, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the method for installing a common component as described in any one of the above embodiments.
[0028] It can be understood that the beneficial effects that can be achieved by using the electronic device, computer-readable storage medium and computer program product described in the above embodiments can be referred to the beneficial effects of the method of installing common components and any possible implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0030] Figure 1 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a display page of an installation program of an installation package of software M provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the process of installing software with common components provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of a common component installation conflict provided in an embodiment of the present application;
[0034] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0035] Figure 6A schematic diagram of the process of installing software provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the installation process of installing only one common component provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of the installation process of common components that are installed simultaneously provided in an embodiment of the present application;
[0038] Fig. 9 A flowchart of a method for installing a common component provided in an embodiment of the present application;
[0039] Fig.10 A flowchart of installing a first installation package provided in an embodiment of the present application;
[0040] Fig.11 A flowchart of another method for installing a common component provided in an embodiment of the present application;
[0041] Fig.12 A schematic diagram of the installation process of a high version of the second common component provided in the embodiment of the present application;
[0042] Fig.13 A schematic diagram of the installation process of a low version of the second common component provided in the embodiment of the present application;
[0043] Fig.14 A flowchart of another method for installing common components provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be described clearly below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, other embodiments obtained by ordinary technicians in this field without making creative work all belong to the protection scope of the present application.
[0045] In the following, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0046] In addition, in the present application, directional terms such as "upper", "lower", "inner" and "outer" are defined relative to the orientation of the components schematically placed in the drawings. It should be understood that these directional terms are relative concepts. They are used for relative description and clarification, and they can change accordingly according to the changes in the orientation of the components placed in the drawings.
[0047] To facilitate understanding of this application, some technical terms involved are first explained below.
[0048] Target executable file: An executable file used to install or preinstall an application or software. Specifically, it is a part of the program used to install software in the system, responsible for performing some preparatory work before installing the main program, such as checking the system environment, installing necessary components, or performing system configuration, etc. Exemplarily, in the embodiment of the present application, the target executable file is MBAInstallPre.exe.
[0049] Core Locking: refers to the mechanism for access control of specific resources or data in a multi-core processor or multi-threaded system. Its purpose is to prevent multiple threads or processes from accessing and modifying shared resources at the same time, thereby avoiding race conditions and data inconsistency. Multithreaded Programming: In a multi-threaded program, different threads may access shared resources (such as variables, files, etc.). Core locks ensure that only one thread can access these resources at the same time. Database Management System: In a database system, lock mechanisms are used to manage concurrent access to data to ensure data consistency and integrity. Operating System: The operating system uses various lock mechanisms to manage concurrent access to hardware resources and memory to ensure system stability and security. Common core lock types include: Mutex, Read-Write Lock, and Spin Lock. Mutex locks are used to ensure that only one thread can access a resource. Read-Write Locks allow multiple threads to read data at the same time, but write operations will monopolize the resource. Spin locks are a type of busy wait lock, where threads keep checking in a loop while waiting for the lock to be released, rather than going into sleep mode. Exemplarily, in an embodiment of the present application, the core lock is used to mark that a common component is being installed, and the type of the core lock is a mutex lock.
[0050] A computer is an electronic device that can accept data, process it, store it, and output results. They accomplish these tasks by executing a series of instructions (called programs). Computers are widely used in various fields, including business, education, scientific research, entertainment, etc. The main components include hardware and software. Hardware includes: central processing unit (CPU), memory (RAM), storage device, motherboard, input device, output device, and graphics processing unit (GPU). Software includes: operating system (OS), application software, and driver. Among them, the operating system is used to manage hardware and software resources and provide a user interface. For example, Windows, macOS, Linux. Drivers are software that enables the operating system to communicate with hardware devices. Application software is software for specific tasks, such as word processing, spreadsheets, browsers, games, etc. Specifically, computers are classified according to their form: desktop computers, laptops, tablets, and embedded systems. Among them, embedded systems are computers integrated into other devices, such as smart home appliances, car navigation systems, etc. Computers have a wide range of applications, including office, entertainment, education, scientific research, business, and finance. The problem to be solved by the embodiments of the present application is that when software with the same common components are installed on a computer at the same time, there may be a common component installation conflict and error.
[0051] Common components in software refer to code libraries, modules or functions that are shared and reused in multiple software systems or applications. The design goals of these components are to improve development efficiency, reduce duplication of code and ensure consistency. Some common types of common components include: library, framework, API (application programming interface), middleware, module, plugin, microservices and template, etc.
[0052] An installer package is an archive file that contains the software and all its necessary files, libraries, dependencies, and configurations. The format and content of the installation package may vary, depending on the operating system and the type of software. The installation package formats in Windows systems include: .exe, .msi.
[0053] An installer is an application responsible for extracting files from an installation package and copying them to the appropriate location on the target system. The installer also performs necessary configuration steps to ensure that the software can run correctly. These steps typically include: Unzip and copy files: Unzip and copy the files in the installation package to the target folder. Register components: Register dynamic link libraries (DLLs) or shared libraries in the system to make them available to other software. Configure environment variables: Set system environment variables to ensure that the software can find necessary resources and dependencies. Create shortcuts: Create shortcuts on the desktop or in the start menu to make it easier for users to start the software. Update the registry: Write the software's configuration information and settings in the registry. Verify dependencies: Check and install dependencies required for the software to run (such as a specific version of Java, .NET Framework, etc.). User interaction: Interact with users through a graphical interface or command line interface to obtain necessary installation paths, configuration options, and other information.
[0054] The following describes the steps to install the installation package:
[0055] Launch the installer: The user double-clicks the installation package to launch the installer. The installer usually provides a graphical user interface (GUI) or command line interface (CLI) to guide the user through the installation process. Unzip and check: The installer first unzips the installation package and checks its integrity and validity to ensure that there are no damaged or missing files. Copy files: The installer copies the files in the installation package to the target directory. These files include executable files, configuration files, library files, etc. Configure the system: The installer configures the system as needed, such as setting environment variables, registering components, updating the registry, etc. Create shortcuts and menu items: The installer creates the necessary shortcuts and menu items so that users can easily start and use the software. Installation completed: After the installer completes all steps, it displays a message to the user that the installation was successful and may provide the option to start the software.
[0056] For example, take the installation of a Windows application as an example: Download the installation package: The user downloads an .exe or .msi file containing the software. Start the installer: The user double-clicks the .exe or .msi file to start the installer. User License Agreement: The installer displays the license agreement, and the user continues after reading and agreeing. Select the installation path: The user selects the target directory for the software installation. Copy files: The installer copies the software files to the target directory. Configure the system: The installer may write necessary configuration information in the registry, set environment variables, etc. Create a shortcut: Create a shortcut to the software on the desktop or in the start menu. Complete the installation: The installer displays a message that the installation was successful, and the user can choose to start the software immediately.
[0057] To facilitate understanding of the technical solution of the application, the background technology of the application is described below.
[0058] The development of computers can be divided into several important stages: from the first generation of computers using vacuum tubes in the 1940s (such as ENIAC), to the second generation of computers using transistors in the 1950s and 1960s, to the third generation of computers using integrated circuits in the 1960s and 1970s. Since the 1970s, the introduction of microprocessors has marked the arrival of the fourth generation of computers, and personal computers have become popular. Today, computers are developing in new directions such as artificial intelligence and quantum computing, continuously improving computing power and intelligence.
[0059] With the gradual development of computers, there are more and more types of application software. In order to improve the development efficiency of application software, reduce duplicate codes and ensure consistency, application software development has begun to be implemented based on common components.
[0060] Due to the iteration of technology, the content of common components is also being updated, and the versions of common components used by installation packages of different application software may also be different. When two application software installed at the same time have the same common components, an error message will be displayed, resulting in the failure of software installation.
[0061] If two installation packages with the same common components are installed, the possible conflicts include: file overwrite conflict, version incompatibility, configuration file conflict, registry conflict, etc. Among them, file overwrite conflict means that if two installation packages try to install the same file in the same location, one package may overwrite the file of the other package, causing the original function to not work properly. Version incompatibility means that the versions of the common components contained in the two installation packages are different, which may cause the application to fail to run properly because it depends on different versions of components. This situation is common in conflicts between dynamic link libraries (DLLs) and shared libraries. Configuration file conflict means that the common components may depend on the same configuration file. If two installation packages try to modify the same configuration file, it may cause configuration confusion and affect the normal operation of the application. Registry conflict means that the common components may create the same key or value in the registry. If two installation packages modify the same registry key, it may cause instability in the system or application.
[0062] Therefore, the present application provides a method for installing common components, so that when two application software installed at the same time have the same common components, the common components that need to be installed are determined based on the versions of the common components without reporting errors, so that the software can be installed normally and the user experience is improved.
[0063] Figure 1A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application.
[0064] Combination Figure 1 As shown, the icons included on the display screen 101 of the electronic device include: an installation package 102 of software M, an installation package 103 of software N, this computer 104, a recycle bin 105, a control panel 106, a start menu 107, and a time 108. Among them, the installation package 102 of software M and the installation package 103 of software N have the same common component.
[0065] Figure 2 A schematic diagram of a display page of an installation program of an installation package of software M provided in an embodiment of the present application.
[0066] Combination Figure 2 As shown, after clicking the installation package to open the installation program, the display page displays the name of the application software "M" 109, user agreement 1 110, user agreement 2 111, "Quick Installation" option 112 and "Custom Installation" option 113, as well as a first check box 114 set on the left side of user agreement 1 110 and a second check box 115 set on the left side of user agreement 2 111. Specifically, the upper edge of the display page of the installation program is also provided with function keys "Minimize" 116, "Maximize" 117 and "Close" 118.
[0067] Figure 3 A schematic diagram of the process of installing software with common components provided in an embodiment of the present application.
[0068] The following combination Figure 3 , taking the installation process of the installation package 102 of software M as an example, the installation process of software with common components is described in detail. The name of the application software corresponding to the installation package 102 of software M is M. Figure 3 The screen in the figure is the screen displayed on the display of the electronic device. Specifically, the installation process and screen of the software with common components provided in the embodiment of the present application are only for illustrative purposes and do not limit the specific installation process.
[0069] Combination Figure 3 As shown in (a), the installation package 102 of the software M on the desktop 101 of the electronic device is opened, and the installation program of the installation package 102 of the software M is started to install the application software M.
[0070] It should be understood that the installation package can be located in a folder or on the desktop, and this application does not limit this. In addition, the installation package of the application software can be opened by right-clicking the installation package and then clicking to open, or by double-clicking the installation package with the left mouse button, and this application does not limit this.
[0071] It should be understood that the pages displayed below are all displayed on the display of the electronic device. Figure 3 (b), (c), (d), (e), (f) and (g) do not show other contents displayed in the display, and only show the display page of the installation program.
[0072] After starting the application software installation program, the following Figure 3 The screen shown in (b) is shown in the figure. Figure 3 As shown in (b), after the installation program is opened, the following is displayed: Figure 2 , at this time, both the "Quick Installation" option 112 and the "Custom Installation" option 113 are unclickable (i.e., clicking the "Quick Installation" option 112 and the "Custom Installation" option 113 at this time also fails to enter the next page). After the user chooses to check User Agreement 1 and User Agreement 2 (i.e., after clicking the first check box 114 and the second check box 115, "√" appears in the first check box 114 and the second check box 115), the "Quick Installation" option 112 and the "Custom Installation" option 113 can be clicked, and the following is obtained. Figure 3 Specifically, the user can also click User Agreement 1 110 to view the content of User Agreement 1, and can click User Agreement 2 111 to view the content of User Agreement 2.
[0073] After the user selects "Quick Installation" 112, the Figure 3 The screen shown in (d) shows that M is being installed, and displays an installation progress bar 119 and an installation progress percentage 120. When the installation progress percentage 120 reaches 100%, the following is displayed: Figure 3 In the screen shown in (e), the installation package 102 of software M is installed, that is, the installation of software M is completed, as well as the basic setting options for software M (including adding automatic startup 121, a third check box 123 for confirming whether to add automatic startup, adding a shortcut in the shortcut bar 122, a fourth check box 124 for confirming whether to add a shortcut in the shortcut bar, and a "Quick Start" option 125).
[0074] After the user selects "Custom Installation", the page allows the user to select the software installation address (such as Figure 3 After completing the selection, click "Next" option 127 to enter the page for selecting the functional components to be installed (such as Figure 3 After selecting the installation location and / or functional components, click Figure 3 In the page shown in (g), click "Install" 130 to enter the following Figure 3 The screen shown in (d) shows that M is being installed, and displays the installation progress bar and the installation progress percentage. When the installation progress percentage reaches 100%, the following is displayed: Figure 3 The screen shown in (e) in the figure.
[0075] Specifically, after the user selects “Quick Install” 112 or “Install” 130 , the common components of the software M begin to be installed.
[0076] In addition, before the installation of the common components of software M begins, the startup record of the installation process of the installation package of software M will be written into the registry to prevent the problem that the installation process of the installation package of software M is unexpectedly terminated due to electronic equipment failure during the installation process of the installation package of software M, resulting in installation failure. After completion, the registry is cleaned up (i.e., the startup record of the installation process of the installation package of software M is deleted), and the name of the common component carries the version number of software M. The startup record of the installation process of the installation package of software M written in the registry includes the startup record of the common component in the installation package of software M. Therefore, the process corresponding to the installation process of the installation package of software M in the registry can be determined by querying to determine the version number of the common component of software M.
[0077] Among them, the registry is an important database in the operating system, which is used to store the configuration information of the system and applications.
[0078] At the same time, before the public components of software M start to be installed, a core lock will be set on the public components of software M to mark that the public components are being installed at this time.
[0079] Figure 4 A schematic diagram of a common component installation conflict provided in an embodiment of the present application.
[0080] The following combination Figure 4 Expand to explain how the technical problem occurred.
[0081] Combination Figure 4 As shown in (a), the display screen of the electronic device has a first installation package 201 and a second installation package 202, the first installation package 201 is the installation package of the first software, and the second installation package 202 is the installation package of the second software. Use the mouse to click on the first installation package 201 and the second installation package 202 to respectively display page 203 of the first installation program of the first installation package 201 and page 204 of the second installation program of the second installation package 202 on the desktop. Taking the example of using quick installation to install the first installation package 201 and the second installation package 202, after clicking quick installation 205 on page 203 of the first installation program, the first installation package 201 enters the installation process (the installation progress interface 207 of the first installation package 201 appears), and the second installation package 202 is not installed at this time. Figure 4 After clicking on the quick installation 206 on the second installation program page 204, the second installation package 202 also enters the installation process (the installation process interface 208 of the second installation package 202 appears), as shown in FIG. Figure 4 As shown in (c). The first common component of the first installation package 201 and the second common component of the second installation package 202 both need to be installed. When both the first common component and the second common component are installed, there will be a conflict between the installation process of the first common component and the installation process of the second common component, resulting in an error (error prompt 209 appears), such as Figure 4 As shown in (d).
[0082] In summary, when software with the same common components (the installation package contains the same common components) are installed at the same time, there will be a problem of common component installation conflicts leading to errors. Therefore, the present application provides a method for installing common components to reduce the problems of installation conflicts and errors caused by the simultaneous installation of the same common components.
[0083] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0084] An embodiment of the present application provides an electronic device 100, which may be a desktop computer, a laptop computer, a tablet computer, or an embedded system with a Windows system.
[0085] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a button 190, an indicator 192, a camera 193 and a display screen 194, etc.
[0086] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0087] It should be understood that when the electronic device 100 is of different types, the components included in the electronic device 100 are also different. For example, when the electronic device 100 is a desktop computer, the electronic device 100 does not include antenna 1 and antenna 2, but when the electronic device 100 is a tablet computer, the electronic device 100 includes antenna 1 and antenna 2.
[0088] The processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0089] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0090] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0091] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0092] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0093] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0094] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0095] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0096] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0097] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0098] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0099] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0100] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0101] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0102] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0103] In the embodiment of the present application, the display panel of the display screen 194 is used to display the Figure 3 Neutralization Figure 4 All screens in .
[0104] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0105] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0106] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0107] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0108] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0109] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0110] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0111] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0112] The target executable file used in the embodiment of the present application is stored in the internal memory 121 .
[0113] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0114] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0115] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0116] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0117] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0118] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0119] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0120] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.
[0121] In the embodiment of the present application, the software to be installed is referred to as the first software, the installation package of the first software is the first installation package, and the first installation package contains the first common component. The software being installed is referred to as the second software, the installation package of the second software is the second installation package, and the second installation package contains the second common component. The first common component and the second common component are the same common component, but the versions of the two are the same or different.
[0122] In the embodiment of the present application, when the first common component is about to be installed, it is determined whether there is a second common component being installed. If there is a second common component being installed, it is necessary to determine which common component needs to be installed based on the first version number of the first common component and the second version number of the second common component, so as to prevent conflicts caused by the simultaneous installation of the first common component and the second common component.
[0123] For example, in combination with the above Figure 3 For example, when installing the installation package of software M, you need to first confirm whether there are common components of other software (software with the same common components) being installed. If there are common components of other software (software with the same common components) being installed, you need to determine whether to install the common components of software M or the common components of other software (software with the same common components) based on the version number of the common components of software M and the version number of the common components of other software (software with the same common components).
[0124] Specifically, during the installation process from the start of installing the first software to the installation of the first common component in the first software, the node of “the first common component to be installed” can be set.
[0125] For example, in combination Figure 3 As shown, taking the installation software M as the first software as an example, the node of "the first common component to be installed" is explained. When the user opens the installation package 102 of the software M, that is, Figure 3 As shown in (a), when the user clicks the icon of "Software M installation package" to open the installation program of the first software, it is used as the node of "First common component to be installed". Or, the page is Figure 3 In (b), when the user selects protocol 1 and / or protocol 2, it is used as the node of "the first common component to be installed". Or, the page is Figure 3 In (c), when the user clicks the "Quick Install" 112 option, it is used as the node of "The first common component will be installed". Figure 3In (c), when the user clicks the "Custom Installation" 113 option, it is used as the node of "The first common component will be installed". Or, the page is Figure 3 In (e), when the user selects the installation address (i.e. clicks the "Find File Address" button 126), it is used as the node of "the first common component to be installed". Figure 3 In (g), when the user selects the functional components to be installed (i.e., selects functional component 1 128 and / or functional component 2 129), it is used as the node of "the first common component to be installed". Figure 3 In (d), during the process of installing the first installation package, when the next component to be installed is the first common component, it is used as the node of "the first common component to be installed".
[0126] Specifically, after the same common component is updated, the version number becomes larger, but it may have more functions. Installing a higher version of the common component can satisfy both the normal operation of the software corresponding to the first installation package and the normal operation of the software corresponding to the second installation package. Therefore, the embodiment of the present application determines the common component with the highest version number between the first common component and the second common component and installs it.
[0127] Figure 6 A flowchart of the software installation process provided in accordance with an embodiment of the present application.
[0128] The following combination Figure 6 , an exemplary description is given of the method for installing common components provided in an embodiment of the present application.
[0129] Combination Figure 6 As shown, the method for installing a common component provided in the embodiment of the present application includes steps S601 to S608, and the execution subject of the method may be an electronic device, which is specifically as follows:
[0130] Step S601, start installing the first installation package.
[0131] Step S602: The first common component is to be installed.
[0132] Step S603, whether the second common component is being installed. If the second common component is not being installed, proceed to step S604. If the second common component is being installed, proceed to step S605.
[0133] Step S604: installing the first common component.
[0134] Step S605: Obtain a first version number of the first common component and a second version number of the second common component.
[0135] Step S606: The first version number is greater than the second version number. If the first version number is less than or equal to the second version number, proceed to step S607. If the first version number is greater than the second version number, proceed to step S608.
[0136] Step S607: installing the second common component.
[0137] Step S608, ending the installation of the second common component and installing the first common component.
[0138] After double-clicking the first installation package to open the installation program of the first installation package, arrive at the node to be installed the first common component.By determining whether there is currently the second common component being installed, to reduce the problem of the first common component and the second common component being installed simultaneously causing conflict, error reporting.Thus in the absence of the second common component being installed, show that the first common component is installed at this time and there will be no conflict error, so directly install the first common component.In the presence of the second common component being installed, show that the first common component is installed at this time and there will be a conflict error, so need to select to install the first common component or the second common component.
[0139] Further, by obtaining the first version number of the first common component and the second version number of the second common component, it is determined whether to install the first common component or the second common component according to the comparison result of the first version number and the second version number. Since the function of the common component with a higher version number is better, the second common component is installed when the first version number is less than or equal to the second version number. When the first version number is greater than the second version number, the installation of the second common component is terminated and the first common component is installed.
[0140] Figure 7 A schematic diagram of the installation process for installing only one common component provided in an embodiment of the present application.
[0141] For example, in combination Figure 7 As shown, taking the installation of the second installation package as an example, after clicking the second installation package (step S701), during the installation of the second installation package, the second public component enters the installation (step S702), after the installation of the second public component is completed (step S703), the remaining parts in the second installation package are installed, and when the contents of the second installation package are completely installed, the installation of the second installation package is completed (step S704).
[0142] Figure 8 A schematic diagram of the installation process of common components that are installed simultaneously is provided for an embodiment of the present application.
[0143] Combination Figure 8As shown, after clicking and installing the second installation package (step S801), enter the installation program of the second installation package, and start installing the second common component. When the second common component is being installed, that is, after the second common component enters the installation (step S802), and the node to be installed with the first common component arrives (step S803), it is necessary to compare the first version number of the first common component and the second version number of the second common component (step S804) to determine whether the first common component or the second common component needs to be installed, thereby installing the corresponding first common component or the second common component (step S805). In this way, the conflict and error reporting problems caused by the simultaneous installation of the first common component and the second common component are reduced.
[0144] Fig. 9 A flowchart of a method for installing a common component provided in an embodiment of the present application.
[0145] Combination Fig. 9 As shown, the method for installing a common component provided by the present application includes steps S100 and S200, and the execution subject of the method may be an electronic device, specifically as follows:
[0146] Step S100, when the first common component is about to be installed and the second common component is being installed, obtain the first version number of the first common component and the second version number of the second common component; the first common component and the second common component are the same or different versions of the same common component, the first common component is located in a first installation package, the second common component is located in a second installation package, and the first installation package and the second installation package are installation packages of different applications.
[0147] In this step, since when installation packages carrying the same common components are installed at the same time, there will be an installation conflict and error message when the same common components are installed at the same time, it is necessary to obtain the version numbers of the first common component and the second common component when the first common component is about to be installed and the second common component is being installed, so as to determine which common component to install based on the version number.
[0148] Optionally, determining that the second common component is being installed includes step S101 and step S102, which are specifically as follows:
[0149] Step S101, query the first core lock.
[0150] Step S102: if the first core lock exists, it is determined that the second common component is being installed.
[0151] Specifically, the first core lock is set for the second common component when the second common component is to be installed, and the first core lock is used to mark that the second common component is being installed.
[0152] In this embodiment, since the first core lock is a mark used to mark that the second common component is being installed, it can be determined whether the second common component is currently being installed by querying the first core lock.
[0153] Optionally, querying the first core lock includes: querying a first core lock flag.
[0154] Optionally, determining that the second common component is being installed includes: querying a registry; and determining that the second common component is being installed when the first record exists in the registry.
[0155] Specifically, the first record is a record written into the registry when the second installation package is installed, and the first record is used to wake up the installation process of the second installation package to automatically start the computer, so as to prevent the electronic device from malfunctioning during the installation of the second installation package, causing the installation process of the second installation package to terminate unexpectedly, resulting in the problem of installation failure. In addition, if the installation of the second installation package is stopped or after the installation of the second installation package is completed, the first record in the registry needs to be deleted.
[0156] Since the second installation package includes the second public component, the first record also includes the boot-up self-starting record of the second public component.
[0157] In this embodiment, if the first record exists in the registry, it can be proved that the second common component is being installed, thereby determining that the second common component is being installed.
[0158] Optionally, determining that the first common component is to be installed includes: when the first installation package starts to be installed, the first common component is to be installed.
[0159] In this embodiment, when the first installation package starts to be installed, it is used as the node of "the first common component to be installed".
[0160] Exemplarily, when double-clicking to open the first installation package, it is deemed that the first installation package starts to be installed, that is, as the node of "the first common component to be installed". Alternatively, when checking protocol 1 and / or protocol 2, it is deemed that the first installation package starts to be installed, that is, as the node of "the first common component to be installed". Alternatively, when clicking the "Quick Installation" option, it is deemed that the first installation package starts to be installed, that is, as the node of "the first common component to be installed". Alternatively, when clicking the "Custom Installation" option, it is deemed that the first installation package starts to be installed, that is, as the node of "the first common component to be installed". Alternatively, when selecting the installation address (i.e. clicking the "Find File Address" button), it is deemed that the first installation package starts to be installed, that is, as the node of "the first common component to be installed". Alternatively, when selecting the functional components to be installed (i.e. clicking functional component 1 and / or functional component 2), it is deemed that the first installation package starts to be installed, that is, as the node of "the first common component to be installed". Alternatively, during the process of installing the first installation package, any time point before the next component to be installed is the first common component can be regarded as the start of the installation of the first installation package, that is, as the node of "the first common component to be installed".
[0161] Optionally, obtaining the first version number of the first common component includes steps S103 to S105, which are specifically as follows:
[0162] Step S103, obtaining the storage address of the first common component.
[0163] Optionally, obtaining the storage address of the first public component includes: adding an address interface in the target executable file, the address interface is used to obtain the storage address of the first public component; the target executable file is used to install the public component; when the first installation package starts to be installed, obtaining the storage address of the first public component through the address interface.
[0164] In this embodiment, an address interface is set in the target executable file to receive the storage address of the first common component sent by the installer of the first installation package through the address interface, thereby obtaining the storage address of the first common component, thereby facilitating determining the version number of the first common component.
[0165] Specifically, the target executable file (MBAInstallPre.exe) is an executable file used to install or pre-install an application or software. Specifically, it is responsible for performing some preparatory work before installing the main program in the system, such as checking the system environment, installing necessary components, or performing system configuration.
[0166] Fig.10 A flowchart for installing a first installation package provided in an embodiment of the present application.
[0167] Specifically, combined Fig.10As shown, when the first common component is to be installed, the installation process of the first installation package sends the storage address of the first common component to the target executable file through the address interface (step S1), and then confirms the first version number of the first common component and installs the first common component through the target executable file (step S2). Further, the installation process of the first installation package starts to install the first common component through step S3, and after the installation of the first common component is completed, the installation information is returned to the installation process of the first installation package through step S4.
[0168] Step S104, searching for a target file in the storage address based on the first target character, the file name of the target file includes a first target field and a first version number, and the first target field includes a common name of the first common component.
[0169] Exemplarily, the first target field is "BasicService", the file name of the target file is "BasicService18.0", and the first version number is 18.0.
[0170] Step S105, extracting the first version number from the file name of the target file.
[0171] In this embodiment, the target file is searched in the storage address of the first common component so as to determine the version number of the first common component through the file name of the target file.
[0172] Optionally, obtaining the first version number of the first common component also includes: printing a first error log in case of failure to obtain the storage address of the first common component, or failure to find the target file in the storage address, or failure to extract the first version number from the file name of the target file.
[0173] In this embodiment, the first error log is printed to facilitate understanding of the cause of the installation error, thereby facilitating adjustment of the first installation package, and further facilitating successful installation of the first installation package and the second installation package at the same time.
[0174] Optionally, obtaining the second version number of the second common component includes step S106 and step S107, which are specifically as follows:
[0175] Step S106, searching the registry for a target process corresponding to the second common component based on the second target character, the process name of the target process including a second target field and a second version number, the second target field being a common name of the second common component.
[0176] Exemplarily, the second target field is "BasicService", the process name of the target process is "BasicService18.1", and the second version number is 18.1.
[0177] Step S107, extracting the second version number from the process name of the target process.
[0178] In this embodiment, the target process is the startup process of the installation program of the second common component written in the registry before the second common component starts to be installed, and the process name of the target process includes the second target field and the second version number. Therefore, the second version number of the second common component can be determined by searching the target process in the registry.
[0179] Optionally, obtaining the second version number of the second common component further includes: printing a second error log when searching for a target process corresponding to the second common component fails or when extracting the second version number from the process name of the target process fails.
[0180] In this embodiment, the second error log is printed to facilitate understanding of the cause of the installation error, thereby facilitating adjustment of the registry, and further facilitating successful installation of the first installation package and the second installation package at the same time.
[0181] Step S200: installing the first common component or the second common component based on the first version number and the second version number.
[0182] In this step, by determining whether to install the first common component or the second common component based on the first version number and the second version number, conflicts and error problems caused by installing the first common component and the second common component at the same time are reduced.
[0183] Fig.11 A flowchart of another method for installing common components provided in an embodiment of the present application.
[0184] Optionally, combined Fig.11 As shown, based on the first version number and the second version number, installing the first common component or the second common component includes step S201 and step S202, which are specifically as follows:
[0185] Step S201, when the first version number is greater than the second version number, end the installation of the second common component and install the first common component.
[0186] Optionally, after the installation of the second common component is completed, the method for installing the common component further includes step S2011 and step S2012, which are specifically as follows:
[0187] Step S2011, clearing the first record in the registry, where the first record is a record of the second installation package starting automatically upon startup.
[0188] In this step, the first record is a record written into the registry when the installation of the second installation package begins. The first record is used to wake up the installation process of the second installation package at startup. Since the second installation package includes a second common component, the first record also includes the startup record of the second common component.
[0189] Step S2012, deleting the first core lock on the second public component, the first core lock is used to mark the status of the second public component as being installed, and the first core lock is set for the second public component when the second public component is to be installed.
[0190] In this embodiment, the first record in the registry is deleted, and the first core lock on the second common component is deleted to end the relevant process of installing the second common component, so as to start installing the first common component.
[0191] Optionally, in the case where clearing the first record in the registry fails, a third error log is printed.
[0192] Optionally, before installing the first common component, the method for installing the common component further includes step S2013 and step S2014, which are specifically as follows:
[0193] Step S2013, adding a second record in the registry, where the second record is a record of the first installation package starting automatically upon startup.
[0194] In this step, the second record is a record written into the registry when the installation of the first installation package begins. The second record is used to wake up the installation process of the first installation package at startup. Since the first installation package includes the first common component, the second record also includes the startup record of the first common component.
[0195] Step S2014: When the first common component is to be installed, a second core lock is set on the first common component, and the second core lock is used to mark the status of the first common component as being installed.
[0196] In this embodiment, a second record is added to the registry to write the installation process of the first common component into the registry when it is automatically started. In addition, a second core lock is set on the first common component to mark that the first common component is in the state of being installed, thereby facilitating the start of the installation of the first common component.
[0197] Optionally, when adding the second record in the registry fails, a fourth error log is printed.
[0198] Step S202: When the first version number is less than or equal to the second version number, continue to install the second common component.
[0199] In this embodiment, whether the first common component or the second common component needs to be installed is determined by the first version number and the second version number, so as to reduce conflicts and error problems caused by installing the first common component and the second common component at the same time.
[0200] Fig.12 The second common component provided for the embodiment of the present application is a schematic diagram of the installation process of a higher version.
[0201] Combination Fig.12 As shown, the first version number of the first common component is 18.0, and the second version number of the second common component is 18.1, and the version number of the second common component being installed is higher. In the process of the second installation package being installed, the installation process of the second common component is established by step S5, that is, the second common component with the version number of 18.1 is started to be installed. At the same time, in the process of the first installation package being installed, the installation process of the first common component is established by step S6, that is, the first common component with the version number of 18.0 is started to be installed. At this time, the first version number of the comprehensive first common component and the second version number of the second common component are judged, and the common component of the target installation is determined to be the second common component with a higher version number, and then the first common component is cancelled by step S7, and the second common component is installed by step S8. After the second common component is installed, the version information of the second common component installed is returned to the installation process of the second installation package and the installation process of the first installation package by step S9.
[0202] Fig.13 The second common component provided for the embodiment of the present application is a schematic diagram of the installation process of a low version.
[0203] Combination Fig.13 As shown, the first version number of the first common component is 18.1, and the second version number of the second common component is 18.0, and the version number of the first common component to be installed is higher. During the installation of the second installation package, the installation process of the second common component is established by step S10, that is, the second common component with a version number of 18.0 is installed. At the same time, during the installation of the first installation package, the installation process of the first common component is established by step S11, that is, the first common component with a version number of 18.1 is installed. At this time, the first version number of the first common component and the second version number of the second common component are judged comprehensively, and the common component of the target installation is determined to be the second common component with a higher version number, and then the installation of the second common component is cancelled by step S12, and the first common component is installed by step S13. After the installation of the second common component is completed, the version information of the installed first common component is returned to the installation process of the second installation package and the installation process of the first installation package by step S14.
[0204] Optionally, when the first common component is to be installed and there is no common component being installed, the method for installing the common component further includes step S300:
[0205] Step S300: installing a first common component.
[0206] In this embodiment, when the first common component is about to be installed and there is no common component being installed, there will be no installation conflict problem if the first common component is directly installed, so the first common component can be directly installed.
[0207] The method for installing common components provided by the embodiment of the present application determines whether there is a second common component being installed when the first common component is about to be installed. If there is a second common component being installed, it is necessary to determine which common component needs to be installed based on the first version number of the first common component and the second version number of the second common component, thereby reducing the problem of conflicts and errors caused by installing the first common component and the second common component at the same time.
[0208] Fig.14 A flowchart of another method for installing common components provided in an embodiment of the present application.
[0209] Combination Fig.14 As shown, another method for installing a common component provided in an embodiment of the present application includes steps S1401 to S1422. The execution subject of the method may be an electronic device, and the details are as follows:
[0210] Step S1401, start installing the first installation package.
[0211] Step S1402, the first common component is to be installed.
[0212] Step S1403, query the first core lock.
[0213] Step S1404: in the case where the first core lock exists, it is determined that the second common component is being installed.
[0214] Step S1405: directly install the first common component in the absence of the first core lock.
[0215] Step S1406: when the first common component is about to be installed and the second common component is being installed, obtain the storage address of the first common component.
[0216] Step S1407: searching for a target file in the storage address based on the first target character, wherein the file name of the target file includes a first target field and a first version number, and the first target field includes a common name of the first common component.
[0217] Step S1408, extracting the first version number from the file name of the target file.
[0218] Step S1409, when the acquisition of the storage address of the first common component fails, or when the search for the target file in the storage address fails, or when the extraction of the first version number in the file name of the target file fails, print the first error log.
[0219] Step S1410, searching the registry for a target process corresponding to the second common component based on the second target character, the process name of the target process including a second target field and a second version number, the second target field being a common name of the second common component.
[0220] Step S1411, extracting the second version number from the process name of the target process.
[0221] Step S1412: When the search for the target process corresponding to the second common component fails, or when the extraction of the second version number in the process name of the target process fails, print a second error log.
[0222] The implementation details and effects of the above steps S1401 to S1412 correspond to step S100 described in the above embodiment.
[0223] Step S1413, determine whether the first version number is greater than the second version number.
[0224] Step S1414, when the first version number is greater than the second version number, end the installation of the second common component.
[0225] Step S1415, clearing the first record in the registry, where the first record is a record of the second installation package starting automatically upon startup.
[0226] Step S1416, deleting the first core lock on the second public component, the first core lock is used to mark the status of the second public component as being installed, and the first core lock is set for the second public component when the second public component is to be installed.
[0227] Step S1417, when clearing the first record in the registry fails, print a third error log and delete the first core lock on the second public component.
[0228] Step S1418, adding a second record in the registry, where the second record is a record of the first installation package starting automatically upon startup.
[0229] Step S1419: When the first common component is to be installed, a second core lock is set on the first common component, and the second core lock is used to mark the status of the first common component as being installed.
[0230] Step S1420: When adding the second record to the registration table fails, print a fourth error log.
[0231] Step S1421, installing the first common component.
[0232] Step S1422: When the first version number is less than or equal to the second version number, continue to install the second common component.
[0233] The implementation details and effects of the above steps S1413 to S1422 correspond to step S200 described in the above embodiment.
[0234] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method of installing common components.
[0235] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute each function or step executed by the electronic device in the above method of installing a common component.
[0236] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0237] It is easy to understand that those skilled in the art can combine, split, reorganize, etc. the embodiments of the present application to obtain other embodiments based on the several embodiments provided in the present application, and these embodiments do not exceed the protection scope of the present application.
[0238] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0239] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0240] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0241] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0242] It should be noted that those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are only regarded as exemplary, and the true scope of the present application is indicated by the claims.
[0243] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for installing a common component, characterized in that: include: When a first common component is about to be installed and a second common component is being installed, obtaining a first version number of the first common component and a second version number of the second common component; the first common component and the second common component are the same or different versions of the same common component, the first common component is located in a first installation package, the second common component is located in a second installation package, and the first installation package and the second installation package are installation packages of different applications; Based on the first version number and the second version number, the first public component or the second public component is installed.
2. The method for installing a common component according to claim 1, characterized in that: The installing the first common component or the second common component based on the first version number and the second version number includes: When the first version number is greater than the second version number, ending the installation of the second common component and installing the first common component; or, When the first version number is less than or equal to the second version number, continue to install the second common component.
3. The method for installing a common component according to claim 2, characterized in that: After the installation of the second common component is completed, the method further includes: Clearing a first record in a registry, where the first record is a record of the second installation package being automatically started at startup; The first core lock on the second public component is deleted, where the first core lock is used to mark the status of the second public component as being installed, and the first core lock is set for the second public component when the second public component is to be installed.
4. The method for installing a common component according to claim 3, characterized in that: Determining that the second common component is being installed includes: Query the first core lock; In the presence of the first core lock, it is determined that the second common component is being installed.
5. The method for installing a common component according to claim 2, characterized in that: Before installing the first common component, the method further includes: Add a second record in the registry, where the second record is a record of the first installation package starting automatically at startup; When the first common component is to be installed, a second core lock is provided on the first common component, and the second core lock is used to mark the status of the first common component as being installed.
6. The method for installing a common component according to claim 1, characterized in that: Obtaining a first version number of the first public component includes: Obtaining the storage address of the first common component; Searching for a target file in the storage address based on the first target character, the file name of the target file including the first target field and a first version number, the first target field including a common name of the first common component; The first version number is extracted from the file name of the target file.
7. The method for installing a common component according to claim 6, characterized in that: The obtaining the storage address of the first common component includes: Adding an address interface in a target executable file, wherein the address interface is used to obtain the storage address of the first public component; the target executable file is used to install the public component; When the first installation package starts to be installed, the storage address of the first public component is obtained through the address interface.
8. The method for installing a common component according to claim 1, characterized in that: Obtaining a second version number of the second public component includes: Searching for a target process corresponding to the second public component in a registry based on a second target character, wherein the process name of the target process includes a second target field and a second version number, and the second target field is a common name of the second public component; The second version number is extracted from the process name of the target process.
9. The method for installing a common component according to claim 1, characterized in that: Determining that the first common component is to be installed includes: When the first installation package starts to be installed, the first public component will be installed.
10. The method for installing a common component according to claim 1, characterized in that: In the case where the first common component is to be installed and there is no common component being installed, the method for installing the common component further includes: The first common component is installed.
11. An electronic device, characterized in that: include: Processor, memory and touch screen; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the method for installing a common component according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method for installing a common component as claimed in any one of claims 1 to 10.
13. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is caused to execute the method for installing a common component according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for solving component version conflict and storage medium
CN115202714A
Application installation method and device, electronic equipment and machine readable storage medium
CN116301948A
Public dependency item management method for software construction and software construction method
CN116501377A
Dependence conflict processing method, medium, device and computing equipment
CN116680008A
Disk space optimization development method based on multi-project package sharing
CN117573146A
