[go: up one dir, main page]

CN112988213B - Program data updating method, electronic equipment and computer storage medium - Google Patents

Program data updating method, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN112988213B
CN112988213B CN202110393355.1A CN202110393355A CN112988213B CN 112988213 B CN112988213 B CN 112988213B CN 202110393355 A CN202110393355 A CN 202110393355A CN 112988213 B CN112988213 B CN 112988213B
Authority
CN
China
Prior art keywords
update
program data
application
storage area
data
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
Application number
CN202110393355.1A
Other languages
Chinese (zh)
Other versions
CN112988213A (en
Inventor
肖名鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110393355.1A priority Critical patent/CN112988213B/en
Publication of CN112988213A publication Critical patent/CN112988213A/en
Application granted granted Critical
Publication of CN112988213B publication Critical patent/CN112988213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a program data updating method, electronic equipment and a computer storage medium, relates to the technical field of Internet, and solves the problem that program flash back occurs during application program updating. The specific scheme is as follows: under the condition that the first application is in a using state and the first program data needs to be updated, placing an upgrading task corresponding to the first program data into a waiting list; acquiring a use state of a first application; taking out the upgrade task from the waiting list under the condition that the first application is in an unused state; under the instruction of an upgrade task, analyzing and installing an update data packet of the first program data; or under the instruction of the upgrade task, updating the first program data according to the second program data; the second program data is obtained by analyzing and installing an update data packet of the first program data in the second storage area; the second storage area is different from the first storage area for storing the first program data.

Description

一种程序数据更新方法、电子设备及计算机存储介质A program data updating method, electronic device and computer storage medium

技术领域Technical field

本申请涉及互联网技术领域,尤其涉及一种程序数据更新方法、电子设备及计算机存储介质。This application relates to the field of Internet technology, and in particular to a program data update method, electronic equipment and computer storage media.

背景技术Background technique

应用程序通过与用户的交互,向用户提供多样化的服务,丰富了用户的生活。随着互联网技术纵深发展,应用程序需要快速迭代(比如,版本的更新),以适应市场的变化节奏。Applications provide users with diverse services through interaction with users, enriching users' lives. With the in-depth development of Internet technology, applications need to be quickly iterated (for example, version updates) to adapt to the changing rhythm of the market.

然而,在一些场景下,应用程序更新过程中,会出现程序闪退的问题,而程序闪退也会直接造成中断向用户提供相关服务。以升级安装于手机内的聊天应用举例。如图1中的(a)所示,手机显示聊天应用的聊天窗口,用户正通过该聊天窗口与联系人聊天,如果此时升级该聊天应用,则可能突然出现短暂的卡顿,聊天应用所提供的服务被中断,聊天应用会闪退,如图1中的(b)所示,手机会显示桌面。在用户需再次使用聊天应用时,可重新开启聊天应用,手机可重新显示聊天应用的聊天窗口,如图1中的(c)所示,但原编辑聊天内容会丢失。However, in some scenarios, during the application update process, program crashes may occur, and program crashes may directly interrupt the provision of relevant services to users. Take, for example, upgrading a chat application installed on a mobile phone. As shown in (a) in Figure 1, the mobile phone displays the chat window of the chat application, and the user is chatting with the contact through the chat window. If the chat application is upgraded at this time, there may be a sudden temporary lag, and the chat application If the service provided is interrupted, the chat application will crash, as shown in (b) in Figure 1, and the mobile phone will display the desktop. When the user needs to use the chat application again, he can reopen the chat application, and the mobile phone can re-display the chat window of the chat application, as shown in (c) in Figure 1, but the original edited chat content will be lost.

可见,应用程序更新时出现程序闪退,不仅影响用户的使用体验,还会影响用户对系统及应用程序稳定性能的评估。It can be seen that program crashes during application updates not only affect the user experience, but also affect the user's evaluation of the stability and performance of the system and applications.

发明内容Contents of the invention

本申请提供一种程序数据更新方法、电子设备及计算机存储介质,程序更新过程避开了应用程序被使用期间。保障程序更新需求的同时,提高应用程序运行的稳定性。增强用户的使用体验。This application provides a program data updating method, electronic device and computer storage medium. The program updating process avoids the period when the application program is in use. While ensuring program update requirements, it also improves the stability of application operations. Enhance user experience.

为达到上述目的,本申请采用如下技术方案:In order to achieve the above purpose, this application adopts the following technical solutions:

第一方面,本申请实施例提供一种程序数据更新方法,所述方法包括:在第一应用处于正在使用状态,且需要对第一程序数据进行更新的情况下,将所述第一程序数据对应的升级任务放入等待列表;获取所述第一应用的使用状态;所述第一程序数据是所述第一应用的程序文件,或是所述第一应用的公共组件的程序文件;在所述第一应用处于未使用状态的情况下,将所述升级任务从所述等待列表中取出;在所述升级任务的指示下,解析安装所述第一程序数据的更新数据包,以更新所述第一程序数据;或,在所述升级任务的指示下,根据第二程序数据更新所述第一程序数据;其中,所述第二程序数据是在第二存储区域内解析安装所述第一程序数据的更新数据包后得到的数据;所述第二存储区域与所述第一存储区域不同;所述第一存储区域为用于存储所述第一程序数据的存储区域。In a first aspect, embodiments of the present application provide a method for updating program data. The method includes: when the first application is in use and the first program data needs to be updated, updating the first program data The corresponding upgrade task is put into the waiting list; the usage status of the first application is obtained; the first program data is the program file of the first application, or the program file of a common component of the first application; in When the first application is in an unused state, remove the upgrade task from the waiting list; under the instruction of the upgrade task, parse and install the update data package of the first program data to update The first program data; or, under the instruction of the upgrade task, update the first program data according to the second program data; wherein the second program data is parsed and installed in the second storage area. Data obtained after updating the data package of the first program data; the second storage area is different from the first storage area; the first storage area is a storage area used to store the first program data.

在上述实施例中,在第一程序数据所对应的关联应用(也即,第一应用)处于正在使用状态的情况下,暂缓对第一程序数据的数据实体进行更新。在第一程序数据所对应的所有关联应用均处于未使用状态时,才执行第一程序数据的数据实体进行更新。从而,避免了程序数据升级与应用程序使用之间产生冲突。也改善了应用程序使用过程中受程序升级影响导致闪退的问题。提高用户的使用体验。In the above embodiment, when the associated application corresponding to the first program data (that is, the first application) is in use, updating the data entity of the first program data is suspended. When all associated applications corresponding to the first program data are in an unused state, the data entity of the first program data is updated. Thus, conflicts between program data upgrade and application usage are avoided. It has also improved the issue of crashes caused by program upgrades during application use. Improve user experience.

示例性地,可以在关联应用处于未使用状态的情况下,将对应的升级任务从等待列表中取出。然而,按照升级任务的指示下,解析安装第一程序数据的更新数据包,以更新第一程序数据。避免解析安装更新数据包时出现关闭关联应用的应用进程的现象。For example, when the associated application is in an unused state, the corresponding upgrade task can be removed from the waiting list. However, according to the instructions of the upgrade task, the update data package for installing the first program data is parsed to update the first program data. Avoid closing the application process of the associated application when parsing and installing update data packages.

示例性地,还可以在关联应用处于未使用状态的情况下,利用第二存储区域内已有的第二程序数据更新第一存储区域内的第一程序数据。也即,在关联应用处于未使用状态的情况下,直接利用已有的第二程序数据更替第一程序数据的数据实体,避免出现关闭关联应用的应用进程的现象。For example, when the associated application is in an unused state, the first program data in the first storage area can be updated using the second program data already in the second storage area. That is, when the associated application is in an unused state, the existing second program data is directly used to replace the data entity of the first program data to avoid closing the application process of the associated application.

结合第一方面,在一种可能的实现方式中,所述解析安装所述第一程序数据的更新数据包,包括:根据升级任务,获取所述第一程序数据的更新数据包;在第一存储区域内解析安装所述第一程序数据的更新数据包,以替换所述第一程序数据。In conjunction with the first aspect, in a possible implementation, the parsing and installing the update data package of the first program data includes: obtaining the update data package of the first program data according to the upgrade task; The update data package of the first program data is parsed and installed in the storage area to replace the first program data.

结合第一方面,在另一种可能的实现方式中,在第一应用处于正在使用状态,且需要对第一程序数据进行更新的情况下,所述方法还包括:在所述第二存储区域内解析安装所述第一程序数据的更新数据包,以得到所述第二程序数据。In conjunction with the first aspect, in another possible implementation manner, when the first application is in use and the first program data needs to be updated, the method further includes: in the second storage area The update data package for installing the first program data is parsed and installed to obtain the second program data.

在上述实施例中,通过预先在第二存储区域内解压第一程序数据的更新数据包,缩短更新第一程序数据的时耗。提高升级效率。In the above embodiment, by decompressing the update data packet of the first program data in the second storage area in advance, the time consumption of updating the first program data is shortened. Improve upgrade efficiency.

结合第一方面,在另一种可能的实现方式中,在所述更新数据包为全量数据包的情况下,所述根据第二程序数据更新所述第一程序数据,包括:采用所述第二程序数据,替换所述第一程序数据。In conjunction with the first aspect, in another possible implementation manner, when the update data packet is a full data packet, updating the first program data according to the second program data includes: using the third program data. The second program data replaces the first program data.

结合第一方面,在另一种可能的实现方式中,在所述更新数据包为增量数据包的情况下,所述根据第二程序数据更新所述第一程序数据,包括:将所述第二程序数据存储至所述第一存储区域,并与所述第一程序数据融合。In conjunction with the first aspect, in another possible implementation manner, when the update data packet is an incremental data packet, updating the first program data according to the second program data includes: converting the The second program data is stored in the first storage area and merged with the first program data.

结合第一方面,在另一种可能的实现方式中,在所述更新数据包为全量数据包的情况下,所述根据第二程序数据更新所述第一程序数据,包括:In conjunction with the first aspect, in another possible implementation, when the update data packet is a full data packet, updating the first program data according to the second program data includes:

将所述第一程序数据的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。The loading address of the first program data is changed from the address of the first storage area to the address of the second storage area.

在上述实施例中,使更新第一程序数据的过程更加简单快速。提升了更新效率,避免长时间影响用户使用关联应用。In the above embodiment, the process of updating the first program data is made simpler and faster. Improved update efficiency to avoid long-term impact on users' use of associated applications.

结合第一方面,在另一种可能的实现方式中,在所述更新数据包为增量数据包的情况下,所述根据第二程序数据更新所述第一程序数据,包括:将所述第一程序数据镜像至所述第二存储区域,并与所述第二程序数据融合;将所述第一程序数据的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。In conjunction with the first aspect, in another possible implementation manner, when the update data packet is an incremental data packet, updating the first program data according to the second program data includes: converting the The first program data is mirrored to the second storage area and merged with the second program data; the loading address of the first program data is changed from the address of the first storage area to the second storage area the address of.

结合第一方面,在另一种可能的实现方式中,上述方法还包括:将第一存储区域内的所述第一程序数据删除。In conjunction with the first aspect, in another possible implementation, the above method further includes: deleting the first program data in the first storage area.

在上述实施例中,有效地减少电子设备内数据的冗余。In the above embodiment, the redundancy of data in the electronic device is effectively reduced.

结合第一方面,在另一种可能的实现方式中,将第一存储区域内的所述第一程序数据删除,包括:Combined with the first aspect, in another possible implementation, deleting the first program data in the first storage area includes:

所述第一应用在加载地址变更后的预设时长内未出现运行异常的情况下,删除所述第一存储区域内的所述第一程序数据。The first application deletes the first program data in the first storage area if no operating abnormality occurs within a preset time period after the loading address is changed.

结合第一方面,在另一种可能的实现方式中,所述方法还包括:Combined with the first aspect, in another possible implementation, the method further includes:

所述第一应用在加载地址变更后的预设时长内出现运行异常的情况下,将加载所述第一程序数据的加载地址恢复为所述第一存储区域的地址;清空所述第二存储区域。If the first application runs abnormally within a preset time period after the loading address is changed, the loading address for loading the first program data is restored to the address of the first storage area; and the second storage is cleared. area.

在上述实施例中,实现异常回退保护,提升了应用程序的稳定性能。In the above embodiment, exception rollback protection is implemented, which improves the stability of the application program.

结合第一方面,在另一种可能的实现方式中,获取所述第一应用的使用状态,包括:Combined with the first aspect, in another possible implementation, obtaining the usage status of the first application includes:

周期性地重启获取所述第一应用的使用状态,直至所述第一程序数据的所有第一应用都处于未使用状态。Periodically restart and obtain the usage status of the first application until all first applications of the first program data are in an unused status.

结合第一方面,在另一种可能的实现方式中,获取所述第一应用的使用状态,包括:Combined with the first aspect, in another possible implementation, obtaining the usage status of the first application includes:

在检测到任一应用程序从正在使用状态切换为未使用状态的情况下,重启获取所述第一应用的使用状态。When it is detected that any application program switches from the in-use state to the unused state, restart and obtain the use state of the first application.

结合第一方面,在另一种可能的实现方式中,在更新所述第一程序数据的过程中,所述方法还包括:In conjunction with the first aspect, in another possible implementation, during the process of updating the first program data, the method further includes:

在所述第一应用的桌面图标上显示提示信息;或,在接收到用户对所述第一应用的图标的操作后,显示提示信息;Display prompt information on the desktop icon of the first application; or, after receiving a user's operation on the icon of the first application, display prompt information;

其中,所述提示信息用于提示以下信息中的至少一个:更新状态、更新进度、更新版本、更新发布时间。The prompt information is used to prompt at least one of the following information: update status, update progress, update version, and update release time.

在上述实施例中,通过提醒,改善用户在第一程序升级期间误操作关联应用的问题。也使用户能够更加了解更新信息。In the above embodiment, reminders are used to improve the problem of users misoperating associated applications during the first program upgrade. It also enables users to be more aware of updated information.

结合第一方面,在另一种可能的实现方式中,所述方法还包括:在对第一程序数据升级完毕后,取消在所述第一应用的桌面图标上显示提示信息;或,在接收到用户对所述第一应用的图标的操作后,取消显示提示信息。In conjunction with the first aspect, in another possible implementation, the method further includes: after completing the upgrade of the first program data, canceling the display of prompt information on the desktop icon of the first application; or, after receiving After the user operates the icon of the first application, the prompt information is canceled.

结合第一方面,在另一种可能的实现方式中,获取所述第一应用的使用状态,包括:Combined with the first aspect, in another possible implementation, obtaining the usage status of the first application includes:

根据所述第一应用的运行状态,确定所述使用状态;Determine the usage status according to the running status of the first application;

其中,所述运行状态包括前台运行,后台运行和停止运行;Wherein, the running status includes foreground running, background running and stopped running;

在所述运行状态为所述前台运行的情况下,所述使用状态为正在使用状态;When the running state is the foreground running, the use state is the in-use state;

在所述运行状态为所述停止运行的情况下,所述使用状态为未使用状态;When the operating state is the stopped operation, the use state is an unused state;

在所述运行状态为所述后台运行且显示多任务界面,或所述运行状态为所述后台运行且接收到用户对所述多任务界面中所述第一应用的界面的操作的情况下,所述使用状态为正在使用状态。When the running state is the background running and a multi-tasking interface is displayed, or the running state is the background running and a user's operation on the interface of the first application in the multi-tasking interface is received, The usage status is the in-use status.

第二方面,本申请实施例提供一种电子设备,该电子设备包括一个或多个处理器和存储器;存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,所述一个或多个处理器,用于在第一应用处于正在使用状态,且需要对第一程序数据进行更新的情况下,将所述第一程序数据对应的升级任务放入等待列表;获取所述第一应用的使用状态;所述第一程序数据是所述第一应用的程序文件,或是所述第一应用的公共组件的程序文件;在所述第一应用处于未使用状态的情况下,将所述升级任务从所述等待列表中取出;在所述升级任务的指示下,解析安装所述第一程序数据的更新数据包,以更新所述第一程序数据;或,在所述升级任务的指示下,根据第二程序数据更新所述第一程序数据;其中,所述第二程序数据是在第二存储区域内解析安装所述第一程序数据的更新数据包后得到的数据;所述第二存储区域与所述第一存储区域不同;所述第一存储区域为用于存储所述第一程序数据的存储区域。In a second aspect, embodiments of the present application provide an electronic device. The electronic device includes one or more processors and memories; the memory is coupled to the processor, and the memory is used to store computer program code. The computer program code includes computer instructions. When a or multiple processors execute computer instructions, the one or more processors are configured to update the first program data when the first application is in use and the first program data needs to be updated. The corresponding upgrade task is put into the waiting list; the usage status of the first application is obtained; the first program data is the program file of the first application, or the program file of a common component of the first application; in When the first application is in an unused state, remove the upgrade task from the waiting list; under the instruction of the upgrade task, parse and install the update data package of the first program data to update The first program data; or, under the instruction of the upgrade task, update the first program data according to the second program data; wherein the second program data is parsed and installed in the second storage area. Data obtained after updating the data package of the first program data; the second storage area is different from the first storage area; the first storage area is a storage area used to store the first program data.

结合第二方面,在一种可能的实现方式中,所述一个或多个处理器,用于所述解析安装所述第一程序数据的更新数据包,包括:根据升级任务,获取所述第一程序数据的更新数据包;在第一存储区域内解析安装所述第一程序数据的更新数据包,以替换所述第一程序数据。In conjunction with the second aspect, in a possible implementation, the one or more processors are configured to parse and install an update data package of the first program data, including: obtaining the third program data according to an upgrade task. An update data package of program data; parse and install the update data package of the first program data in the first storage area to replace the first program data.

结合第二方面,在另一种可能的实现方式中,在第一应用处于正在使用状态,且需要对第一程序数据进行更新的情况下,所述一个或多个处理器,还用于:在所述第二存储区域内解析安装所述第一程序数据的更新数据包,以得到所述第二程序数据。Combined with the second aspect, in another possible implementation, when the first application is in use and needs to update the first program data, the one or more processors are also used to: The update data package for installing the first program data is parsed in the second storage area to obtain the second program data.

结合第二方面,在另一种可能的实现方式中,在所述更新数据包为全量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述第一程序数据,包括:采用所述第二程序数据,替换所述第一程序数据。In conjunction with the second aspect, in another possible implementation manner, when the update data packet is a full data packet, the one or more processors are configured to update the update data packet according to the second program data. The first program data includes: using the second program data to replace the first program data.

结合第二方面,在另一种可能的实现方式中,在所述更新数据包为增量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述第一程序数据,包括:将所述第二程序数据存储至所述第一存储区域,并与所述第一程序数据融合。In conjunction with the second aspect, in another possible implementation, when the update data packet is an incremental data packet, the one or more processors are configured to update the data according to the second program data. The first program data includes: storing the second program data in the first storage area and merging it with the first program data.

结合第二方面,在另一种可能的实现方式中,在所述更新数据包为全量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述第一程序数据,包括:In conjunction with the second aspect, in another possible implementation manner, when the update data packet is a full data packet, the one or more processors are configured to update the update data packet according to the second program data. First program data, including:

将所述第一程序数据的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。The loading address of the first program data is changed from the address of the first storage area to the address of the second storage area.

结合第二方面,在另一种可能的实现方式中,在所述更新数据包为增量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述第一程序数据,包括:将所述第一程序数据镜像至所述第二存储区域,并与所述第二程序数据融合;将所述第一程序数据的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。In conjunction with the second aspect, in another possible implementation, when the update data packet is an incremental data packet, the one or more processors are configured to update the data according to the second program data. The first program data includes: mirroring the first program data to the second storage area and merging it with the second program data; changing the loading address of the first program data from the first storage area. The address of the area is changed to the address of the second storage area.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,还用于:将第一存储区域内的所述第一程序数据删除。In conjunction with the second aspect, in another possible implementation, the one or more processors are further configured to delete the first program data in the first storage area.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,用于将第一存储区域内的所述第一程序数据删除,包括:In conjunction with the second aspect, in another possible implementation, the one or more processors are configured to delete the first program data in the first storage area, including:

所述第一应用在加载地址变更后的预设时长内未出现运行异常的情况下,删除所述第一存储区域内的所述第一程序数据。The first application deletes the first program data in the first storage area if no operating abnormality occurs within a preset time period after the loading address is changed.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,还用于:Combined with the second aspect, in another possible implementation, the one or more processors are also used to:

所述第一应用在加载地址变更后的预设时长内出现运行异常的情况下,将加载所述第一程序数据的加载地址恢复为所述第一存储区域的地址;清空所述第二存储区域。If the first application runs abnormally within a preset time period after the loading address is changed, the loading address for loading the first program data is restored to the address of the first storage area; and the second storage is cleared. area.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,用于获取所述第一应用的使用状态,包括:In conjunction with the second aspect, in another possible implementation, the one or more processors are configured to obtain the usage status of the first application, including:

周期性地重启获取所述第一应用的使用状态,直至所述第一程序数据的所有第一应用都处于未使用状态。Periodically restart and obtain the usage status of the first application until all first applications of the first program data are in an unused status.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,用于获取所述第一应用的使用状态,包括:In conjunction with the second aspect, in another possible implementation, the one or more processors are configured to obtain the usage status of the first application, including:

在检测到任一应用程序从正在使用状态切换为未使用状态的情况下,重启获取所述第一应用的使用状态。When it is detected that any application program switches from the in-use state to the unused state, restart and obtain the use state of the first application.

结合第二方面,在另一种可能的实现方式中,在更新所述第一程序数据的过程中,所述一个或多个处理器,还用于:Combined with the second aspect, in another possible implementation, during the process of updating the first program data, the one or more processors are also used to:

在所述第一应用的桌面图标上显示提示信息;或,在接收到用户对所述第一应用的图标的操作后,显示提示信息;Display prompt information on the desktop icon of the first application; or, after receiving a user's operation on the icon of the first application, display prompt information;

其中,所述提示信息用于提示以下信息中的至少一个:更新状态、更新进度、更新版本、更新发布时间。The prompt information is used to prompt at least one of the following information: update status, update progress, update version, and update release time.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,还用于:在对第一程序数据升级完毕后,取消在所述第一应用的桌面图标上显示提示信息;或,在接收到用户对所述第一应用的图标的操作后,取消显示提示信息。In conjunction with the second aspect, in another possible implementation, the one or more processors are further configured to: after the first program data is upgraded, cancel the display on the desktop icon of the first application. Prompt information; or, after receiving a user's operation on the icon of the first application, cancel the display of prompt information.

结合第二方面,在另一种可能的实现方式中,所述一个或多个处理器,用于获取所述第一应用的使用状态,包括:In conjunction with the second aspect, in another possible implementation, the one or more processors are configured to obtain the usage status of the first application, including:

根据所述第一应用的运行状态,确定所述使用状态;Determine the usage status according to the running status of the first application;

其中,所述运行状态包括前台运行,后台运行和停止运行;Wherein, the running status includes foreground running, background running and stopped running;

在所述运行状态为所述前台运行的情况下,所述使用状态为正在使用状态;When the running state is the foreground running, the use state is the in-use state;

在所述运行状态为所述停止运行的情况下,所述使用状态为未使用状态;When the operating state is the stopped operation, the use state is an unused state;

在所述运行状态为所述后台运行且显示多任务界面,或所述运行状态为所述后台运行且接收到用户对所述多任务界面中所述第一应用的界面的操作的情况下,所述使用状态为正在使用状态。When the running state is the background running and a multi-tasking interface is displayed, or the running state is the background running and a user's operation on the interface of the first application in the multi-tasking interface is received, The usage status is the in-use status.

第三方面,本申请实施例提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如第一方面及其任一种可能的设计方式所述的方法。In a third aspect, embodiments of the present application provide a computer storage medium. The computer storage medium includes computer instructions. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute the first aspect and any one thereof. Possible design methods described.

第四方面,本申请实施例提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面及其任一种可能的设计方式所述的方法。In a fourth aspect, embodiments of the present application provide a computer program product. When the computer program product is run on a computer, it causes the computer to execute the method described in the first aspect and any possible design manner thereof.

可以理解地,上述提供的第二方面及其任一种可能的设计方式所述的电子设备,第三方面所述的计算机存储介质,以及第四方面所述的计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。It can be understood that the electronic device described in the second aspect and any possible design manner provided above, the computer storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to execute the above. The corresponding method provided above, therefore, the beneficial effects it can achieve can be referred to the beneficial effects in the corresponding method provided above, and will not be described again here.

附图说明Description of the drawings

图1为相关技术中应用更新过程中,出现闪退的示例图;Figure 1 is an example of a crash during the application update process in related technologies;

图2为本申请实施例提供的手机的结构示意图;Figure 2 is a schematic structural diagram of a mobile phone provided by an embodiment of the present application;

图3为本申请实施例提供的手机的软件结构框图;Figure 3 is a software structure block diagram of a mobile phone provided by an embodiment of the present application;

图4为本申请实施例提供的程序数据更新方法的步骤流程图之一;Figure 4 is one of the step flow charts of the program data updating method provided by the embodiment of the present application;

图5为本申请实施例提供中单个应用程序处于前台运行的示例图;Figure 5 is an example diagram of a single application running in the foreground according to the embodiment of the present application;

图6为本申请实施例提供中多个应用程序处于前台运行的示例图之一;Figure 6 is one of the example diagrams of multiple applications running in the foreground provided by the embodiment of the present application;

图7为本申请实施例提供中多个应用程序处于前台运行的示例图之二;Figure 7 is the second example diagram of multiple applications running in the foreground provided by the embodiment of the present application;

图8为本申请实施例提供的触发开启多任务界面的方式示例图;Figure 8 is an example diagram of a method for triggering the opening of a multi-task interface provided by an embodiment of the present application;

图9为本申请实施例提供的通过桌面图标显示提示信息的示例图之一;Figure 9 is an example diagram of displaying prompt information through desktop icons provided by an embodiment of the present application;

图10为本申请实施例提供的通过桌面图标显示提示信息的示例图之二;Figure 10 is the second example diagram of displaying prompt information through desktop icons provided by the embodiment of the present application;

图11为本申请实施例提供的通过接收到用户对所述第一应用的图标的操作后,显示提示信息的示例图;Figure 11 is an example diagram of displaying prompt information after receiving a user's operation on the icon of the first application provided by an embodiment of the present application;

图12为本申请实施例提供的程序数据更新方法的步骤流程图之二;Figure 12 is the second step flow chart of the program data updating method provided by the embodiment of the present application;

图13为本申请实施例提供的程序数据更新方法的步骤流程图之三;Figure 13 is the third step flow chart of the program data updating method provided by the embodiment of the present application;

图14为本申请实施例提供的一种芯片系统的组成示意图。Figure 14 is a schematic diagram of the composition of a chip system provided by an embodiment of the present application.

具体实施方式Detailed ways

以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms “first” and “second” are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

下面将结合附图对本实施例的实施方式进行详细描述。The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.

本申请实施例提供一种程序数据更新方法,可以应用于电子设备内的程序更新过程中。Embodiments of the present application provide a program data updating method, which can be applied in the program updating process in electronic devices.

上述程序更新可以是对电子设备内的应用程序(application,APP)的程序文件进行更新。以电子设备为图1中的(b)所示的手机为例,手机内安装有地图APP、视频APP、打车APP等。那么上述程序更新可以是指对地图APP、视频APP或打车APP的程序文件进行更新。The above program update may be an update of a program file of an application program (application, APP) in the electronic device. Taking the electronic device as a mobile phone shown in (b) in Figure 1 as an example, the mobile phone is installed with a map APP, a video APP, a taxi APP, etc. Then the above-mentioned program update may refer to updating the program files of the map APP, video APP or taxi-hailing APP.

上述程序更新还可以是对公共组件的程序文件进行更新。其中,上述公共组件可以是为电子设备中不同应用程序提供服务支持的程序组件。以常见的公共组件:谷歌移动服务(Google Mobile Service,gms)组件、webview组件、银联支付组件等举例,gms组件可以为图1中的(b)示出的手机内的地图APP、视频APP、打车APP等多类应用程序提供应用内购买、支付、位置信息、推送服务、广告、应用开发等服务支持。再比如,webview组件可以为手机内的地图APP、视频APP、打车APP等多类应用程序提供网页视图加载服务支持。再比如,银联支付组件可以为手机内的交易类APP提供支付服务支持。The above-mentioned program update may also be an update of program files of common components. Wherein, the above-mentioned common component may be a program component that provides service support for different applications in the electronic device. Take common public components: Google Mobile Service (GMS) component, webview component, UnionPay payment component, etc. as examples. The gms component can be the map APP, video APP, etc. in the mobile phone shown in (b) in Figure 1. Many types of applications, such as taxi-hailing apps, provide in-app purchase, payment, location information, push services, advertising, application development and other service support. For another example, the webview component can provide web view loading service support for many types of applications such as map APPs, video APPs, and taxi-hailing APPs on mobile phones. For another example, the UnionPay payment component can provide payment service support for transaction APPs on mobile phones.

上述应用程序和公共组件的程序文件,均可以称为程序数据。可以理解的,上述程序数据运行、更新都可以影响到至少一个应用程序。例如,应用程序的程序文件可以影响到该应用程序本身。再例如,公共组件的程序文件可以影响到所有使用了该公共组件的应用程序。The program files of the above-mentioned application programs and public components can all be called program data. It is understandable that the above program data running and updating can affect at least one application program. For example, an application's program files can affect the application itself. For another example, the program files of a common component can affect all applications that use the common component.

为了方便描述,可以将受程序数据影响的应用程序简称为该程序数据的关联应用。For convenience of description, the application affected by the program data may be simply referred to as the associated application of the program data.

相关技术下,在程序更新过程中,会强制关闭关联应用的应用进程。显然地,一旦关联应用的应用进程被关闭,关联应用向用户提供的服务将被中断。如果此时用户正在使用该关联应用,那么将会发生应用闪退,中断用户的使用,影响用户的使用体验。Under related technologies, during the program update process, the application process of the associated application will be forcibly closed. Obviously, once the application process of the associated application is closed, the services provided by the associated application to the user will be interrupted. If the user is using the associated application at this time, the application will crash, interrupting the user's use and affecting the user's experience.

换句话说,就是应用使用和程序更新之间发生了冲突。In other words, there is a conflict between application usage and program updates.

为了解决应用使用和程序更新之间的冲突。避免用户正使用应用的过程中,由程序更新导致闪退。在本申请实施例提供的程序数据更新方法,通过将“程序数据的解析安装”和“关联应用的使用”错位进行,从而,降低程序更新与应用使用之间产生冲突的可能,提升应用程序的使用稳定性,也能增加用户对系统和应用程序的稳定性的认可。To resolve conflicts between application usage and program updates. Avoid crashes caused by program updates while users are using the app. The program data update method provided in the embodiment of the present application displaces the "parsing and installation of program data" and the "use of associated applications", thereby reducing the possibility of conflict between program update and application use, and improving the efficiency of the application. Stability of use can also increase users' recognition of the stability of the system and applications.

在一些实施例中,上述“错位进行”可以是时间维度上的错位。也就是,将程序更新中的解析安装时间段与关联应用的使用时间段错开,从时间维度避免程序更新和应用使用之间出现冲突。In some embodiments, the above-mentioned "dislocation" may be a displacement in the time dimension. That is to say, the analysis and installation time period in program updates is staggered with the usage time period of the associated application, so as to avoid conflicts between program updates and application usage from the time dimension.

在另一些实施例中,上述“错位进行”还可以是空间维度的错位。上述空间可以是指存储空间。将程序更新中解析安装阶段所操作的存储空间和正在运行的程序数据的存储空间分开,避免文件覆盖现象而出现冲突,从而实现空间维度的错位进行。In other embodiments, the above-mentioned "dislocation process" can also be a displacement of spatial dimensions. The above space may refer to storage space. Separate the storage space operated during the parsing and installation phase of program updates from the storage space of running program data to avoid conflicts caused by file overwriting, thereby achieving misalignment of spatial dimensions.

可见,通过错位的方式进行更新,无需关闭用户正在使用的应用程序的进程。在保障用户体验的前提下,实现程序更新。It can be seen that updating in a staggered manner does not require closing the process of the application that the user is using. Implement program updates while ensuring user experience.

示例性的,本申请实施例中的电子设备可以是智能音箱、智能电视机、冰箱、洗衣机、空调、空气净化器、厨卫用品等家居设备。本申请实施例中的电子设备还可以是便携式计算机(如手机)、平板电脑、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、媒体播放器等设备,本申请实施例对该电子设备的具体形态不作特殊限制。For example, the electronic devices in the embodiments of the present application may be smart speakers, smart TVs, refrigerators, washing machines, air conditioners, air purifiers, kitchen and bathroom appliances and other household devices. The electronic device in the embodiment of the present application can also be a portable computer (such as a mobile phone), a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), or a netbook. As well as devices such as cellular phones, personal digital assistants (PDAs), augmented reality (AR)/virtual reality (VR) devices, media players, etc., the embodiments of the present application are specific to the electronic devices. There are no special restrictions on the form.

以电子设备为手机举例,图2示出了手机的结构示意图。Taking the electronic device as a mobile phone as an example, Figure 2 shows a schematic structural diagram of the mobile phone.

手机可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180等。The mobile phone may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, and an audio module 170. Speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, etc.

可以理解的是,本申请实施例示意的结构并不构成对手机的具体限定。在本申请另一些实施例中,手机可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone. In other embodiments of the present application, the mobile phone may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Among them, different processing units can be independent devices or integrated in one or more processors.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.

手机的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the mobile phone can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

天线1和天线2用于发射和接收电磁波信号。手机中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in a phone can be used to cover a single or multiple communication bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.

移动通信模块150可以提供应用在手机上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(lownoise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied to mobile phones. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.

无线通信模块160可以提供应用在手机上的包括无线局域网(wireless localarea networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequencymodulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the mobile phone including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system). navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.

在一些实施例中,手机的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code divisionmultiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC ,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system ,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the mobile phone is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code Wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou satellite navigation system (beidounavigation satellite system, BDS), quasi-zenith satellite system (quasi- zenith satellitesystem (QZSS) and/or satellite based augmentation systems (SBAS).

手机通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The mobile phone implements display functions through the GPU, display screen 194, and application processor. The GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,手机可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, etc. Display 194 includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode). (AMOLED), flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the mobile phone may include 1 or N display screens 194, where N is a positive integer greater than 1.

手机可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The mobile phone can realize the shooting function through the ISP, camera 193, video codec, GPU, display 194 and application processor.

ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the optical signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,手机可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object passes through the lens to produce an optical image that is projected onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other format image signals. In some embodiments, the mobile phone may include 1 or N cameras 193, where N is a positive integer greater than 1.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当手机在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the mobile phone selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

视频编解码器用于对数字视频压缩或解压缩。手机可以支持一种或多种视频编解码器。这样,手机可以播放或录制多种编码格式的视频,例如:动态图像专家组(movingpicture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. A mobile phone can support one or more video codecs. In this way, the mobile phone can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG)1, MPEG2, MPEG3, MPEG4, etc.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. The processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the mobile phone. The internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area can store data created during the use of the mobile phone (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), etc.

手机可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.

音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .

扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。手机可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The mobile phone can listen to music through speaker 170A, or listen to hands-free calls.

受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当手机接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the mobile phone answers a call or voice message, the voice can be heard by bringing the receiver 170B close to the human ear.

麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。手机可以设置至少一个麦克风170C。在另一些实施例中,手机可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,手机还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 170C with the human mouth and input the sound signal to the microphone 170C. The mobile phone can be set with at least one microphone 170C. In other embodiments, the mobile phone can be equipped with two microphones 170C, which in addition to collecting sound signals, can also implement noise reduction functions. In other embodiments, the mobile phone can also be equipped with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.

耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The headphone interface 170D is used to connect wired headphones. The headphone interface 170D may be a USB interface 130, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.

传感器模块180中可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。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.

当然,手机还可以包括充电管理模块、电源管理模块、电池、按键、指示器以及1个或多个SIM卡接口等,本申请实施例对此不做任何限制。Of course, the mobile phone may also include a charging management module, a power management module, a battery, a button, an indicator, one or more SIM card interfaces, etc. This embodiment of the present application does not impose any restrictions on this.

上述手机的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明手机的软件结构。The software system of the above-mentioned mobile phones can adopt layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture. The embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the mobile phone.

图3是本申请实施例的手机的软件结构框图。Figure 3 is a software structure block diagram of a mobile phone according to an embodiment of the present application.

分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture 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 four layers, from top to bottom: application layer, application framework layer, Android runtime (Android runtime) and system libraries, and kernel layer.

应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.

如图3所示,应用程序层中可以包括:通话,备忘录,浏览器,联系人,相机,图库,日历,地图,蓝牙,音乐,视频,短信息、桌面等APP(应用,application)。其中,上述应用可以是系统级应用;也可以是第三方应用。As shown in Figure 3, the application layer can include: calls, memos, browsers, contacts, cameras, galleries, calendars, maps, Bluetooth, music, videos, short messages, desktop and other APPs (applications). Among them, the above-mentioned applications can be system-level applications; they can also be third-party applications.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。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.

如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,更新管理服务,资源管理器,通知管理器等。As shown in Figure 3, the application framework layer can include window managers, content providers, view systems, update management services, resource managers, notification managers, etc.

其中,上述窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。Among them, the above-mentioned 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 above 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.

上述视图系统可用于构建应用程序的显示界面。每个显示界面可以由一个或多个控件组成。一般而言,控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、微件(Widget)等界面元素。The above view system can be used to build the display interface of the application. Each display interface can be composed of one or more controls. Generally speaking, controls can include interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

上述更新管理服务用来管理应用升级,为电子设备内安装的应用程序提供升级服务。上述更新管理服务是基于程序数据更新方法所创建的服务。上述更新管理服务工作于独立线程,上述更新管理服务由WorkManger管理后台任务,也即,后台状态下,在系统进程中运行。The above update management service is used to manage application upgrades and provide upgrade services for applications installed in electronic devices. The above update management service is a service created based on the program data update method. The above-mentioned update management service works in an independent thread, and the above-mentioned update management service is managed by WorkManger as a background task, that is, it runs in the system process in the background state.

上述资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The above resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.

上述通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,振动,指示灯闪烁等。The above notification manager allows the application 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. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, prompt text information in the status bar, sound a beep, vibrate, blink the indicator light, etc.

如图3所示,系统库可以包括多个功能模块。例如:图层整合器(SurfaceFlinger),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。SurfaceFlinger用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如: MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。As shown in Figure 3, the system library can include multiple functional modules. For example: layer integrator (SurfaceFlinger), media libraries (Media Libraries), 3D graphics processing libraries (for example: OpenGL ES), 2D graphics engines (for example: SGL), etc. SurfaceFlinger is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing. 2D Graphics Engine is a drawing engine for 2D drawing.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. The Android runtime is responsible for the scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and application framework layer into binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.

内核层是硬件和软件之间的层。内核层至少包含摄像头驱动,音频驱动,传感器驱动等,本申请实施例对此不做任何限制。The kernel layer is the layer between hardware and software. The kernel layer at least includes camera drivers, audio drivers, sensor drivers, etc., and the embodiments of this application do not impose any restrictions on this.

本申请实施例提供的程序数据更新方法可以在电子设备中实现,例如,由图2、图3示出的手机实现。The program data updating method provided by the embodiment of the present application can be implemented in an electronic device, for example, by the mobile phone shown in FIG. 2 and FIG. 3 .

示例性地,如图4所示,上述程序数据更新方法可以包括以下步骤:Exemplarily, as shown in Figure 4, the above program data updating method may include the following steps:

S101,获取第一程序数据对应的关联应用的运行状态。S101. Obtain the running status of the associated application corresponding to the first program data.

在一些实施例中,电子设备侦测到程序更新需求的情况下,可以确定出具有更新需求的程序数据(也即,第一程序数据)。In some embodiments, when the electronic device detects a program update requirement, it may determine the program data (that is, the first program data) that has the update requirement.

示例性地,可以是电子设备检测到升级任务时,判定出现程序更新需求。其中,升级任务是用于指示更新的事项。升级任务中包括具有更新需求的程序数据的标签。(比如,包名)。不同的程序数据所对应的标签也不同,通过升级任务中携带的程序数据的标签,即可确定出第一程序数据。For example, when the electronic device detects the upgrade task, it may be determined that a program update requirement occurs. Among them, the upgrade task is a matter used to instruct the update. Included in the upgrade task are tags with program data that require updating. (for example, package name). Different program data correspond to different labels. The first program data can be determined through the labels of the program data carried in the upgrade task.

当然,电子设备内可以同时存在多个升级任务。多个升级任务也可以确定出多个第一程序数据。然而,对于每一个第一程序数据的更新原理都相同。因此,为了方便描述,后续实施例主要以一个升级任务为例进行说明。Of course, multiple upgrade tasks can exist within the electronic device at the same time. Multiple upgrade tasks can also determine multiple first program data. However, the principle of updating the data for each first program is the same. Therefore, for convenience of description, subsequent embodiments mainly take an upgrade task as an example for description.

通常升级任务的生成与更新服务器是否发布更新数据包有关。可以理解的,上述更新服务器可以是用于发布更新数据包的服务器。示例性地,上述更新服务器可以是云端服务器,用于发布系统级程序(比如,系统级应用、公共组件)的更新数据包。示例性地,上述更新服务器还可以是第三服务器,用于发布第三方程序数据的更新数据包。Usually the generation of upgrade tasks is related to whether the update server publishes update data packages. It can be understood that the above-mentioned update server may be a server used to publish update data packages. For example, the above-mentioned update server may be a cloud server, used to publish update data packages of system-level programs (such as system-level applications, public components). For example, the above update server may also be a third server, used to publish update data packages of third-party program data.

而上述更新数据包则是用于更新第一程序数据的数据包。在更新服务器发布了新的更新数据包的情况下,可以广播程序更新通知。其中,上述程序更新通知中可以包括第一标识,第一标识可以是第一程序数据的标签。The above-mentioned update data packet is a data packet used to update the first program data. Program update notifications can be broadcast when a new update package is published by the update server. Wherein, the above-mentioned program update notification may include a first identifier, and the first identifier may be a label of the first program data.

在一些实施例中,电子设备开启自动升级功能的情况下,若侦听到更新服务器发布的程序更新通知,则根据程序更新通知携带的第一标识,创建对应的升级任务。In some embodiments, when the automatic upgrade function is enabled on the electronic device and a program update notification issued by the update server is heard, a corresponding upgrade task is created based on the first identifier carried in the program update notification.

在其他实施例中,电子设备未开启自动升级功能的情况下,电子设备也可以侦听更新服务器发布的通知。若侦听到程序更新通知,则由电子设备显示程序更新提醒,以征询用户是否具有更新意愿。如果用户通过交互操作向电子设备反馈了确认更新的指示,那么电子设备可以根据程序更新通知的第一标识,创建对应的升级任务。In other embodiments, when the electronic device does not turn on the automatic upgrade function, the electronic device may also listen for notifications issued by the update server. If a program update notification is detected, the electronic device displays a program update reminder to inquire whether the user is willing to update. If the user feeds back an instruction to confirm the update to the electronic device through interactive operations, the electronic device can create a corresponding upgrade task according to the first identifier of the program update notification.

示例性地,在可能的实施例中,还可以通过其他方式确定是否存在程序更新需求。For example, in possible embodiments, whether there is a program update requirement may also be determined through other methods.

比如,电子设备内预先设定各个程序文件的升级周期,进入每个升级周期都会自触发程序更新需求。如此,只要检测到进入新的升级周期,即可判定具有程序更新需求。此外,确定具有程序更新需求后,向更新服务器请求升级。电子设备在接收到更新服务器反馈的更新数据包后,创建升级任务。For example, the upgrade cycle of each program file is preset in the electronic device, and entering each upgrade cycle will automatically trigger the program update requirement. In this way, as long as it is detected that a new upgrade cycle has entered, it can be determined that there is a need for program update. In addition, after determining that there is a need for program update, request an upgrade from the update server. After receiving the update data packet fed back by the update server, the electronic device creates an upgrade task.

再比如,电子设备检测到程序文件多次运行异常的情况下,判定具有程序更新需求。此外,确定具有程序更新需求后,电子设备还需向更新服务器发送升级请求。其中,上述升级请求可以包括异常描述信息。电子设备在接收到更新服务器针对升级请求反馈的更新数据包后,创建升级任务。For another example, when an electronic device detects that a program file has run abnormally multiple times, it determines that a program update is required. In addition, after determining that there is a program update requirement, the electronic device also needs to send an upgrade request to the update server. The above upgrade request may include exception description information. After receiving the update data packet fed back by the update server in response to the upgrade request, the electronic device creates an upgrade task.

创建升级任务之后,电子设备还可以获取第一程序数据所对应的关联应用(又可称为第一程序数据的第一应用)的运行状态。例如,第一程序数据为聊天APP的程序文件,那么获取聊天APP的运行状态。再例如,第一程序数据为gms组件的程序文件,电子设备中使用gms组件的应用程序包括地图APP、视频APP、打车APP,那么电子设备还获取地图APP、视频APP、打车APP的运行状态。After creating the upgrade task, the electronic device can also obtain the running status of the associated application corresponding to the first program data (also called the first application of the first program data). For example, if the first program data is the program file of the chat APP, then the running status of the chat APP is obtained. For another example, the first program data is the program file of the gms component. Applications using the gms component in the electronic device include map APP, video APP, and taxi APP. Then the electronic device also obtains the running status of the map APP, video APP, and taxi APP.

上述运行状态是指应用程序在电子设备中的实际工作状态,比如,上述运行状态可以分为前台运行、后台运行及停止运行。The above-mentioned running status refers to the actual working status of the application in the electronic device. For example, the above-mentioned running status can be divided into foreground running, background running and stopped running.

其中,在电子设备内,前台运行和后台运行的应用程序都有对应的应用进程,而停止运行的应用程序却没有。Among them, in electronic devices, applications running in the foreground and background running have corresponding application processes, but applications that stop running do not.

因此,可以通过检测关联应用是否具有进程,判定该关联应用的运行状态是否属于停止运行。Therefore, it can be determined whether the running status of the associated application is stopped by detecting whether the associated application has a process.

在一些实施例中,在判定关联应用的运行状态不是停止运行的情况下,还需分辨关联应用处于前台运行还是后台运行。而分辨关联应用处于前台运行还是后台运行,可以采用电子设备中已有的服务实现。比如,通过UsageStatsManager实现。In some embodiments, when it is determined that the running status of the associated application is not stopped, it is also necessary to determine whether the associated application is running in the foreground or in the background. To distinguish whether the associated application is running in the foreground or in the background, existing services in the electronic device can be used. For example, through UsageStatsManager.

另外,处于前台运行的应用程序,可以直接向用户提供相应的服务。In addition, applications running in the foreground can directly provide corresponding services to users.

以图5为例,图5中电子设备以手机的形态示出,在手机中的视频APP处于前台运行的情况下,用户可以直接观看视频APP所提供的视频播放服务。Taking Figure 5 as an example, the electronic device in Figure 5 is shown in the form of a mobile phone. When the video APP in the mobile phone is running in the foreground, the user can directly watch the video playback service provided by the video APP.

再例如,电子设备是智能音箱情况下,音乐APP处于前台运行的情况下,智能音箱可以通过音乐APP向用户播放音乐。For another example, when the electronic device is a smart speaker and the music APP is running in the foreground, the smart speaker can play music to the user through the music APP.

此外,电子设备内可以存在一个或多个处于前台运行的应用程序。In addition, there may be one or more applications running in the foreground within the electronic device.

比如,图6示出的场景,手机中的音乐APP正在播放音乐,同时,手机的显示屏展示着阅读APP提供的阅读内容。在此场景下,手机内的音乐APP和阅读APP都是处于前台运行的应用程序。For example, in the scene shown in Figure 6, the music APP in the mobile phone is playing music, and at the same time, the display screen of the mobile phone displays the reading content provided by the reading APP. In this scenario, the music APP and reading APP in the mobile phone are both applications running in the foreground.

再比如,图7示出的场景,手机中聊天APP向用户提供聊天服务,同时,手机还在显示屏内开辟小窗口展示视频APP提供的视频内容。在此场景下,手机内的聊天APP和阅读APP都是处于前台运行的应用程序。For another example, in the scenario shown in Figure 7, the chat APP in the mobile phone provides chat services to the user. At the same time, the mobile phone also opens a small window in the display screen to display the video content provided by the video APP. In this scenario, the chat APP and reading APP in the mobile phone are both applications running in the foreground.

基于以上描述的前台运行的运行特点,在另一些实施例中,在判定关联应用的运行状态不是停止运行的情况下,还可以通过捕获关联应用的输出动作,结合关联应用提供的服务类型,分析关联应用是否处于前台运行。Based on the operating characteristics of the foreground operation described above, in other embodiments, when it is determined that the running status of the associated application is not stopped, the output action of the associated application can also be captured and analyzed in combination with the service type provided by the associated application. Whether the associated application is running in the foreground.

示例性地,通过分析关联应用是否调用输出驱动(比如,音频驱动)、输出类服务(比如,视图系统),结合关联应用的服务特点,分析关联应用是否属于前台运行。For example, by analyzing whether the associated application calls an output driver (for example, audio driver) or output type service (for example, a view system), combined with the service characteristics of the associated application, it is analyzed whether the associated application runs in the foreground.

比如,对于画面输出类的应用程序,诸如聊天APP、视频APP一类应用程序,检测到该类应用程序调用了视图系统,在电子设备的显示屏渲染了应用界面,那么判断该类应用程序处于前台运行。For example, for screen output applications, such as chat APPs and video APPs, if it is detected that the application calls the view system and renders the application interface on the display screen of the electronic device, then it is determined that the application is in Front desk operation.

再如,对于输出声音类的应用程序,诸如音乐APP一类应用程序,检测到该类应用程序调用了音频系统,那么判断该类应用程序处于前台运行。For another example, for an application that outputs sound, such as a music APP, if it is detected that the application has called the audio system, it is determined that the application is running in the foreground.

S102,根据关联应用的运行状态,确定对应的使用状态。S102: Determine the corresponding usage status according to the running status of the associated application.

在一些实施例中,关联应用的使用状态可以通过关联应用的运行状态分析得到。In some embodiments, the usage status of the associated application can be obtained by analyzing the running status of the associated application.

与运行状态不同,上述使用状态是表征应用程序向用户提供服务的状态。示例性地,使用状态可以分为未使用状态和正在使用状态。在一个应用程序处于正在使用状态时,表征用户当前对该应用程序具有使用需求。在一个应用程序处于未使用状态时,表征用户当前对该应用程序不具有使用需求。Different from the running state, the above-mentioned usage state is a state that represents the service provided by the application to the user. For example, the usage status can be divided into an unused status and an in-use status. When an application is in use, it indicates that the user currently has a need to use the application. When an application is not in use, it means that the user currently has no need to use the application.

可以理解的,前台运行的应用程序,实际上也处于正在向用户提供相应的服务的状态。故,可以将处于前台运行的关联应用判定为处于正在使用状态。It is understandable that applications running in the foreground are actually in a state of providing corresponding services to users. Therefore, the associated application running in the foreground can be determined to be in use.

此外,应用程序处于停止运行时,没有对应的应用进程,也无法向用户提供相应的服务的状态。故,可以将处于停止运行的关联应用判定为处于未使用状态。In addition, when the application is stopped, there is no corresponding application process and the corresponding service cannot be provided to the user. Therefore, the associated application that is stopped can be determined to be in an unused state.

示例性地,根据运行状态,分析关联应用的使用状态的方式可以包括以下几种:For example, based on the running status, the methods of analyzing the usage status of the associated application may include the following:

方式一,可以在关联应用的运行状态为停止运行的情况下,判定关联应用处于未使用状态。在关联应用的运行状态为前台运行或后台运行的情况下,判定关联应用处于正在使用状态。Method 1: When the running status of the associated application is stopped, it can be determined that the associated application is in an unused state. When the running status of the associated application is running in the foreground or running in the background, it is determined that the associated application is in use.

方式二,可以在关联应用的运行状态为停止运行或后台运行的情况下,判定关联应用处于未使用状态。在关联应用的运行状态为前台运行的情况下,判定关联应用处于正在使用状态。Method 2: When the running status of the associated application is stopped or running in the background, it can be determined that the associated application is in an unused state. When the running state of the associated application is running in the foreground, it is determined that the associated application is in use.

其中,方式一考虑到处于后台运行的应用程序(简称:后台应用)随时可能被切换到前台运行。示例场景,用户正在使用电子设备内的游戏APP的过程中,临时切入聊天APP看朋友所发信息内容。此时,游戏APP将暂时的被切换到后台运行。待用户看完信息内容后,会立刻切回游戏APP中,使游戏APP再次恢复到前台运行。在此过程中,游戏APP从后台运行切换到前台运行之间的时耗较短。Among them, the first method considers that an application running in the background (referred to as: background application) may be switched to the foreground at any time. In the example scenario, while the user is using a game APP on an electronic device, he temporarily switches to the chat APP to view the content of messages sent by his friends. At this time, the game APP will be temporarily switched to the background. After the user has finished reading the information, he will immediately switch back to the game APP, allowing the game APP to resume running in the foreground. During this process, the time consumption between switching the game APP from background running to foreground running is short.

而,方式二考虑到后台应用当前并没有提供服务,并且大部分后台应用会被用户长时间滞留后台,导致后台应用处于长时间不被使用。示例场景,用户使用完电子设备内的阅读APP后,并未彻底关闭阅读APP,而是让他进入后台运行。此后,用户使用电子设备中的其他APP,接受其他APP所提供的服务,不再切回阅读APP。从而使阅读APP长期处于后台运行,使阅读APP长期不被使用。However, Method 2 takes into account that background applications currently do not provide services, and most background applications will be left in the background by users for a long time, resulting in background applications not being used for a long time. In the example scenario, after the user finished using the reading APP in the electronic device, he did not completely close the reading APP, but let him run it in the background. After that, the user uses other APPs on the electronic device, accepts the services provided by other APPs, and does not switch back to the reading APP. As a result, the reading APP will be running in the background for a long time, so that the reading APP will not be used for a long time.

显然,方式一和方式二是基于不同的角度所设计的判定规则,各具优势。本领域技术人员在实际使用过程中,可以根据实际情况进行选择。Obviously, Method 1 and Method 2 are judgment rules designed based on different perspectives, and each has its own advantages. Those skilled in the art can make selections based on actual conditions during actual use.

此外,为了提高对后台应用的使用状态的准确判断,根据运行状态分析使用状态的方式还可以包括:In addition, in order to improve the accurate judgment of the usage status of background applications, the method of analyzing the usage status based on the running status can also include:

方式三,可以在关联应用的运行状态为停止运行情况下,判定关联应用处于未使用状态。在关联应用进入后台运行的时长超过指定值时,判定关联应用处于未使用状态。在关联应用进入后台运行的时长不超过指定值时,判定关联应用处于正在使用状态。在关联应用的运行状态为前台运行情况下,判定关联应用处于正在使用状态。Method 3: When the running status of the associated application is stopped, it can be determined that the associated application is in an unused state. When the associated application runs in the background for longer than the specified value, the associated application is determined to be in an unused state. When the duration of the associated application running in the background does not exceed the specified value, the associated application is determined to be in use. When the running state of the associated application is running in the foreground, it is determined that the associated application is in use.

在一些实施例中,上述指定值的取值可以是预设的经验值。In some embodiments, the above specified value may be a preset empirical value.

方式四,在关联应用的运行状态为停止运行情况下,判定关联应用处于未使用状态。在关联应用的运行状态为前台运行情况下,判定关联应用处于正在使用状态。在关联应用的运行状态为后台运行时,判断用户是否正在查看后台应用。在判定用户正在查看后台应用的情况下,判定关联应用处于正在使用状态。反之,则判定处于未使用状态。Method 4: When the running status of the associated application is stopped, it is determined that the associated application is in an unused state. When the running state of the associated application is running in the foreground, it is determined that the associated application is in use. When the running status of the associated application is running in the background, determine whether the user is viewing the background application. When it is determined that the user is viewing a background application, it is determined that the associated application is in use. Otherwise, it is judged to be in an unused state.

在一些实施例中,电子设备判断用户是否正在查看后台应用的方式可以是以下之一或之间的组合:In some embodiments, the way in which the electronic device determines whether the user is viewing a background application may be one of the following or a combination thereof:

(1)在电子设备接收到后台查看触发操作时,判定用户正在查看后台应用。比如,在桌面上做出上滑是查看后台的操作。如图8中的(a)所示,电子设备在接收到用户在桌面上做出上滑操作后,可判定用户正在查看后台应用。(1) When the electronic device receives the background viewing trigger operation, it is determined that the user is viewing the background application. For example, swiping up on the desktop is a background operation. As shown in (a) of Figure 8, after receiving the user's sliding up operation on the desktop, the electronic device can determine that the user is viewing a background application.

(2)在显示屏上展示多任务界面期间,判定用户正在查看后台应用。多任务界面中包括在电子设备后台运行的应用程序的界面。多任务界面后台应用的界面可以是界面缩略图。比如,界面缩略图可以是上述后台应用进入后台运行前显示的最后一帧界面。比如,结合图8中的(a)中所示的示例,作为对上滑操作的响应,如图8中的(b)所示,电子设备可以显示多任务界面,在电子设备显示多任务界面期间,可判定用户正在查看后台应用。(2) While the multi-tasking interface is displayed on the display screen, it is determined that the user is viewing background applications. Multitasking interfaces include interfaces for applications running in the background of electronic devices. The interface of the multi-tasking interface background application can be an interface thumbnail. For example, the interface thumbnail may be the last frame of the interface displayed before the background application enters the background. For example, combined with the example shown in (a) of Figure 8, in response to the slide-up operation, as shown in (b) of Figure 8, the electronic device can display a multi-tasking interface. During this period, it can be determined that the user is viewing background applications.

(3)在电子设备接收到滑动后台应用的界面缩略图的操作时,判定用户正在查看后台应用。(3) When the electronic device receives the operation of sliding the interface thumbnail of the background application, it determines that the user is viewing the background application.

以上基于运行状态分析使用状态的方式,本领域技术人员可以根据实际需求选择。The above method of analyzing usage status based on running status can be selected by those skilled in the art according to actual needs.

除了基于运行状态分析对应的使用状态之外,在其他实施例中,还可以结合电子设备的设备状态分析关联应用的使用状态。In addition to analyzing the corresponding usage status based on the running status, in other embodiments, the usage status of the associated application can also be analyzed in combination with the device status of the electronic device.

示例性地,上述设备状态可以包括待机状态和息屏状态。其中,上述待机状态可以是电子设备处于开机但是不进行任何实质性工作(即不对文件和程序的各种操作)的状态。上述息屏状态可以是电子设备的显示屏不显示任何实质性图像内容的状态。比如,在显示屏显示黑屏界面、白屏界面或者屏保图像的情况下,判定电子设备处于息屏状态。For example, the above-mentioned device status may include a standby state and a screen-off state. The above-mentioned standby state may be a state in which the electronic device is powered on but does not perform any substantive work (ie, does not perform various operations on files and programs). The above-mentioned screen-off state may be a state in which the display screen of the electronic device does not display any substantial image content. For example, when the display screen displays a black screen interface, a white screen interface, or a screensaver image, it is determined that the electronic device is in a screen-off state.

在一些实施例中,若电子设备处于待机状态和/或息屏状态,可以将电子设备中的所有应用程序所对应的使用状态为未使用状态,也即,关联应用处于未使用状态。反之,可以根据运行状态,判定关联应用所处的使用状态。In some embodiments, if the electronic device is in the standby state and/or the screen-off state, the usage status corresponding to all applications in the electronic device can be set to the unused state, that is, the associated applications are in the unused state. On the contrary, the usage status of the associated application can be determined based on the running status.

在其他实施例中,在需要对第一程序数据进行更新的情况下,也可以不按照上述S101和S102获取关联应用的使用状态。而是,直接获取到关联应用的使用状态。例如,向用户询问是否使用关联应用的方式确定关联应用的使用状态。再例如,还可以从其他程序获取关联应用的使用状态。其中,其他程序为用于监控电子设备内应用程序的使用状态的程序。In other embodiments, when the first program data needs to be updated, the usage status of the associated application may not be obtained according to the above S101 and S102. Instead, the usage status of the associated application is directly obtained. For example, the user is asked whether to use the associated application to determine the usage status of the associated application. For another example, you can also obtain the usage status of associated applications from other programs. Among them, other programs are programs used to monitor the usage status of applications in the electronic device.

S103,在第一程序数据的至少一个关联应用处于正在使用状态时,按照错位升级策略,对第一程序数据进行更新升级。S103: When at least one associated application of the first program data is in use, update and upgrade the first program data according to the misaligned upgrade strategy.

示例性地,第一程序数据为应用程序的程序文件的情况下,可以是在该应用程序自身还处于正在使用状态时,按照错位升级策略,利用更新数据包对第一程序数据进行更新升级。比如,第一程序数据为聊天APP的程序文件,在聊天APP还处于正在使用状态时,按照错位升级策略,利用更新数据包对第一程序数据进行更新升级。For example, when the first program data is a program file of an application program, the first program data may be updated and upgraded using an update data package according to a staggered upgrade strategy while the application program itself is still in use. For example, the first program data is the program file of the chat APP. When the chat APP is still in use, the first program data is updated and upgraded using the update data package according to the misplaced upgrade strategy.

示例性地,第一程序数据为公共组件的程序文件的情况下,可以是在使用了该公共组件的应用程序中至少一个处于正在使用状态时,按照错位升级策略,利用更新数据包对第一程序数据进行更新升级。比如,第一程序数据为gms组件的程序文件,且电子设备中使用gms组件的应用程序包括地图APP、视频APP、打车APP。在地图APP、视频APP、打车APP中至少一个还处于正在使用状态时,按照错位升级策略,利用更新数据包对第一程序数据进行更新升级。For example, when the first program data is a program file of a common component, when at least one of the applications using the common component is in use, the update data package may be used to update the first program data according to the staggered upgrade strategy. Program data is updated and upgraded. For example, the first program data is the program file of the gms component, and applications using the gms component in the electronic device include map APPs, video APPs, and taxi hailing APPs. When at least one of the map APP, the video APP, and the taxi-hailing APP is still in use, the first program data is updated and upgraded according to the misplaced upgrade strategy using the update data package.

其中,上述更新数据包可以由更新服务器提供。在一些实施例中,电子设备可以创建升级任务后,从更新服务器中下载对应的更新数据包。Wherein, the above update data package may be provided by the update server. In some embodiments, the electronic device can download the corresponding update data package from the update server after creating the upgrade task.

在关联应用处于正在使用状态,且需要对第一程序数据进行更新的情况下,如果按照相关技术,直接对第一程序数据进行更新,会影响到用户对关联应用的使用,导致关联应用出现闪退。When the associated application is in use and the first program data needs to be updated, if the first program data is directly updated according to relevant technologies, it will affect the user's use of the associated application and cause the associated application to crash. retreat.

而本申请实施例中,在关联应用处于正在使用状态,且需要对第一程序数据进行更新的情况下,按照错位升级策略对第一程序数据进行更新,从而避免处于正在使用状态的关联应用受升级的影响。In the embodiment of the present application, when the associated application is in use and the first program data needs to be updated, the first program data is updated according to the misaligned upgrade strategy, thereby preventing the associated application in use from being affected. Impact of upgrades.

可以采用多种方式实现“错位升级策略”。当然,无论采用何种方式实现,更新第一程序数据的数据实体的前提是:已判定关联应用都进入了未使用状态。故,实现“错位升级策略”会涉及到将对应的升级任务放入等待列表中,重新获取关联应用的使用状态。在关联应用处于未使用状态的情况下,才对第一程序数据的数据实体进行更新。There are many ways to implement the "dislocation upgrade strategy". Of course, no matter which method is used to implement it, the prerequisite for updating the data entity of the first program data is that it is determined that the associated applications have entered an unused state. Therefore, implementing the "misplaced upgrade strategy" will involve putting the corresponding upgrade tasks into the waiting list and reacquiring the usage status of the associated applications. The data entity of the first program data is updated only when the associated application is in an unused state.

在一些实施例中,上述错位升级策略可以是:按照时间错位的方式对第一程序数据进行更新。In some embodiments, the above staggered upgrade strategy may be: updating the first program data in a time staggered manner.

示例性地,上述按照时间错位的方式对第一程序数据进行更新的过程可以是:将第一程序数据对应的升级任务放入等待列表中。将从更新服务器中获取到的更新数据包缓存。在第一程序数据对应的关联应用都变为未使用状态的情况下,将第一程序数据所对应的升级任务从等待列表中取出。依据升级任务的指示,获取缓存的更新数据包并进行解析安装处理,以更新第一程序数据。For example, the above process of updating the first program data in a time-shifted manner may be: placing the upgrade task corresponding to the first program data into a waiting list. Cache update packets obtained from the update server. When all associated applications corresponding to the first program data become unused, the upgrade task corresponding to the first program data is taken out from the waiting list. According to the instructions of the upgrade task, the cached update data package is obtained and parsed and installed to update the first program data.

可理解地,升级任务中具有第一程序数据的第一标识。同时,由于更新数据包用于更新第一程序数据,其也可以携带第一程序数据的标识。可见,升级任务与更新数据包之间存在关联。通过升级任务中第一标识即可从电子设备内查询到对应的更新数据包。Understandably, the upgrade task has a first identifier of the first program data. At the same time, since the update data packet is used to update the first program data, it may also carry the identification of the first program data. It can be seen that there is a correlation between the upgrade task and the update data package. The corresponding update data package can be queried from the electronic device through the first identifier in the upgrade task.

另外,对更新数据包进行解析安装处理可以是在存储区域1(也即,第一存储区域)中直接对更新数据包进行解析安装。In addition, parsing and installing the update data package may be directly parsing and installing the update data package in storage area 1 (that is, the first storage area).

此外,在第一程序数据更新期间,还需提醒用户暂时不要使用关联应用。In addition, during the first program data update period, users need to be reminded not to use associated applications temporarily.

在一些实施例中,可以通过广播报文1通知桌面,刷新关联应用的桌面图标,以使刷新后的桌面图标可以提示用户暂停使用。也即,通过关联应用的桌面图标显示提示信息。In some embodiments, the desktop can be notified through the broadcast message 1 to refresh the desktop icon of the associated application, so that the refreshed desktop icon can prompt the user to suspend use. That is, the prompt information is displayed through the desktop icon of the associated application.

其中,广播报文1包括第一程序数据的更新提示参数。The broadcast message 1 includes update prompt parameters of the first program data.

此外,还可以根据广播报文1,关闭关联应用的启动触发接口,使关联应用不能被点开,避免用户在第一程序数据更新过程中误开启关联应用。In addition, according to the broadcast message 1, the startup triggering interface of the associated application can be closed so that the associated application cannot be clicked to prevent the user from accidentally opening the associated application during the first program data update process.

在一些实施例中,广播报文1可以设置有系统访问权限,以使作为系统级应用的桌面才有权限读取广播报文1。避免广播报文1对其他应用程序产生影响。In some embodiments, the broadcast message 1 can be set with system access rights, so that only the desktop as a system-level application has the permission to read the broadcast message 1 . Avoid broadcast message 1 from affecting other applications.

另外,示例性地,更新提示参数可以是表征第一程序数据处于正在更新状态的参数。待桌面接收到该广播报文1后,将关联应用的桌面图标上增加更新标识(也即,提示信息)。比如,图9所示,图9中的聊天APP是第一程序数据的关联应用,在桌面接收到关于第一程序数据的广播报文1后,聊天APP的桌面图标刷新为添加有更新标识的桌面图标。In addition, for example, the update prompt parameter may be a parameter indicating that the first program data is in an updating state. After the desktop receives the broadcast message 1, an update identifier (that is, a prompt message) will be added to the desktop icon of the associated application. For example, as shown in Figure 9, the chat APP in Figure 9 is an associated application of the first program data. After the desktop receives the broadcast message 1 about the first program data, the desktop icon of the chat APP is refreshed to have an update logo added. homescreen icon.

示例性地,更新提示参数还可以是包括第一程序数据的更新进度。上述通过广播报文1通知桌面可以是:周期性地根据第一程序数据的更新进度创建广播报文1,并广播。桌面每接收到一广播报文1,便根据广播报文1,在关联应用的桌面图标上增加更新进度(也即,提示信息)。比如,图10所示,图10中的视频APP是第一程序数据的关联应用。第一程序数据在第一时刻下,更新进度达到20%。在桌面接收到第一时刻创建的广播报文1后,在视频APP的桌面图标下会显示更新进度为20%。第一程序数据在第二时刻下,更新进度达到80%。在桌面接收到第二时刻创建的广播报文1后,在视频APP的桌面图标下会显示更新进度为80%。Exemplarily, the update prompt parameter may also be an update progress including the first program data. The above notification to the desktop through the broadcast message 1 may be: periodically creating the broadcast message 1 according to the update progress of the first program data and broadcasting. Each time the desktop receives a broadcast message 1, the update progress (that is, prompt information) is added to the desktop icon of the associated application according to the broadcast message 1. For example, as shown in Figure 10, the video APP in Figure 10 is an associated application of the first program data. The update progress of the first program data reaches 20% at the first moment. After the desktop receives the broadcast message 1 created at the first moment, the update progress of 20% will be displayed under the desktop icon of the video APP. At the second moment, the update progress of the first program data reaches 80%. After the desktop receives the broadcast message 1 created at the second moment, the update progress will be displayed as 80% under the desktop icon of the video APP.

在另一些实施例中,在通过广播报文1通知桌面后,也可以不对桌面图标的形态进行改变。在接到广播报文1后,关闭关联应用的启动触发接口,使关联应用不能被点开。之后,侦测到关联应用的桌面图标被用户点击,可以弹出通知框。通过通知框向用户展示广播报文1中的更新提示参数。In other embodiments, after notifying the desktop through the broadcast message 1, the form of the desktop icon may not be changed. After receiving the broadcast message 1, close the startup trigger interface of the associated application so that the associated application cannot be opened. Afterwards, it is detected that the desktop icon of the associated application is clicked by the user, and a notification box can pop up. Display the update prompt parameters in broadcast message 1 to the user through the notification box.

也即,接收到用户对所述第一应用的图标的操作后,显示提示信息。That is, after receiving the user's operation on the icon of the first application, the prompt information is displayed.

其中,上述更新提示参数可以包括但不限于包括正在更新状态、更新进度、更新版本、更新发布时间等信息之一或之间的组合。比如,图11中的(a)所示出的支付APP是第一程序数据的关联应用。在桌面接收到广播报文1后,侦测到用户点击支付APP,那么如图11中的(b)所示弹出通知框,展示对应的更新提示参数。The above update prompt parameters may include, but are not limited to, one or a combination of information such as updating status, update progress, update version, update release time, etc. For example, the payment APP shown in (a) in Figure 11 is an associated application of the first program data. After the desktop receives broadcast message 1 and detects that the user clicks on the payment APP, a notification box pops up as shown in (b) in Figure 11, displaying the corresponding update prompt parameters.

显然地,在更新提示参数中的更新进度是一个动态变化的量。上述更新进度可以是侦测到用户点击关联应用时第一程序数据的更新进度。当然,第一程序数据的更新进度的采集时间点和用户点击关联应用的时间点也可以不是绝对的对齐。比如,更新进度的采集时间点可以稍晚于用户点击关联应用的时间点。Obviously, the update progress in the update prompt parameter is a dynamically changing quantity. The above update progress may be the update progress of the first program data when the user clicks on the associated application. Of course, the collection time point of the update progress of the first program data and the time point when the user clicks on the associated application may not be absolutely aligned. For example, the update progress collection time can be slightly later than the time when the user clicks on the associated application.

当然,也为了避免第一程序数据更新结束后,关联应用持续受广播报文1的影响。待第一程序数据完成更新后,还可以通过广播报文2通知桌面,取消对关联应用的桌面图标的变更。比如,取消关联应用的桌面图标上的更新标识。再比如,取消点击关联应用弹出通知框。再比如,恢复关联应用的启动触发接口,使用户可以通过点击桌面图标启动使用关联应用。Of course, this is also to prevent the associated application from continuing to be affected by broadcast message 1 after the data update of the first program is completed. After the first program data is updated, the desktop can also be notified through the broadcast message 2 to cancel the change to the desktop icon of the associated application. For example, unlink the update logo on the app's desktop icon. For another example, cancel clicking on the associated application to pop up a notification box. Another example is to restore the startup trigger interface of associated applications so that users can start and use associated applications by clicking on the desktop icon.

也即,如图12所示,在图4所示的程序数据更新方法的基础上,上述S103可以包括:That is, as shown in Figure 12, based on the program data update method shown in Figure 4, the above S103 may include:

S103-1,将第一程序数据对应的升级任务放入等待列表。暂不执行第一程序数据对应的升级任务。S103-1: Put the upgrade task corresponding to the first program data into the waiting list. The upgrade task corresponding to the first program data is not executed yet.

S103-2,监测第一程序数据的关联应用是否都处于未使用状态。S103-2: Monitor whether the applications associated with the first program data are in an unused state.

如果第一程序数据的关联应用都处于未使用状态,流程进入S103-3。如果第一程序数据的关联应用不是全处于未使用状态,那么继续监测第一程序数据的关联应用所处的使用状态。If the applications associated with the first program data are not in use, the process proceeds to S103-3. If not all the associated applications of the first program data are in an unused state, then continue to monitor the usage state of the associated applications of the first program data.

S103-3,在判定第一程序数据对应的关联应用处于未使用状态的情况下,将升级任务从等待列表中取出,并执行。S103-3: When it is determined that the associated application corresponding to the first program data is in an unused state, the upgrade task is removed from the waiting list and executed.

在一些实施例中,执行升级任务过程可以是:依据升级任务中的第一标识,从缓存区域中获取第一程序数据所对应的更新数据包。并在存储区域1中对更新数据包进行解析安装,实现对第一程序数据的更新。In some embodiments, the process of executing the upgrade task may be: obtaining the update data packet corresponding to the first program data from the cache area according to the first identifier in the upgrade task. And the update data package is parsed and installed in storage area 1 to update the first program data.

在一些实施例中,在启动对升级任务的执行时,流程进入S103-4。In some embodiments, when the execution of the upgrade task is started, the process enters S103-4.

S103-4,通知桌面变更关联应用的桌面图标。S103-4, notify the desktop to change the desktop icon of the associated application.

在一些实施例中,可以是通过广播报文通知桌面将关联应用的桌面图标进行变更。具体可参照前述实施例中的描述。In some embodiments, a broadcast message may be used to notify the desktop that the desktop icon of the associated application will be changed. For details, reference may be made to the descriptions in the foregoing embodiments.

总体而言,按照时间错位的方式进行分为两个阶段。其中,第一阶段为对更新数据包进行解析安装之前,需等待关联应用都切换至未使用状态。第二阶段为更新数据包的解析安装过程中,避免用户在解析安装期间使用关联应用。Generally speaking, it is divided into two stages according to the time displacement method. Among them, the first stage is to wait for all associated applications to switch to an unused state before parsing and installing the update data package. The second stage is the parsing and installation process of the update data package, which prevents users from using associated applications during parsing and installation.

实现时间错位的关键在于第一阶段。也即,在对更新数据包进行解析安装之前,第一程序数据对应的关联应用都需要处于未使用状态。The key to achieving time dislocation lies in the first stage. That is, before the update data package is parsed and installed, the associated applications corresponding to the first program data need to be in an unused state.

作为一种实现方式,可以通过定期查询的方式,判断第一程序数据对应的关联应用是否处于未使用状态。As an implementation method, it can be determined by regular query whether the associated application corresponding to the first program data is in an unused state.

在等待列表中存在多个升级任务的情况下,可以循环遍历等待列表中的每一个升级任务。在循环遍历的过程中,每遍历到一个升级任务,依据该升级任务指示的第一程序数据,获取对应的关联应用的使用状态。从而判定第一程序数据对应的关联应用是否处于未使用状态。When there are multiple upgrade tasks in the waiting list, you can loop through each upgrade task in the waiting list. During the loop traversal, each time an upgrade task is traversed, the usage status of the corresponding associated application is obtained based on the first program data indicated by the upgrade task. Thereby it is determined whether the associated application corresponding to the first program data is in an unused state.

作为另一种实现方式,对电子设备内处于正在使用状态的应用程序进行监控。在处于正在使用状态的应用程序切换为未使用状态的情况下,触发检测第一程序数据所对应的关联应用是否都处于未使用状态。As another implementation method, applications in use in the electronic device are monitored. When an application program in use is switched to an unused state, it is triggered to detect whether associated applications corresponding to the first program data are all in an unused state.

除了按照时间错位的方式更新第一程序数据外,为了提高更新效率,在本申请实施例中,上述错位升级策略可以是按照存储空间错位的方式对第一程序数据进行更新。In addition to updating the first program data in a time-shifted manner, in order to improve the update efficiency, in the embodiment of the present application, the above-mentioned misaligned upgrade strategy may be to update the first program data in a storage space-shifted manner.

示例性地,上述按照存储空间错位的方式对第一程序数据进行更新的过程可以是:For example, the above-mentioned process of updating the first program data in a storage space dislocation manner may be:

将第一程序数据对应的升级任务放入等待列表中。Put the upgrade task corresponding to the first program data into the waiting list.

在存储区域2(又称为第二存储区域)内,对第一程序数据对应的更新数据包进行解析安装。通过解析安装创建临时安装目录。其中,临时安装目录内存放有更新程序数据,又称为第二程序数据。上述更新程序数据用于更替第一程序数据的数据实体。In the storage area 2 (also called the second storage area), the update data package corresponding to the first program data is parsed and installed. Create a temporary installation directory by parsing the installation. Among them, the temporary installation directory stores update program data, also known as second program data. The above updated program data is used to replace the data entity of the first program data.

需说明的是,上述存储区域2与存储区域1不同。其中,存储区域1是用于存储第一程序数据的存储空间。在一些实施例中,第一程序数据可以存放在存储区域1中的固定安装目录下。It should be noted that the above-mentioned storage area 2 is different from the storage area 1 . Among them, storage area 1 is a storage space used to store first program data. In some embodiments, the first program data may be stored in a fixed installation directory in the storage area 1 .

示例性地,固定安装目录和临时安装目录都可以包括命名为“/data/dalvik-cache”、“package.xml”、“package.list”等子目录。其中,子目录/data/dalvik-cache用于存放应用代码执行文件(如dex、oat文件),子目录package.xml用于存放应用申请的权限、签名和代码所在的位置等信息。子目录package.list用于记录应用安装位置等信息。For example, both the fixed installation directory and the temporary installation directory may include subdirectories named "/data/dalvik-cache", "package.xml", "package.list", etc. Among them, the subdirectory /data/dalvik-cache is used to store application code execution files (such as dex and oat files), and the subdirectory package.xml is used to store information such as permissions applied for by the application, signatures, and the location of the code. The subdirectory package.list is used to record information such as application installation location.

在一些实施例中,上述存储区域2可以是预先为第一程序数据分配的备用存储区域。在另一些实施例中,上述存储区域2还可以是执行升级任务时,从空闲的存储空间中为第一程序数据划分出的存储区域。In some embodiments, the above-mentioned storage area 2 may be a spare storage area allocated in advance for the first program data. In other embodiments, the above-mentioned storage area 2 may also be a storage area divided from the free storage space for the first program data when performing an upgrade task.

由于存储区域1和存储区域2是不同的存储空间,因此,在解析安装更新数据包时,无需强制关闭关联应用的应用进程。从而,避免更新数据包的解析安装过程影响到用户使用关联应用。Since storage area 1 and storage area 2 are different storage spaces, there is no need to forcefully close the application process of the associated application when parsing and installing the update data package. Therefore, the parsing and installation process of the update data package is prevented from affecting the user's use of the associated application.

在更新数据包解析安装于存储区域2后,将得到的临时安装目录与第一程序数据关联上。例如,通过用户身份证明(User Identification,UID)将临时安装目录与第一程序数据关联。如此,也使临时安装目录下的更新程序数据与第一程序数据关联上。同时,升级任务与第一程序数据之间也存在对应关系。故,升级任务与临时安装目录下的更新程序数据之间也就建立起对应关系。After the update data package is parsed and installed in the storage area 2, the obtained temporary installation directory is associated with the first program data. For example, the temporary installation directory is associated with the first program data through User Identification (UID). In this way, the update program data in the temporary installation directory is also associated with the first program data. At the same time, there is also a corresponding relationship between the upgrade task and the first program data. Therefore, a corresponding relationship is established between the upgrade task and the update program data in the temporary installation directory.

之后,还需要监控第一程序数据对应的关联应用是否都切换到未使用状态,也即,重复获取关联应用的使用状态。若第一程序数据对应的关联应用都切换到未使用状态,将对应的升级任务从等待列表中取出。依据升级任务的指示,获取与第一程序数据关联的更新程序数据。再利用更新程序数据替换第一程序数据的数据实体。从而,完整地完成对第一程序数据的更新。Afterwards, it is also necessary to monitor whether the associated applications corresponding to the first program data are switched to an unused state, that is, to repeatedly obtain the usage status of the associated applications. If the associated applications corresponding to the first program data are switched to an unused state, the corresponding upgrade task is removed from the waiting list. Obtain update program data associated with the first program data according to instructions of the upgrade task. The updated program data is then used to replace the data entity of the first program data. Thus, the update of the first program data is completely completed.

也就是,本申请实施例中,可以是在第一程序数据对应的关联应用都切换到未使用状态的时刻,对第一程序数据的数据实体进行更新。That is, in the embodiment of the present application, the data entity of the first program data may be updated at the moment when the associated applications corresponding to the first program data are switched to an unused state.

在一些实施例中,可以周期性地重启对关联应用的使用状态的判断,直至第一程序数据的所有关联应用都处于未使用状态。In some embodiments, the determination of the usage status of associated applications may be periodically restarted until all associated applications of the first program data are in an unused state.

在另一些实施例中,也可以是受电子设备内出现应用程序从正在使用状态切换为未使用状态的触发,检测第一程序数据的关联应用是否都处于未使用状态。In other embodiments, it may also be triggered by the occurrence of an application program switching from an in-use state to an unused state in the electronic device, and it may be detected whether the associated applications of the first program data are all in an unused state.

此外,在一些实施例中,采用更新程序数据更替第一程序数据的数据实体的方式可以是将更新程序数据存储至存储区域1,并覆盖第一程序数据。另外,更新程序数据转移后,存储区域2也随之清空。In addition, in some embodiments, the method of replacing the data entity of the first program data with the updated program data may be to store the updated program data in the storage area 1 and overwrite the first program data. In addition, after the update program data is transferred, the storage area 2 is also cleared.

上述覆盖式更新,适用于更新数据包为全量数据包的场景。在更新数据包为增量数据包的情况下,将更新数据包解析后,也可得到更新程序数据。但,此场景下的更新程序数据又可成为增量程序数据。The above overlay update is suitable for scenarios where the update data packet is a full data packet. When the update data packet is an incremental data packet, the update program data can also be obtained after parsing the update data packet. However, the update program data in this scenario can also become incremental program data.

此情况下,上述更替第一程序数据的数据实体的方式还可以是:将增量程序数据移动至存储区域1,与第一程序数据进行融合,以完成对第一程序数据的更新。In this case, the above method of replacing the data entity of the first program data may also be: moving the incremental program data to the storage area 1 and integrating it with the first program data to complete the update of the first program data.

其中,全量数据包被解析后可以得到完全替代第一程序数据的更新数据。而增量数据包是解析后需要与原第一程序数据融合,才能得到完全替代第一程序数据的更新数据。Among them, after the full data packet is parsed, updated data that completely replaces the first program data can be obtained. The incremental data packet needs to be merged with the original first program data after parsing to obtain updated data that completely replaces the first program data.

在一些实施例中,将增量程序数据与原第一程序数据进行融合可以理解为利用增量程序数据对原第一程序数据进行增、删和替换中的至少一项操作。概念性地示例,如果增量程序数据指示对原第一程序数据中部分数据的修改,那么将增量程序数据替换原第一程序数据中被修改的部分数据。如果增量程序数据指示增加原第一程序数据的数据内容,那么将增量程序数据并入第一程序数据。如果增量程序数据是指示对原第一程序数据中部分数据进行删除,那么将被指示的部分数据从第一程序数据中删除。In some embodiments, fusing the incremental program data with the original first program data can be understood as using the incremental program data to perform at least one operation of adding, deleting, and replacing the original first program data. As a conceptual example, if the incremental program data indicates modification of part of the data in the original first program data, then the incremental program data replaces the modified part of the data in the original first program data. If the incremental program data indicates adding the data content of the original first program data, then the incremental program data is merged into the first program data. If the incremental program data indicates deletion of part of the data in the original first program data, then the instructed part of the data is deleted from the first program data.

在利用更新程序数据更新第一程序数据的数据实体的过程中,由于需要对第一程序数据的数据实体处理,故,处理期间也需要提示用户暂停使用关联应用。提醒用户暂停使用关联应用的方式,可以是参考前述实施例中提到的广播报文通知的方式,在此不再赘述。In the process of updating the data entity of the first program data using the update program data, since the data entity of the first program data needs to be processed, the user also needs to be prompted to suspend use of the associated application during the processing. The method of reminding the user to suspend the use of the associated application may refer to the method of broadcast message notification mentioned in the previous embodiment, which will not be described again here.

除此之外,待第一程序数据完成更新后,也可以通过广播报文2通知桌面,取消对关联应用的暂停使用提示。具体实现可参考前述实施例中的描述。In addition, after the first program data is updated, the desktop can also be notified through broadcast message 2 to cancel the suspension prompt for the associated application. For specific implementation, reference may be made to the descriptions in the foregoing embodiments.

当然,在另一些实施例中,为了缩短用户需要等待第一程序数据的数据实体被更新的时长,在更新数据包为全量数据包的情况下,将更新数据包解析安装于存储区域2后,直接将关联应用加载第一程序数据的加载地址更换为存储区域2的地址。如此,下一次启动关联应用则可以直接加载存储区域2中的更新程序数据。换句话说,再次启动关联应用时,原来的临时安装目录变为新的固定安装目录。Of course, in other embodiments, in order to shorten the time the user needs to wait for the data entity of the first program data to be updated, when the update data packet is a full data packet, after the update data packet is parsed and installed in the storage area 2, Directly replace the loading address of the first program data loaded by the associated application with the address of storage area 2. In this way, the update program data in the storage area 2 can be directly loaded the next time the associated application is started. In other words, when the associated application is started again, the original temporary installation directory becomes the new fixed installation directory.

在更新数据包为增量数据包的情况下,将更新数据包解析安装于存储区域2后,还需要将第一程序数据镜像到存储区域2,并与增量数据包融合。完成数据融合之后,再将关联应用加载第一程序数据的加载地址更换为存储区域2的地址。When the update data packet is an incremental data packet, after the update data packet is parsed and installed in the storage area 2, the first program data also needs to be mirrored to the storage area 2 and merged with the incremental data package. After the data fusion is completed, the loading address of the first program data loaded by the associated application is replaced with the address of storage area 2.

此后,还可以将原来的固定安装目录删除,以释放出冗余的存储空间。Afterwards, you can also delete the original fixed installation directory to release redundant storage space.

当然,在一些其他的实施例中,变更加载地址后,还可以将原来的固定安装目录的第一程序数据保留指定时长。在指定时长内,持续监测关联应用是否运行异常。Of course, in some other embodiments, after changing the loading address, the first program data in the original fixed installation directory can also be retained for a specified period of time. Within a specified period of time, continuously monitor whether the associated application is running abnormally.

其中,上述运行异常可以是加载第一程序数据时出现的异常。比如,第一程序数据为应用程序的程序文件时,若关联应用出现程序无法启动或者程序报错次数超过预设值,则判定出现运行异常。再比如,第一程序数据为公共组件的程序文件时,若出现关联应用调用公共组件时出现异常,则判定出现运行异常。The above-mentioned running exception may be an exception that occurs when loading the first program data. For example, when the first program data is the program file of an application program, if the associated application fails to start the program or the number of program error reports exceeds a preset value, it will be determined that a running abnormality has occurred. For another example, when the first program data is a program file of a public component, if an exception occurs when the associated application calls the public component, it will be determined that a running exception has occurred.

如果指定时长内关联应用存在运行异常的问题,那么再将关联应用加载第一程序数据的加载地址恢复为存储区域1的地址,并清除存储区域2内的程序数据。If there is a problem with abnormal operation of the associated application within the specified period of time, then the loading address of the first program data loaded by the associated application is restored to the address of storage area 1, and the program data in storage area 2 is cleared.

如果指定时长内关联应用未出现运行异常,那么将第一存储区域下的第一程序数据删除。If no operation abnormality occurs in the associated application within a specified period of time, the first program data in the first storage area is deleted.

作为一个示例,如图13所示,在图4所示的程序数据更新方法的基础上,上述S103可以包括:As an example, as shown in Figure 13, based on the program data update method shown in Figure 4, the above S103 may include:

S103-5,在存储区域2内,解析安装更新数据包。通过解析安装更新数据包,得到更新程序数据。S103-5, in storage area 2, parse and install the update data package. Obtain update program data by parsing the installation update data package.

S103-6,将更新程序数据与第一程序数据关联。S103-6, associate the update program data with the first program data.

S103-7,监控第一程序数据的关联应用的使用状态。S103-7: Monitor the usage status of the associated application of the first program data.

在第一程序数据的关联应用都处于未使用状态的情况,流程进入S103-8。否则,继续执行S103-7。When all associated applications of the first program data are in an unused state, the process proceeds to S103-8. Otherwise, continue to execute S103-7.

S103-8,利用关联的更新程序数据更新第一程序数据的数据实体。S103-8: Update the data entity of the first program data using the associated update program data.

此外,在执行S103-8期间,还需要执行S103-9。In addition, during the execution of S103-8, S103-9 also needs to be executed.

S103-9,通知桌面变更关联应用的桌面图标。S103-9, notify the desktop to change the desktop icon of the associated application.

在一些实施例中,S103-8与S103-4的原理相同,在此不再赘述。In some embodiments, the principles of S103-8 and S103-4 are the same and will not be described again.

显然地,无论采取何种错位升级策略,都避免了关闭处于正在使用状态下的关联应用。避免关联应用在用户使用期间出现闪退。从而,解决了应用使用和程序更新之间的冲突。Obviously, no matter what misplaced upgrade strategy is adopted, it is avoided to close the associated applications that are in use. Prevent associated applications from crashing during user use. Thus, conflicts between application usage and program updates are resolved.

S104,在关联应用处于未使用状态时,基于更新数据包,直接对第一程序数据进行更新。S104: When the associated application is in an unused state, directly update the first program data based on the update data package.

在一些实施例中,可以是直接将更新数据包解析安装到存储区域1,用于更新固定安装目录中的第一程序数据。在解析安装期间,也可以通过广播报文1,提醒用户暂停使用关联应用。同样地,在第一程序数据更新结束后,也可以通过广播报文2,取消暂停使用提醒。In some embodiments, the update data package may be directly parsed and installed into the storage area 1 for updating the first program data in the fixed installation directory. During the parsing and installation period, broadcast message 1 can also be used to remind the user to suspend use of the associated application. Similarly, after the first program data update is completed, the suspension reminder can also be canceled through broadcast message 2.

另外,无论是S103中按照错位升级策略对第一程序数据进行更新,还是S104中直接对第一程序数据进行更新,还需要考虑电子设备的自身条件是否适合进行更新。In addition, whether the first program data is updated according to the misaligned upgrade strategy in S103 or the first program data is directly updated in S104, it is also necessary to consider whether the conditions of the electronic device are suitable for updating.

示例性地,执行S103或S104之前,可以查看电子设备是否具有更新的存储空间要求。如果满足,继续执行S103或S104。反之,则不执行。For example, before performing S103 or S104, it may be checked whether the electronic device has updated storage space requirements. If satisfied, continue to execute S103 or S104. Otherwise, it will not be executed.

示例性地,执行S103或S104之前,还可以查看电子设备的剩余电量是否支持完成更新。如果剩余电量足够支持完成更新,那么继续执行S103或S104。反之,则不执行。当然,判定电子设备的剩余电量是否支持完成更新的方式,可以是将剩余电量与升级电量下限值进行比较。如果剩余电量低于预设的电量下限值,那么判定剩余电量不支持完成更新。如果剩余电量不低于预设的电量下限值,那么判定剩余电量支持完成更新。For example, before performing S103 or S104, you may also check whether the remaining power of the electronic device supports completing the update. If the remaining power is sufficient to complete the update, continue to perform S103 or S104. Otherwise, it will not be executed. Of course, the way to determine whether the remaining power of the electronic device supports completion of the update may be to compare the remaining power with the lower limit of the upgrade power. If the remaining power is lower than the preset lower limit of power, it is determined that the remaining power does not support completing the update. If the remaining power is not lower than the preset lower limit of power, it is determined that the remaining power supports completion of the update.

示例性地,执行S103和S104之前,还可以查看电子设备是否处于充电状态。如果处于充电状态,那么继续执行S103或S104。反之,则不执行。For example, before performing S103 and S104, you may also check whether the electronic device is in a charging state. If it is in the charging state, continue to execute S103 or S104. Otherwise, it will not be executed.

本申请实施例还提供一种电子设备,该电子设备可以包括:显示屏、存储器和一个或多个处理器。该显示屏、存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,可使得电子设备执行上述实施例中手机执行的各个步骤。当然,该电子设备包括但不限于上述显示屏、存储器和一个或多个处理器。例如,该电子设备的结构可以参考图2所示的手机的结构。An embodiment of the present application also provides an electronic device, which may include a display screen, a memory, and one or more processors. The display, memory and processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can be caused to perform various steps performed by the mobile phone in the above embodiments. Of course, the electronic device includes but is not limited to the above-mentioned display screen, memory and one or more processors. For example, the structure of the electronic device may refer to the structure of the mobile phone shown in FIG. 2 .

本申请实施例还提供一种芯片系统,该芯片系统可以应用于前述实施例中的电子设备。如图14所示,该芯片系统包括至少一个处理器2201和至少一个接口电路2202。该处理器2201可以是上述电子设备中的处理器。处理器2201和接口电路2202可通过线路互联。该处理器2201可以通过接口电路2202从上述电子设备的存储器接收并执行计算机指令。当计算机指令被处理器2201执行时,可使得电子设备执行上述实施例中手机执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。Embodiments of the present application also provide a chip system, which can be applied to the electronic devices in the foregoing embodiments. As shown in Figure 14, the chip system includes at least one processor 2201 and at least one interface circuit 2202. The processor 2201 may be the processor in the above-mentioned electronic device. The processor 2201 and the interface circuit 2202 may be interconnected via wires. The processor 2201 can receive and execute computer instructions from the memory of the above-mentioned electronic device through the interface circuit 2202. When the computer instructions are executed by the processor 2201, the electronic device can be caused to perform various steps performed by the mobile phone in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the above description of the embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated as needed. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working processes of the systems, devices and units described above, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be described again here.

在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage device. The medium includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above are only specific implementation modes of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present application shall be covered by this application. within the protection scope of the application embodiment. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims (21)

1.一种程序数据更新方法,其特征在于,所述方法包括:1. A program data update method, characterized in that the method includes: 获取公共组件的更新数据包,所述公共组件包括谷歌移动服务组件、webview组件、银联支付组件;Obtain the update data package of public components, which include Google mobile service components, webview components, and UnionPay payment components; 确定与所述公共组件相关联的多个第一应用,其中,所述相关联的应用程序是指调用所述公共组件的应用程序;Determine a plurality of first applications associated with the common component, wherein the associated application refers to an application that calls the common component; 获取所述多个第一应用的运行状态,所述运行状态包括前台运行,后台运行和停止运行;依据所述运行状态,获取所有的所述第一应用的使用状态;其中,所述使用状态包括:正在使用状态和未使用状态;在所述运行状态为所述前台运行的情况下,所述使用状态为正在使用状态;在所述运行状态为所述后台运行且显示多任务界面,或所述运行状态为所述后台运行且接收到用户对所述多任务界面中所述第一应用的界面的操作的情况下,所述使用状态为正在使用状态;Obtain the running status of the plurality of first applications, the running status includes foreground running, background running and stopped running; according to the running status, obtain the usage status of all the first applications; wherein, the usage status Including: an in-use state and an unused state; when the running state is the foreground running, the using state is the in-use state; when the running state is the background running and a multi-task interface is displayed, or When the running state is running in the background and a user's operation on the interface of the first application in the multi-tasking interface is received, the use state is an in-use state; 在至少一个所述第一应用处于正在使用状态的情况下,将所述公共组件对应的升级任务放入等待列表;When at least one of the first applications is in use, put the upgrade task corresponding to the public component into a waiting list; 再次获取所有的所述第一应用的使用状态;Obtain the usage status of all the first applications again; 在所有的所述第一应用处于未使用状态的情况下,基于所述公共组件的更新数据包,对公共组件进行升级;所述对公共组件进行升级包括:解析安装所述公共组件的更新数据包,以更新所述公共组件;或,根据第二程序数据更新所述公共组件;其中,所述第二程序数据是在第二存储区域内解析安装所述公共组件的更新数据包后得到的数据;所述第二存储区域与第一存储区域不同;所述第一存储区域为用于存储所述公共组件的存储区域。When all the first applications are in an unused state, the public components are upgraded based on the update data package of the public components; the upgrading of the public components includes: parsing and installing the update data of the public components package to update the common component; or to update the common component according to second program data; wherein the second program data is obtained after parsing and installing the update data package of the common component in the second storage area data; the second storage area is different from the first storage area; the first storage area is a storage area used to store the common component. 2.如权利要求1所述的方法,其特征在于,所述解析安装所述公共组件的更新数据包,包括:2. The method of claim 1, wherein the analyzing and installing the update data package of the public component includes: 在第一存储区域内解析安装所述更新数据包,以替换所述公共组件。The update data package is parsed and installed in the first storage area to replace the common component. 3.如权利要求1所述的方法,其特征在于,在第一应用处于正在使用状态,且获取到公共组件的更新数据包的情况下,所述方法还包括:3. The method of claim 1, wherein when the first application is in use and the update data packet of the public component is obtained, the method further includes: 在所述第二存储区域内解析安装所述更新数据包,以得到所述第二程序数据。The update data package is parsed and installed in the second storage area to obtain the second program data. 4.如权利要求1所述的方法,其特征在于,在所述更新数据包为全量数据包的情况下,所述根据第二程序数据更新所述公共组件,包括:4. The method of claim 1, wherein when the update data packet is a full data packet, updating the common component according to the second program data includes: 采用所述第二程序数据,替换所述公共组件。The second program data is used to replace the common component. 5.如权利要求1所述的方法,其特征在于,在所述更新数据包为增量数据包的情况下,所述根据第二程序数据更新所述公共组件,包括:5. The method of claim 1, wherein when the update data packet is an incremental data packet, updating the common component according to the second program data includes: 将所述第二程序数据存储至所述第一存储区域,并与所述公共组件融合。The second program data is stored in the first storage area and merged with the common component. 6.如权利要求1所述的方法,其特征在于,在所述更新数据包为全量数据包的情况下,所述根据第二程序数据更新所述公共组件,包括:6. The method of claim 1, wherein when the update data packet is a full data packet, updating the common component according to the second program data includes: 将所述公共组件的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。The loading address of the common component is changed from the address of the first storage area to the address of the second storage area. 7.如权利要求1所述的方法,其特征在于,在所述更新数据包为增量数据包的情况下,所述根据第二程序数据更新所述公共组件,包括:7. The method of claim 1, wherein when the update data packet is an incremental data packet, updating the common component according to the second program data includes: 将所述公共组件镜像至所述第二存储区域,并与所述第二程序数据融合;Mirror the common component to the second storage area and merge it with the second program data; 将所述公共组件的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。The loading address of the common component is changed from the address of the first storage area to the address of the second storage area. 8.如权利要求6或7所述的方法,其特征在于,所述方法还包括:8. The method according to claim 6 or 7, characterized in that the method further comprises: 所述第一应用在加载地址变更后的预设时长内未出现运行异常的情况下,删除所述第一存储区域内的所述公共组件。The first application deletes the common component in the first storage area if no running abnormality occurs within a preset time period after the loading address is changed. 9.如权利要求6或7所述的方法,其特征在于,所述方法还包括:9. The method according to claim 6 or 7, characterized in that the method further comprises: 所述第一应用在加载地址变更后的预设时长内出现运行异常的情况下,将加载所述公共组件的加载地址恢复为所述第一存储区域的地址;If the first application runs abnormally within a preset time period after the loading address is changed, the loading address of the public component is restored to the address of the first storage area; 清空所述第二存储区域。Clear the second storage area. 10.如权利要求1-7任意一项所述的方法,其特征在于,在更新所述公共组件的过程中,所述方法还包括:10. The method according to any one of claims 1 to 7, characterized in that, in the process of updating the common component, the method further includes: 在所述第一应用的桌面图标上显示提示信息;或,Display prompt information on the desktop icon of the first application; or, 在接收到用户对所述第一应用的图标的操作后,显示提示信息;After receiving a user's operation on the icon of the first application, display prompt information; 其中,所述提示信息用于提示以下信息中的至少一个:更新状态、更新进度、更新版本、更新发布时间。The prompt information is used to prompt at least one of the following information: update status, update progress, update version, and update release time. 11.一种电子设备,其特征在于,电子设备包括一个或多个处理器和存储器;存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,11. An electronic device, characterized in that the electronic device includes one or more processors and a memory; the memory is coupled to the processor, and the memory is used to store computer program code. The computer program code includes computer instructions. When one or more processes When the machine executes computer instructions, 所述一个或多个处理器,用于获取公共组件的更新数据包,所述公共组件包括谷歌移动服务组件、webview组件、银联支付组件;确定与所述公共组件相关联的多个第一应用,其中,所述相关联的应用程序是指调用所述公共组件的应用程序;获取所述多个第一应用的运行状态,所述运行状态包括前台运行,后台运行和停止运行;依据所述运行状态,获取所有的所述第一应用的使用状态;其中,所述使用状态包括:正在使用状态和未使用状态;在所述运行状态为所述前台运行的情况下,所述使用状态为正在使用状态;在所述运行状态为所述后台运行且显示多任务界面,或所述运行状态为所述后台运行且接收到用户对所述多任务界面中所述第一应用的界面的操作的情况下,所述使用状态为正在使用状态;在至少一个所述第一应用处于正在使用状态的情况下,将所述公共组件对应的升级任务放入等待列表;再次获取所有的所述第一应用的使用状态;在所有的所述第一应用处于未使用状态的情况下,基于所述公共组件的更新数据包,对公共组件进行升级;所述对公共组件进行升级包括:解析安装所述公共组件的更新数据包,以更新所述公共组件;或,根据第二程序数据更新所述公共组件;其中,所述第二程序数据是在第二存储区域内解析安装所述公共组件的更新数据包后得到的数据;所述第二存储区域与第一存储区域不同;所述第一存储区域为用于存储所述公共组件的存储区域。The one or more processors are used to obtain update data packets of public components, the public components include Google mobile service components, webview components, and UnionPay payment components; determine multiple first applications associated with the public components , wherein the associated application program refers to an application program that calls the public component; obtaining the running status of the plurality of first applications, the running status includes foreground running, background running and stopping running; according to the Running status: obtain the usage status of all the first applications; wherein, the usage status includes: in use status and unused status; when the running status is the foreground running, the usage status is In-use state; when the running state is running in the background and a multi-tasking interface is displayed, or the running state is running in the background and a user's operation on the interface of the first application in the multi-tasking interface is received When at least one of the first applications is in use, put the upgrade task corresponding to the common component into the waiting list; obtain all the first applications again. The use status of an application; when all the first applications are in an unused state, the public components are upgraded based on the update data package of the public components; the upgrading of the public components includes: parsing and installing the The update data package of the public component is used to update the public component; or, the public component is updated according to the second program data; wherein the second program data is parsed and installed in the second storage area to install the public component. Data obtained after updating the data package; the second storage area is different from the first storage area; the first storage area is a storage area used to store the common component. 12.如权利要求11所述的电子设备,其特征在于,所述一个或多个处理器,用于所述解析安装所述公共组件的更新数据包,包括:12. The electronic device according to claim 11, wherein the one or more processors are configured to parse and install the update data package of the common component, including: 在第一存储区域内解析安装所述公共组件的更新数据包,以替换所述公共组件。An update data package for installing the common component is parsed in the first storage area to replace the common component. 13.如权利要求11所述的电子设备,其特征在于,在第一应用处于正在使用状态,且获取到所述公共组件的更新数据包的情况下,所述一个或多个处理器,还用于:13. The electronic device of claim 11, wherein when the first application is in use and the update data packet of the common component is obtained, the one or more processors further Used for: 在所述第二存储区域内解析安装所述公共组件的更新数据包,以得到所述第二程序数据。The update data package for installing the common component is parsed in the second storage area to obtain the second program data. 14.如权利要求11所述的电子设备,其特征在于,在所述更新数据包为全量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述公共组件,包括:14. The electronic device of claim 11, wherein when the update data packet is a full data packet, the one or more processors are configured to update the data according to the second program data. The common components described above include: 采用所述第二程序数据,替换所述公共组件。The second program data is used to replace the common component. 15.如权利要求11所述的电子设备,其特征在于,在所述更新数据包为增量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述公共组件,包括:15. The electronic device of claim 11, wherein when the update data packet is an incremental data packet, the one or more processors are configured to update the data according to the second program. The common components include: 将所述第二程序数据存储至所述第一存储区域,并与所述公共组件融合。The second program data is stored in the first storage area and merged with the common component. 16.如权利要求11所述的电子设备,其特征在于,在所述更新数据包为全量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述公共组件,包括:16. The electronic device of claim 11, wherein when the update data packet is a full data packet, the one or more processors are configured to update the data according to the second program data. The common components described above include: 将所述公共组件的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。The loading address of the common component is changed from the address of the first storage area to the address of the second storage area. 17.如权利要求11所述的电子设备,其特征在于,在所述更新数据包为增量数据包的情况下,所述一个或多个处理器,用于所述根据第二程序数据更新所述公共组件,包括:17. The electronic device of claim 11, wherein when the update data packet is an incremental data packet, the one or more processors are configured to update the data according to the second program. The common components include: 将所述公共组件镜像至所述第二存储区域,并与所述第二程序数据融合;Mirror the common component to the second storage area and merge it with the second program data; 将所述公共组件的加载地址由所述第一存储区域的地址变更为所述第二存储区域的地址。The loading address of the common component is changed from the address of the first storage area to the address of the second storage area. 18.如权利要求16或17所述的电子设备,其特征在于,所述一个或多个处理器,还用于:18. The electronic device according to claim 16 or 17, characterized in that the one or more processors are also used to: 所述第一应用在加载地址变更后的预设时长内未出现运行异常的情况下,删除所述第一存储区域内的所述公共组件。The first application deletes the common component in the first storage area if no running abnormality occurs within a preset time period after the loading address is changed. 19.如权利要求16或17所述的电子设备,其特征在于,所述一个或多个处理器,还用于:19. The electronic device according to claim 16 or 17, characterized in that the one or more processors are also used for: 所述第一应用在加载地址变更后的预设时长内出现运行异常的情况下,将加载所述公共组件的加载地址恢复为所述第一存储区域的地址;If the first application runs abnormally within a preset time period after the loading address is changed, the loading address of the public component is restored to the address of the first storage area; 清空所述第二存储区域。Clear the second storage area. 20.如权利要求11-17任意一项所述的电子设备,其特征在于,在更新所述公共组件的过程中,所述一个或多个处理器,还用于:20. The electronic device according to any one of claims 11 to 17, characterized in that, in the process of updating the common component, the one or more processors are also used to: 在所述第一应用的桌面图标上显示提示信息;或,Display prompt information on the desktop icon of the first application; or, 在接收到用户对所述第一应用的图标的操作后,显示提示信息;After receiving a user's operation on the icon of the first application, display prompt information; 其中,所述提示信息用于提示以下信息中的至少一个:更新状态、更新进度、更新版本、更新发布时间。Wherein, the prompt information is used to prompt at least one of the following information: update status, update progress, update version, and update release time. 21.一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。21. A computer storage medium, characterized by comprising computer instructions that, when run on an electronic device, cause the electronic device to perform the method according to any one of claims 1-10.
CN202110393355.1A 2021-04-13 2021-04-13 Program data updating method, electronic equipment and computer storage medium Active CN112988213B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110393355.1A CN112988213B (en) 2021-04-13 2021-04-13 Program data updating method, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110393355.1A CN112988213B (en) 2021-04-13 2021-04-13 Program data updating method, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN112988213A CN112988213A (en) 2021-06-18
CN112988213B true CN112988213B (en) 2023-11-14

Family

ID=76338098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110393355.1A Active CN112988213B (en) 2021-04-13 2021-04-13 Program data updating method, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112988213B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113853580A (en) * 2021-06-30 2021-12-28 华为技术有限公司 Electronic Control Unit (ECU) updating method, ECU and terminal
CN114443117B (en) * 2021-08-17 2023-08-22 荣耀终端有限公司 Custom package processing method and electronic equipment
CN117555410B (en) * 2022-08-05 2025-09-12 荣耀终端股份有限公司 5G function switch state switching method and electronic device
CN115640034B (en) * 2022-11-28 2023-06-02 荣耀终端有限公司 Data storage method and device
CN116244008B (en) * 2023-05-10 2023-09-15 荣耀终端有限公司 Application launch methods, electronic devices and storage media
CN117806680B (en) * 2023-12-29 2025-05-09 北京字跳网络技术有限公司 Business data upgrade method, device, medium and electronic equipment for business application

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104007992A (en) * 2014-06-09 2014-08-27 广州华多网络科技有限公司 Methods and devices for program updating and starting
CN106445609A (en) * 2016-09-30 2017-02-22 广东欧珀移动通信有限公司 Automatic updating method of application program and mobile terminal
CN107239295A (en) * 2016-03-29 2017-10-10 腾讯科技(深圳)有限公司 The method and software updating apparatus of a kind of software upgrading
CN107436756A (en) * 2016-05-26 2017-12-05 高德信息技术有限公司 One kind applies update method, server, terminal and system
CN110647333A (en) * 2018-06-26 2020-01-03 霍尼韦尔环境自控产品(天津)有限公司 Firmware upgrading method and equipment configured to upgrade firmware therein
CN110806890A (en) * 2019-11-21 2020-02-18 金蝶软件(中国)有限公司 Software updating method and related device
CN111611042A (en) * 2020-05-22 2020-09-01 京东方科技集团股份有限公司 Device state change processing method, apparatus and computer-readable storage medium
CN111736863A (en) * 2020-05-22 2020-10-02 深圳市鸿合创新信息技术有限责任公司 A software upgrade method, device and electronic device
CN112099821A (en) * 2020-08-25 2020-12-18 珠海格力电器股份有限公司 Program upgrading method and device and air conditioning system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7530079B2 (en) * 2006-09-07 2009-05-05 Microsoft Corporation Managing application customization
US9361091B2 (en) * 2014-05-27 2016-06-07 Nintendo Co., Ltd. Information processing apparatus, information processing system, information processing method, and non-transitory computer-readable storage medium having stored therein an information processing program
US10296324B2 (en) * 2015-10-30 2019-05-21 Sap Se Zero downtime software system upgrade

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104007992A (en) * 2014-06-09 2014-08-27 广州华多网络科技有限公司 Methods and devices for program updating and starting
CN107239295A (en) * 2016-03-29 2017-10-10 腾讯科技(深圳)有限公司 The method and software updating apparatus of a kind of software upgrading
CN107436756A (en) * 2016-05-26 2017-12-05 高德信息技术有限公司 One kind applies update method, server, terminal and system
CN106445609A (en) * 2016-09-30 2017-02-22 广东欧珀移动通信有限公司 Automatic updating method of application program and mobile terminal
CN110647333A (en) * 2018-06-26 2020-01-03 霍尼韦尔环境自控产品(天津)有限公司 Firmware upgrading method and equipment configured to upgrade firmware therein
CN110806890A (en) * 2019-11-21 2020-02-18 金蝶软件(中国)有限公司 Software updating method and related device
CN111611042A (en) * 2020-05-22 2020-09-01 京东方科技集团股份有限公司 Device state change processing method, apparatus and computer-readable storage medium
CN111736863A (en) * 2020-05-22 2020-10-02 深圳市鸿合创新信息技术有限责任公司 A software upgrade method, device and electronic device
CN112099821A (en) * 2020-08-25 2020-12-18 珠海格力电器股份有限公司 Program upgrading method and device and air conditioning system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
利用Socket实现应用系统文件自动升级;温华;;电脑知识与技术;第5卷(第26期);第7397-7399页 *

Also Published As

Publication number Publication date
CN112988213A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112988213B (en) Program data updating method, electronic equipment and computer storage medium
US11803451B2 (en) Application exception recovery
US11853820B2 (en) Cross-process communication method, apparatus, and device
US11947974B2 (en) Application start method and electronic device
JP2023506936A (en) MULTI-SCREEN COOPERATION METHOD AND SYSTEM AND ELECTRONIC DEVICE
CN110865837B (en) Method and terminal for system upgrade
WO2021027772A1 (en) Method for switching running of application and device
CN116483734B (en) Pile inserting method and system based on compiler and related electronic equipment
CN113391743B (en) A display method and electronic device
WO2025060715A1 (en) Method for managing system services, and related apparatus
CN115941674B (en) Multi-device application connection method, device and storage medium
CN116033064B (en) Card display method, electronic device and readable storage medium
WO2022267786A1 (en) Shortcut icon display method and terminal device
CN115373778A (en) Screen projection method and related device
CN113867999B (en) Application exception handling method, terminal and computer-readable storage medium
CN116048544B (en) A pop-up advertisement processing method, electronic device and readable storage medium
CN116048685B (en) Display method, graphical interface and electronic device of magazine lock screen
CN116719556B (en) System upgrading method and electronic device
CN114625428B (en) Application exception processing method and electronic equipment
CN117555658B (en) Method for managing application running and electronic equipment
CN116737258B (en) Method and related device for unloading application
CN115344860B (en) Method for managing application program and electronic equipment
CN116048545B (en) Processing method of popup advertisement, electronic equipment and readable storage medium
CN117009023B (en) Method and related device for displaying notification information
CN117729561B (en) System upgrade method, terminal and storage medium

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
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