CN116775084B - System upgrade methods and electronic equipment - Google Patents
System upgrade methods and electronic equipment Download PDFInfo
- Publication number
- CN116775084B CN116775084B CN202311062410.4A CN202311062410A CN116775084B CN 116775084 B CN116775084 B CN 116775084B CN 202311062410 A CN202311062410 A CN 202311062410A CN 116775084 B CN116775084 B CN 116775084B
- Authority
- CN
- China
- Prior art keywords
- installation
- upgrade
- target
- business module
- system upgrade
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000009434 installation Methods 0.000 claims abstract description 521
- 238000004590 computer program Methods 0.000 claims description 10
- 230000004044 response Effects 0.000 claims description 6
- 238000004891 communication Methods 0.000 claims description 3
- 238000001514 detection method Methods 0.000 claims 2
- 230000006870 function Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 238000011900 installation process Methods 0.000 description 9
- 230000006837 decompression Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种系统升级的方法及电子设备。The present application relates to the field of computer technology, and in particular, to a system upgrade method and electronic equipment.
背景技术Background technique
终端设备中通常需要安装系统才能被用户使用,例如,手机中安装有安卓系统、iOS系统等。终端设备可以向服务器发送搜包请求,服务器响应于搜包请求,搜索是否存在到参数、hota或补丁类型的系统升级安装包,并向终端设备返回搜包结果。终端设备接收该搜包结果,若终端设备根据搜包结果确定搜包成功,该终端设备可以从服务器获取搜索到的系统升级安装包并安装新版本的系统升级安装包。Terminal devices usually need to install a system before they can be used by users. For example, mobile phones are equipped with Android systems, iOS systems, etc. The terminal device can send a packet search request to the server. The server responds to the packet search request, searches for whether there is a system upgrade installation package of parameter, hota or patch type, and returns the packet search result to the terminal device. The terminal device receives the packet search result. If the terminal device determines that the packet search is successful based on the packet search result, the terminal device can obtain the searched system upgrade installation package from the server and install a new version of the system upgrade installation package.
然而,若终端设备同时安装参数版本的系统升级安装包和hota版本的系统升级安装包,或者同时安装参数版本的系统升级安装包和补丁版本的系统升级安装包,会出现安装冲突的问题,例如,终端设备安装补丁类型的系统升级安装包的过程中,终端设备会接收到参数版本的系统升级安装包安装成功或失败的消息、终端设备中与参数对应的解压接口被多次调用的问题。However, if the terminal device installs the parametric version of the system upgrade installation package and the hota version of the system upgrade installation package at the same time, or installs the parametric version of the system upgrade installation package and the patch version of the system upgrade installation package at the same time, installation conflicts will occur, for example During the process of installing a patch-type system upgrade installation package on a terminal device, the terminal device will receive a message indicating whether the installation of the parameter version of the system upgrade installation package is successful or failed, and the decompression interface corresponding to the parameter in the terminal device is called multiple times.
发明内容Contents of the invention
为了解决上述技术问题,本申请提供一种系统升级的方法及电子设备,使得电子设备同时安装参数类型的系统升级安装包和补丁类型(或hota类型)的系统升级安装包时,可以避免出现安装混乱的问题,同时电子设备可以及时安装参数类型的系统升级安装包,提高电子设备的性能。In order to solve the above technical problems, this application provides a system upgrade method and electronic equipment, so that when the electronic equipment simultaneously installs a parameter type system upgrade installation package and a patch type (or hota type) system upgrade installation package, installation can be avoided. To solve the problem of confusion, electronic equipment can promptly install parameter-type system upgrade installation packages to improve the performance of electronic equipment.
第一方面,本申请提供一种系统升级的方法,包括:系统更新应用检测到系统升级指令,为本次待安装的目标系统升级安装包分配第一连接,第一连接用于系统更新应用的第一业务模块与升级引擎服务通信;第一业务模块通过第一连接实时接收升级引擎服务发送的升级引擎服务的状态;在本次安装的生命周期内,第一业务模块允许使用接收的升级引擎服务的状态;若升级引擎服务的状态为可用状态,第一业务模块根据升级引擎服务的状态和目标安装标识,生成安装指示并发送至升级引擎服务,目标安装标识用于指示当前的业务模块是否调用升级引擎服务中的目标安装接口,目标安装接口为与目标系统升级安装包的类型对应的安装接口;升级引擎服务响应于安装指示,安装目标系统升级安装包;第一业务模块若确定本次安装结束,标记本次安装的生命周期结束并断开第一连接。In a first aspect, this application provides a system upgrade method, which includes: a system update application detects a system upgrade instruction, and allocates a first connection to the target system upgrade installation package to be installed this time. The first connection is used for the system update application. The first business module communicates with the upgrade engine service; the first business module receives the status of the upgrade engine service sent by the upgrade engine service in real time through the first connection; within the life cycle of this installation, the first business module allows the use of the received upgrade engine The status of the service; if the status of the upgrade engine service is available, the first business module generates an installation instruction based on the status of the upgrade engine service and the target installation ID and sends it to the upgrade engine service. The target installation ID is used to indicate whether the current business module Call the target installation interface in the upgrade engine service. The target installation interface is the installation interface corresponding to the type of the target system upgrade installation package; the upgrade engine service responds to the installation instructions and installs the target system upgrade installation package; if the first business module determines that this The installation ends, marking the end of the life cycle of this installation and disconnecting the first connection.
这样,系统更新应用为本次待安装的目标系统升级安装包分配对应的连接(即第一连接),当第一连接建立后,第一业务模块实时接收到升级引擎服务发送的状态,而本示例中该第一业务模块在本次安装的生命周期内,允许使用升级引擎服务的状态,可以避免从第一业务模块执行断开第一连接的操作到第一连接断开的时段内,该第一业务模块使用接收到的升级引擎服务的状态而导致出现安装错误、混乱的问题;由于目标安装标识可以指示当前的业务模块是否调用升级引擎服务中的目标安装接口,通过新增目标安装标识,可以丰富第一业务模块判断是否指示升级引擎服务本次安装该目标系统升级安装包的信息,使得第一业务模块可以准确判断出该升级引擎服务的安装进程是否被占用,及时安装目标系统升级安装包(如参数类型、补丁类型或hota类型),从而避免升级引擎服务同时安装参数类型的系统升级安装包和其他系统升级安装包(即补丁类型的系统升级安装包或hota类型的系统升级安装包)导致的安装冲突的问题。同时,升级引擎服务及时安装目标系统升级安装包(如参数类型的系统升级安装包),可以提高电子设备的性能。In this way, the system update application allocates a corresponding connection (i.e., the first connection) to the target system upgrade installation package to be installed this time. When the first connection is established, the first business module receives the status sent by the upgrade engine service in real time, and this In the example, the first business module is allowed to use the status of the upgrade engine service during the life cycle of this installation, which can avoid the period from when the first business module performs the operation of disconnecting the first connection to when the first connection is disconnected. The first business module uses the received status of the upgrade engine service, which causes installation errors and confusion; because the target installation identification can indicate whether the current business module calls the target installation interface in the upgrade engine service, by adding a new target installation identification , can enrich the information of the first business module to determine whether to instruct the upgrade engine service to install the target system upgrade installation package this time, so that the first business module can accurately determine whether the installation process of the upgrade engine service is occupied, and install the target system upgrade in a timely manner Installation packages (such as parameter type, patch type or hota type) to avoid upgrading the engine service while installing parameter type system upgrade installation packages and other system upgrade installation packages (i.e. patch type system upgrade installation packages or hota type system upgrade installation packages) package) causing installation conflicts. At the same time, the upgrade engine service promptly installs the target system upgrade installation package (such as a parameter-type system upgrade installation package), which can improve the performance of electronic equipment.
根据第一方面,在本次安装的生命周期内,所述第一业务模块允许使用接收的所述升级引擎服务的状态,包括:第一业务模块获取第一标识信息,第一标识信息用于指示本次安装的生命周期是否结束,其中,初始的第一标识信息指示本次安装的生命周期未结束;第一业务模块若检测到第一标识信息指示本次安装的生命周期未结束,第一业务模块允许使用升级引擎服务的状态;第一业务模块若检测到第一标识信息指示本次安装的生命周期结束,第一业务模块丢弃升级引擎服务的状态。According to the first aspect, within the life cycle of this installation, the first business module allows the use of the received status of the upgrade engine service, including: the first business module obtains the first identification information, and the first identification information is used for Indicates whether the life cycle of this installation has ended, wherein the initial first identification information indicates that the life cycle of this installation has not ended; if the first business module detects the first identification information indicating that the life cycle of this installation has not ended, the first business module A business module allows the use of the status of the upgrade engine service; if the first business module detects the first identification information indicating that the life cycle of this installation is over, the first business module discards the status of the upgrade engine service.
这样,第一业务模块通过第一标识信息可以快速确定本次安装的生命周期结束的时刻,使得第一业务模块在断开第一连接的操作时,即可不再使用升级引擎服务的状态,避免因断开第一连接所消耗的时间长,导致第一业务模块还在使用升级引擎服务的状态的问题。In this way, the first business module can quickly determine the end of the life cycle of this installation through the first identification information, so that when the first business module disconnects the first connection operation, it can no longer use the status of the upgrade engine service to avoid Due to the long time it takes to disconnect the first connection, the first business module is still using the upgrade engine service.
根据第一方面,系统更新应用检测到系统升级指令,为本次待安装的目标系统升级安装包分配第一业务模块;第一业务模块向升级引擎服务发送服务请求,服务请求用于请求升级引擎服务安装目标系统升级安装包;升级引擎服务响应于服务请求,与第一业务模块绑定接口定义语言AIDL接口,建立第一连接。这样,第一业务模块通过绑定AIDL接口,使得该第一连接与本次安装目标系统升级安装包对应,保证每个连接用于传输与该目标系统升级安装包相关的数据,确保安装的准确性。According to the first aspect, the system update application detects the system upgrade instruction and allocates the first business module to the target system upgrade installation package to be installed this time; the first business module sends a service request to the upgrade engine service, and the service request is used to request the upgrade engine The service installs the target system upgrade installation package; the upgrade engine service responds to the service request, binds the interface definition language AIDL interface with the first business module, and establishes the first connection. In this way, the first business module binds the AIDL interface so that the first connection corresponds to the target system upgrade installation package of this installation, ensuring that each connection is used to transmit data related to the target system upgrade installation package, ensuring the accuracy of the installation. sex.
根据第一方面,标记本次安装的生命周期结束,包括:第一业务模块将第一标识信息更新为指示本次安装的生命周期已结束。这样,第一业务模块通过修改第一标识信息标记本次安装的生命周期结束,该方式简单快速,耗时短。According to the first aspect, marking the end of the life cycle of this installation includes: the first business module updating the first identification information to indicate that the life cycle of this installation has ended. In this way, the first business module marks the end of the life cycle of this installation by modifying the first identification information. This method is simple, fast and short in time.
根据第一方面,第一业务模块根据升级引擎服务的状态和目标安装标识,生成安装指示,包括:第一业务模块若检测到升级引擎服务的状态为空闲状态且检测到目标安装标识指示第一业务模块未调用目标安装接口,则第一业务模块确定该安装指示指示升级引擎服务安装目标系统升级安装包,并将目标安装标识更新为指示第一业务模块已调用目标安装接口;其中,初始的目标安装标识指示第一业务模块未调用目标安装接口。这样,第一业务模块在空闲状态下通过判断第一业务模块是否调用目标安装接口,可以快速确定升级引擎服务是否安装过该目标系统升级安装包。According to the first aspect, the first business module generates an installation instruction according to the status of the upgrade engine service and the target installation identification, including: if the first business module detects that the status of the upgrade engine service is idle and detects that the target installation identification indicates the first If the business module does not call the target installation interface, the first business module determines that the installation instruction instructs the upgrade engine service to install the target system upgrade installation package, and updates the target installation identification to indicate that the first business module has called the target installation interface; where, the initial The target installation identification indicates that the first business module has not called the target installation interface. In this way, the first business module can quickly determine whether the upgrade engine service has installed the target system upgrade installation package by determining whether the first business module calls the target installation interface in the idle state.
根据第一方面,该方法还包括:升级引擎服务响应于安装指示,将升级引擎服务的状态更新为繁忙状态。这样,升级引擎服务及时更新自身的安装状态(即升级引擎服务的状态)。According to the first aspect, the method further includes: in response to the installation instruction, the upgrade engine service updates the status of the upgrade engine service to a busy status. In this way, the upgrade engine service updates its own installation status (that is, the status of the upgrade engine service) in a timely manner.
根据第一方面,该方法还包括:第一业务模块若检测到升级引擎服务的状态为繁忙状态,检测第一连接的建立时长是否超时预设时长;若检测到超过预设时长,则检测目标安装标识是否指示第一业务模块已调用目标安装接口;若检测到否,则第一业务模块确定下一次安装目标系统升级安装包。这样,第一业务模块检测到第一连接建立超时且未调用目标安装接口,表征该升级引擎服务正在安装其他系统升级安装包,如目标系统升级安装包为参数类型的安装包,其他系统升级安装包可以是补丁包、hota。由于该升级引擎服务正在安装其他系统升级安装包,第一业务模块确定等待下一次安装,可以避免发生安装冲突。而当第一业务模块检测到第一连接建立超时且已调用目标安装接口,确定安装目标系统升级安装包失败,断开第一连接,避免升级引擎服务长时间安装目标系统升级安装包失败。According to the first aspect, the method also includes: if the first business module detects that the status of the upgrade engine service is a busy state, detect whether the establishment time of the first connection has exceeded the preset time; if it is detected that the preset time has been exceeded, detect the target Whether the installation identification indicates that the first business module has called the target installation interface; if not, the first business module determines the next installation of the target system upgrade installation package. In this way, the first business module detects that the first connection establishment times out and does not call the target installation interface, which indicates that the upgrade engine service is installing other system upgrade installation packages. For example, the target system upgrade installation package is a parameter type installation package, and other system upgrade installation packages The package can be a patch package or hota. Since the upgrade engine service is installing other system upgrade installation packages, the first business module determines to wait for the next installation, which can avoid installation conflicts. When the first business module detects that the first connection establishment has timed out and the target installation interface has been called, it determines that the installation of the target system upgrade installation package has failed, and disconnects the first connection to avoid the upgrade engine service failing to install the target system upgrade installation package for a long time.
根据第一方面,该方法还包括:第一业务模块若确定下一次安装目标系统升级安装包,则确定本次安装结束;在标记本次安装的生命周期结束并断开第一连接之后,该方法还包括:在第一业务模块断开第一连接第二预设时长之后,系统更新应用重新为本次待安装的目标系统升级安装包分配第二连接,以重新执行安装目标系统升级安装包。这样,第一业务模块重新建立第二连接,以尝试安装目标系统升级安装包,使得可以及时安装目标系统升级安装包,提高电子设备的性能。According to the first aspect, the method also includes: if the first business module determines that the target system upgrade installation package will be installed next time, it determines that this installation is over; after marking the end of the life cycle of this installation and disconnecting the first connection, the first business module The method also includes: after the first business module disconnects the first connection for a second preset period of time, the system update application re-allocates the second connection to the target system upgrade installation package to be installed this time to re-install the target system upgrade installation package. . In this way, the first business module re-establishes the second connection to try to install the target system upgrade installation package, so that the target system upgrade installation package can be installed in time and the performance of the electronic device can be improved.
根据第一方面,该方法还包括:第一业务模块若检测到目标安装标识指示第一业务模块已调用目标安装接口,则第一业务模块确定本次安装目标系统升级安装包失败,标记本次安装的生命周期结束并断开第一连接。这样,第一业务模块在检测到本次安装目标系统升级安装包失败时,断开第一连接并标记本次安装的生命周期结束,使得第一业务模块可以不再使用接收到的升级引擎服务的状态,也避免升级引擎服务在安装失败后长时间占用安装进程。According to the first aspect, the method further includes: if the first business module detects that the target installation identifier indicates that the first business module has called the target installation interface, the first business module determines that the current installation of the target system upgrade installation package has failed, and marks this time. The installation's life cycle ends and the first connection is disconnected. In this way, when the first business module detects that the installation of the target system upgrade installation package fails this time, it disconnects the first connection and marks the end of the life cycle of this installation, so that the first business module can no longer use the received upgrade engine service. status, and also avoids the upgrade engine service from occupying the installation process for a long time after the installation fails.
根据第一方面,第一业务模块根据升级引擎服务的状态和目标安装标识,生成安装指示,包括:第一业务模块若检测到的状态为结束状态且检测到目标安装标识指示第一业务模块未调用目标安装接口,则第一业务模块确定该安装指示指示升级引擎服务安装目标系统升级安装包,并将目标安装标识更新为指示第一业务模块已调用目标安装接口;其中,初始的目标安装标识指示第一业务模块未调用目标安装接口。这样,当第一业务模块检测到结束状态且未调用目标安装接口,表征当前安装的不是目标系统升级安装包,即第一业务模块通过目标安装标识,识别出当前安装结束状态不是本次安装目标系统升级安装包的安装结果,进一步避免其他系统升级安装包的安装结果,对本次目标系统升级安装包造成的干扰。According to the first aspect, the first business module generates an installation instruction according to the status of the upgrade engine service and the target installation identification, including: if the detected status of the first business module is the end state and the detected target installation identification indicates that the first business module has not When the target installation interface is called, the first business module determines that the installation instruction instructs the upgrade engine service to install the target system upgrade installation package, and updates the target installation identification to indicate that the first business module has called the target installation interface; wherein, the initial target installation identification Indicates that the first business module has not called the target installation interface. In this way, when the first business module detects the end state and does not call the target installation interface, it means that the current installation is not the target system upgrade installation package. That is, the first business module identifies that the current installation end state is not the target of this installation through the target installation identifier. The installation results of the system upgrade installation package further avoid the interference caused by the installation results of other system upgrade installation packages on this target system upgrade installation package.
根据第一方面,该方法还包括:第一业务模块若检测到的状态为结束状态且检测到目标安装标识指示第一业务模块已调用目标安装接口,则第一业务模块确定本次成功安装目标系统升级安装包;标记本次安装的生命周期结束并断开第一连接。这样,第一业务模块在确定本次安装成功时,断开第一连接,可以避免接收到其他系统升级安装包的安装结果,造成安装错乱。According to the first aspect, the method further includes: if the detected state of the first business module is the end state and the detected target installation identifier indicates that the first business module has called the target installation interface, the first business module determines that the target is successfully installed this time. System upgrade installation package; mark the end of the life cycle of this installation and disconnect the first connection. In this way, when the first business module determines that the installation is successful, it disconnects the first connection, which can avoid receiving the installation results of other system upgrade installation packages, causing installation confusion.
根据第一方面,该方法还包括:第一业务模块若检测到升级引擎服务的状态属于不可用状态,则标记本次安装的生命周期结束并断开第一连接;在第一业务模块断开第一连接第二预设时长之后,系统更新应用重新为本次待安装的目标系统升级安装包分配第二连接,以重新执行安装目标系统升级安装包。这样,第一业务模块在升级引擎服务不可用时,直接尝试下一次安装,可以减少判断步骤,缩短安装目标系统升级安装包的时间。According to the first aspect, the method also includes: if the first business module detects that the status of the upgrade engine service is unavailable, marking the end of the life cycle of this installation and disconnecting the first connection; disconnecting the first business module After the second preset duration of the first connection, the system update application re-allocates the second connection to the target system upgrade installation package to be installed this time, so as to re-install the target system upgrade installation package. In this way, when the upgrade engine service is unavailable, the first business module directly tries the next installation, which can reduce the judgment steps and shorten the time to install the target system upgrade installation package.
根据第一方面,目标系统升级安装包的类型包括:参数包、hota或补丁包。According to the first aspect, the type of target system upgrade installation package includes: parameter package, hota or patch package.
根据第一方面,在系统更新应用检测到系统升级指令,为本次待安装的目标系统升级安装包分配第一连接之前,该方法还包括:系统更新应用接收到用户输入的安装目标系统升级安装包的系统升级指令;或者,系统更新应用检测到电子设备处于息屏状态,生成安装目标系统升级安装包的系统升级指令。这样,电子设备提供两种触发安装目标系统升级安装包的方式,为用户可以使用安装方式提供了便利。According to the first aspect, before the system update application detects the system upgrade instruction and allocates a first connection to the target system upgrade installation package to be installed this time, the method further includes: the system update application receives the installation target system upgrade installation input by the user. System upgrade instructions for the package; or, the system update application detects that the electronic device is in a screen-off state and generates system upgrade instructions for installing the target system upgrade installation package. In this way, the electronic device provides two ways to trigger the installation of the target system upgrade installation package, which provides convenience for users to use the installation method.
第二方面,本申请提供了一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中一个或多个计算机程序存储在存储器上,当计算机程序被一个或多个处理器执行时,使得电子设备执行第一方面以及第一方面的任一种实现方式对应的系统升级的方法。In a second aspect, the present application provides an electronic device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer program is processed by one or more When executed by multiple processors, the electronic device is caused to execute the first aspect and the system upgrade method corresponding to any implementation of the first aspect.
第二方面以及第二方面的任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第二方面以及第二方面的任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The second aspect and any implementation manner of the second aspect respectively correspond to the first aspect and any implementation manner of the first aspect. The technical effects corresponding to the second aspect and any implementation manner of the second aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, which will not be described again here.
第三方面,本申请提供了一种计算机可读介质,用于存储计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行上述第一方面以及第一方面的任意一种实现方式所对应的系统升级的方法。In a third aspect, the present application provides a computer-readable medium for storing a computer program. When the computer program is run on an electronic device, the electronic device causes the electronic device to execute any one of the above first aspect and the first aspect. The system upgrade method corresponding to the implementation method.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. , for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative labor.
图1 是示例性示出的手机中安装系统升级包出现冲突的示意图;Figure 1 is a schematic diagram illustrating a conflict in the installation of a system upgrade package on a mobile phone;
图2是示例性示出的电子设备的结构示意图;Figure 2 is a schematic structural diagram of an exemplary electronic device;
图3是示例性示出的电子设备的软件结构框图;Figure 3 is a software structure block diagram of an exemplary electronic device;
图4是示例性示出的一种系统升级的流程图;Figure 4 is an exemplary flow chart of a system upgrade;
图5 是示例性示出的OUC与升级引擎服务之间的交互图;Figure 5 is an exemplary interaction diagram between OUC and the upgrade engine service;
图6是示例性示出的设置系统升级安装包的安装方式的示意图。FIG. 6 is a schematic diagram illustrating an installation method for setting up a system upgrade installation package.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。The term "and/or" in this article is just an association relationship that describes related objects, indicating that three relationships can exist. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations.
本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。The terms “first” and “second” in the description and claims of the embodiments of this application are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first target object, the second target object, etc. are used to distinguish different target objects, rather than to describe a specific order of the target objects.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in the embodiments of the present application is not to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。In the description of the embodiments of this application, unless otherwise specified, the meaning of “plurality” refers to two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
在对本申请实施例的技术方案说明之前,首先结合附图对本申请实施例的系统升级进行说明。Before describing the technical solutions of the embodiments of the present application, the system upgrade of the embodiments of the present application will first be described with reference to the drawings.
OTA(Over-the-Air Technology,空间下载技术)升级是Android系统提供的标准软件升级方式,是通过移动通信(GSM或CDMA)的空中接口对SIM卡数据及应用进行远程管理的技术。终端设备中的OTA升级客户端(OTA Update Client,“OUC”)可以向服务器发送搜包请求,服务器响应于搜包请求,搜索是否存在到参数、hota或补丁版本的系统升级安装包,并向终端设备返回搜包结果。终端设备的OUC接收该搜包结果,若OUC确定搜包成功,该OUC可以从服务器获取搜索到的系统升级安装包并下载新版本的系统升级安装包。OTA (Over-the-Air Technology) upgrade is a standard software upgrade method provided by the Android system. It is a technology for remote management of SIM card data and applications through the air interface of mobile communications (GSM or CDMA). The OTA Update Client ("OUC") in the terminal device can send a packet search request to the server. The server responds to the packet search request, searches for whether there is a system upgrade installation package with parameters, hota or patch version, and sends it to the server. The terminal device returns the packet search results. The OUC of the terminal device receives the packet search result. If the OUC determines that the packet search is successful, the OUC can obtain the searched system upgrade installation package from the server and download the new version of the system upgrade installation package.
终端设备中OUC可以同时下载多个类型的系统升级安装包,系统升级安装包的类型包括:补丁、hota或者参数。OUC也可以在不同时刻下载不同类型的系统升级安装包。OUC可以根据系统升级安装包的类型的优先级,安装系统升级安装包。通常,补丁、hota类型的系统升级安装包的优先级高于参数类型的系统升级安装包的优先级。补丁和hota类型的系统升级安装包所占容量大,终端设备安装补丁或者安装hota类型的系统升级安装包所消耗的时间长,导致参数类型的系统升级安装包不能及时被更新,影响终端设备的性能。为了避免终端设备不能及时更新参数类型的系统升级安装包,终端设备调高该参数类型的系统升级安装包的优先级,以使该参数类型的系统升级安装包的优先级与补丁或hota类型的系统升级安装包的优先级相同,即该终端设备在下载了参数类型的系统升级安装包后,立即触发终端设备安装该参数类型的系统升级安装包,而无需在终端设备安装补丁或hota类型的系统升级安装包之后再安装该参数类型的系统升级安装包,从而提高了终端设备的系统性能。OUC in the terminal device can download multiple types of system upgrade installation packages at the same time. The types of system upgrade installation packages include: patches, hota or parameters. OUC can also download different types of system upgrade installation packages at different times. OUC can install the system upgrade installation package according to the priority of the system upgrade installation package type. Usually, the priority of patch and hota type system upgrade installation packages is higher than the priority of parameter type system upgrade installation packages. Patch and hota type system upgrade installation packages occupy a large capacity, and it takes a long time for terminal devices to install patches or hota type system upgrade installation packages. As a result, parameter type system upgrade installation packages cannot be updated in time, affecting the terminal equipment. performance. In order to prevent the terminal device from being unable to update the system upgrade installation package of the parameter type in time, the terminal device increases the priority of the system upgrade installation package of the parameter type so that the priority of the system upgrade installation package of the parameter type is the same as that of the patch or hota type. The system upgrade installation packages have the same priority, that is, after the terminal device downloads the system upgrade installation package of the parameter type, it will immediately trigger the terminal device to install the system upgrade installation package of the parameter type without the need to install patches or hota types on the terminal device. Install the system upgrade installation package of this parameter type after the system upgrade installation package, thereby improving the system performance of the terminal device.
然而,由于参数类型的系统升级安装包的优先级与补丁、hota类型的系统升级安装包的优先级相同,导致该OUC可能同时指示终端设备的升级引擎服务(UpdateEngineService)安装参数类型的系统升级安装包与补丁类型的系统升级安装包,或者同时安装参数类型的系统升级安装包与hota类型的系统升级安装包。由于升级引擎服务的安装进程只有一个,这将出现安装冲突,安装冲突会导致安装结果错乱,安装包被多次安装等问题。图1为示例性示出的手机安装系统升级包时出现冲突的示意图。如图1所示,终端设备以手机为例,该手机已下载了补丁类型的系统升级安装包,并正在安装该补丁类型的系统升级安装包。当手机的OUC检测到搜包结果指示存在新版本的参数类型的系统升级安装包,该手机可以在显示界面提示用户更新参数。如图1所示的显示界面101中显示有提示窗102,该提示窗102可以显示第一提示信息,该第一提示信息用于指示用户更新设备优化参数。该提示窗102还可以显示第二提示信息103,该第二提示信息103用于指示用户启动自动更新功能。若用户开启该自动更新功能,则该终端设备在检测到搜包结果指示存在新版本的参数类型的系统升级安装包时,不再显示界面显示该提示窗102。终端设备将自动下载新版本的参数类型的系统升级安装包,并在检测到终端设备处于息屏状态时,安装该新版本的参数类型的系统升级安装包。However, since the priority of the parameter type system upgrade installation package is the same as the priority of the patch and hota type system upgrade installation package, the OUC may also instruct the upgrade engine service (UpdateEngineService) of the terminal device to install the parameter type system upgrade installation package. Package and patch type system upgrade installation packages, or install parameter type system upgrade installation packages and hota type system upgrade installation packages at the same time. Since there is only one installation process for upgrading the engine service, installation conflicts will occur. Installation conflicts will lead to confusing installation results and installation packages being installed multiple times. Figure 1 is a schematic diagram illustrating a conflict when a mobile phone installs a system upgrade package. As shown in Figure 1, the terminal device takes a mobile phone as an example. The mobile phone has downloaded a patch type system upgrade installation package and is installing the patch type system upgrade installation package. When the OUC of the mobile phone detects that the packet search result indicates that there is a system upgrade installation package with a new version of the parameter type, the mobile phone can prompt the user to update the parameters on the display interface. As shown in the display interface 101 shown in Figure 1, a prompt window 102 is displayed. The prompt window 102 can display first prompt information. The first prompt information is used to instruct the user to update the device optimization parameters. The prompt window 102 can also display second prompt information 103, which is used to instruct the user to start the automatic update function. If the user turns on the automatic update function, when the terminal device detects that the packet search result indicates that there is a system upgrade installation package of a new version of the parameter type, the interface will no longer display the prompt window 102. The terminal device will automatically download the new version of the parameter type system upgrade installation package, and when detecting that the terminal device is in the screen-off state, install the new version of the parameter type system upgrade installation package.
本示例中,如图1中的1a所示,用户点击提示窗102中的下载并更新的控件,终端设备中的OUC响应于用户输入的指令(即下载系统升级安装包并安装该系统升级安装包),从服务器下载该参数类型的系统升级安装包。该OUC在下载了该参数类型的系统升级安装包之后,指示升级引擎服务安装该参数类型的系统升级安装包。若此时升级引擎服务安装补丁类型的系统升级安装包失败,并将该状态信息返回OUC,OUC获取到该状态后,指示升级引擎服务结束安装该参数类型的系统升级包。该手机的显示界面104中显示软件更新失败的通知105。In this example, as shown in 1a in Figure 1, the user clicks the download and update control in the prompt window 102, and the OUC in the terminal device responds to the instructions entered by the user (i.e., download the system upgrade installation package and install the system upgrade installation package), download the system upgrade installation package of this parameter type from the server. After downloading the system upgrade installation package of this parameter type, the OUC instructs the upgrade engine service to install the system upgrade installation package of this parameter type. If the upgrade engine service fails to install the system upgrade package of the patch type at this time, and returns the status information to OUC, after OUC obtains the status, it instructs the upgrade engine service to end the installation of the system upgrade package of this parameter type. A notification 105 of software update failure is displayed on the display interface 104 of the mobile phone.
本示例中,由于升级引擎服务同时在安装补丁类型的系统升级安装包和参数类型的系统升级安装包,导致在安装参数类型的系统升级安装包时,OUC接收到安装补丁类型的系统升级安装包的安装结果(如安装成功、安装失败),而导致OUC不再安装该参数类型的系统升级安装包,或多次调用该参数类型的解压接口,即多次安装该该参数类型的系统升级安装包。同理,也可能出现升级引擎服务在安装补丁类型(或hota类型)的系统升级安装包时,OUC接收到安装参数类型的系统升级安装包的安装结果(如安装成功、安装失败),导致OUC不再安装该补丁类型(或hota类型)的系统升级安装包,或多次调用该补丁类型(或hota类型)的解压接口。In this example, because the upgrade engine service is installing a patch type system upgrade installation package and a parameter type system upgrade installation package at the same time, when installing the parameter type system upgrade installation package, OUC receives the patch type system upgrade installation package. The installation result (such as successful installation, installation failure) causes OUC to no longer install the system upgrade installation package of this parameter type, or calls the decompression interface of this parameter type multiple times, that is, installs the system upgrade installation of this parameter type multiple times. Bag. In the same way, it may also happen that when the upgrade engine service is installing a patch type (or hota type) system upgrade installation package, OUC receives the installation result of the installation parameter type system upgrade installation package (such as successful installation, installation failure), resulting in OUC The system upgrade installation package of this patch type (or hota type) will no longer be installed, or the decompression interface of this patch type (or hota type) will be called multiple times.
本申请实施例提供一种系统升级的方法,该方法由电子设备运行,该电子设备中的系统升级应用检测到系统升级指令,为本次待安装的目标系统升级安装包分配第一连接,第一连接用于系统更新应用的第一业务模块与升级引擎服务通信;第一业务模块通过第一连接实时接收升级引擎服务发送的升级引擎服务的状态;在本次安装的生命周期内,第一业务模块允许使用接收的升级引擎服务的状态;若升级引擎服务的状态为可用状态,第一业务模块根据升级引擎服务的状态和目标安装标识,生成安装指示并发送至升级引擎服务,目标安装标识用于指示当前的业务模块是否调用升级引擎服务中的目标安装接口,目标安装接口为与目标系统升级安装包的类型对应的安装接口;升级引擎服务响应于安装指示,安装目标系统升级安装包;第一业务模块若确定本次安装结束,标记本次安装的生命周期结束并断开第一连接。Embodiments of the present application provide a system upgrade method, which is run by an electronic device. The system upgrade application in the electronic device detects the system upgrade instruction and allocates a first connection to the target system upgrade installation package to be installed this time. A connection is used for the first business module of the system update application to communicate with the upgrade engine service; the first business module receives the status of the upgrade engine service sent by the upgrade engine service in real time through the first connection; within the life cycle of this installation, the first The business module is allowed to use the status of the received upgrade engine service; if the status of the upgrade engine service is available, the first business module generates an installation instruction based on the status of the upgrade engine service and the target installation ID and sends it to the upgrade engine service and the target installation ID. Used to indicate whether the current business module calls the target installation interface in the upgrade engine service. The target installation interface is the installation interface corresponding to the type of the target system upgrade installation package; the upgrade engine service responds to the installation instructions and installs the target system upgrade installation package; If the first business module determines that this installation is over, it marks the end of the life cycle of this installation and disconnects the first connection.
本示例中,系统升级应用的第一业务模块仅在本次安装的生命周期内允许使用升级引擎服务的状态,可以避免在断开第一连接的过程中,第一业务模块还使用升级引擎服务的状态,以指示升级引擎服务安装目标系统升级安装包,导致安装错乱的问题。本示例中,通过该升级服务引擎的状态和目标安装标识可以准确判断是否可以安装该目标系统升级安装包,避免该升级引擎服务的安装进程同时安装目标系统升级安装包和其他系统升级安装包时发生安装冲突。同时,该系统升级方式使得参数类型的系统升级安装包可以及时更新,提高电子设备的性能。In this example, the first business module of the system upgrade application is only allowed to use the status of the upgrade engine service during the life cycle of this installation. This can avoid the first business module also using the upgrade engine service during the process of disconnecting the first connection. status to instruct the upgrade engine service to install the target system upgrade installation package, causing installation confusion. In this example, the status of the upgrade service engine and the target installation identification can be used to accurately determine whether the target system upgrade installation package can be installed, preventing the installation process of the upgrade engine service from simultaneously installing the target system upgrade installation package and other system upgrade installation packages. An installation conflict has occurred. At the same time, this system upgrade method allows parameter-type system upgrade installation packages to be updated in time to improve the performance of electronic equipment.
图2为本申请实施例示出的一种电子设备100的结构示意图。应该理解的是,图2示出的电子设备100仅是电子设备的一个范例,并且电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图2中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。FIG. 2 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application. It should be understood that the electronic device 100 shown in FIG. 2 is only an example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, and two or more components may be combined. parts, or can have different part configurations. The various components shown in Figure 2 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2. Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, And subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
图3是本申请实施例的电子设备100的软件结构框图。FIG. 3 is a software structure block diagram of the electronic device 100 according to the embodiment of the present application.
电子设备100的分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为三层,从上至下分别为应用程序层,应用程序框架层,以及内核层。可以理解的是,图3的软件结构中的层以及各层中包含的部件,并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的层,以及每个层中可以包括更多或更少的部件,本申请不做限定。The layered architecture of the electronic device 100 divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system is divided into three layers, from top to bottom: application layer, application framework layer, and kernel layer. It can be understood that the layers in the software structure of FIG. 3 and the components included in each layer do not constitute specific limitations on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown in the figures, and each layer may include more or fewer components, which is not limited by this application.
如图3所示,应用程序层可以包括一系列应用程序包。应用程序包可以包括系统更新应用,相机,图库,日历,短消息,通话,导航,蓝牙等应用程序。应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。As shown in Figure 3, the application layer can include a series of application packages. Application packages can include system update applications, camera, gallery, calendar, short message, calling, navigation, Bluetooth and other applications. The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
该系统更新应用(即OUC),该系统更新应用可以实时向服务器发送搜索请求,并获取服务器返回的搜包结果。若OUC检测到搜包结果指示存在新版本的系统升级安装包,该OUC可以从服务器下载新版本的系统升级安装包。OUC若接收到用户输入的升级指令或者检测到满足升级条件时,执行本申请中的系统升级的方法。The system update application (ie, OUC) can send search requests to the server in real time and obtain the packet search results returned by the server. If the OUC detects that the packet search result indicates that a new version of the system upgrade installation package exists, the OUC can download the new version of the system upgrade installation package from the server. If the OUC receives the upgrade instruction input by the user or detects that the upgrade conditions are met, the OUC executes the system upgrade method in this application.
如图3所示,应用程序框架层可以包括升级引擎服务,窗口管理器,资源管理器,内容提供器,视图系统,电话管理器,通知管理器等。As shown in Figure 3, the application framework layer can include the upgrade engine service, window manager, resource manager, content provider, view system, phone manager, notification manager, etc.
升级引擎服务用于安装待升级的系统升级安装包。The upgrade engine service is used to install the system upgrade installation package to be upgraded.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make this data accessible to applications. Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, etc. A view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the electronic device 100 . For example, call status management (including connected, hung up, etc.).
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。The notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
图4为示例性示出的一种系统升级的流程图,下面具体说明系统升级的过程:Figure 4 is an exemplary flow chart of a system upgrade. The system upgrade process is described in detail below:
电子设备可以是手机、平板电脑、车载设备、智能手环、智能手表、笔记本电脑等。本示例中,电子设备以手机为例。该手机的应用程序中包括系统更新应用(即OUC),该OUC可以获取新版本的系统升级安装包,并指示升级引擎服务安装新版本的系统升级安装包。OUC接收到服务器返回的搜包结果,若该搜包结果指示存在新的参数版本(即参数类型的系统升级安装包),该OUC可以如图1中的1a所示显示提示窗102,用户点击“下载并更新”的按钮,该OUC响应于用户的该点击操作,生成系统升级指令。Electronic devices can be mobile phones, tablets, vehicle-mounted devices, smart bracelets, smart watches, laptops, etc. In this example, the electronic device is a mobile phone. The mobile phone application includes a system update application (ie, OUC), which can obtain a new version of the system upgrade installation package and instruct the upgrade engine service to install the new version of the system upgrade installation package. The OUC receives the packet search result returned by the server. If the packet search result indicates that there is a new parameter version (ie, a system upgrade installation package of parameter type), the OUC can display a prompt window 102 as shown in 1a in Figure 1, and the user clicks "Download and update" button, the OUC generates system upgrade instructions in response to the user's click operation.
在另一个示例中,如图6中的6a所示,用户可以点击软件设置界面中的“更多”按钮601,手机响应于用户点击按钮601的操作,显示弹框602。该弹框602中可以包括两个选型,第一选项用于跳转至补丁和hota的更新设置页面,第二选项用于跳转至参数的更新设置页面。本示例中,如图6中的6a所示,用户点击第二选项,手机的显示页面跳转至参数的更新设置页面603,该用户可以点击按钮604,以开启自动下载并更新功能,该功能开启后,该手机的OUC检测到电子设备处于息屏状态时,可以生成安装新的参数版本的系统升级指令。In another example, as shown in 6a in Figure 6, the user can click the "More" button 601 in the software setting interface, and the mobile phone displays a pop-up box 602 in response to the user's operation of clicking the button 601. The pop-up box 602 may include two options, the first option is used to jump to the update setting page of patches and hota, and the second option is used to jump to the update setting page of parameters. In this example, as shown in 6a in Figure 6, the user clicks the second option, and the display page of the mobile phone jumps to the parameter update setting page 603. The user can click button 604 to enable the automatic download and update function. After being turned on, when the OUC of the mobile phone detects that the electronic device is in a screen-off state, it can generate a system upgrade instruction to install a new parameter version.
同理,如图6的6a所示,若用户点击第一选项,手机的显示页面跳转至补丁和hota的更新设置页面605,该用户可以点击按钮606,以开启自动下载并更新功能,该功能开启后,该手机的OUC检测到电子设备处于息屏状态时,可以生成安装新的补丁或hota版本的升级指令。可选地,该用户可以点击按钮607,手机在检测到处于息屏状态且处于预设安装时段时,生成系统升级指令。若该按钮606和按钮607均被开启,则手机可以在WLAN或移动网络下自动下载新版本的系统升级安装包,在检测到处于息屏状态且处于预设安装时段(如02:00~04:00)时,生成升级指令。Similarly, as shown in 6a of Figure 6, if the user clicks the first option, the display page of the mobile phone jumps to the patch and hota update setting page 605. The user can click button 606 to enable the automatic download and update function. After the function is turned on, when the OUC of the mobile phone detects that the electronic device is in a screen-off state, it can generate an upgrade instruction to install a new patch or hota version. Optionally, the user can click button 607, and the mobile phone generates a system upgrade instruction when it detects that the screen is off and in the preset installation period. If button 606 and button 607 are both turned on, the mobile phone can automatically download a new version of the system upgrade installation package under WLAN or mobile network. When it is detected that the screen is in the off-screen state and is in the preset installation period (such as 02:00~04 :00), generate an upgrade command.
当手机的OUC生成系统升级指令时,该OUC可以为本次待安装的目标系统升级安装包分配第一业务模块。本示例中,该待安装的目标系统升级安装包的类型可以是参数、补丁或hota。When the OUC of the mobile phone generates a system upgrade instruction, the OUC can allocate the first business module to the target system upgrade installation package to be installed this time. In this example, the type of the target system upgrade installation package to be installed can be parameter, patch or hota.
若系统升级指令指示安装参数类型的系统升级安装包,该参数类型的系统升级安装包作为目标系统升级安装包,若系统升级指令指示安装补丁类型的系统升级安装包,该补丁类型的系统升级安装包作为目标系统升级安装包。If the system upgrade instruction instructs the installation of a system upgrade installation package of parameter type, the system upgrade installation package of this parameter type is used as the target system upgrade installation package. If the system upgrade instruction instructs the installation of a system upgrade installation package of patch type, the system upgrade installation package of this patch type is installed. package as the target system upgrade installation package.
需要说明的是,OUC可以为不同的系统升级安装包分配各自不同的业务模块,以建立不同的连接。也就是说,本示例中,OUC的不同业务模块可以同时建立各自对应的连接,以安装各自对应的目标系统升级安装包。例如,第一业务模块可以建立第一连接,以安装参数类型的系统升级安装包,该第二业务模块可以建立第三连接,以安装补丁类型的系统升级安装包。It should be noted that OUC can allocate different business modules to different system upgrade installation packages to establish different connections. That is to say, in this example, different business modules of OUC can establish their corresponding connections at the same time to install their corresponding target system upgrade installation packages. For example, the first business module may establish a first connection to install a parameter-type system upgrade installation package, and the second business module may establish a third connection to install a patch-type system upgrade installation package.
步骤401:第一业务模块绑定UpdateEngine服务,建立连接。Step 401: The first business module binds the UpdateEngine service and establishes a connection.
示例性地,该第一业务模块可以向升级引擎(UpdateEngine)服务发送安装该目标系统升级安装包的服务请求。升级引擎(UpdateEngine)服务响应于该服务请求,与第一业务模块绑定接口定义语言(Android Interface Definition Language,“AIDL”)接口,建立第一连接。该第一连接用于传输与本次安装相关的数据,例如,第一连接可以传输该升级引擎服务的安装状态,还可以传输待安装的目标系统升级安装包。可以理解的是,第一业务模块创建的第一连接与本次安装相匹配。For example, the first business module may send a service request to install the target system upgrade installation package to the upgrade engine (UpdateEngine) service. In response to the service request, the upgrade engine (UpdateEngine) service binds an interface definition language (Android Interface Definition Language, "AIDL") interface with the first business module to establish a first connection. The first connection is used to transmit data related to this installation. For example, the first connection can transmit the installation status of the upgrade engine service, and can also transmit the target system upgrade installation package to be installed. It can be understood that the first connection created by the first business module matches this installation.
可选地,当第一业务模块成功建立第一连接时,可以启动定时器。若第一业务模块断开第一连接,销毁该定时器。也就是说,每个连接有各自对应的定时器。Optionally, when the first service module successfully establishes the first connection, the timer may be started. If the first service module disconnects the first connection, the timer is destroyed. In other words, each connection has its own corresponding timer.
步骤402:第一业务模块接收升级引擎服务的状态。Step 402: The first business module receives the status of the upgrade engine service.
示例性地,当第一业务模块成功建立第一连接后,该升级引擎服务可以实时获取当前的安装状态(即升级引擎服务的状态),并将获取的安装状态通过第一连接传输至第一业务模块。该第一业务模块实时接收升级引擎服务发送的安装状态。该第一业务模块接收到的安装状态可以包括:空闲状态、繁忙状态、结束状态以及不可用状态。其中,空闲状态、繁忙状态以及结束状态属于可用状态。For example, after the first business module successfully establishes the first connection, the upgrade engine service can obtain the current installation status (that is, the status of the upgrade engine service) in real time, and transmit the obtained installation status to the first connection through the first connection. Business module. The first business module receives the installation status sent by the upgrade engine service in real time. The installation status received by the first service module may include: idle status, busy status, end status, and unavailable status. Among them, idle state, busy state and end state are available states.
空闲状态用于表征升级引擎服务中的安装进程未被占用。繁忙状态用于表征该升级引擎服务的安装进程正在安装系统升级安装包。结束状态用于表征该升级引擎服务的安装进程安装该系统升级安装包成功或失败。不可用状态为异常状态。The idle state is used to indicate that the installation process in the upgrade engine service is not occupied. The busy status is used to indicate that the installation process of the upgrade engine service is installing the system upgrade installation package. The end status is used to indicate whether the installation process of the upgrade engine service succeeds or fails in installing the system upgrade installation package. The unavailable state is an abnormal state.
需要说明的是,若OUC若同时建立了多个连接,则该升级引擎服务会实时通过每个连接向OUC中的每个业务模块传输该升级引擎服务的状态。It should be noted that if OUC establishes multiple connections at the same time, the upgrade engine service will transmit the status of the upgrade engine service to each business module in OUC through each connection in real time.
步骤403:第一业务模块判断第一标识信息指示本次安装的生命周期是否结束。若是,则结束流程。若否,则执行步骤404。Step 403: The first business module determines whether the first identification information indicates whether the life cycle of this installation is over. If so, end the process. If not, execute step 404.
示例性地,该第一业务模块在接收到升级引擎服务发送的安装状态,获取存储的第一标识信息,并判断第一标识信息是否指示本次安装的生命周期结束。若第一业务模块检测到该第一标识信息指示本次安装的生命周期未结束,该第一业务模块允许使用接收到的安装状态。若第一业务模块检测到该第一标识信息指示本次安装的生命周期结束,则可以丢弃接收到的安装状态,或者直接结束流程。本示例中,当第一业务模块检测到该第一标识信息指示本次安装的生命周期结束,以直接结束流程为例。For example, after receiving the installation status sent by the upgrade engine service, the first business module obtains the stored first identification information, and determines whether the first identification information indicates the end of the life cycle of this installation. If the first business module detects that the first identification information indicates that the life cycle of this installation has not ended, the first business module allows the use of the received installation status. If the first business module detects that the first identification information indicates that the life cycle of this installation is over, it may discard the received installation status or directly end the process. In this example, when the first business module detects that the first identification information indicates the end of the life cycle of this installation, the process is directly terminated as an example.
当第一连接创建成功时,将第一标识信息设置为指示本次安装的生命周期未结束。本次安装的生命周期用于指示本次安装该目标系统升级安装包过程中,允许使用接收到的安装状态的时段。本示例中,第一业务模块在成功建立第一连接时可以设置第一标识信息的初始值,例如,第一业务模块在第一连接建立时,设置isClosed=false,该第一标识信息为“isClosed”,当isClosed的值为“false”时,指示当前第一连接已建立,即指示本次安装的生命周期未结束。若isClosed的值为“true”时,表征当前第一连接断开,即指示本次安装的生命周期已结束。需要说明的是,当isClosed的值为“true”时,第一连接还可能处于连接状态,例如,第一业务模块执行断开第一连接的操作时,isClosed的值被置为“true”,但该第一连接还未断开。When the first connection is successfully created, the first identification information is set to indicate that the life cycle of this installation has not ended. The life cycle of this installation is used to indicate the period during which the received installation status is allowed to be used during the current installation of the target system upgrade installation package. In this example, the first business module can set the initial value of the first identification information when the first connection is successfully established. For example, when the first connection is established, the first business module sets isClosed=false, and the first identification information is " isClosed", when the value of isClosed is "false", it indicates that the current first connection has been established, which indicates that the life cycle of this installation has not ended. If the value of isClosed is "true", it means that the current first connection is disconnected, which indicates that the life cycle of this installation has ended. It should be noted that when the value of isClosed is "true", the first connection may still be in the connected state. For example, when the first business module performs the operation of disconnecting the first connection, the value of isClosed is set to "true". But the first connection has not yet been disconnected.
当第一业务模块成功建立第一连接且设置(或标记)第一标识信息为指示本次安装的生命周期未结束的时刻作为本次安装的生命周期的开始时刻。第一业务模块设置(或标记)该第一标识信息为指示本次安装的生命周期已结束的时刻作为本次安装的生命周期的结束时刻。该第一业务模块在本次安装的生命周期内允许使用接收到的安装状态。When the first business module successfully establishes the first connection and sets (or marks) the first identification information to indicate that the life cycle of this installation has not ended, it is regarded as the start time of the life cycle of this installation. The first business module sets (or marks) the first identification information to indicate that the life cycle of this installation has ended as the end time of the life cycle of this installation. The first business module is allowed to use the received installation status during the life cycle of this installation.
由于升级引擎服务实时向第一业务模块发送升级引擎服务的安装状态,该第一业务模块可以在接收到升级引擎服务的安装状态时,执行步骤403,直至结束流程。Since the upgrade engine service sends the installation status of the upgrade engine service to the first business module in real time, the first business module can execute step 403 when receiving the installation status of the upgrade engine service until the process ends.
步骤404:第一业务模块允许使用当前升级引擎服务的安装状态。Step 404: The first business module allows the current installation status of the upgrade engine service to be used.
示例性地,第一业务模块若检测到该第一标识信息指示本次安装的生命周期未结束,确定第一业务模块可以使用当前升级引擎服务的安装状态。For example, if the first business module detects that the first identification information indicates that the life cycle of this installation has not ended, it determines that the first business module can use the current installation status of the upgrade engine service.
步骤405:第一业务模块检测到该安装状态为空闲状态,检测目标安装标识是否指示第一业务模块已调用目标安装接口。若否,则执行步骤406。Step 405: The first business module detects that the installation state is idle, and detects whether the target installation identifier indicates that the first business module has called the target installation interface. If not, execute step 406.
在一个示例中,第一业务模块获取允许使用的安装状态,若该安装状态为空闲状态,该第一业务模块可以检测目标安装标识是否指示第一业务模块已调用目标安装接口。可选地,当第一业务模块成功建立第一连接时,可以设置该目标安装标识的初始值为指示第一业务模块未调用目标安装接口。可选地,第一业务模块可以在向升级引擎服务发送安装目标系统升级安装的服务请求时,设置该目标安装标识的初始值为指示第一业务模块未调用目标安装接口。In one example, the first business module obtains an installation status that is allowed to be used. If the installation status is an idle state, the first business module can detect whether the target installation identifier indicates that the first business module has called the target installation interface. Optionally, when the first service module successfully establishes the first connection, the initial value of the target installation identifier may be set to indicate that the first service module does not call the target installation interface. Optionally, when sending a service request to install the target system upgrade and installation to the upgrade engine service, the first business module may set the initial value of the target installation identifier to indicate that the first business module does not call the target installation interface.
举例来说,目标系统升级安装包为6.1.0版本的参数包,第一业务模块为安装该6.1.0版本的参数包,建立第一连接,并设置第一标识信息为指示本次安装的生命周期未结束(如isClosed=false),设置目标安装标识(如“isCalledStartUpdatePara”)的值为false。升级引擎服务通过第一连接实时向第一业务模块反馈的该升级引擎服务的安装状态。该第一业务模块在接收到该升级引擎服务的安装状态(如该安装状态为空闲状态)时,检测isClosed的值为false,确定允许使用升级引擎服务的安装状态。该第一业务模块检测到该安装状态为空闲状态,检测isCalledStartUpdatePara的值是否为true。本示例中,在第一业务模块在建立第一连接时,设置isCalledStartUpdatePara的初始值为fasle,当前该第一业务模块检测到该isCalledStartUpdatePara的值为fasle,即该第一业务模块可以确定当前升级引擎服务处于空闲状态且未安装该6.1.0版本的参数包,第一业务模块指示升级引擎服务安装6.1.0版本的参数包,此时,该第一业务模块调用了与参数包的类型对应的安装接口,可以将isCalledStartUpdatePara置为true。可选地,第一业务模块也可以将isCalledStartUpdatePara置为true(即步骤407),再指示升级引擎服务安装6.1.0版本的参数包,该升级引擎服务根据第一业务模块的指示安装该目标系统升级安装包(即步骤406)。For example, if the target system upgrade installation package is the parameter package of version 6.1.0, the first business module installs the parameter package of version 6.1.0, establishes the first connection, and sets the first identification information to indicate this installation. If the life cycle has not ended (such as isClosed=false), set the value of the target installation identifier (such as "isCalledStartUpdatePara") to false. The upgrade engine service feeds back the installation status of the upgrade engine service to the first business module in real time through the first connection. When receiving the installation status of the upgrade engine service (for example, the installation status is idle), the first business module detects that the value of isClosed is false and determines that the installation status of the upgrade engine service is allowed. The first business module detects that the installation state is idle, and detects whether the value of isCalledStartUpdatePara is true. In this example, when the first business module establishes the first connection, it sets the initial value of isCalledStartUpdatePara to fasle. Currently, the first business module detects that the value of isCalledStartUpdatePara is fasle, that is, the first business module can determine the current upgrade engine. The service is in an idle state and the parameter package of version 6.1.0 is not installed. The first business module instructs the upgrade engine service to install the parameter package of version 6.1.0. At this time, the first business module calls the parameter package corresponding to the type of the parameter package. To install the interface, you can set isCalledStartUpdatePara to true. Optionally, the first business module can also set isCalledStartUpdatePara to true (ie, step 407), and then instruct the upgrade engine service to install the parameter package of version 6.1.0. The upgrade engine service installs the target system according to the instructions of the first business module. Upgrade the installation package (step 406).
可选地,第一业务模块也可以在指示升级引擎服务安装目标系统升级安装包的同时,将目标安装标识更新为指示第一业务模块已调用目标安装接口。Optionally, the first business module may also update the target installation identification to indicate that the first business module has called the target installation interface while instructing the upgrade engine service to install the target system upgrade installation package.
步骤406:该升级引擎服务根据第一业务模块的指示安装该目标系统升级安装包。Step 406: The upgrade engine service installs the target system upgrade installation package according to the instructions of the first business module.
示例性地,第一业务模块生成安装指示,该安装指示用于指示升级引擎服务安装该目标系统升级安装包。升级引擎服务响应于该安装指示,安装该目标系统升级安装包。同时,该升级引擎服务将升级引擎服务的安装状态(也称为升级引擎服务的状态)从空闲状态更新为繁忙状态。For example, the first business module generates an installation instruction, which is used to instruct the upgrade engine service to install the target system upgrade installation package. The upgrade engine service responds to the installation instruction and installs the target system upgrade installation package. At the same time, the upgrade engine service updates the installation status of the upgrade engine service (also called the status of the upgrade engine service) from the idle state to the busy state.
步骤407:该第一业务模块将目标安装标识更新为指示第一业务模块已调用目标安装接口。Step 407: The first business module updates the target installation identification to indicate that the first business module has called the target installation interface.
步骤408:第一业务模块检测到该安装状态为繁忙状态,检测定时器是否超时。若是,则执行步骤409。Step 408: The first service module detects that the installation status is a busy status, and detects whether the timer times out. If yes, step 409 is executed.
示例性地,若第一业务模块检测到当前升级引擎服务的安装状态为繁忙状态,检测定时器记录的时长是否超过第一预设时长,第一预设时长可以预先设置,例如,第一预设时长为1分钟,45秒、30秒等。第一业务模块若检测到该定时器记录的时长超过第一预设时长,则确定检测到定时器超时,执行步骤409。For example, if the first business module detects that the current installation status of the upgrade engine service is in a busy state, it detects whether the time recorded by the timer exceeds a first preset time length. The first preset time length can be set in advance, for example, the first preset time length. Let the duration be 1 minute, 45 seconds, 30 seconds, etc. If the first service module detects that the time recorded by the timer exceeds the first preset time period, it determines that the timer has timed out and executes step 409.
第一业务模块若检测到该定时器记录的时长未超过第一预设时长,该第一业务模块不做进一步处理,由升级引擎服务继续安装当前正在安装的系统升级安装包。可选地,该升级引擎服务正在安装的系统升级安装包可以是目标系统升级安装包,也可以是其他系统升级安装包。If the first business module detects that the time recorded by the timer does not exceed the first preset time, the first business module does not perform further processing, and the upgrade engine service continues to install the system upgrade installation package currently being installed. Optionally, the system upgrade installation package being installed by the upgrade engine service may be a target system upgrade installation package or other system upgrade installation packages.
举例来说,参照步骤406中的例子,第一业务模块指示升级引擎服务安装6.1.0版本的参数包,升级引擎服务按照第一业务模块的指示安装该目标系统升级安装包时,将安装状态从空闲状态更新为繁忙状态。该升级引擎服务将当前的安装状态(即繁忙状态)发送至第一业务模块,该第一业务模块检测到isClosed=false,允许使用该安装状态(即繁忙状态)。第一业务模块检测到安装状态为繁忙状态,获取定时器记录的时长(如30秒),假设第一预设时长为45秒,该第一业务模块检测到定时器记录的时长小于第一预设时长,该第一业务模块不做操作,由升级引擎服务继续安装6.1.0版本的参数包。若该升级引擎服务安装6.1.0版本的参数包成功,可以将升级引擎服务的安装状态更新为结束状态。For example, referring to the example in step 406, the first business module instructs the upgrade engine service to install the parameter package of version 6.1.0. When the upgrade engine service installs the target system upgrade installation package according to the instructions of the first business module, the installation status Update from idle to busy. The upgrade engine service sends the current installation status (ie, busy status) to the first business module. The first business module detects isClosed=false and allows the installation status (ie, busy status) to be used. The first business module detects that the installation status is busy and obtains the duration recorded by the timer (such as 30 seconds). Assume that the first preset duration is 45 seconds. The first business module detects that the duration recorded by the timer is less than the first preset duration. For a set time, the first business module does not perform operations, and the upgrade engine service continues to install the parameter package of version 6.1.0. If the upgrade engine service successfully installs the parameter package of version 6.1.0, the installation status of the upgrade engine service can be updated to the completed status.
再如,该升级引擎服务当前正在安装补丁包(即补丁类型的系统升级安装包),该升级引擎服务将当前的安装状态(即繁忙状态)发送至第一业务模块,该第一业务模块检测到isClosed=false,允许使用该安装状态(即繁忙状态)。第一业务模块检测到安装状态为繁忙状态,获取定时器记录的时长(如50秒),假设第一预设时长为45秒,该第一业务模块检测到定时器记录的时长大于第一预设时长,该第一业务模块确定定时器超时,检测目标安装标识是否指示第一业务模块已调用目标安装接口,即执行步骤409。For another example, the upgrade engine service is currently installing a patch package (i.e., a patch-type system upgrade installation package). The upgrade engine service sends the current installation status (i.e., busy status) to the first business module, and the first business module detects to isClosed=false to allow this installation state (i.e. busy state) to be used. The first business module detects that the installation status is busy and obtains the duration recorded by the timer (such as 50 seconds). Assume that the first preset duration is 45 seconds. The first business module detects that the duration recorded by the timer is greater than the first preset duration. Assuming the duration, the first service module determines that the timer has timed out, detects whether the target installation identifier indicates that the first service module has called the target installation interface, and then executes step 409.
步骤409:第一业务模块检测目标安装标识是否指示第一业务模块已调用目标安装接口。若是,则执行步骤410;若否,则执行步骤415。Step 409: The first business module detects whether the target installation identifier indicates that the first business module has called the target installation interface. If yes, perform step 410; if not, perform step 415.
示例性地,若第一业务模块检测到目标安装标识指示第一业务模块未调用目标安装接口,则确定等待下一次安装目标系统升级安装包,该第一业务模块断开该第一连接,并将第一标识信息更新为指示本次安装的生命周期结束,即执行步骤415。由于本次未安装该目标系统升级安装包,可以等待下一次安装该目标系统升级安装包,即第一业务模块可以等待(或称为延迟)第二预设时长,重新与升级引擎服务建立新的连接,以重新尝试安装该目标系统升级安装包。For example, if the first business module detects that the target installation identifier indicates that the first business module has not called the target installation interface, it determines to wait for the next installation of the target system upgrade installation package, the first business module disconnects the first connection, and The first identification information is updated to indicate the end of the life cycle of this installation, that is, step 415 is executed. Since the target system upgrade installation package has not been installed this time, you can wait for the next installation of the target system upgrade installation package. That is, the first business module can wait (or delay) for the second preset time to re-establish a new installation with the upgrade engine service. connection to retry installing the target system upgrade installation package.
若第一业务模块检测到目标安装标识指示第一业务模块已调用目标安装接口,则确定本次安装该目标系统升级安装包失败(即步骤410),并执行步骤411。If the first business module detects that the target installation identifier indicates that the first business module has called the target installation interface, it determines that the installation of the target system upgrade installation package failed this time (ie, step 410), and executes step 411.
步骤410:第一业务模块确定安装目标系统升级安装包失败。Step 410: The first business module determines that the installation of the target system upgrade installation package failed.
可选地,该第一业务模块可以确定安装该目标系统升级安装包失败,执行步骤411。Optionally, the first business module may determine that the installation of the target system upgrade installation package fails, and perform step 411.
步骤411:第一业务模块断开连接,并将第一标识信息更新为指示本次安装的生命周期结束。Step 411: The first service module disconnects and updates the first identification information to indicate the end of the life cycle of this installation.
示例性地,第一业务模块断开第一连接(即解绑AIDL接口),并将第一标识信息更新为指示本次安装的生命周期结束,例如,第一业务模块将isClosed的值置为true。当第一业务模块接收到升级引擎服务发送的安装状态时,该第一业务模块检测到isClosed的值为true,结束流程。Illustratively, the first business module disconnects the first connection (ie, unbinds the AIDL interface), and updates the first identification information to indicate the end of the life cycle of this installation. For example, the first business module sets the value of isClosed to true. When the first business module receives the installation status sent by the upgrade engine service, the first business module detects that the value of isClosed is true and ends the process.
第一业务模块执行断开第一连接的操作后,第一连接并不会立即断开,从第一业务模块执行断开第一连接的操作到第一连接断开的时段内,该升级引擎服务依然向该第一业务模块返回升级引擎服务的安装状态。本示例中,由于第一业务模块在断开第一连接的操作时,还更新了第一标识信息(更新为指示本次安装的生命周期结束),使得从第一业务模块执行断开第一连接的操作到第一连接断开的时段内,第一业务模块不再允许使用接收到的安装状态,从而避免第一业务模块在第一业务模块执行断开第一连接的操作到第一连接断开的时段内发生安装错误、混乱的问题。After the first business module performs the operation of disconnecting the first connection, the first connection will not be disconnected immediately. During the period from when the first business module performs the operation of disconnecting the first connection to the time when the first connection is disconnected, the upgrade engine The service still returns the installation status of the upgrade engine service to the first business module. In this example, when the first business module disconnects the first connection, it also updates the first identification information (updated to indicate the end of the life cycle of this installation), so that the first business module disconnects the first connection. During the period from the operation of connecting to the disconnection of the first connection, the first business module is no longer allowed to use the received installation status, thereby preventing the first business module from performing the operation of disconnecting the first connection to the first connection. Installation errors and confusion may occur during the disconnection period.
步骤412:第一业务模块检测到该安装状态为结束状态,检测目标安装标识是否指示第一业务模块已调用目标安装接口。若是,则执行步骤413;若否,则执行步骤406。Step 412: The first business module detects that the installation status is the completion status, and detects whether the target installation identifier indicates that the first business module has called the target installation interface. If yes, perform step 413; if not, perform step 406.
示例性地,第一业务模块检测到该安装状态为结束状态,同样检测目标安装标识是否指示第一业务模块已调用目标安装接口,若是,则确定本次安装该目标系统升级安装包结束,可以断开第一连接。若否,表征当前安装的其他系统升级安装包结束,可以安装目标系统升级安装包,即执行步骤406。Exemplarily, the first business module detects that the installation status is the end state, and also detects whether the target installation identifier indicates that the first business module has called the target installation interface. If so, it is determined that the current installation of the target system upgrade installation package is completed. Disconnect the first connection. If not, it indicates that the currently installed other system upgrade installation packages have ended, and the target system upgrade installation package can be installed, that is, step 406 is performed.
举例来说,升级引擎服务安装补丁包失败或成功,将安装状态更新为结束状态。假设目标系统安装包为6.1.0版本的参数包。该升级引擎服务将当前的安装状态(即结束状态)发送至第一业务模块,该第一业务模块检测到isClosed=false,允许使用该安装状态(即结束状态)。第一业务模块检测到安装状态为结束状态,检测到目标安装标识(如“isCalledStartUpdatePara”)的值为false,则指示升级引擎服务开始安装该6.1.0版本的参数包并将目标安装标识的值更新为true。当升级引擎服务开始装该6.1.0版本的参数包时,将安装状态从结束状态更新为繁忙状态。For example, if the upgrade engine service fails or succeeds in installing a patch package, the installation status is updated to the completed status. It is assumed that the target system installation package is the parameter package of version 6.1.0. The upgrade engine service sends the current installation status (ie, the end status) to the first business module. The first business module detects isClosed=false and allows the use of the installation status (ie, the end status). The first business module detects that the installation status is the completed state and detects that the value of the target installation identifier (such as "isCalledStartUpdatePara") is false, then instructs the upgrade engine service to start installing the parameter package of version 6.1.0 and changes the value of the target installation identifier. Updated to true. When the upgrade engine service starts to install the parameter package of version 6.1.0, the installation status is updated from the completed status to the busy status.
步骤413:第一业务模块确定安装结束。Step 413: The first business module determines that the installation is completed.
该第一业务模块确定安装结束,可以由第一业务模块处理安装结果,如在显示界面显示该安装当前的系统升级安装包的结果。The first business module determines that the installation is completed, and the first business module can process the installation result, such as displaying the result of installing the current system upgrade installation package on the display interface.
步骤414:第一业务模块断开连接,并将第一标识信息更新为指示本次安装的生命周期结束。Step 414: The first service module disconnects and updates the first identification information to indicate the end of the life cycle of this installation.
该步骤与步骤411类似,相关描述可以参照步骤411中的描述,此处不再进行赘述。This step is similar to step 411. For related description, please refer to the description in step 411, which will not be described again here.
步骤415:第一业务模块检测到安装状态为不可用状态,则断开连接,并将第一标识信息更新为指示本次安装的生命周期结束。Step 415: The first business module detects that the installation status is unavailable, disconnects the connection, and updates the first identification information to indicate the end of the life cycle of this installation.
示例性地,当第一业务模块检测到安装状态为不可用状态,则执行断开第一连接的操作,并将第一标识信息更新为指示本次安装的生命周期结束。For example, when the first business module detects that the installation status is unavailable, it performs the operation of disconnecting the first connection, and updates the first identification information to indicate the end of the life cycle of this installation.
步骤416:第一业务模块延迟第二预设时长后,重新绑定UpdateEngine服务,建立连接。Step 416: After delaying the second preset time period, the first business module rebinds the UpdateEngine service and establishes a connection.
示例性地,该第一模块可以延迟第二预设时长,重新绑定UpdateEngine服务,建立新的连接(如第二连接),以尝试下一次安装该目标系统升级安装包,即重新执行401。可选地,第二预设时长可以为3秒、5秒、10秒、15秒等。本示例中,第二预设时长以5秒为例。For example, the first module can delay the second preset time period, rebind the UpdateEngine service, and establish a new connection (such as a second connection) to try to install the target system upgrade installation package next time, that is, re-execute 401. Optionally, the second preset time length may be 3 seconds, 5 seconds, 10 seconds, 15 seconds, etc. In this example, the second preset time is 5 seconds.
需要说明的是,升级引擎服务的安装状态根据安装的过程发生变化,例如,在T1时刻升级引擎服务的安装状态为空闲状态,当开始安装目标系统升级安装包时,升级引擎服务的安装状态更新为繁忙状态。若升级引擎服务安装目标系统升级安装包失败或成功时,升级引擎服务的安装状态更新为结束状态。It should be noted that the installation status of the upgrade engine service changes according to the installation process. For example, at time T1, the installation status of the upgrade engine service is idle. When the target system upgrade installation package starts to be installed, the installation status of the upgrade engine service is updated. is in busy status. If the upgrade engine service fails or succeeds in installing the target system upgrade installation package, the installation status of the upgrade engine service is updated to the completed status.
系统更新应用为本次待安装的目标系统升级安装包分配对应的连接(即第一连接),并在该本次安装的生命周期内,允许使用升级引擎服务的状态,可以避免从第一业务模块执行断开第一连接的操作到第一连接断开的时段内,该第一业务模块使用接收到的升级引擎服务的状态而导致出现安装错误、混乱的问题;由于目标安装标识可以指示当前的业务模块是否调用升级引擎服务中的目标安装接口,通过新增目标安装标识,可以丰富第一业务模块判断是否指示升级引擎服务本次安装该目标系统升级安装包的信息,使得第一业务模块可以准确判断出该升级引擎服务的安装进程是否被占用,及时安装目标系统升级安装包(如参数类型、补丁类型或hota类型),从而避免升级引擎服务同时安装参数类型的系统升级安装包和其他系统升级安装包(即补丁类型的系统升级安装包或hota类型的系统升级安装包)导致的安装冲突的问题。同时,升级引擎服务及时安装目标系统升级安装包(如参数类型的系统升级安装包),可以提高电子设备的性能。The system update application allocates a corresponding connection (i.e., the first connection) to the target system upgrade installation package to be installed this time, and allows the use of the status of the upgrade engine service during the life cycle of this installation, which can avoid the first business interruption. During the period from when the module performs the operation of disconnecting the first connection to when the first connection is disconnected, the first business module uses the received status of the upgrade engine service to cause installation errors and confusion; because the target installation identifier can indicate the current Whether the business module calls the target installation interface in the upgrade engine service. By adding a target installation identifier, the first business module can enrich the information of whether to instruct the upgrade engine service to install the target system upgrade installation package this time, so that the first business module can It can accurately determine whether the installation process of the upgrade engine service is occupied, and promptly install the target system upgrade installation package (such as parameter type, patch type or hota type), thereby avoiding the upgrade engine service from installing parameter type system upgrade installation packages and other types at the same time. Installation conflicts caused by system upgrade installation packages (i.e. patch type system upgrade installation packages or hota type system upgrade installation packages). At the same time, the upgrade engine service promptly installs the target system upgrade installation package (such as a parameter-type system upgrade installation package), which can improve the performance of electronic equipment.
图5为示例性示出的OUC与升级引擎服务之间的交互图。如图5所示,包括:Figure 5 is an exemplary interaction diagram between the OUC and the upgrade engine service. As shown in Figure 5, it includes:
步骤501:OUC的第一业务模块向升级引擎服务发送安装目标系统升级安装包的服务请求。Step 501: The first business module of OUC sends a service request to install the target system upgrade installation package to the upgrade engine service.
步骤502:第一业务模块绑定AIDL接口,建立第一连接。Step 502: The first service module binds the AIDL interface and establishes the first connection.
该步骤501和步骤502可以参照步骤401中的相关描述,此处不再进行赘述。For steps 501 and 502, reference may be made to the relevant description in step 401, which will not be described again here.
步骤503:升级引擎服务获取当前的安装状态。Step 503: Upgrade the engine service to obtain the current installation status.
步骤504:升级引擎服务通过AIDL接口,向第一业务模块发送当前升级引擎服务的安装状态。Step 504: The upgrade engine service sends the current installation status of the upgrade engine service to the first business module through the AIDL interface.
步骤505:第一业务模块判断第一标识信息是否指示本次安装的生命周期结束。若是,则结束流程,若否,则执行步骤506。Step 505: The first business module determines whether the first identification information indicates the end of the life cycle of this installation. If yes, the process ends, if not, step 506 is executed.
步骤506:第一业务模块允许使用当前升级引擎服务的安装状态。Step 506: The first business module allows the current installation status of the upgrade engine service to be used.
步骤503~步骤506可以参照步骤402~步骤404中的相关描述,此处不再进行赘述。For steps 503 to 506, reference may be made to the relevant descriptions in steps 402 to 404, which will not be described again here.
步骤507:第一业务模块若检测到安装状态为空闲状态,检测目标安装标识是否指示第一业务模块已调用目标安装接口。若检测到否,则执行步骤508。Step 507: If the first business module detects that the installation state is idle, detect whether the target installation identifier indicates that the first business module has called the target installation interface. If no is detected, step 508 is executed.
步骤508:第一业务模块将目标安装标识更新为第一业务模块已调用目标安装接口。Step 508: The first business module updates the target installation identification to indicate that the first business module has called the target installation interface.
步骤509:第一业务模块指示升级引擎服务安装目标系统升级安装包。Step 509: The first business module instructs the upgrade engine service to install the target system upgrade installation package.
步骤510:升级引擎服务安装目标系统升级安装包。Step 510: The upgrade engine service installs the target system upgrade installation package.
步骤511:第一业务模块检测到安装状态为繁忙状态,检测定时器记录的时长是否超时,若检测到是,则执行步骤512;若检测到否,第一业务模块可以不执行操作。Step 511: The first business module detects that the installation status is busy, and detects whether the time recorded by the timer has timed out. If yes, step 512 is executed; if no, the first business module does not need to perform the operation.
步骤512:第一业务模块检测目标安装标识是否指示第一业务模块已调用目标安装接口。若检测到是,则执行步骤513。若检测到否,则执行步骤514。Step 512: The first business module detects whether the target installation identifier indicates that the first business module has called the target installation interface. If yes is detected, step 513 is executed. If no is detected, step 514 is executed.
步骤513:第一业务模块确定安装失败,断开第一连接,将第一标识信息更新为指示本次安装的生命周期结束。Step 513: The first business module determines that the installation fails, disconnects the first connection, and updates the first identification information to indicate the end of the life cycle of this installation.
步骤514:第一业务模块确定下一次安装,断开第一连接,将第一标识信息更新为指示本次安装的生命周期结束。该步骤之后执行步骤518,即第一业务模块延时第二预设时长,重新与升级引擎服务建立新的连接,以尝试下一次安装该目标系统升级安装包。Step 514: The first business module determines the next installation, disconnects the first connection, and updates the first identification information to indicate the end of the life cycle of this installation. After this step, step 518 is performed, that is, the first business module delays for a second preset time period and re-establishes a new connection with the upgrade engine service to try to install the target system upgrade installation package next time.
步骤515:第一业务模块检测到安装状态为结束状态,检测目标安装标识是否指示第一业务模块已调用目标安装接口。若检测到是,则执行步骤516。若检测到否,则执行步骤508。Step 515: The first business module detects that the installation status is the completion state, and detects whether the target installation identifier indicates that the first business module has called the target installation interface. If yes is detected, step 516 is executed. If no is detected, step 508 is executed.
步骤516:第一业务模块确定安装结束,断开第一连接,将第一标识信息更新为指示本次安装的生命周期结束。Step 516: The first business module determines that the installation is completed, disconnects the first connection, and updates the first identification information to indicate the end of the life cycle of this installation.
步骤517:第一业务模块检测到安装状态为不可用状态,则断开第一连接,将第一标识信息更新为指示本次安装的生命周期结束。该步骤之后执行步骤518。Step 517: The first business module detects that the installation status is unavailable, disconnects the first connection, and updates the first identification information to indicate the end of the life cycle of this installation. This step is followed by step 518.
步骤518:第一业务模块延时第二预设时长,与升级引擎服务建立新的连接,以尝试下一次安装该目标系统升级安装包。Step 518: The first business module delays for a second preset time and establishes a new connection with the upgrade engine service to try to install the target system upgrade installation package next time.
上述步骤507~步骤518可以参照步骤405~步骤416中的相关描述,此处不再进行赘述。For the above steps 507 to 518, reference can be made to the relevant descriptions in steps 405 to 416, and will not be described again here.
可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to implement the above functions, the electronic device includes corresponding hardware and/or software modules that perform each function. In conjunction with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or by computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions in conjunction with the embodiments for each specific application, but such implementations should not be considered to be beyond the scope of this application.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的系统升级的方法。存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。This embodiment also provides a computer storage medium that stores computer instructions. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute the above related method steps to implement the system upgrade method in the above embodiment. . Storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的系统升级的方法。This embodiment also provides a computer program product. When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the system upgrade method in the above embodiment.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic equipment, computer storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the corresponding methods provided above. The beneficial effects of the method will not be repeated here.
本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。Any contents of various embodiments of this application, as well as any contents of the same embodiment, can be freely combined. Any combination of the above is within the scope of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
Claims (15)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311062410.4A CN116775084B (en) | 2023-08-23 | 2023-08-23 | System upgrade methods and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311062410.4A CN116775084B (en) | 2023-08-23 | 2023-08-23 | System upgrade methods and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116775084A CN116775084A (en) | 2023-09-19 |
CN116775084B true CN116775084B (en) | 2023-11-24 |
Family
ID=87989853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311062410.4A Active CN116775084B (en) | 2023-08-23 | 2023-08-23 | System upgrade methods and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116775084B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101697133A (en) * | 2009-10-26 | 2010-04-21 | 中兴通讯股份有限公司 | Software upgrading method, software upgrading system and client |
CN103517258A (en) * | 2012-06-25 | 2014-01-15 | 中兴通讯股份有限公司 | A method of updating software on a mobile terminal, a mobile terminal and a server |
CN103955381A (en) * | 2014-04-04 | 2014-07-30 | 京信通信系统(中国)有限公司 | Method and system for management server to perform batch software update on terminal equipment |
CN107368324A (en) * | 2016-05-11 | 2017-11-21 | 中兴通讯股份有限公司 | A kind of component upgrade methods, devices and systems |
CN108399075A (en) * | 2018-02-28 | 2018-08-14 | 郑州云海信息技术有限公司 | A kind of method and system of update management engine |
CN114610499A (en) * | 2022-03-22 | 2022-06-10 | 深圳须弥云图空间科技有限公司 | Task scheduling method and device, computer readable storage medium and electronic equipment |
CN115269063A (en) * | 2022-07-19 | 2022-11-01 | 京东科技信息技术有限公司 | Process creation method, system, device and medium |
CN115543368A (en) * | 2022-01-10 | 2022-12-30 | 荣耀终端有限公司 | A kind of operating system upgrade method and electronic equipment |
CN116400938A (en) * | 2023-03-27 | 2023-07-07 | 荣耀终端有限公司 | Operating system upgrading method, device and storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11231921B2 (en) * | 2019-02-08 | 2022-01-25 | Atlassian Pty Ltd. | Software application update management engine |
US11989545B2 (en) * | 2020-03-26 | 2024-05-21 | EMC IP Holding Company LLC | Flexible upgrade of multi-subsystem products |
-
2023
- 2023-08-23 CN CN202311062410.4A patent/CN116775084B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101697133A (en) * | 2009-10-26 | 2010-04-21 | 中兴通讯股份有限公司 | Software upgrading method, software upgrading system and client |
CN103517258A (en) * | 2012-06-25 | 2014-01-15 | 中兴通讯股份有限公司 | A method of updating software on a mobile terminal, a mobile terminal and a server |
CN103955381A (en) * | 2014-04-04 | 2014-07-30 | 京信通信系统(中国)有限公司 | Method and system for management server to perform batch software update on terminal equipment |
CN107368324A (en) * | 2016-05-11 | 2017-11-21 | 中兴通讯股份有限公司 | A kind of component upgrade methods, devices and systems |
CN108399075A (en) * | 2018-02-28 | 2018-08-14 | 郑州云海信息技术有限公司 | A kind of method and system of update management engine |
CN115543368A (en) * | 2022-01-10 | 2022-12-30 | 荣耀终端有限公司 | A kind of operating system upgrade method and electronic equipment |
CN114610499A (en) * | 2022-03-22 | 2022-06-10 | 深圳须弥云图空间科技有限公司 | Task scheduling method and device, computer readable storage medium and electronic equipment |
CN115269063A (en) * | 2022-07-19 | 2022-11-01 | 京东科技信息技术有限公司 | Process creation method, system, device and medium |
CN116400938A (en) * | 2023-03-27 | 2023-07-07 | 荣耀终端有限公司 | Operating system upgrading method, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116775084A (en) | 2023-09-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3493059B1 (en) | Application data migration method and device | |
WO2019024754A1 (en) | Page loading method, device, and system | |
CN107943505A (en) | Application upgrade management method and device, storage medium and electronic equipment | |
CN113727333B (en) | Custom application download system | |
KR20200140555A (en) | Electronic device for switching between a dual standby mode and a single standby mode and method for the same | |
CN115328563B (en) | System startup method and electronic device | |
EP1571527A1 (en) | System and method for providing anti-virus program using wireless communication terminal | |
EP2869604B1 (en) | Method, apparatus and device for processing a mobile terminal resource | |
CN113094064A (en) | Gateway software module upgrading method, device, equipment and storage medium | |
CN109144596B (en) | Quick starting method, device, terminal, server and system | |
CN113050962B (en) | Mobile service upgrade method, device and terminal | |
CN114185579A (en) | Software upgrading method and device, electronic equipment and readable storage medium | |
US9928134B2 (en) | Method and apparatus for repairing dynamic link library file | |
CN113434233B (en) | Interface jump method and device, storage medium and electronic device | |
KR101203741B1 (en) | System and method for widget service based on smart card, and smart card applied to the same | |
CN116775084B (en) | System upgrade methods and electronic equipment | |
CN114172925B (en) | Network distribution method and equipment | |
CN118349243A (en) | Equipment system upgrading method, device, medium and equipment | |
US9690592B2 (en) | Display control device, and display control method | |
CN114640974B (en) | Data migration method, device and storage medium | |
CN108549552B (en) | Kernel loading method and device and storage medium | |
CN115002877B (en) | Network searching method and device | |
CN116048830B (en) | Method for reminding of software version upgrade, electronic equipment and readable storage medium | |
CN110336693A (en) | Management method, device, equipment and the storage medium of network control techology | |
CN117130627B (en) | Fitting upgrading method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |