Method for installing common components, electronic device and storage medium
By using version number determination and a core lock mechanism, the problem of conflicts in common components during software installation was resolved, resulting in a conflict-free installation process.
Patent Information
- Application Number
- CN202410940396.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-07-12
AI Technical Summary
During software installation, conflicts and errors can occur because different applications share common components.
By determining the version number of the public components being installed, it can identify which version of the component needs to be installed to avoid conflicts caused by simultaneous installation. This includes stopping the installation of lower version components, clearing related records and lock flags, and adding startup records and setting core locks in the registry.
This reduces conflicts and errors caused by installing common components simultaneously, ensuring smooth software installation.
Smart Images

Figure CN118885185B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software installation technology, specifically to a method for installing common components, an electronic device, and a storage medium. Background Technology
[0002] A computer is an electronic device capable of receiving, processing, storing, and outputting data. They accomplish these tasks by executing a series of instructions (called programs). Computers are widely used in various fields, including business, education, scientific research, and entertainment. The main components of a computer include hardware and software.
[0003] With the continuous development of information technology, more and more application software is emerging. During the installation process of some software, conflicts can occur due to different software sharing the same common components, leading to installation failures. Summary of the Invention
[0004] This application provides a method, electronic device, and storage medium for installing common components. When a first common component is about to be installed, it is determined whether a second common component is being installed. If a second common component is 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. This prevents conflicts caused by simultaneously installing the first and second common components, thereby reducing the likelihood of installation conflicts and errors due to the simultaneous installation of the same common component.
[0005] In some embodiments, a method for installing a common component is provided, comprising: 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; and installing the first common component or the second common component based on the first version number and the second version number.
[0006] The method for installing common components provided in this application determines whether a second common component is being installed when the first common component is about to be installed. If a second common component is 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 conflicts and errors caused by installing the first and second common components simultaneously.
[0007] Optionally, based on the first version number and the second version number, the installation of the first common component or the second common component includes: if 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, if the first version number is less than or equal to the second version number, continuing the installation of the second common component.
[0008] In this embodiment, the first version number and the second version number are used to determine whether the first public component or the second public component needs to be installed, so as to reduce conflicts and error problems caused by the simultaneous installation of the first public component and the second public component.
[0009] Optionally, after finishing the installation of the second common component, the method for installing the common component also includes: clearing the first record in the registry, which is the record for the second installation package to start automatically at boot; deleting the first core lock on the second common component, which is used to mark the status of the second common component as being installed, and the first core lock is set on the second common component when it is about to be installed.
[0010] In this embodiment, the installation process of the second public component is terminated by deleting the first record in the registry and deleting the first core lock on the second public component, so as to start the installation of the first public component.
[0011] Optionally, determining that a second common component is being installed includes: querying the first core lock; and if the first core lock exists, determining that a second common component is being installed.
[0012] In this embodiment, since the first core lock is 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 of installing the common component further includes: adding a second record to the registry, the second record being a record for the first installation package to start automatically at boot; and setting a second kernel lock on the first common component when it is about to be installed, the second kernel 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 automatically start the installation process of the first common component at boot. Furthermore, a second kernel lock is set on the first common component to mark it as being installed, thus facilitating the initiation of the installation process.
[0015] Optionally, obtaining the first version number of the first public component includes: obtaining the storage address of the first public component; searching for a target file within the storage address based on a first target character, wherein the filename of the target file includes a first target field and a first version number, and the first target field includes the common name of the first public component; and extracting the first version number from the filename of the target file.
[0016] In this embodiment, the version number of the first public component is determined by searching for the target file in the storage address of the first public component and using the file name of the target file.
[0017] Optionally, obtaining the storage address of the first common component includes: adding an address interface to the target executable file, the address interface being used to obtain the storage address of the first common component; the target executable file being used to install the common component; and obtaining the storage address of the first common component through the address interface when the first installation package begins installation.
[0018] In this embodiment, by setting an address interface in the target executable file, the storage address of the first common component sent by the installer of the first installation package is received through the address interface, thereby obtaining the storage address of the first common component and facilitating the determination of the version number of the first common component.
[0019] Optionally, obtaining the second version number of the second public component includes: searching the registry for the target process corresponding to the second public component based on the second target character, wherein the process name of the target process includes the second target field and the second version number, and the second target field is the common name of the second public 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 installer of the second public component, which is written to the registry before the installation begins. Furthermore, the process name of the target process includes a second target field and a second version number. Therefore, the second version number of the second public component can be determined by searching for the target process in the registry.
[0021] Optionally, determining which first common component will be installed includes: if the first installation package begins installation, the first common component will be installed.
[0022] In this embodiment, the node is designated as "the first common component to be installed" when the first installation package begins installation.
[0023] Optionally, if a first common component is to be installed and no other common component is being installed, the method for installing the common component may further include: installing the first common component.
[0024] In this embodiment, since there is no other public component being installed, directly installing the first public component will not cause an installation conflict, so the first public component can be installed directly.
[0025] In some embodiments, an electronic device is provided, including: a processor, a memory, and a touch screen; the memory stores program instructions that, when executed by the processor, cause the electronic device to perform a method for installing a common component as described in any of the above embodiments.
[0026] In some embodiments, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform a method for installing a common component as described in any of the above embodiments.
[0027] In some embodiments, a computer program product is provided that, when run on a computer, causes the computer to perform a method for installing common components as described in any of the above embodiments.
[0028] It is understood that the beneficial effects achieved by using the electronic devices, computer-readable storage media, and computer program products described in the above embodiments can be referenced to the beneficial effects of the method for installing common components and any possible implementation thereof, which will not be repeated here. Attached Figure Description
[0029] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of the display screen of the electronic device provided in the embodiments of this application;
[0031] Figure 2 A schematic diagram showing the display page of the installer of the software M installation package provided in this application embodiment;
[0032] Figure 3 A schematic diagram illustrating the software installation process with common components provided for embodiments of this application;
[0033] Figure 4 A schematic diagram illustrating common component installation conflicts provided in embodiments of this application;
[0034] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0035] Figure 6A schematic diagram illustrating the software installation process provided in this application embodiment;
[0036] Figure 7 A schematic diagram illustrating the installation process of installing only one common component, provided for an embodiment of this application;
[0037] Figure 8 A schematic diagram illustrating the installation process of common components that are installed simultaneously, provided for embodiments of this application;
[0038] Figure 9 A flowchart illustrating a method for installing a common component provided in an embodiment of this application;
[0039] Figure 10 A flowchart for installing the first installation package provided in an embodiment of this application;
[0040] Figure 11 A flowchart illustrating another method for installing a common component provided in an embodiment of this application;
[0041] Figure 12 The second common component provided in this application embodiment is a schematic diagram of the installation process for a higher version;
[0042] Figure 13 The second common component provided in this application embodiment is a schematic diagram of the installation process for a lower version;
[0043] Figure 14 This is a flowchart illustrating another method for installing a common component provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are all within the protection scope of this application.
[0045] In the following description, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0046] Furthermore, in this application, directional terms such as "upper," "lower," "inner," and "outer" are defined relative to the indicated placement of the components in the accompanying drawings. It should be understood that these directional terms are relative concepts, used for relative description and clarification, and can change accordingly depending on the placement of the components in the accompanying drawings.
[0047] To facilitate understanding of this application, some technical terms will be explained below.
[0048] Target executable file: An executable file used to install or pre-install an application or software. Specifically, it is part of a program in the system used to install software, responsible for performing preparatory work before installing the main program, such as checking the system environment, installing necessary components, or configuring the system. For example, in this embodiment, the target executable file is MBAInstallPre.exe.
[0049] Core locking refers to a mechanism for controlling access to specific resources or data in a multi-core processor or multi-threaded system. Its purpose is to prevent multiple threads or processes from simultaneously accessing and modifying shared resources, thereby avoiding race conditions and data inconsistency problems. Multithreaded programming: In multithreaded programs, different threads may access shared resources (such as variables, files, etc.). Core locks ensure that only one thread can access these resources at a time. Database management systems: In database systems, locking mechanisms are used to manage concurrent access to data, ensuring data consistency and integrity. Operating systems: Operating systems use various locking mechanisms to manage concurrent access to hardware resources and memory, ensuring system stability and security. Common core lock types include: mutexes, read-write locks, and spin locks. Mutexes ensure that only one thread can access a resource. Read-write locks allow multiple threads to read data simultaneously, but write operations exclusively occupy the resource. Spin locks are busy-waiting locks; threads continuously check for lock release instead of entering a sleep state. For example, in this application embodiment, the core lock is used to mark that a common component is being installed, and the core lock type is a mutex lock.
[0050] A computer is an electronic device capable of receiving, processing, storing, and outputting data. They accomplish these tasks by executing a series of instructions (called programs). Computers are widely used in various fields, including business, education, scientific research, and entertainment. Their main components include hardware and software. Hardware includes: a central processing unit (CPU), memory (RAM), storage devices, a motherboard, input devices, output devices, and a graphics processing unit (GPU). Software includes: an operating system (OS), application software, and drivers. The operating system manages hardware and software resources and provides a user interface. Examples include Windows, macOS, and 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, and games. Specifically, computers can be classified by form factor: desktop computers, laptops, tablets, and embedded systems. Embedded systems are computers integrated into other devices, such as smart home appliances and car navigation systems. Computers have a wide range of applications, including office work, entertainment, education, scientific research, business, and finance. The problem addressed by this application is that when software with the same common components is installed on a computer at the same time, conflicts and errors occur in the installation of these common components.
[0051] Common components in software refer to code libraries, modules, or functionalities that are shared and reused across multiple software systems or applications. These components are designed to improve development efficiency, reduce code duplication, and ensure consistency. Some common types of common components include: libraries, frameworks, APIs (Application Programming Interfaces), middleware, modules, plugins, microservices, and templates.
[0052] An installer package is an archive file containing software and all its necessary files, libraries, dependencies, and configurations. The format and content of installer packages may vary depending on the operating system and the type of software. Windows installer package formats include .exe and .msi.
[0053] An installer is an application responsible for extracting files from the installation package and copying them to the appropriate locations on the target system. The installer also performs necessary configuration steps to ensure the software functions correctly. These steps typically include: Unzipping and copying files: Unzipping the files in the installation package and copying them to the target folder. Registering components: Registering dynamic link libraries (DLLs) or shared libraries in the system, making them available to other software. Configuring environment variables: Setting system environment variables to ensure the software can find the necessary resources and dependencies. Creating shortcuts: Creating shortcuts on the desktop or Start menu for easy user access to the software. Updating the registry: Writing the software's configuration information and settings to the registry. Verifying dependencies: Checking and installing the dependencies required for the software to run (such as specific versions of Java, .NET Framework, etc.). User interaction: Interacting with the user through a graphical or command-line interface to obtain necessary information such as the installation path and configuration options.
[0054] The following are the steps for installing the installation package:
[0055] Launching the Installer: The user double-clicks the installation package to launch the installer. The installer typically provides a graphical user interface (GUI) or command-line interface (CLI) to guide the user through the installation process. Unzipping and Checking: The installer first unzips the installation package and checks its integrity and validity, ensuring no corrupted or missing files. Copying Files: The installer copies files from the installation package to the target directory. These files include executable files, configuration files, library files, etc. Configuring the System: The installer configures the system as needed, such as setting environment variables, registering components, and updating the registry. Creating Shortcuts and Menu Items: The installer creates necessary shortcuts and menu items for easy user access to and use of the software. Installation Complete: After completing all steps, the installer displays a message indicating successful installation and may provide options to launch the software.
[0056] For example, let's take installing 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, which the user reads and agrees to before continuing. Select installation path: The user selects the target directory for software installation. Copy files: The installer copies the software files to the target directory. Configure the system: The installer may write necessary configuration information to the registry, set environment variables, etc. Create shortcut: Creates a shortcut to the software on the desktop or Start menu. Installation complete: The installer displays a message indicating successful installation, and the user can choose to launch the software immediately.
[0057] To facilitate understanding of the technical solution of this application, the background technology of this application is explained 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, and then 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 begun to become widespread. Today, computers are developing in new directions such as artificial intelligence and quantum computing, continuously improving their computing power and intelligence.
[0059] With the gradual development of computers, the types of application software have also increased. In order to improve the development efficiency of application software, reduce duplicate code, and ensure consistency, application software development based on common components has begun.
[0060] As technology evolves, the content of common components is also updated. Different application software installation packages may use different versions of common components. If two application software programs installed at the same time have the same common components, an error will occur, resulting in the software installation failure.
[0061] When two installers containing the same common components are installed, potential conflicts can arise, including file overwriting conflicts, version incompatibility, configuration file conflicts, and registry conflicts. File overwriting conflicts occur when two installers attempt to install the same files in the same location; one package might overwrite the other's files, causing existing functionality to malfunction. Version incompatibility occurs when the two installers contain different versions of common components, potentially causing the application to malfunction due to dependencies on different versions of components. This is common in conflicts involving dynamic link libraries (DLLs) and shared libraries. Configuration file conflicts occur when common components may depend on the same configuration file. If two installers attempt to modify the same configuration file, it can lead to configuration errors and affect application performance. Registry conflicts occur when common components may create identical keys or values in the registry. If two installers modify the same registry key, it can cause system or application instability.
[0062] Therefore, this 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 method determines the common components that need to be installed based on the version of the common components, without causing errors, so that the software can be installed normally and the user experience can be improved.
[0063] Figure 1This is a schematic diagram of the display screen of the electronic device provided in the embodiments of this application.
[0064] Combination Figure 1 As shown, the icons displayed on the screen 101 of the electronic device include: installation package 102 for software M, installation package 103 for software N, This PC 104, Recycle Bin 105, Control Panel 106, Start Menu 107, and Time 108. Among these, installation package 102 for software M and installation package 103 for software N share the same common component.
[0065] Figure 2 This is a schematic diagram of the display page of the installer of the software M installation package provided in the embodiments of this application.
[0066] Combination Figure 2 As shown, after clicking the installation package to open the installer, the display page shows the application software name "M" 109, User Agreement 1 110, User Agreement 2 111, "Quick Install" option 112, and "Custom Install" option 113, as well as a first checkbox 114 to the left of User Agreement 1 110 and a second checkbox 115 to the left of User Agreement 2 111. Specifically, the top edge of the installer's display page also has function keys "Minimize" 116, "Maximize" 117, and "Close" 118.
[0067] Figure 3 This is a schematic diagram illustrating the software installation process with common components provided in an embodiment of this application.
[0068] The following combination Figure 3 Taking the installation process of software M's installation package 102 as an example, the installation process of software with common components will be explained in detail. The application software corresponding to software M's installation package 102 is named M. Figure 3 The images shown are those displayed on the screen of an electronic device. Specifically, the installation process and images of software with common components provided in the embodiments of this application are merely illustrative and do not limit the specific installation process.
[0069] Combination Figure 3 As shown in (a), open the installation package 102 of software M on the desktop 101 of the electronic device, start the installer of the installation package 102 of software M to install 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 restrict this. Furthermore, the installation package of the application software can be opened by right-clicking the installation package and then clicking "Open," or by double-clicking the installation package with the left mouse button; this application does not restrict this either.
[0071] It should be understood that the pages shown below are displayed on the screen of an electronic device. Figure 3 In (b), (c), (d), (e), (f), and (g), no other content displayed on the monitor is shown; only the display page of the installation program is shown.
[0072] After launching the application software installer, the following is displayed: Figure 3 The image shown in (b) is combined with... Figure 3 As shown in (b), after the installer is opened, it displays as follows: Figure 2 As shown in the screenshot, both the "Quick Install" option 112 and the "Custom Install" option 113 are currently unclickable (meaning clicking either option 112 or 113 will not lead to the next page). After the user selects to check User Agreement 1 and User Agreement 2 (i.e., after clicking the first checkbox 114 and the second checkbox 115, a checkmark appears in both boxes 114 and 115), the "Quick Install" option 112 and the "Custom Install" option 113 become clickable, resulting in the following screen. Figure 3 The screen shown in (c) is shown in the image. Specifically, users can also click on User Agreement 1 110 to view the content of User Agreement 1, and can click on User Agreement 2 111 to view the content of User Agreement 2.
[0073] After the user selects "Quick Installation" 112, the process will proceed as follows: Figure 3 The screen shown in (d) displays M being installed, along with an installation progress bar of 119 and an installation progress percentage of 120. When the installation progress percentage of 120 reaches 100%, the following is displayed: Figure 3 The screen shown in (e) indicates that the installation package 102 of software M has been installed, that is, software M has been installed, and the basic settings options for software M (including adding startup 121, a third checkbox 123 to confirm whether to add startup, adding shortcut in the shortcut bar 122, a fourth checkbox 124 to confirm whether to add shortcut in the shortcut bar, and the "Quick Startup" option 125).
[0074] After the user selects "Custom Installation," the page allows them to choose the software's installation location (e.g., ...). Figure 3 (as shown in screen (f)). After making your selections, click "Next" option 127 to proceed to the page for selecting the functional components you wish to install (such as...). Figure 3 (The screen shown in (g)). After selecting the installation location and / or functional components, click as shown in (g). Figure 3 The "Install" 130 on the page shown in (g) leads to... Figure 3 The screen shown in (d) displays that M is being installed, along with an installation progress bar and the installation progress percentage. When the installation progress percentage reaches 100%, the following will be displayed: Figure 3 The image shown in (e) is shown in the middle.
[0075] Specifically, after the user selects "Quick Install" 112 or "Install" 130, the common components of software M begin to be installed.
[0076] Furthermore, before installation begins, the common components of software M write their startup records to the registry to prevent unexpected termination of the installation process due to electronic device malfunction, thus ensuring a successful installation. After installation, the registry is cleaned up (i.e., the startup records of the software M installation process are deleted), and the names of the common components contain the version number of software M. The startup records of the software M installation process written to the registry include the startup records of the common components within the software M installation package. Therefore, the version number of the common components of software M can be determined by querying the registry to identify the process corresponding to the software M installation package's installation process.
[0077] The registry is an important database in the operating system, used to store configuration information for the system and applications.
[0078] At the same time, before the common components of software M begin installation, a core lock is set on the common components of software M to mark that a common component is being installed at this time.
[0079] Figure 4 This is a schematic diagram illustrating a common component installation conflict provided in an embodiment of this application.
[0080] The following combination Figure 4 Explain in detail how the technical problem occurred.
[0081] Combination Figure 4 As shown in (a), the display screen of the electronic device shows a first installation package 201 and a second installation package 202. The first installation package 201 is the installation package for the first software, and the second installation package 202 is the installation package for the second software. Clicking on the first installation package 201 and the second installation package 202 with the mouse will display the first installation program page 203 for the first installation package 201 and the second installation program page 204 for the second installation package 202 on the desktop, respectively. Taking the quick installation method for both the first installation package 201 and the second installation package 202 as an example, after clicking the quick installation 205 on the first installation program page 203, the first installation package 201 enters the installation process (the installation process interface 207 of the first installation package 201 appears). At this time, the second installation package 202 is not being installed. Figure 4 As shown in (b). After clicking the quick install 206 on page 204 of the second installer, the second installer package 202 also enters the installation process (the installation process interface 208 of the second installer package 202 appears), as shown. Figure 4 As shown in (c). Both the first common component of the first installation package 201 and the second common component of the second installation package 202 need to be installed. When both the first and second common components are installed, a conflict occurs between the installation processes of the first and second common components, resulting in an error (error message 209). Figure 4 As shown in (d).
[0082] In summary, when software with the same common components (installation packages containing the same common components) are installed simultaneously, installation conflicts can occur, leading to errors. Therefore, this application provides a method for installing common components to reduce the problems of installation conflicts and errors that arise when the same common components are installed simultaneously.
[0083] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0084] This application provides an electronic device 100, which can be a desktop computer, laptop computer, tablet computer, or embedded system with a Windows system.
[0085] 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, a headphone jack 170D, buttons 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0086] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0087] It should be understood that the components included in electronic device 100 vary depending on the type of electronic device 100. For example, if electronic device 100 is a desktop computer, it does not include antenna 1 and antenna 2, while if electronic device 100 is a tablet computer, it includes antenna 1 and antenna 2.
[0088] The processor 110 communicates with the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via a UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via a UART interface to enable music playback via Bluetooth headphones.
[0089] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0090] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an 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] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0092] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0093] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0094] The power management module 141 connects 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, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0095] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[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 one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0097] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0098] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates 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 processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0099] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0100] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0101] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0102] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0103] In this embodiment, the display panel of the display screen 194 is used to display, such as Figure 3 neutralization Figure 4 All the scenes in the video.
[0104] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0105] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0106] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0107] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0108] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0109] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0110] The external storage 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 storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0111] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0112] The target executable file used in this embodiment is stored in the internal memory 121.
[0113] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0114] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0115] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.
[0116] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0117] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0118] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0119] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0120] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0121] In this embodiment, the software to be installed is referred to as the first software, and the installation package of the first software is called the first installation package. The first installation package contains a first common component. The software being installed is referred to as the second software, and the installation package of the second software is called the second installation package. The second installation package contains a second common component. The first common component and the second common component are the same common component, but their versions may be the same or different.
[0122] In this embodiment, when a first public component is about to be installed, it is determined whether a second public component is being installed. If a second public component is being installed, it is necessary to determine which public component needs to be installed based on the first version number of the first public component and the second version number of the second public component, to prevent conflicts caused by installing the first and second public components simultaneously.
[0123] For example, in conjunction with the above regarding Figure 3 The following explanation uses software M as an example. When installing the installation package of software M, it is necessary to first confirm whether other software (software with the same common components) is installing its common components. If other software (software with the same common components) is installing its common components, it is necessary 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 numbers of the common components of software M and the version numbers of the common components of other software (software with the same common components).
[0124] Specifically, the node can be set to "The first common component will be installed" during the installation process from the start of the first software installation to the installation of the first common component in the first software.
[0125] For example, combined Figure 3 As shown, taking the installation of software M as the first software as an example, the node "The first common component will be installed" is explained. This occurs when the user opens the installation package 102 of software M. Figure 3 As shown in (a), when a user clicks the icon for "Installation Package of Software M" to open the installer for the first software, it appears as a node labeled "First Common Component to be Installed". Alternatively, the page is... Figure 3 In section (b), when the user selects Protocol 1 and / or Protocol 2, it is displayed as a node for "The first common component will be installed". Alternatively, the page is... Figure 3 In section (c), when the user clicks the "Quick Install" option 112, it becomes the node for "Installing the first common component". Alternatively, the page is... Figure 3In section (c), when the user clicks the "Custom Installation" option 113, it becomes the node for "Installing the first common component". Alternatively, the page is... Figure 3 In section (e), when the user selects the installation location (i.e., clicks the "Find File Location" button 126), it becomes the node for "Installing the First Common Component". Alternatively, the page is... Figure 3 In section (g), when the user selects the functional components to be installed (i.e., clicks on functional component 1 128 and / or functional component 2 129), it serves as the node for "Installing the First Common Component". Alternatively, the page is... Figure 3 In the middle (d), when the next component to be installed during the installation of the first installation package is the first common component, it is designated as the node "to be installed the first common component".
[0126] Specifically, after an update, the version number of the same common component increases, but it may have more functions. Installing a higher version of the common component can ensure the normal operation of the software corresponding to both the first and second installation packages. Therefore, this embodiment of the application identifies the common component with the highest version number between the first and second common components and installs it.
[0127] Figure 6 This is a schematic diagram of the software installation process provided in an embodiment of this application.
[0128] The following combination Figure 6 The method for installing common components provided in the embodiments of this application will be described by way of example.
[0129] Combination Figure 6 As shown, the method for installing common components provided in this application includes steps S601 to S608. The subject executing this method can be an electronic device, as detailed below:
[0130] Step S601: Begin installing the first installation package.
[0131] Step S602 involves installing the first common component.
[0132] Step S603: Check if a second common component is being installed. If no second common component is being installed, proceed to step S604. If a second common component is being installed, proceed to step S605.
[0133] Step S604: Install the first common component.
[0134] Step S605: Obtain the first version number of the first public component and the second version number of the second public 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: Install the second common component.
[0137] Step S608: Finish installing the second common component and install the first common component.
[0138] After double-clicking the first installation package to open its installer, you will reach the node where you will install the first common component. This step checks if a second common component is currently being installed to reduce conflicts and errors that might occur if both components are installed simultaneously. If no second common component is being installed, installing the first common component will not cause a conflict, so you can install it directly. If a second common component is being installed, installing the first common component will cause a conflict, so you must choose to install either the first or the second common component.
[0139] Furthermore, by obtaining the first version number of the first common component and the second version number of the second common component, a comparison between the first and second version numbers is used to determine whether to install the first or second common component. Since the common component with the higher version number has better functionality, the second common component is installed if the first version number is less than or equal to the second version number. If 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 This is a schematic diagram illustrating the installation process of installing only one common component, as provided in an embodiment of this application.
[0141] For example, combined 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 common component enters the installation (step S702). After the installation of the second common component is completed (step S703), the remaining parts in the second installation package are installed. 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 This is a schematic diagram illustrating the installation process of common components that are installed simultaneously, as provided in an embodiment of this application.
[0143] Combination Figure 8As shown, after selecting to install the second installation package (step S801), the installation program for the second installation package is entered, thus beginning the installation of the second common component. While the second common component is being installed (step S802), and the node for installing the first common component is reached (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 or second common component needs to be installed, and thus install the corresponding first or second common component (step S805). This reduces conflicts and error issues caused by the simultaneous installation of the first and second common components.
[0144] Figure 9 This is a flowchart illustrating a method for installing a common component, as provided in an embodiment of this application.
[0145] Combination Figure 9 As shown, the method for installing common components provided in this application includes steps S100 and S200. The subject executing this method can be an electronic device, as detailed below:
[0146] Step S100: When the first public component is about to be installed and the second public component is being installed, obtain the first version number of the first public component and the second version number of the second public component; the first public component and the second public component are the same or different versions of the same public component, the first public component is located in the first installation package, the second public component is located in the second installation package, and the first installation package and the second installation package are installation packages of different applications.
[0147] In this step, since installing installation packages containing the same common components at the same time can cause installation conflicts and errors, it is necessary to obtain the version numbers of the first and second common components 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 a second common component is being installed includes steps S101 and S102, as follows:
[0149] Step S101: Query the first core lock.
[0150] Step S102: If the first core lock is present, determine that the second common component is being installed.
[0151] Specifically, the first core lock is set on the second common component when it is about 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 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 the first core lock flag.
[0154] Optionally, determining that a second public component is being installed includes: querying the registry; if a first record exists in the registry, determining that a second public component is being installed.
[0155] Specifically, the first record is a record written to the registry when the installation of the second installation package begins. This first record is used to activate the automatic startup of the second installation package's installation process at boot, preventing the installation process from unexpectedly terminating due to electronic device malfunction during the installation process, thus causing installation failure. Furthermore, the first record in the registry must be deleted if the installation of the second installation package is stopped or completed.
[0156] Since the second installation package includes the second common component, the first record also includes the startup record of the second common component.
[0157] In this embodiment, if a first record exists in the registry, it proves that a second public component is being installed. This confirms the existence of a second public component being installed.
[0158] Optionally, determining which first common component will be installed includes: if the first installation package begins installation, the first common component will be installed.
[0159] In this embodiment, the node is designated as "the first common component to be installed" when the first installation package begins installation.
[0160] For example, double-clicking to open the first installation package is considered the start of the installation process, i.e., it marks the node "First common component to be installed". Alternatively, selecting Protocol 1 and / or Protocol 2 is considered the start of the installation process, i.e., it marks the node "First common component to be installed". Alternatively, clicking the "Quick Install" option is considered the start of the installation process, i.e., it marks the node "First common component to be installed". Alternatively, clicking the "Custom Install" option is considered the start of the installation process, i.e., it marks the node "First common component to be installed". Alternatively, selecting the installation location (i.e., clicking the "Find File Location" button) is considered the start of the installation process, i.e., it marks the node "First common component to be installed". Alternatively, selecting the functional components to be installed (i.e., selecting Functional Component 1 and / or Functional Component 2) is considered the start of the installation process, i.e., it marks the node "First common component to be installed". Alternatively, during the installation of the first installation package, any point in time before the next component to be installed is the first common component can be considered as the start of the installation of the first installation package, i.e., a node "about to install the first common component".
[0161] Optionally, obtaining the first version number of the first public component includes steps S103 to S105, as follows:
[0162] Step S103: Obtain the storage address of the first public component.
[0163] Optionally, obtaining the storage address of the first common component includes: adding an address interface to the target executable file, the address interface being used to obtain the storage address of the first common component; the target executable file being used to install the common component; and obtaining the storage address of the first common component through the address interface when the first installation package begins installation.
[0164] In this embodiment, by setting an address interface in the target executable file, the storage address of the first common component sent by the installer of the first installation package is received through the address interface, thereby obtaining the storage address of the first common component and facilitating the determination of the version number of the first common component.
[0165] Specifically, the target executable file (i.e., MBAInstallPre.exe) is an executable file used to install or pre-install an application or software. In other words, it is responsible for performing preparatory work in the system before installing the main program, such as checking the system environment, installing necessary components, or configuring the system.
[0166] Figure 10 A flowchart for installing the first installation package provided in an embodiment of this application.
[0167] Specifically, in combination Figure 10As shown, when the first common component is about 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 uses the target executable file to confirm the first version number of the first common component and install the first common component (step S2). Further, the installation process of the first installation package begins installing the first common component in 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 in step S4.
[0168] Step S104: Locate the target file in the storage address based on the first target character. The file name of the target file includes the first target field and the first version number. The first target field includes the common name of the first common component.
[0169] For example, the first target field is “BasicService”, the target file name is “BasicService18.0”, and the first version number is 18.0.
[0170] Step S105: Extract the first version number from the filename of the target file.
[0171] In this embodiment, the version number of the first public component is determined by searching for the target file in the storage address of the first public component and using the file name of the target file.
[0172] Optionally, obtaining the first version number of the first public component further includes: printing a first error log if obtaining the storage address of the first public component fails, or if searching for the target file within the storage address fails, or if extracting the first version number from the filename of the target file fails.
[0173] In this embodiment, printing a first error log helps to understand the cause of the installation error, thereby facilitating the adjustment of the first installation package and making it easier to install the first and second installation packages successfully at the same time.
[0174] Optionally, obtaining the second version number of the second public component includes steps S106 and S107, as follows:
[0175] Step S106: Based on the second target character, search for the target process corresponding to the second public component in the registry. The process name of the target process includes the second target field and the second version number. The second target field is the common name of the second public component.
[0176] For example, 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: Extract 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 installer of the second public component, which is written to the registry before the installation begins. Furthermore, the process name of the target process includes a second target field and a second version number. Therefore, the second version number of the second public component can be determined by searching for the target process in the registry.
[0179] Optionally, obtaining the second version number of the second public component further includes: printing a second error log if the search for the target process corresponding to the second public component fails, or if the extraction of the second version number from the process name of the target process fails.
[0180] In this embodiment, printing a second error log helps to understand the cause of the installation error, thereby facilitating registry adjustments and enabling the first and second installation packages to be installed successfully simultaneously.
[0181] Step S200: Based on the first version number and the second version number, install the first public component or the second public component.
[0182] In this step, the installation of the first or second common component is determined based on the first and second version numbers, in order to reduce conflicts and errors caused by installing the first and second common components at the same time.
[0183] Figure 11 This is a flowchart illustrating another method for installing a common component provided in an embodiment of this application.
[0184] Optionally, combined Figure 11 As shown, based on the first version number and the second version number, the first common component or the second common component is installed, including steps S201 and S202, as follows:
[0185] Step S201: If 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 completing the installation of the second common component, the method for installing the common component further includes steps S2011 and S2012, as follows:
[0187] Step S2011: Clear the first record in the registry. The first record is the record for the second installation package to start automatically on boot.
[0188] In this step, the first record is a record written to the registry when the installation of the second installation package begins. This first record is used to wake up the startup of the installation process of the second installation package. Since the second installation package includes the second common component, the first record also includes the startup record of the second common component.
[0189] Step S2012: Delete the first core lock on the second common component. The first core lock is used to mark the status of the second common component as being installed. The first core lock is set on the second common component when it is about to be installed.
[0190] In this embodiment, the installation process of the second public component is terminated by deleting the first record in the registry and deleting the first core lock on the second public component, so as to start the installation of the first public component.
[0191] Optionally, if 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 steps S2013 and S2014, as follows:
[0193] Step S2013: Add a second record to the registry. The second record is the record for the first installation package to start automatically on boot.
[0194] In this step, the second record is a record written to the registry when the first installation package is started. This second record is used to wake up the boot startup of the installation process of the first installation package. Since the first installation package includes the first common component, the second record also includes the boot startup record of the first common component.
[0195] In step S2014, when the first common component is about to be installed, a second core lock is set on the first common component. 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 automatically start the installation process of the first common component at boot. Furthermore, a second kernel lock is set on the first common component to mark it as being installed, thus facilitating the initiation of the installation process.
[0197] Optionally, if adding a second record to the registry fails, a fourth error log is printed.
[0198] Step S202: If the first version number is less than or equal to the second version number, continue installing the second common component.
[0199] In this embodiment, the first version number and the second version number are used to determine whether the first public component or the second public component needs to be installed, so as to reduce conflicts and error problems caused by the simultaneous installation of the first public component and the second public component.
[0200] Figure 12 The second common component provided in this application embodiment is a schematic diagram of the installation process for a higher version.
[0201] Combination Figure 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. The version number of the second common component being installed is higher. During the installation of the second installation package, the installation process of the second common component is established through step S5, that is, the installation of the second common component with version number 18.1 begins. Simultaneously, during the installation of the first installation package, the installation process of the first common component is established through step S6, that is, the installation of the first common component with version number 18.0 begins. At this point, by combining the first version number of the first common component and the second version number of the second common component, it is determined that the target common component to be installed is the second common component with a higher version number. Therefore, the installation of the first common component is canceled through step S7, and the installation of the second common component is carried out through step S8. After the installation of the second common component is completed, the version information of the installed second common component is returned to the installation processes of the second installation package and the first installation package through step S9.
[0202] Figure 13 The second common component provided in this application embodiment is a schematic diagram of the installation process for a lower version.
[0203] Combination Figure 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. 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 through step S10, that is, the installation of the second common component with version number 18.0 begins. At the same time, during the installation of the first installation package, the installation process of the first common component is established through step S11, that is, the installation of the first common component with version number 18.1 begins. At this time, the first version number of the first common component and the second version number of the second common component are combined to determine that the target common component to be installed is the second common component with a higher version number. Then, the installation of the second common component is canceled through step S12, and the first common component is installed through 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 through step S14.
[0204] Optionally, if the first common component is about to be installed, and no common component is currently being installed, the method for installing the common component further includes step S300:
[0205] Step S300: Install the first common component.
[0206] In this embodiment, since there is no other public component being installed, directly installing the first public component will not cause an installation conflict, so the first public component can be installed directly.
[0207] The method for installing common components provided in this application determines whether a second common component is being installed when the first common component is about to be installed. If a second common component is 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 conflicts and errors caused by installing the first and second common components simultaneously.
[0208] Figure 14 This is a flowchart illustrating another method for installing a common component provided in an embodiment of this application.
[0209] Combination Figure 14 As shown, another method for installing a common component provided in this application embodiment includes steps S1401 to S1422. The subject executing this method can be an electronic device, as detailed below:
[0210] Step S1401: Begin installing the first installation package.
[0211] Step S1402 involves installing the first common component.
[0212] Step S1403: Query the first core lock.
[0213] Step S1404: If the first core lock is present, determine that the second common component is being installed.
[0214] Step S1405: If the first core lock does not exist, directly install the first common component.
[0215] Step S1406: When the first public component is about to be installed and the second public component is being installed, obtain the storage address of the first public component.
[0216] Step S1407: Locate the target file in the storage address based on the first target character. The file name of the target file includes the first target field and the first version number. The first target field includes the common name of the first common component.
[0217] Step S1408: Extract the first version number from the filename of the target file.
[0218] Step S1409: If it fails to obtain the storage address of the first common component, or fails to find the target file in the storage address, or fails to extract the first version number from the filename of the target file, print the first error log.
[0219] Step S1410: Based on the second target character, search for the target process corresponding to the second public component in the registry. The process name of the target process includes the second target field and the second version number. The second target field is the common name of the second public component.
[0220] Step S1411: Extract the second version number from the process name of the target process.
[0221] Step S1412: If the search for the target process corresponding to the second common component fails, or if the extraction of the second version number from the process name of the target process fails, print the second error log.
[0222] The implementation details and effects of the above steps S1401 to S1412 correspond to step S100 in the above embodiments.
[0223] Step S1413: Determine whether the first version number is greater than the second version number.
[0224] Step S1414: If the first version number is greater than the second version number, end the installation of the second common component.
[0225] Step S1415: Clear the first record in the registry. The first record is the record for the second installation package to start automatically on boot.
[0226] Step S1416: Delete the first core lock on the second common component. The first core lock is used to mark the status of the second common component as being installed. The first core lock is set on the second common component when it is about to be installed.
[0227] In step S1417, if clearing the first record in the registry fails, print the third error log and remove the first core lock on the second public component.
[0228] Step S1418: Add a second record to the registry. The second record is the record for the first installation package to start automatically on boot.
[0229] Step S1419: When the first common component is about to be installed, a second core lock is set on the first common component. The second core lock is used to mark the status of the first common component as being installed.
[0230] In step S1420, if adding the second record to the registry fails, print the fourth error log.
[0231] Step S1421: Install the first common component.
[0232] Step S1422: If the first version number is less than or equal to the second version number, continue installing the second common component.
[0233] The implementation details and effects of the above steps S1413 to S1422 correspond to step S200 in the above embodiments.
[0234] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on the electronic device, they cause the electronic device to perform various functions or steps performed by the electronic device in the method for installing common components.
[0235] This application also provides a computer program product that, when run on a computer, causes the computer to perform various functions or steps performed by the electronic device in the above-described method for installing common components.
[0236] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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 readily understood that, based on the several embodiments provided in this application, those skilled in the art can combine, split, or reorganize the embodiments of this application to obtain other embodiments, none of which exceed the protection scope of this application.
[0238] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0239] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0240] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0241] If the integrated unit is implemented as 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 solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0242] It should be noted that those skilled in the art, upon considering the specification and practicing the application disclosed herein, will readily conceive of other embodiments of this application. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope of this application is indicated by the claims.
[0243] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method of installing a common component, characterized by, The application comprises the following steps: In the case that a first common component is about to be installed and a second common component is being installed, a first version number of the first common component and a second version number of the second common component are obtained; 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 application programs; a first core lock is arranged on the second common component, and the first core lock is used to mark the state of the second common component as being installed, and the first core lock is arranged on the second common component when the second common component is about to be installed; Based on the first version number and the second version number, the first common component or the second common component is installed; The second common component being installed is determined, comprising the following steps: The first core lock is inquired; In the case that the first core lock exists, it is determined that the second common component is being installed; Before the first common component is installed, the following steps are further included: A second record is added in a registry, and the second record is a record of the first installation package starting automatically at startup; When the first common component is about to be installed, a second core lock is arranged on the first common component, and the second core lock is used to mark the state of the first common component as being installed; The second version number of the second common component is obtained, comprising the following steps: based on a second target character, a target process corresponding to the second common component is found in a registry, the process name of the target process comprises a second target field and a second version number, and the second target field is the general name of the second common component; and the second version number in the process name of the target process is extracted.
2. The method of installing a common assembly of claim 1, wherein, The first common component or the second common component is installed based on the first version number and the second version number, comprising the following steps: In the case that the first version number is greater than the second version number, the installation of the second common component is ended, and the first common component is installed; Or, In the case that the first version number is less than or equal to the second version number, the installation of the second common component is continued.
3. The method of installing a common assembly of claim 2, wherein, After the installation of the second common component is ended, the following steps are further included: A first record in a registry is cleared, and the first record is a record of the second installation package starting automatically at startup; The first core lock on the second common component is deleted.
4. The method of installing a common assembly of claim 1, wherein, The first version number of the first common component is obtained, comprising the following steps: The storage address of the first common component is obtained; Based on a first target character, a target file is found in the storage address, the file name of the target file comprises the first target character and a first version number, and the first target character comprises the general name of the first common component; The first version number in the file name of the target file is extracted.
5. The method of installing a common assembly of claim 4, wherein, The storage address of the first common component is obtained, comprising the following steps: An address interface is added in a target executable file, the address interface is used to obtain the storage address of the first common component, and the target executable file is used to install a common component; When the first installation package starts to install, the storage address of the first common component is obtained through the address interface.
6. The method of installing a common assembly of claim 1, wherein, The first common component to be installed is determined, comprising: In the case that the first installation package starts to install, the first common component is to be installed.
7. The method of installing a common assembly of claim 1, wherein, In the case that the first common component is to be installed and there is no common component being installed, the method for installing common components further comprises: The first common component is installed.
8. An electronic device, comprising: Comprise: A processor, a memory and a touch screen; The memory stores program instructions, when the program instructions are executed by the processor, the electronic device executes the method for installing common components as claimed in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, Comprise computer instructions, when the computer instructions run on an electronic device, the electronic device executes the method for installing common components as claimed in any one of claims 1 to 7.
10. A computer program product, characterised in that, When the computer program product runs on a computer, the computer executes the method for installing common components as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Application installation method and device, electronic equipment and machine readable storage medium
CN116301948A