WO2023005783A1 - Data processing method and electronic device - Google Patents

Data processing method and electronic device Download PDF

Info

Publication number
WO2023005783A1
WO2023005783A1 PCT/CN2022/106967 CN2022106967W WO2023005783A1 WO 2023005783 A1 WO2023005783 A1 WO 2023005783A1 CN 2022106967 W CN2022106967 W CN 2022106967W WO 2023005783 A1 WO2023005783 A1 WO 2023005783A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
application
data
information
memory
Prior art date
Application number
PCT/CN2022/106967
Other languages
French (fr)
Chinese (zh)
Inventor
王大能
任超
奚林兴
杨伟健
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023005783A1 publication Critical patent/WO2023005783A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Abstract

A data processing method and an electronic device, relating to the technical field of communication. A first electronic device may acquire second electronic device information used for determining whether a second electronic device can assist the first electronic device in implementing application keep-alive; when the second electronic device can assist the first electronic device in implementing application keep-alive, sending to the second electronic device data of a first application running in the background of the first electronic device, and deleting the data of the first application. Thus, the first electronic device can release the data of the first application to obtain more free storage space. The background application of the first electronic device is prevented from being killed due to insufficient running memory, thereby realising application keep-alive and enhancing the user experience.

Description

数据处理方法及电子设备Data processing method and electronic device
“本申请要求于2021年7月26日提交国家知识产权局、申请号为202110846381.5、发明名称为“数据处理方法及电子设备”的专利申请的优先权,其全部内容通过引用结合在本申请中”。"This application claims the priority of the patent application filed with the State Intellectual Property Office on July 26, 2021, with the application number 202110846381.5, and the title of the invention is "Data Processing Method and Electronic Equipment", the entire content of which is incorporated by reference in this application ".
技术领域technical field
本申请涉及通信技术领域,尤其涉及数据处理方法及电子设备。The present application relates to the technical field of communication, and in particular to a data processing method and electronic equipment.
背景技术Background technique
随着科技的不断发展,使用电子设备的用户越来越多,在电子设备上开发应用(application,APP)的开发商也越来越多。所以,一台电子设备上通常会安装多个应用,例如微信
Figure PCTCN2022106967-appb-000001
支付宝
Figure PCTCN2022106967-appb-000002
腾讯视频
Figure PCTCN2022106967-appb-000003
百度地图
Figure PCTCN2022106967-appb-000004
等等。对于各个应用的开发商,他们希望电子设备上的应用可以持续保活,也就是说,开发商希望应用的进程维持开启状态而不被杀死。这样,开发商就可以向用户推送消息,以开展自身业务。对于电子设备的用户,他们也希望电子设备上的应用可以持续保活。这样,用户可以通过电子设备及时接收开发商推送的消息,而且,用户再次打开应用时,应用还维持着上次的使用状态,使用起来较为方便。
With the continuous development of technology, more and more users use electronic devices, and more and more developers develop applications (applications, APPs) on the electronic devices. Therefore, multiple applications are usually installed on an electronic device, such as WeChat
Figure PCTCN2022106967-appb-000001
Alipay
Figure PCTCN2022106967-appb-000002
Tencent Video
Figure PCTCN2022106967-appb-000003
Baidu map
Figure PCTCN2022106967-appb-000004
etc. For each application developer, they hope that the application on the electronic device can keep alive, that is, the developer hopes that the process of the application will remain open and not be killed. In this way, developers can push messages to users to carry out their own business. For users of electronic devices, they also hope that the applications on the electronic devices can be continuously kept alive. In this way, the user can receive the news pushed by the developer through the electronic device in time, and when the user opens the application again, the application will still maintain the last usage state, which is more convenient to use.
然而,在电子设备的内存不足的情况下,电子设备会杀死部分应用,以回收内存,保证电子设备正常运行。因此,如何保活应用是当前亟需解决的问题。However, when the memory of the electronic device is insufficient, the electronic device will kill some applications to reclaim the memory and ensure the normal operation of the electronic device. Therefore, how to keep the application alive is a problem that needs to be solved urgently.
发明内容Contents of the invention
本申请实施例提供数据处理方法及电子设备,可以在多个电子设备之间共享内存,避免电子设备中的应用由于内存不足而被杀死,进而提高了用户体验。The embodiments of the present application provide a data processing method and an electronic device, which can share memory among multiple electronic devices, avoiding the killing of applications in the electronic device due to insufficient memory, thereby improving user experience.
为达到上述目的,本申请的实施例采用如下技术方案:In order to achieve the above object, the embodiments of the present application adopt the following technical solutions:
第一方面,本申请实施例提供一种数据处理方法,该数据处理方法可以应用于第一电子设备,也可以应用于第一电子设备中的模块,例如芯片或芯片系统。下面以该数据处理方法应用于第一电子设备为例进行描述。其中,第一电子设备与第二电子设备连接,第一电子设备上运行至少一个应用,至少一个应用包括在第一电子设备后台运行的第一应用。该方法包括:获取第二电子设备的信息,第二电子设备的信息用于确定第二电子设备能否协助第一电子设备实现应用保活;若第二电子设备能够协助第一电子设备实现应用保活,向第二电子设备发送第一应用的数据;删除第一应用的数据。In a first aspect, an embodiment of the present application provides a data processing method, and the data processing method may be applied to a first electronic device, or to a module in the first electronic device, such as a chip or a chip system. The following description will be made by taking the application of the data processing method to the first electronic device as an example. Wherein, the first electronic device is connected to the second electronic device, at least one application runs on the first electronic device, and the at least one application includes the first application running in the background of the first electronic device. The method includes: acquiring information of the second electronic device, and the information of the second electronic device is used to determine whether the second electronic device can assist the first electronic device to realize application keeping alive; if the second electronic device can assist the first electronic device to realize application Keep alive, sending the data of the first application to the second electronic device; deleting the data of the first application.
基于上述第一方面提供的方法,第一电子设备可以在第二电子设备能够协助第一电子设备实现应用保活的情况下,向第二电子设备发送第一应用的数据,使得第一电子设备能够共享第二电子设备的内存。因此,第一电子设备可以释放第一应用的数据,来获得更多空闲的存储空间。避免了第一电子设备的后台应用因为运行内存不足而被杀,实现了应用保活,提高了用户体验。另外,上述第一方面提供的方法不需要对第一电子设备上的应用进行任何修改或适配,操作简单,使用方便。Based on the method provided in the first aspect above, the first electronic device can send the data of the first application to the second electronic device under the condition that the second electronic device can assist the first electronic device in keeping the application alive, so that the first electronic device The memory of the second electronic device can be shared. Therefore, the first electronic device can release the data of the first application to obtain more free storage space. This prevents the background application of the first electronic device from being killed due to insufficient running memory, realizes application keeping alive, and improves user experience. In addition, the method provided by the above first aspect does not require any modification or adaptation to the application on the first electronic device, and is easy to operate and easy to use.
一种可能的实现方式,若第一应用切换至第一电子设备的前台运行,该方法还包括:向第二电子设备发送用于请求第一应用的数据的第一请求信息;接收来自第二电子设备的第一应用的数据。基于上述方法,在第一应用切换至第一电子设备的前台运行的情况下,第一电子设备可以从第二电子设备获取第一应用的数据,以便第一应用在第一电子设备的前台运行。In a possible implementation manner, if the first application is switched to run in the foreground of the first electronic device, the method further includes: sending the first request information for requesting data of the first application to the second electronic device; Data of the first application of the electronic device. Based on the above method, when the first application is switched to run in the foreground of the first electronic device, the first electronic device can obtain the data of the first application from the second electronic device, so that the first application runs in the foreground of the first electronic device .
一种可能的实现方式,该方法还包括:建立第一通道,第一通道用于传输存储在第二电子设备中、第一电子设备上的应用的数据。基于上述方法,第一电子设备可以通过第一通道从第二电子设备获取存储在第二电子设备中、第一电子设备上的应用的数据。In a possible implementation manner, the method further includes: establishing a first channel, where the first channel is used to transmit application data stored in the second electronic device and on the first electronic device. Based on the above method, the first electronic device may obtain from the second electronic device the data of the application stored in the second electronic device and on the first electronic device through the first channel.
一种可能的实现方式,该方法还包括:向第二电子设备发送第二应用的数据,第二应用包括在至少一个应用中,第二应用在第一电子设备的后台运行。基于上述方法,第一电子设备可以向第二电子设备发送第二应用的数据,使得第一电子设备可以释放更多的内存。In a possible implementation manner, the method further includes: sending data of a second application to the second electronic device, the second application is included in at least one application, and the second application runs in the background of the first electronic device. Based on the above method, the first electronic device can send the data of the second application to the second electronic device, so that the first electronic device can release more memory.
一种可能的实现方式,第一操作的优先级高于第二操作的优先级,第一操作是接收来自第二电子设备的第一应用的数据,第二操作是向第二电子设备发送第二应用的数据。基于上述方法,在第一操作和第二操作同时存在的情况下,第一电子设备可以优先执行第一操作,使得第一电子设备可以及时获取到第一应用的数据。如此,第一应用切换至第一电子设备的前台运行后,可以及时恢复运行,不影响用户体验。In a possible implementation manner, the priority of the first operation is higher than that of the second operation, the first operation is to receive data from the first application of the second electronic device, and the second operation is to send the data of the first application to the second electronic device. 2. Application data. Based on the above method, when the first operation and the second operation exist simultaneously, the first electronic device can preferentially execute the first operation, so that the first electronic device can obtain the data of the first application in time. In this way, after the first application is switched to run in the foreground of the first electronic device, it can resume running in time without affecting user experience.
一种可能的实现方式,该方法还包括:向第二电子设备发送用于请求第一数据的第二请求信息,其中,第一数据为第二应用的数据中的部分数据;接收来自第二电子设备的第一数据。基于上述方法,第一电子设备可以从第二电子设备获取第二应用的数据中的部分数据。In a possible implementation manner, the method further includes: sending to the second electronic device second request information for requesting the first data, wherein the first data is part of the data of the second application; The first data of the electronic device. Based on the above method, the first electronic device may acquire part of the data of the second application from the second electronic device.
一种可能的实现方式,第一操作的优先级高于第三操作的优先级,第一操作是接收来自第二电子设备的第一应用的数据,第三操作是接收来自第二电子设备的第一数据。基于上述方法,在第一操作和第三操作同时存在的情况下,第一电子设备可以优先执行第一操作,使得第一电子设备可以及时获取到第一应用的数据。如此,第一应用切换至第一电子设备的前台运行后,可以及时恢复运行,不影响用户体验。In a possible implementation manner, the priority of the first operation is higher than that of the third operation, the first operation is to receive data from the first application of the second electronic device, and the third operation is to receive data from the second electronic device first data. Based on the above method, when the first operation and the third operation exist simultaneously, the first electronic device can preferentially execute the first operation, so that the first electronic device can obtain the data of the first application in time. In this way, after the first application is switched to run in the foreground of the first electronic device, it can resume running in time without affecting user experience.
一种可能的实现方式,该方法还包括:建立第二通道,第二通道用于传输存储在第二电子设备中、第一电子设备上的应用的数据中的部分数据。基于上述方法,第一电子设备可以通过第二通道从第二电子设备获取存储在第二电子设备中、第一电子设备上的应用的数据中的部分数据。In a possible implementation manner, the method further includes: establishing a second channel, where the second channel is used to transmit part of the data stored in the second electronic device and the application data on the first electronic device. Based on the above method, the first electronic device may obtain from the second electronic device part of the data stored in the second electronic device and on the application data on the first electronic device through the second channel.
一种可能的实现方式,该方法还包括:建立第三通道,第三通道用于传输第一电子设备上的应用的数据。基于上述方法,第一电子设备可以通过第三通道向第二电子设备发送第一电子设备上的应用的数据。In a possible implementation manner, the method further includes: establishing a third channel, where the third channel is used to transmit data of applications on the first electronic device. Based on the above method, the first electronic device may send the data of the application on the first electronic device to the second electronic device through the third channel.
一种可能的实现方式,获取第二电子设备的信息,包括:接收来自第二电子设备的第二电子设备的信息。基于上述方法,第一电子设备可以从第二电子设备获取第二电子设备的信息,进而可以根据第二电子设备的信息确定第二电子设备能否协助第一电子设备实现应用保活。In a possible implementation manner, acquiring information of the second electronic device includes: receiving information of the second electronic device from the second electronic device. Based on the above method, the first electronic device can obtain the information of the second electronic device from the second electronic device, and then can determine whether the second electronic device can assist the first electronic device in implementing application keep-alive according to the information of the second electronic device.
一种可能的实现方式,第二电子设备的信息指示第二电子设备的可用内存;或者, 第二电子设备的信息指示第二电子设备能否协助第一电子设备实现应用保活。基于上述方法,第一电子设备可以根据第二电子设备的可用内存确定第二电子设备能否协助第一电子设备实现应用保活,或者,第一电子设备可以根据第二电子设备的指示确定第二电子设备能否协助第一电子设备实现应用保活。In a possible implementation manner, the information of the second electronic device indicates available memory of the second electronic device; or, the information of the second electronic device indicates whether the second electronic device can assist the first electronic device in implementing application keep-alive. Based on the above method, the first electronic device can determine whether the second electronic device can assist the first electronic device in implementing application keep-alive according to the available memory of the second electronic device, or the first electronic device can determine the second electronic device according to the instruction of the second electronic device. Whether the second electronic device can assist the first electronic device to implement application keep-alive.
一种可能的实现方式,该方法还包括:向第二电子设备发送第三请求信息,第三请求信息用于请求第二电子设备的信息。基于上述方法,第一电子设备可以触发第二电子设备发送第二电子设备的信息。In a possible implementation manner, the method further includes: sending third request information to the second electronic device, where the third request information is used to request information of the second electronic device. Based on the above method, the first electronic device may trigger the second electronic device to send the information of the second electronic device.
一种可能的实现方式,第一电子设备的可用内存小于或等于第一阈值的情况下,获取第二电子设备的信息。基于上述方法,第一电子设备可以在第一电子设备的可用内存不足的情况下,获取第二电子设备的信息。In a possible implementation manner, when the available memory of the first electronic device is less than or equal to the first threshold, the information of the second electronic device is acquired. Based on the above method, the first electronic device can acquire information of the second electronic device when the available memory of the first electronic device is insufficient.
第二方面,本申请实施例提供一种数据处理方法,该数据处理方法可以应用于第二电子设备,也可以应用于第二电子设备中的模块,例如芯片或芯片系统。下面以该数据处理方法应用于第二电子设备为例进行描述。其中,第二电子设备与第一电子设备连接,第一电子设备上运行至少一个应用,至少一个应用包括在第一电子设备后台运行的第一应用。该方法包括:向第一电子设备发送第二电子设备的信息,第二电子设备的信息用于确定第二电子设备能否协助第一电子设备实现应用保活;若第二电子设备能够协助第一电子设备实现应用保活,接收来自第一电子设备的第一应用的数据。In a second aspect, the embodiment of the present application provides a data processing method, and the data processing method may be applied to the second electronic device, and may also be applied to a module in the second electronic device, such as a chip or a chip system. The following description will be made by taking the application of the data processing method to the second electronic device as an example. Wherein, the second electronic device is connected to the first electronic device, and at least one application runs on the first electronic device, and the at least one application includes the first application running in the background of the first electronic device. The method includes: sending information of the second electronic device to the first electronic device, and the information of the second electronic device is used to determine whether the second electronic device can assist the first electronic device to realize application keep-alive; if the second electronic device can assist the second electronic device An electronic device implements application keep-alive, and receives data of a first application from the first electronic device.
基于上述第二方面提供的方法,第二电子设备可以向第一电子设备发送第二电子设备的信息,使得第一电子设备可以根据第二电子设备的信息确定第二电子设备能否协助第一电子设备实现应用保活。在第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活的情况下,接收来自第一电子设备的第一应用的数据,使得,第一电子设备可以释放第一应用的数据,来获得更多空闲的存储空间。避免了第一电子设备的后台应用因为运行内存不足而被杀,实现了应用保活,提高了用户体验。另外,上述第二方面提供的方法不需要对第一电子设备上的应用进行任何修改或适配,操作简单,使用方便。Based on the method provided by the second aspect above, the second electronic device can send the information of the second electronic device to the first electronic device, so that the first electronic device can determine whether the second electronic device can assist the first electronic device according to the information of the second electronic device. The electronic device implements application keep-alive. When the first electronic device determines that the second electronic device can assist the first electronic device in keeping the application alive, receiving the data of the first application from the first electronic device, so that the first electronic device can release the data of the first application , to get more free storage space. This prevents the background application of the first electronic device from being killed due to insufficient running memory, realizes application keeping alive, and improves user experience. In addition, the method provided by the above second aspect does not require any modification or adaptation of the application on the first electronic device, and is easy to operate and easy to use.
一种可能的实现方式,该方法还包括:接收来自第一电子设备的用于请求第一应用的数据的第一请求信息;向第一电子设备发送第一应用的数据。基于上述方法,第二电子设备可以基于第一电子设备的请求,向第一电子设备发送第一应用的数据,使得第一应用可以在第一电子设备上运行。In a possible implementation manner, the method further includes: receiving first request information for requesting data of the first application from the first electronic device; and sending the data of the first application to the first electronic device. Based on the above method, the second electronic device may send data of the first application to the first electronic device based on the request of the first electronic device, so that the first application can run on the first electronic device.
一种可能的实现方式,该方法还包括:建立第一通道,第一通道用于传输存储在第二电子设备中、第一电子设备上的应用的数据。基于上述方法,第二电子设备可以通过第一通道向第一电子设备发送存储在第二电子设备中、第一电子设备上的应用的数据。In a possible implementation manner, the method further includes: establishing a first channel, where the first channel is used to transmit application data stored in the second electronic device and on the first electronic device. Based on the above method, the second electronic device may send data of the application stored in the second electronic device and on the first electronic device to the first electronic device through the first channel.
一种可能的实现方式,该方法还包括:接收来自第一电子设备的第二应用的数据,第二应用在第一电子设备的后台运行。基于上述方法,第二电子设备可以接收来自第一电子设备的第二应用的数据,使得第一电子设备可以释放更多的内存。In a possible implementation manner, the method further includes: receiving data from a second application of the first electronic device, where the second application runs in the background of the first electronic device. Based on the above method, the second electronic device can receive data from the second application of the first electronic device, so that the first electronic device can release more memory.
一种可能的实现方式,第一操作的优先级高于第二操作的优先级,第一操作是向第一电子设备发送第一应用的数据,第二操作是接收来自第一电子设备的第二应用的数据。基于上述方法,在第一操作和第二操作同时存在的情况下,第二电子设备可以 优先执行第一操作,使得第一电子设备可以及时获取到第一应用的数据。如此,第一电子设备可以及时恢复运行第一应用,不影响用户体验。In a possible implementation manner, the priority of the first operation is higher than that of the second operation, the first operation is to send data of the first application to the first electronic device, and the second operation is to receive the first application data from the first electronic device. 2. Application data. Based on the above method, when the first operation and the second operation exist simultaneously, the second electronic device can preferentially execute the first operation, so that the first electronic device can obtain the data of the first application in time. In this way, the first electronic device can resume running the first application in time without affecting user experience.
一种可能的实现方式,该方法还包括:接收来自第一电子设备的用于请求第一数据的第二请求信息,第一数据为第二应用的数据中的部分数据;向第一电子设备发送第一数据。基于上述方法,第二电子设备可以向第一电子设备发送第二应用的数据中的部分数据。In a possible implementation manner, the method further includes: receiving second request information for requesting first data from the first electronic device, where the first data is part of the data of the second application; Send the first data. Based on the above method, the second electronic device may send part of the data of the second application to the first electronic device.
一种可能的实现方式,第一操作的优先级高于第三操作的优先级,第一操作是向第一电子设备发送第一应用的数据,第三操作是向第一电子设备发送第一数据。基于上述方法,在第一操作和第三操作同时存在的情况下,第二电子设备可以优先执行第一操作,使得第一电子设备可以及时获取到第一应用的数据。如此,第一电子设备可以及时恢复运行第一应用,不影响用户体验。In a possible implementation manner, the priority of the first operation is higher than that of the third operation, the first operation is to send the data of the first application to the first electronic device, and the third operation is to send the data of the first application to the first electronic device. data. Based on the above method, when the first operation and the third operation exist simultaneously, the second electronic device can preferentially execute the first operation, so that the first electronic device can obtain the data of the first application in time. In this way, the first electronic device can resume running the first application in time without affecting user experience.
一种可能的实现方式,该方法还包括:建立第二通道,第二通道用于传输存储在第二电子设备中、第一电子设备上的应用的数据中的部分数据。基于上述方法,第二电子设备可以通过第二通道向第一电子设备发送存储在第二电子设备中、第一电子设备上的应用的数据中的部分数据。In a possible implementation manner, the method further includes: establishing a second channel, where the second channel is used to transmit part of the data stored in the second electronic device and the application data on the first electronic device. Based on the above method, the second electronic device may send to the first electronic device part of the data stored in the second electronic device and the application data on the first electronic device through the second channel.
一种可能的实现方式,该方法还包括:建立第三通道,第三通道用于传输第一电子设备上的应用的数据。基于上述方法,第二电子设备可以通过第三通道接收来自第一电子设备的第一电子设备上的应用的数据。In a possible implementation manner, the method further includes: establishing a third channel, where the third channel is used to transmit data of applications on the first electronic device. Based on the above method, the second electronic device may receive data from the application on the first electronic device of the first electronic device through the third channel.
一种可能的实现方式,第二电子设备的信息指示第二电子设备的可用内存;或者,第二电子设备的信息指示第二电子设备能否协助第一电子设备实现应用保活。基于上述方法,第一电子设备可以根据第二电子设备的可用内存确定第二电子设备能否协助第一电子设备实现应用保活,或者,第一电子设备可以根据第二电子设备的指示确定第二电子设备能否协助第一电子设备实现应用保活。In a possible implementation manner, the information of the second electronic device indicates available memory of the second electronic device; or, the information of the second electronic device indicates whether the second electronic device can assist the first electronic device in implementing application keep-alive. Based on the above method, the first electronic device can determine whether the second electronic device can assist the first electronic device in implementing application keep-alive according to the available memory of the second electronic device, or the first electronic device can determine the second electronic device according to the instruction of the second electronic device. Whether the second electronic device can assist the first electronic device to implement application keep-alive.
一种可能的实现方式,该方法还包括:接收来自第一电子设备的第三请求信息,第三请求信息用于请求第二电子设备的信息。基于上述方法,第二电子设备可以在第一电子设备触发后,向第一电子设备发送第二电子设备的信息。In a possible implementation manner, the method further includes: receiving third request information from the first electronic device, where the third request information is used to request information of the second electronic device. Based on the above method, the second electronic device may send the information of the second electronic device to the first electronic device after being triggered by the first electronic device.
第三方面,本申请实施例提供一种电子设备,该电子设备用于实现上述方法。该电子设备可以为上述第一方面中的第一电子设备;或者,该电子设备可以为上述第二方面中的第二电子设备。该电子设备包括实现上述方法相应的模块、单元、或手段(means),该模块、单元、或means可以通过硬件实现,软件实现,或者通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块或单元。In a third aspect, an embodiment of the present application provides an electronic device, and the electronic device is configured to implement the foregoing method. The electronic device may be the first electronic device in the first aspect above; or, the electronic device may be the second electronic device in the second aspect above. The electronic device includes a corresponding module, unit, or means (means) for implementing the above method, and the module, unit, or means can be implemented by hardware, software, or by executing corresponding software on hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
结合上述第三方面,在第一种可能的实现方式中,该电子设备可以包括处理模块和收发模块。该处理模块,可以用于实现上述任一方面及其任意可能的实现方式中的处理功能。该处理模块例如可以为处理器。该收发模块,也可以称为收发单元,用以实现上述任一方面及其任意可能的实现方式中的发送和/或接收功能。该收发模块可以由收发电路,收发机,收发器或者通信接口构成。With reference to the third aspect above, in a first possible implementation manner, the electronic device may include a processing module and a transceiver module. The processing module may be used to implement the processing functions in any of the above aspects and any possible implementation manners thereof. The processing module may be, for example, a processor. The transceiver module, which may also be referred to as a transceiver unit, is configured to implement the sending and/or receiving functions in any of the above aspects and any possible implementation manners thereof. The transceiver module may be composed of a transceiver circuit, a transceiver, a transceiver or a communication interface.
结合上述第三方面,在第一种可能的实现方式中,收发模块包括发送模块和接收模块,分别用于实现上述任一方面及其任意可能的实现方式中的发送和接收功能。With reference to the third aspect above, in a first possible implementation manner, the transceiver module includes a sending module and a receiving module, respectively configured to implement the sending and receiving functions in any of the above aspects and any possible implementation manners thereof.
第四方面,提供了一种电子设备,包括:处理器;该处理器用于与存储器耦合, 并读取存储器中的指令之后,根据该指令执行如上述任一方面所述的方法。该电子设备可以为上述第一方面中的第一电子;或者,该电子设备可以为上述第二方面中的第二电子设备。According to a fourth aspect, an electronic device is provided, including: a processor; the processor is configured to be coupled with a memory, and after reading an instruction in the memory, execute the method according to any one of the above aspects according to the instruction. The electronic device may be the first electronic device in the first aspect above; or, the electronic device may be the second electronic device in the second aspect above.
结合上述第四方面,在一种可能的实现方式中,该电子设备还包括存储器,该存储器,用于保存必要的程序指令和数据。With reference to the fourth aspect above, in a possible implementation manner, the electronic device further includes a memory, where the memory is configured to store necessary program instructions and data.
结合上述第四方面,在一种可能的实现方式中,该电子设备为芯片或芯片系统。可选的,该电子设备是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。With reference to the fourth aspect above, in a possible implementation manner, the electronic device is a chip or a chip system. Optionally, when the electronic device is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
第五方面,提供了一种电子设备,包括:处理器和接口电路;接口电路,用于接收计算机程序或指令并传输至处理器;处理器用于执行所述计算机程序或指令,以使该电子设备执执行如上述任一方面所述的方法。In a fifth aspect, an electronic device is provided, including: a processor and an interface circuit; the interface circuit is used to receive computer programs or instructions and transmit them to the processor; the processor is used to execute the computer programs or instructions, so that the electronic The device executes the method described in any one of the above aspects.
结合上述第五方面,在一种可能的实现方式中,该电子设备为芯片或芯片系统。可选的,该电子设备是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。With reference to the fifth aspect above, in a possible implementation manner, the electronic device is a chip or a chip system. Optionally, when the electronic device is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
第六方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述任一方面所述的方法。In a sixth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer can execute the method described in any one of the above-mentioned aspects.
第七方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述任一方面所述的方法。In a seventh aspect, there is provided a computer program product containing instructions, which, when run on a computer, enables the computer to execute the method described in any one of the above aspects.
其中,第三方面至第七方面中任一种可能的实现方式所带来的技术效果可参见上述第一方面至第二方面中任一方面或任一方面中不同可能的实现方式所带来的技术效果,此处不再赘述。Among them, the technical effect brought by any possible implementation manner in the third aspect to the seventh aspect can refer to any one of the above-mentioned first aspect to the second aspect or the different possible implementation manners in any aspect. The technical effect of this will not be repeated here.
附图说明Description of drawings
图1A为本申请实施例提供的电子设备的内存示意图一;FIG. 1A is a first schematic diagram of the memory of the electronic device provided by the embodiment of the present application;
图1B为本申请实施例提供的电子设备的内存示意图二;FIG. 1B is a second schematic diagram of the memory of the electronic device provided by the embodiment of the present application;
图1C为本申请实施例提供的电子设备的内存示意图三;FIG. 1C is a schematic diagram 3 of the memory of the electronic device provided in the embodiment of the present application;
图1D为本申请实施例提供的电子设备的内存示意图四;FIG. 1D is a schematic diagram 4 of the memory of the electronic device provided by the embodiment of the present application;
图1E为本申请实施例提供的电子设备的内存示意图五;FIG. 1E is a schematic diagram five of the memory of the electronic device provided by the embodiment of the present application;
图2为本申请实施例提供的数据处理系统的架构示意图;FIG. 2 is a schematic diagram of the architecture of the data processing system provided by the embodiment of the present application;
图3为本申请实施例提供的手机的结构示意图;FIG. 3 is a schematic structural diagram of a mobile phone provided in an embodiment of the present application;
图4为本申请实施例提供的软件架构的组成示意图;FIG. 4 is a schematic diagram of the composition of the software architecture provided by the embodiment of the present application;
图5为本申请实施例提供的数据处理方法的流程示意图一;FIG. 5 is a first schematic flow diagram of the data processing method provided by the embodiment of the present application;
图6A为本申请实施例提供的第一操作、第二操作和第三操作的执行顺序的示意图一;Fig. 6A is a schematic diagram 1 of the execution order of the first operation, the second operation and the third operation provided by the embodiment of the present application;
图6B为本申请实施例提供的第一操作、第二操作和第三操作的执行顺序的示意图二;Fig. 6B is a second schematic diagram of the execution sequence of the first operation, the second operation and the third operation provided by the embodiment of the present application;
图6C为本申请实施例提供的第一操作、第二操作和第三操作的执行顺序的示意图三;Fig. 6C is a schematic diagram 3 of the execution sequence of the first operation, the second operation and the third operation provided by the embodiment of the present application;
图7为本申请实施例提供的数据传输及处理的示意图;FIG. 7 is a schematic diagram of data transmission and processing provided by the embodiment of the present application;
图8为本申请实施例提供的数据处理方法的流程示意图二;FIG. 8 is a schematic flow diagram II of the data processing method provided by the embodiment of the present application;
图9为本申请实施例提供的一种电子设备的结构组成示意图。FIG. 9 is a schematic diagram of the structure and composition of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个、两个或两个以上。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The terms used in the following examples are for the purpose of describing particular examples only, and are not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also Expressions such as "one or more" are included unless the context clearly dictates otherwise. It should also be understood that in the following embodiments of the present application, "at least one" and "one or more" refer to one, two or more than two. The term "and/or" is used to describe the relationship between associated objects, indicating that there may be three relationships; for example, A and/or B may indicate: A exists alone, A and B exist at the same time, and B exists alone, Wherein A and B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。Reference to "one embodiment" or "some embodiments" or the like in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise. The term "connected" includes both direct and indirect connections, unless otherwise stated.
需要说明的是,本申请下述实施例中各个电子设备之间的消息名字或消息中各参数的名字等只是一个示例,具体实现中也可以是其他的名字,本申请实施例对此不作具体限定。It should be noted that the names of messages between electronic devices or the names of parameters in messages in the following embodiments of this application are just examples, and other names can also be used in specific implementations, and this embodiment of this application does not make specific limited.
为了便于描述本申请实施例的技术方案,在本申请实施例中,可以采用“第一”、“第二”等字样对功能相同或相似的技术特征进行区分。该“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。在本申请实施例中,“示例性的”或者“例如”等词用于表示例子、例证或说明,被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。此外,在本申请实施例中,对于一种技术特征,通过“第一”、“第二”、“第三”等区分该种技术特征中的技术特征,该“第一”、“第二”、“第三”描述的技术特征间无先后顺序或者大小顺序。In order to facilitate the description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" may be used to distinguish technical features with the same or similar functions. The words "first" and "second" do not limit the number and execution order, and the words "first" and "second" do not necessarily mean that they must be different. In the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or illustrations, and any embodiment or design described as "exemplary" or "for example" should not be interpreted It is more preferred or more advantageous than other embodiments or design solutions. The use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner for easy understanding. In addition, in the embodiment of the present application, for a technical feature, the technical features of this technical feature are distinguished by "first", "second", "third", etc., the "first", "second" ", "Third" describes the technical features in no order or order of magnitude.
可以理解的,本申请实施例中同一个步骤或者具有相同功能的步骤或者技术特征在不同实施例之间可以互相参考借鉴。It can be understood that, in the embodiments of the present application, the same step or steps or technical features having the same function can be used for reference in different embodiments.
通过背景技术中的描述可以知道,在电子设备上运行有多个应用的情况下,若电子设备的内存不足,电子设备会杀死部分应用。所以,若想要电子设备中的应用持续保活,如何在电子设备有限的内存上通过软件技术实现内存的增加就显得至关重要。例如,可以通过下述方法实现内存的增加。It can be known from the description in the background that, in the case of multiple applications running on the electronic device, if the memory of the electronic device is insufficient, the electronic device will kill some of the applications. Therefore, if the application in the electronic device is to be kept alive, how to increase the memory through software technology on the limited memory of the electronic device is very important. For example, an increase in memory can be achieved by the method described below.
方法1:在电子设备的内存中固定一块内存,作为压缩内存(zip random access memory,zRAM)缓冲区。电子设备可以逐步将电子设备的内存中,不活跃(inactive) 应用的数据进行压缩,将压缩后的数据存放到zRAM缓冲区中。这样,电子设备通过对数据的压缩可以释放一部分内存,使得电子设备中的应用保活。后续,若电子设备需要使用这些数据,再解压缩这些数据。Method 1: Fix a piece of memory in the memory of the electronic device as a compressed memory (zip random access memory, zRAM) buffer. The electronic device can gradually compress the data of inactive applications in the memory of the electronic device, and store the compressed data in the zRAM buffer. In this way, the electronic device can release a part of the memory by compressing the data, so that the applications in the electronic device can be kept alive. Subsequently, if the electronic device needs to use the data, the data is decompressed.
如图1A所示,在电子设备的内存101中固定了一块内存103,作为zRAM缓冲区。其余内存,即内存102可以用于存储数据。图1A中,内存102中的数据被压缩前,存储了不活跃应用的数据和活跃(active)应用的数据,内存102已经被占满了。通过对不活跃应用的数据进行压缩,将压缩后的数据存放到zRAM缓冲区中,内存102有了空闲的内存空间。如此,就不需要杀死应用,可以使得电子设备中的应用保活。As shown in FIG. 1A , a memory 103 is fixed in the memory 101 of the electronic device as a zRAM buffer. The remaining memory, memory 102, can be used to store data. In FIG. 1A , before the data in the memory 102 is compressed, data of inactive applications and data of active applications are stored, and the memory 102 is already full. By compressing the data of inactive applications and storing the compressed data in the zRAM buffer, the memory 102 has free memory space. In this way, there is no need to kill the application, and the application in the electronic device can be kept alive.
本申请实施例中,不活跃应用可以是电子设备的后台运行的任意应用。例如,不活跃应用可以是电子设备的后台运行的应用中,用户在一段时间内没有使用的应用。活跃应用可以是电子设备的前台运行的应用,或者,活跃的应用可以是电子设备的后台运行的应用中,用户经常使用的应用。In this embodiment of the present application, the inactive application may be any application running in the background of the electronic device. For example, an inactive application may be an application that is not used by a user for a period of time among the applications running in the background of the electronic device. The active application may be an application running in the foreground of the electronic device, or the active application may be an application frequently used by the user among the applications running in the background of the electronic device.
方法2:在方法1的基础上进行了扩展。如图1B所示,电子设备将不活跃应用的数据进行压缩后,根据电子设备的内存使用情况,将zRAM缓冲区中的部分压缩数据写入闪存(flash memory)中。如此,可以节省电子设备的内存,使得电子设备中的应用保活。后续,若电子设备需要使用这些数据,再从闪存中读取这些数据。Method 2: Extended on the basis of Method 1. As shown in FIG. 1B , after the electronic device compresses the data of inactive applications, it writes part of the compressed data in the zRAM buffer into the flash memory (flash memory) according to the memory usage of the electronic device. In this way, the memory of the electronic device can be saved, and the applications in the electronic device can be kept active. Subsequently, if the electronic device needs to use the data, the data is read from the flash memory.
方法3:电子设备可以获取与其连接的其他电子设备的信息,根据其他电子设备的信息确定其他电子设备能否协助该电子设备实现应用保活。若其他电子设备能够协助该电子设备实现应用保活,将该电子设备上的不活跃应用的数据发送给其他电子设备,并删除该电子设备上的不活跃应用的数据。这样,该电子设备就可以释放一部分内存,使得该电子设备上的应用保活。方法3的具体过程将在下述图5所示的方法中具体阐述,在此不做赘述。Method 3: The electronic device can obtain information about other electronic devices connected to it, and determine whether the other electronic devices can assist the electronic device in implementing application keep-alive according to the information of the other electronic devices. If the other electronic device can assist the electronic device to keep the application alive, send the data of the inactive application on the electronic device to the other electronic device, and delete the data of the inactive application on the electronic device. In this way, the electronic device can release a part of the memory, so that the applications on the electronic device can be kept alive. The specific process of method 3 will be described in detail in the method shown in FIG. 5 below, and will not be repeated here.
可以理解的,与方法1和方法2相比,方法3不需要固定一块内存作为zRAM缓冲区,也就是说,方法3的电子设备可以支配全部的内存,提高了内存的利用率。此外,与方法1相比,方法3中的其他电子设备的内存远远大于zRAM缓冲区,因此,可以协助电子设备保活更多的应用。与方法2相比,方法3中的其他电子设备的内存的读写寿命不像闪存一样会受到限制。因此,在采用方法3实现内存的增加时,不需要考虑器件的寿命问题,实现起来简单便捷。Understandably, compared with methods 1 and 2, method 3 does not need to fix a block of memory as a zRAM buffer, that is, the electronic device of method 3 can control all the memory, which improves the utilization rate of memory. In addition, compared with method 1, the memory of other electronic devices in method 3 is much larger than the zRAM buffer, therefore, it can assist the electronic device to keep more applications alive. Compared with method 2, in method 3, the read and write life of memory of other electronic devices is not limited like flash memory. Therefore, when using method 3 to increase memory, there is no need to consider the life of the device, and the implementation is simple and convenient.
为了便于理解本申请实施例的技术方案,下面对本申请实施例涉及的技术术语进行解释说明。In order to facilitate understanding of the technical solutions of the embodiments of the present application, technical terms involved in the embodiments of the present application are explained below.
本申请实施例中,电子设备之间交互数据时可以有以下三种情况:In the embodiment of this application, the following three situations may occur when electronic devices exchange data:
1、匿名页整块读出(anonymous page-whole blok read,ap-wbr)1. Anonymous page whole block read (anonymous page-whole blok read, ap-wbr)
ap-wbr可以在一个电子设备上的数据需要写入另一个电子设备的情况下进行。这一过程用户是不感知的。如图1C所示,电子设备1可以将其内存中不活跃应用的数据(如不活跃应用对应的多个匿名页)发送给电子设备2。电子设备2接收到该不活跃应用的数据后,将这些数据写入电子设备2的内存中。这样,电子设备1就可以删除该不活跃应用的数据,使得电子设备1的内存有更多空闲的存储空间。AP-WBR can be performed in situations where data on one electronic device needs to be written to another electronic device. This process is not perceived by the user. As shown in FIG. 1C , electronic device 1 may send data of inactive applications in its memory (such as multiple anonymous pages corresponding to inactive applications) to electronic device 2 . After receiving the data of the inactive application, the electronic device 2 writes these data into the memory of the electronic device 2 . In this way, the electronic device 1 can delete the data of the inactive application, so that the memory of the electronic device 1 has more free storage space.
可以理解的,电子设备1删除了不活跃应用的数据后,该不活跃应用的进程就被冻结了,不能被调度。若需要调度该应用的某个进程,就需要从电子设备2中获取该 进程对应的匿名页。It can be understood that after the electronic device 1 deletes the data of the inactive application, the process of the inactive application is frozen and cannot be scheduled. If a certain process of the application needs to be scheduled, the anonymous page corresponding to the process needs to be obtained from the electronic device 2.
2、匿名页缺页(anonymous page-fault,ap-fault)写入2. Anonymous page fault (anonymous page-fault, ap-fault) write
ap-fault写入可以在电子设备访问不到数据的情况下进行。这一过程用户是不感知的。如图1D所示,电子设备1向电子设备2发送了不活跃应用对应的多个匿名页,并将这些匿名页删除后,若要调度该不活跃应用的个别进程(如微信
Figure PCTCN2022106967-appb-000005
需要定期调度一些进程以接收云侧的消息),则电子设备2可以将该进程对应的匿名页发送给电子设备1,以便电子设备1运行该进程。
AP-fault writes can be performed without the electronic device having access to the data. This process is not perceived by the user. As shown in Figure 1D, electronic device 1 sends multiple anonymous pages corresponding to inactive applications to electronic device 2, and after deleting these anonymous pages, if you want to schedule individual processes of the inactive application (such as WeChat
Figure PCTCN2022106967-appb-000005
Some processes need to be regularly scheduled to receive messages from the cloud), then the electronic device 2 can send the anonymous page corresponding to the process to the electronic device 1, so that the electronic device 1 can run the process.
3、匿名页整块写入(anonymous page-whole blok write,ap-wbw)3. Anonymous page-whole blok write (anonymous page-whole blok write, ap-wbw)
ap-wbw可以在电子设备的后台运行的应用切换到前台运行时进行。在这种情况下,该电子设备可以从存储该应用对应的匿名页的电子设备处获取该应用对应的匿名页,以使得该电子设备运行该应用。例如,如图1E所示,电子设备2向电子设备1发送了个别匿名页后,不活跃应用从电子设备1的后台切换到了前台。在这种情况下,电子设备2可以将整块匿名页中剩余的匿名页发送给电子设备1,以便电子设备1运行该应用。The ap-wbw can be performed when an application running in the background of the electronic device switches to running in the foreground. In this case, the electronic device may acquire the anonymous page corresponding to the application from the electronic device storing the anonymous page corresponding to the application, so that the electronic device runs the application. For example, as shown in FIG. 1E , after the electronic device 2 sends individual anonymous pages to the electronic device 1 , the inactive application switches from the background of the electronic device 1 to the foreground. In this case, electronic device 2 may send the remaining anonymous pages in the entire block of anonymous pages to electronic device 1, so that electronic device 1 can run the application.
可以理解的,用户对ap-wbw这一过程有感知,若电子设备上后台运行的应用切换到前台运行时,该电子设备从其他电子设备获取该应用对应的匿名页过慢的话,会造成应用响应过慢,影响用户体验。It is understandable that users are aware of the process of ap-wbw. If an application running in the background on an electronic device is switched to running in the foreground, if the electronic device obtains the anonymous page corresponding to the application from other electronic devices too slowly, it will cause the application The response is too slow, which affects the user experience.
下面将结合附图对本申请实施例的实施方式进行详细描述。The implementation of the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
如图2所示,为本申请实施例提供的数据处理系统的架构示意图。该数据处理系统至少可以包括:电子设备201和电子设备202。可选的,该数据处理系统还可以包括电子设备203和/或电子设备204。As shown in FIG. 2 , it is a schematic diagram of the architecture of the data processing system provided by the embodiment of the present application. The data processing system may at least include: an electronic device 201 and an electronic device 202 . Optionally, the data processing system may further include an electronic device 203 and/or an electronic device 204 .
图2中的电子设备之间(如电子设备201和电子设备202之间,电子设备201和电子设备203之间)可以通过有线(如通用串行总线(universal serial bus,USB)数据线)或无线的方式建立连接,本申请实施例对具体的连接方式不作限定。图2中的电子设备之间通过无线方式建立连接时,所采用的无线通信协议可以为无线保真(wireless fidelity,Wi-Fi)协议、各种蜂窝网(如第四代(4th generation,4G)通信网络或第五代(5th generation,5G)通信网络)协议等,在此不做具体限制。Between the electronic devices in Fig. 2 (such as between the electronic device 201 and the electronic device 202, between the electronic device 201 and the electronic device 203) can be wired (such as a universal serial bus (universal serial bus, USB) data line) or The connection is established in a wireless manner, and the embodiment of the present application does not limit the specific connection manner. When the electronic devices in Figure 2 are connected wirelessly, the wireless communication protocol adopted can be a wireless fidelity (Wi-Fi) protocol, various cellular networks (such as the fourth generation (4th generation, 4G ) communication network or the fifth generation (5th generation, 5G) communication network) protocol, etc., there is no specific limitation here.
在一些实施例中,图2中的电子设备可以形成超级终端。例如,图2中的电子设备之间可以基于任一种认证机制(如HiChian机制)进行身份认证,认证通过的电子设备可以形成超级终端。可以理解的,超级终端可以包括多个终端,该多个终端为组网连接状态,该多个终端互为可信设备。In some embodiments, the electronic device in FIG. 2 may form a hyperterminal. For example, identity authentication between the electronic devices in FIG. 2 can be performed based on any authentication mechanism (such as the HiChian mechanism), and electronic devices that pass the authentication can form a hyper terminal. It can be understood that the hyper terminal may include multiple terminals, the multiple terminals are in a network connection state, and the multiple terminals are mutually trusted devices.
在具体实现时,图2中的电子设备,例如电子设备201、电子设备202、电子设备203或电子设备204,可以为手机,平板电脑,手持计算机,个人计算机(personal computer,PC),蜂窝电话,个人数字助理(personal digital assistant,PDA),可穿戴式设备(如智能手表、智能手环等),游戏机,或增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备等电子设备。本申请实施例对图2中的电子设备的具体设备形态不做特殊限制。例如,图2中的电子设备还可以为智能家居设备(如电视机,智能音箱),车载电脑(或者称为车机)等。且在本申请实施例中,图2中的电子设备的设备形态可以相同。例如,电子设备201和电子设备202均为手机。图 2中的电子设备的设备形态也可以不同。例如,电子设备201为手机,电子设备202为平板电脑。又例如,电子设备201为智能手表,电子设备202为PC。During specific implementation, the electronic equipment in Fig. 2, such as electronic equipment 201, electronic equipment 202, electronic equipment 203 or electronic equipment 204, can be a mobile phone, a tablet computer, a handheld computer, a personal computer (personal computer, PC), a cellular phone , personal digital assistant (personal digital assistant, PDA), wearable devices (such as smart watches, smart bracelets, etc.), game consoles, or augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) equipment, etc. Electronic equipment. The embodiment of the present application does not specifically limit the specific device form of the electronic device in FIG. 2 . For example, the electronic device in FIG. 2 may also be a smart home device (such as a TV, a smart speaker), a vehicle-mounted computer (or called a vehicle machine), and the like. And in the embodiment of the present application, the device forms of the electronic devices in FIG. 2 may be the same. For example, both the electronic device 201 and the electronic device 202 are mobile phones. The device form of the electronic device in Fig. 2 may also be different. For example, the electronic device 201 is a mobile phone, and the electronic device 202 is a tablet computer. For another example, the electronic device 201 is a smart watch, and the electronic device 202 is a PC.
图2中的电子设备可以是触屏设备,也可以是非触屏设备。触屏设备可以通过手指、触控笔等在屏幕上点击、滑动等方式对电子设备进行控制。非触屏设备可以连接鼠标、键盘、触控面板等输入设备,通过输入设备对电子设备进行控制。在本申请实施例中,图2中的电子设备均是可以运行操作系统,安装应用的电子设备。其中,图2中的电子设备的操作系统可以是Android系统、ios系统、windows系统、mac系统、Linux系统等,本申请实施例在此不做具体限制。图2中的电子设备的操作系统可以相同,也可以不同。作为一种示例,图2中的电子设备分别可以包括内存和处理器。其中,内存可以用于存储操作系统,处理器可以用于运行内存中存储的操作系统。The electronic device in FIG. 2 may be a touch screen device or a non-touch screen device. The touch screen device can control the electronic device by clicking, sliding, etc. on the screen with a finger or a stylus. Non-touch screen devices can be connected to input devices such as a mouse, keyboard, and touch panel, and electronic devices can be controlled through the input devices. In the embodiment of the present application, the electronic devices in FIG. 2 are all electronic devices capable of running an operating system and installing applications. Wherein, the operating system of the electronic device in FIG. 2 may be an Android system, an ios system, a windows system, a mac system, a Linux system, etc., which are not specifically limited in this embodiment of the present application. The operating systems of the electronic devices in FIG. 2 may be the same or different. As an example, the electronic devices in FIG. 2 may include a memory and a processor, respectively. Wherein, the memory can be used to store the operating system, and the processor can be used to run the operating system stored in the memory.
本申请实施例中,内存也可以称为存储器,用于存储操作系统和处理器运算的数据,内存还可以用于运行电子设备上安装的应用的程序。作为一种示例,内存可以是图3中的内部存储器121。In the embodiment of the present application, the memory may also be referred to as a memory, and is used to store data calculated by an operating system and a processor, and the memory may also be used to run application programs installed on electronic devices. As an example, the memory may be the internal memory 121 in FIG. 3 .
本申请实施例中,图2所示的电子设备上可以部署分布式系统。部署了该分布式系统的电子设备可以执行本申请实施例提供的数据处理方法,使得部署了分布式系统的电子设备之间实现内存共享,避免电子设备中的应用由于内存不足而被杀死。In the embodiment of the present application, a distributed system may be deployed on the electronic device shown in FIG. 2 . The electronic device deployed with the distributed system can execute the data processing method provided by the embodiment of the present application, so that memory sharing can be realized between the electronic devices deployed with the distributed system, so as to prevent applications in the electronic device from being killed due to insufficient memory.
图2所示的数据处理系统仅用于举例,并非用于限制本申请实施例的技术方案。本领域的技术人员应当明白,在具体实现过程中,该数据处理系统还可以包括其他设备,同时也可根据具体需要来确定电子设备的数量,不予限制。The data processing system shown in FIG. 2 is for example only, and is not intended to limit the technical solutions of the embodiments of the present application. Those skilled in the art should understand that, in a specific implementation process, the data processing system may also include other devices, and the number of electronic devices may also be determined according to specific needs, without limitation.
在本申请实施例中,以电子设备为手机为例。请参考图3,为本申请实施例提供的一种手机的结构示意图。以下实施例中的方法可以在具有下述硬件结构的手机中实现。In the embodiment of the present application, the electronic device is taken as an example of a mobile phone. Please refer to FIG. 3 , which is a schematic structural diagram of a mobile phone provided by an embodiment of the present application. The methods in the following embodiments can be implemented in a mobile phone with the following hardware structure.
如图3所示,手机可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180等。As shown in Figure 3, mobile phone can comprise processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, etc.
可以理解的是,本申请实施例示意的结构并不构成对手机的具体限定。在本申请另一些实施例中,手机可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure shown 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 fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,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 (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 processor (neural-network processing unit, NPU) wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直 接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly recalled 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 by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。手机中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in a mobile phone can be used to cover single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在手机上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise 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 (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them 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 set 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 set in the same device.
无线通信模块160可以提供应用在手机上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on mobile phones including wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system ( Global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), near field communication (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 division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,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 (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR techniques, etc. The GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
手机通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The mobile phone realizes the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, 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 change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采 用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (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 shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits 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 located 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 generates an optical image through the lens and projects it to 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 light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other 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 the frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
视频编解码器用于对数字视频压缩或解压缩。手机可以支持一种或多种视频编解码器。这样,手机可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture 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 (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 a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the mobile phone by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
手机可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone can realize the audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone 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 signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。手机可以通过扬声器170A收听音乐,或收听免提通话。 Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals. The cell 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 receives a call or a voice message, the receiver 170B can be placed close to the human ear to listen to the voice.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。手机可以设置至少一个麦克风170C。在另一些实施例中,手机可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,手机还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 170C to make a sound, and input the sound signal to the microphone 170C. The mobile phone may be provided with at least one microphone 170C. In some other embodiments, the mobile phone can be provided with two microphones 170C, which can also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the mobile phone can also be equipped with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and realization of directional recording functions, etc.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used for connecting wired earphones. The earphone interface 170D can be a USB interface 130, or a 3.5mm 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 one or more of the following sensors: pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, bone conduction sensor, etc.
当然,手机还可以包括充电管理模块、电源管理模块、电池、按键、指示器以及1个或多个SIM卡接口等,本申请实施例对此不做任何限制。Of course, the mobile phone may also include a charging management module, a power management module, a battery, buttons, an indicator, and one or more SIM card interfaces, etc., which are not limited in this embodiment of the present application.
结合图2,请参考图4,为本申请实施例提供的一种软件架构的组成示意图。如图4所示,图2中的电子设备(如电子设备201和电子设备202)的软件架构均可以包括:应用层和框架层(framework,FWK)。In conjunction with FIG. 2 , please refer to FIG. 4 , which is a schematic diagram of a software architecture provided by an embodiment of the present application. As shown in FIG. 4 , the software architectures of the electronic devices (such as the electronic device 201 and the electronic device 202 ) in FIG. 2 may include: an application layer and a framework layer (framework, FWK).
在一些实施例中,应用层可以包括安装在电子设备的各个应用。例如,安装在电子设备中的应用可以包括设置,计算器,相机,短信息,音乐播放器,文件管理器,图库,浏览器,备忘录,新闻,视频播放器,邮件,微信
Figure PCTCN2022106967-appb-000006
支付宝
Figure PCTCN2022106967-appb-000007
腾讯视频
Figure PCTCN2022106967-appb-000008
百度地图
Figure PCTCN2022106967-appb-000009
等。这些应用可以是电子设备的系统应用,也可以是第三方应用,本申请实施例在此不做具体限制。框架层中可以部署分布式系统。该分布式系统可以实现电子设备之间的内存共享,避免电子设备中的应用由于内存不足而被杀死。
In some embodiments, the application layer may include various applications installed on the electronic device. For example, applications installed in electronic devices may include settings, calculator, camera, SMS, music player, file manager, gallery, browser, memo, news, video player, mail, WeChat
Figure PCTCN2022106967-appb-000006
Alipay
Figure PCTCN2022106967-appb-000007
Tencent Video
Figure PCTCN2022106967-appb-000008
Baidu map
Figure PCTCN2022106967-appb-000009
wait. These applications may be system applications of the electronic device or third-party applications, which are not specifically limited in this embodiment of the present application. Distributed systems can be deployed in the framework layer. The distributed system can realize memory sharing between electronic devices, and prevent applications in the electronic devices from being killed due to insufficient memory.
需要说明的是,本实施例示意的软件架构并不构成对图2中的电子设备的具体限定。在另一些实施例中,图2中的电子设备可以包括比图示更多或更少的层,或者更多或更少的模块,或者组合某些模块,或者不同的模块布置,本实施例在此并不做具体限制。例如,上述所示的软件架构除了包括上述应用层和框架层之外,还可以包括其他层,如内核层(图4中未示出)等。该内核层是硬件和软件之间的层。内核层至少可以包含显示驱动,摄像头驱动,音频驱动,传感器驱动等。It should be noted that the software architecture shown in this embodiment does not constitute a specific limitation on the electronic device in FIG. 2 . In other embodiments, the electronic device in FIG. 2 may include more or fewer layers than shown in the illustration, or more or fewer modules, or combine some modules, or different module arrangements, this embodiment There is no specific limitation here. For example, the above-mentioned software architecture may include other layers, such as a kernel layer (not shown in FIG. 4 ), in addition to the above-mentioned application layer and framework layer. The kernel layer is the layer between hardware and software. The kernel layer can at least include display drivers, camera drivers, audio drivers, sensor drivers, etc.
下面将结合附图,对本申请实施例提供的数据处理方法进行描述。The data processing method provided by the embodiment of the present application will be described below with reference to the accompanying drawings.
如图5所示,为本申请实施例提供的一种数据处理方法,该数据处理方法包括S501-S503。As shown in FIG. 5 , it is a data processing method provided in the embodiment of the present application, and the data processing method includes S501-S503.
S501:第一电子设备获取第二电子设备的信息。S501: The first electronic device acquires information of the second electronic device.
本申请实施例中,第一电子设备可以是图2中的任一电子设备,例如,第一电子设备为图2中的电子设备201。第一电子设备上运行了至少一个应用。例如,该至少一个应用可以在第一电子设备的后台运行;或者,该至少一个应用中,一个应用在第一电子设备的前台运行,其他应用在第一电子设备的后台运行。In this embodiment of the present application, the first electronic device may be any electronic device in FIG. 2 , for example, the first electronic device is electronic device 201 in FIG. 2 . At least one application is running on the first electronic device. For example, the at least one application may run in the background of the first electronic device; or, among the at least one application, one application runs in the foreground of the first electronic device, and other applications run in the background of the first electronic device.
本申请实施例中,第二电子设备可以是图2中除第一电子设备之外,与第一电子设备连接的任一电子设备。例如,若第一电子设备为图2中的电子设备201,则第二电子设备可以是图2中的电子设备202、电子设备203或电子设备204。In the embodiment of the present application, the second electronic device may be any electronic device connected to the first electronic device except the first electronic device in FIG. 2 . For example, if the first electronic device is the electronic device 201 in FIG. 2 , the second electronic device may be the electronic device 202 , the electronic device 203 or the electronic device 204 in FIG. 2 .
可以理解的,为了提高通信安全,防止第一电子设备中的数据泄漏,第二电子设备可以满足一定的条件。It can be understood that, in order to improve communication security and prevent data leakage in the first electronic device, the second electronic device may meet certain conditions.
作为一种示例,第二电子设备为可信设备。例如,第二电子设和第一电子设备都包括在超级终端中。超级终端的介绍可以参考图2所示的数据处理系统中对应的描述。As an example, the second electronic device is a trusted device. For example, both the second electronic device and the first electronic device are included in the HyperTerminal. For the introduction of the hyper terminal, reference may be made to the corresponding description in the data processing system shown in FIG. 2 .
作为另一种示例,第二电子设备可以为第一电子设备存储的设备列表中的设备。该设备列表可以是用户设置的,或者说是用户维护的。例如,用户可以通过人机交互界面将与第一电子设备建立过连接的设备添加到设备列表中。以第一电子设备曾通过wifi与平板电脑、智能手环和智能手表建立了连接为例,用户可以将平板电脑、智能手环和智能手表中的一个或多个设备通过第一电子设备的人机交互界面添加到设备列表中。该设备列表也可以是第一电子设备获取的。例如,第一电子设备可以将与用户的用户名关联的设备添加到该设备列表中。以用户持有第一电子设备、平板电脑和智能手环,并且用户通过用户名登录过第一电子设备和平板电脑为例,第一电子设备可以将平板电脑添加到该设备列表中。As another example, the second electronic device may be a device in the device list stored by the first electronic device. The device list may be set by the user, or maintained by the user. For example, the user may add devices that have established a connection with the first electronic device to the device list through the human-computer interaction interface. Taking the example that the first electronic device has established a connection with the tablet computer, smart bracelet and smart watch through wifi, the user can connect one or more devices among the tablet computer, smart bracelet and smart watch through the first electronic device. The computer interface is added to the device list. The device list may also be acquired by the first electronic device. For example, the first electronic device may add a device associated with the user's username to the device list. Taking the user holding the first electronic device, tablet computer and smart bracelet as an example, and the user has logged in the first electronic device and the tablet computer through the user name, the first electronic device may add the tablet computer to the device list.
本申请实施例中,第二电子设备的信息可以用于确定第二电子设备能否协助第一电子设备实现应用保活。其中,第二电子设备能否协助第一电子设备实现应用保活也可以描述为第二电子设备能否存储第一电子设备上的应用的数据。可以理解的,若第二电子设备能够协助第一电子设备实现应用保活,第一电子设备就可以将第一电子设备上不活跃应用的数据发送给第二电子设备。如此,第一电子设备就能释放该不活跃应用的数据,使得第一电子设备的内存有更多空闲的存储空间。这样,第一电子设备就不需要杀死应用,可以使得第一电子设备中的应用保活。In this embodiment of the present application, the information of the second electronic device may be used to determine whether the second electronic device can assist the first electronic device in implementing application keep-alive. Wherein, whether the second electronic device can assist the first electronic device to implement application keep-alive can also be described as whether the second electronic device can store data of the application on the first electronic device. It can be understood that if the second electronic device can assist the first electronic device to keep the application alive, the first electronic device can send the data of the inactive application on the first electronic device to the second electronic device. In this way, the first electronic device can release the data of the inactive application, so that the internal memory of the first electronic device has more free storage space. In this way, the first electronic device does not need to kill the application, and the application in the first electronic device can be kept alive.
一种可能的实现方式,第二电子设备的信息可以有以下两种情况:In a possible implementation manner, the information of the second electronic device may have the following two situations:
情况1:第二电子设备的信息指示第二电子设备的可用内存。Case 1: The information of the second electronic device indicates the available memory of the second electronic device.
作为一种示例,第二电子设备的信息包括第二电子设备的可用内存的指示信息。As an example, the information of the second electronic device includes indication information of available memory of the second electronic device.
可选的,第二电子设备的信息还包括以下至少一项:第二电子设备的标识(diviceID)、第二电子设备的名称(deviceName)、第二电子设备的类型(deviceType)的指示信息、第二电子设备是否在线(online)的指示信息、第二电子设备是否为可信设备(trusted)的指示信息、第二电子设备的互联网协议(Internet Protocol,IP)地址(IPAddress)、第二电子设备是否处于活动状态(active)的指示信息、第二电子设备的总电量(batteryCapacity)的指示信息、第二电子设备的剩余电量(batteryPercent) 的指示信息、第二电子设备的电池的温度(batteryTemperature)的指示信息、第二电子设备是否正在充电(setCharging)的指示信息、第二电子设备的中央处理器(central processing unit,CPU)主频(CpuFrequency)的指示信息、第二电子设备的CPU占用率(CpuUsage)的指示信息、或第二电子设备的总内存大小(TotalMemorySize)的指示信息。Optionally, the information of the second electronic device further includes at least one of the following: an identifier (deviceID) of the second electronic device, a name (deviceName) of the second electronic device, indication information of the type (deviceType) of the second electronic device, Indication information of whether the second electronic device is online (online), indication information of whether the second electronic device is a trusted device (trusted), Internet Protocol (Internet Protocol, IP) address (IPAddress) of the second electronic device, second electronic device The indication information of whether the device is in an active state (active), the indication information of the total power (batteryCapacity) of the second electronic device, the indication information of the remaining power (batteryPercent) of the second electronic device, the temperature (batteryTemperature) of the battery of the second electronic device ), the indication information of whether the second electronic device is charging (setCharging), the indication information of the central processing unit (central processing unit, CPU) main frequency (CpuFrequency) of the second electronic device, the CPU occupation of the second electronic device The indication information of the rate (CpuUsage), or the indication information of the total memory size (TotalMemorySize) of the second electronic device.
其中,第二电子设备的标识还可以称为第二电子设备的ID。第二电子设备的类型包括:手机、平板电脑、PC、可穿戴设备等。第二电子设备是否在线可用理解为第二电子设备是否与第一电子设备连接。第二电子设备是否处于活动状态可以表示第二电子设备是否被使用。以第二电子设备是手机为例,第二电子设备是否处于活动状态可以表示第二电子设备的屏幕是点亮还是熄灭。例如,若第二电子设备是否处于活动状态的指示信息指示第二电子设备处于活动状态,则表示第二电子设备的屏幕点亮;若第二电子设备是否处于活动状态的指示信息指示第二电子设备未处于活动状态则表示第二电子设备的屏幕熄灭。以第二电子设备是PC为例,第二电子设备是否处于活动状态可以表示第二电子设备是否处于睡眠状态。例如,若第二电子设备是否处于活动状态的指示信息指示第二电子设备处于活动状态,则表示第二电子设备未处于睡眠状态;若第二电子设备是否处于活动状态的指示信息指示第二电子设备未处于活动状态,则表示第二电子设备处于睡眠状态。Wherein, the identifier of the second electronic device may also be referred to as an ID of the second electronic device. Types of the second electronic device include: a mobile phone, a tablet computer, a PC, a wearable device, and the like. Whether the second electronic device is available online is understood as whether the second electronic device is connected to the first electronic device. Whether the second electronic device is in an active state may indicate whether the second electronic device is used. Taking the second electronic device as a mobile phone as an example, whether the second electronic device is in an active state may indicate whether the screen of the second electronic device is on or off. For example, if the indication information indicating whether the second electronic device is in an active state indicates that the second electronic device is in an active state, it means that the screen of the second electronic device is lit; if the indication information indicating whether the second electronic device is in an active state indicates that the second electronic device The device inactive state means that the screen of the second electronic device is off. Taking the second electronic device as a PC as an example, whether the second electronic device is in an active state may indicate whether the second electronic device is in a sleep state. For example, if the indication information indicating whether the second electronic device is in an active state indicates that the second electronic device is in an active state, it means that the second electronic device is not in a sleep state; if the indication information indicating whether the second electronic device is in an active state indicates that the second electronic device If the device is not in an active state, it means that the second electronic device is in a sleeping state.
可选的,第二电子设备的标识、第二电子设备的名称、第二电子设备的类型的指示信息、第二电子设备是否在线的指示信息、第二电子设备是否为可信设备的指示信息和第二电子设备的IP地址可以统称为设备信息。第二电子设备是否处于活动状态的指示信息、第二电子设备的总电量的指示信息、第二电子设备的剩余电量的指示信息、第二电子设备的电池的温度的指示信息和第二电子设备是否正在充电的指示信息可以统称为设备的状态信息(DeviceStatus)。第二电子设备的CPU主频的指示信息和第二电子设备的CPU占用率的指示信息可以统称为CPU的资源信息(CpuResource)。第二电子设备的总内存大小的指示信息和第二电子设备的可用内存的指示信息可以统称为存储资源信息(StorageResource)。设备的状态信息、CPU的资源信息和存储资源信息可以统称为设备资源信息。示例性的,第二电子设备的信息包括的内容可以如表1所示。Optionally, the identification of the second electronic device, the name of the second electronic device, the indication information of the type of the second electronic device, the indication information of whether the second electronic device is online, the indication information of whether the second electronic device is a trusted device and the IP address of the second electronic device may be collectively referred to as device information. The indication information of whether the second electronic device is in an active state, the indication information of the total power of the second electronic device, the indication information of the remaining power of the second electronic device, the indication information of the temperature of the battery of the second electronic device, and the indication information of the second electronic device The indication information of whether charging is being collectively referred to as device status information (DeviceStatus). The indication information of the main frequency of the CPU of the second electronic device and the indication information of the CPU occupancy rate of the second electronic device may be collectively referred to as CPU resource information (CpuResource). The indication information of the total memory size of the second electronic device and the indication information of the available memory of the second electronic device may be collectively referred to as storage resource information (StorageResource). Device status information, CPU resource information, and storage resource information may be collectively referred to as device resource information. Exemplarily, the content included in the information of the second electronic device may be as shown in Table 1.
表1Table 1
Figure PCTCN2022106967-appb-000010
Figure PCTCN2022106967-appb-000010
Figure PCTCN2022106967-appb-000011
Figure PCTCN2022106967-appb-000011
情况2:第二电子设备的信息指示第二电子设备能否协助第一电子设备实现应用保活。Case 2: The information of the second electronic device indicates whether the second electronic device can assist the first electronic device in implementing application keep-alive.
作为一种示例,第二电子设备的信息包括第一指示信息。该第一指示信息为1比特的指示信息。若第一指示信息的值为“0”,则第二电子设备的信息指示第二电子设备不能协助第一电子设备实现应用保活;若第一指示信息的值为“1”,则第二电子设备的信息指示第二电子设备能够协助第一电子设备实现应用保活。在这种情况下,第二电子设备就可以不用向第一电子设备发送情况1中描述的信息,可以节省信令开销。As an example, the information of the second electronic device includes the first indication information. The first indication information is 1-bit indication information. If the value of the first indication information is "0", the information of the second electronic device indicates that the second electronic device cannot assist the first electronic device to keep the application alive; if the value of the first indication information is "1", the second electronic device The information of the electronic device indicates that the second electronic device can assist the first electronic device in implementing application keep-alive. In this case, the second electronic device does not need to send the information described in case 1 to the first electronic device, which can save signaling overhead.
一种可能的实现方式,第一电子设备获取第二电子设备的信息,包括:第一电子设备接收来自第二电子设备的第二电子设备的信息;或者,第一电子设备从本地获取第二电子设备的信息。这一过程将在下述图8所示方法进行具体阐述,在此不做赘述。A possible implementation manner, the acquisition of the information of the second electronic device by the first electronic device includes: the first electronic device receives the information of the second electronic device from the second electronic device; or, the first electronic device acquires the information of the second electronic device locally Electronic device information. This process will be described in detail in the method shown in FIG. 8 below, and will not be repeated here.
可以理解的,若存在多个第二电子设备与第一电子设备连接,则第一电子设备可以获取多个第二电子设备的信息。第一电子设备获取每个第二电子设备的信息的具体过程,可以参考图8中所述的第一电子设备获取第二电子设备的信息的介绍,在此不做赘述。第一电子设备获取到多个第二电子设备的信息后,可以在能够协助第一电子设备实现应用保活的设备中,确定至少一个电子设备,将第一电子设备上不活跃应用的数据发送给该至少一个电子设备,以使得第一电子设备中的应用保活。It can be understood that if there are multiple second electronic devices connected to the first electronic device, the first electronic device may obtain information about the multiple second electronic devices. For the specific process of the first electronic device obtaining the information of each second electronic device, reference may be made to the introduction of the first electronic device obtaining the information of the second electronic device described in FIG. 8 , which will not be repeated here. After the first electronic device obtains the information of multiple second electronic devices, it may determine at least one electronic device among the devices that can assist the first electronic device in keeping applications alive, and send the data of inactive applications on the first electronic device To the at least one electronic device, the application in the first electronic device is kept alive.
以图2所示的数据处理系统为例,若电子设备201与电子设备202、电子设备203和电子设备204建立了连接,则电子设备201可以获取电子设备202的信息、电子设备203的信息和电子设备204的信息。若电子设备202和电子设备203能够协助电子设备201实现应用保活,电子设备204不能协助电子设备201实现应用保活,则电子设备201将电子设备201上不活跃应用的数据发送给电子设备202和电子设备203中的一个或多个设备,以使得电子设备201中的应用保活。Taking the data processing system shown in FIG. 2 as an example, if the electronic device 201 establishes connections with the electronic device 202, the electronic device 203, and the electronic device 204, the electronic device 201 can obtain the information of the electronic device 202, the information of the electronic device 203 and Electronic device 204 information. If the electronic device 202 and the electronic device 203 can assist the electronic device 201 to keep the application alive, but the electronic device 204 cannot assist the electronic device 201 to keep the application alive, then the electronic device 201 sends the data of the inactive application on the electronic device 201 to the electronic device 202 and one or more devices in the electronic device 203, so that the application in the electronic device 201 is kept alive.
S502:若第二电子设备能够协助第一电子设备实现应用保活,第一电子设备向第二电子设备发送第一应用的数据。对应的,第二电子设备接收来自第一电子设备的第一应用的数据。S502: If the second electronic device can assist the first electronic device in implementing application keep-alive, the first electronic device sends data of the first application to the second electronic device. Correspondingly, the second electronic device receives data from the first application of the first electronic device.
本申请实施例中,第一应用包括在第一电子设备上运行的至少一个应用中,并且第一应用在第一电子设备的后台运行。第一应用也可以称为第一电子设备上的不活跃应用。第一应用的数据还可以称为第一应用对应的匿名页。第一应用的数据可以存储在第一电子设备的内存中。第一电子设备向第二电子设备发送第一应用的数据也可以称为ap-wbr。ap-wbr的介绍可以参考前文所述。In this embodiment of the present application, the first application is included in at least one application running on the first electronic device, and the first application runs in the background of the first electronic device. The first application may also be referred to as an inactive application on the first electronic device. The data of the first application may also be referred to as an anonymous page corresponding to the first application. Data of the first application may be stored in the memory of the first electronic device. The data of the first application sent by the first electronic device to the second electronic device may also be referred to as ap-wbr. The introduction of ap-wbr can refer to the above.
一种可能的实现方式,第一电子设备根据第二电子设备的信息,确定第二电子设备能否协助第一电子设备实现应用保活。若第二电子设备能够协助第一电子设备实现应用保活,则第一电子设备向第二电子设备发送第一应用的数据。In a possible implementation manner, the first electronic device determines whether the second electronic device can assist the first electronic device in implementing application keep-alive according to the information of the second electronic device. If the second electronic device can assist the first electronic device to keep the application alive, the first electronic device sends the data of the first application to the second electronic device.
对于上述情况1和情况2,第一电子设备确定第二电子设备能否协助第一电子设 备实现应用保活的过程不同。下面进行具体阐述。For the above case 1 and case 2, the process of the first electronic device determining whether the second electronic device can assist the first electronic device in implementing application keep-alive is different. The details are described below.
对于上述情况1,第一电子设备可以将第二电子设备的信息与预设置信息进行比较,以确定第二电子设备能否协助第一电子设备实现应用保活。其中,预设置信息可以指示能够协助第一电子设备实现应用保活的设备(以下简称协助设备)需要满足的条件。预设置信息可以是在第一电子设备初次执行本申请实施例提供的数据处理方法之前,用户设置的,或者预先存储在第一电子设备中的。后续,预设置信息可以被修改。可以理解的,若第二电子设备能够满足预设置信息指示的条件,则第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活,若第二电子设备不能满足预设置信息指示的条件,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。For the above case 1, the first electronic device may compare the information of the second electronic device with the preset information, so as to determine whether the second electronic device can assist the first electronic device in implementing application keep-alive. Wherein, the preset information may indicate the conditions to be met by a device capable of assisting the first electronic device in implementing application keep-alive (hereinafter referred to as assisting device). The preset information may be set by the user or pre-stored in the first electronic device before the first electronic device executes the data processing method provided by the embodiment of the present application for the first time. Subsequently, the preset information can be modified. It can be understood that if the second electronic device can meet the conditions indicated by the preset information, the first electronic device determines that the second electronic device can assist the first electronic device in implementing application keep-alive; if the second electronic device cannot meet the conditions indicated by the preset information condition, the first electronic device determines that the second electronic device cannot assist the first electronic device in implementing application keep-alive.
示例性的,以第二电子设备的信息包括第二电子设备的可用内存的指示信息,预设置信息指示协助设备的可用内存需要大于或等于2GB为例,若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为8GB,则第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活。若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为1GB,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。Exemplarily, the information of the second electronic device includes the indication information of the available memory of the second electronic device, and the preset information indicates that the available memory of the assisting device needs to be greater than or equal to 2GB as an example, if the indication of the available memory of the second electronic device If the information indicates that the available memory of the second electronic device is 8GB, then the first electronic device determines that the second electronic device can assist the first electronic device in implementing application keep-alive. If the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 1 GB, the first electronic device determines that the second electronic device cannot assist the first electronic device to implement application keep-alive.
示例性的,以第二电子设备的信息包括第二电子设备的可用内存的指示信息和第二电子设备是否为可信设备的指示信息,预设置信息指示协助设备的可用内存需要大于或等于2GB,并且协助设备需要是可信设备为例,若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为8GB、第二电子设备是否为可信设备的指示信息指示第二电子设备为可信设备,则第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活。若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为4GB、第二电子设备是否为可信设备的指示信息指示第二电子设备为不可信设备,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。Exemplarily, the information of the second electronic device includes the indication information of the available memory of the second electronic device and the indication information of whether the second electronic device is a trusted device, and the preset information indicates that the available memory of the assisting device needs to be greater than or equal to 2GB , and the assisting device needs to be a trusted device as an example, if the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 8GB, and the indication information of whether the second electronic device is a trusted device indicates that the second electronic device If the device is a trusted device, the first electronic device determines that the second electronic device can assist the first electronic device in implementing application keep-alive. If the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 4GB, and the indication information of whether the second electronic device is a trusted device indicates that the second electronic device is an untrusted device, then the first electronic device determines The second electronic device cannot assist the first electronic device in implementing application keep-alive.
示例性的,以第二电子设备的信息包括第二电子设备的可用内存的指示信息和第二电子设备是否处于活动状态的指示信息,预设置信息指示协助设备的可用内存需要大于或等于1GB,并且协助设备未处于活动状态为例,若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为8GB、第二电子设备是否处于活动状态的指示信息指示第二电子设备未处于活动状态,则第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活。若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为4GB、第二电子设备是否处于活动状态的指示信息指示第二电子设备处于活动状态,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。Exemplarily, the information of the second electronic device includes the indication information of the available memory of the second electronic device and the indication information of whether the second electronic device is in an active state, and the preset information indicates that the available memory of the assisting device needs to be greater than or equal to 1GB, And the auxiliary device is not in the active state as an example, if the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 8GB, and the indication information of whether the second electronic device is in the active state indicates that the second electronic device is not in active state, the first electronic device determines that the second electronic device can assist the first electronic device in implementing application keep-alive. If the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 4GB, and the indication information of whether the second electronic device is in an active state indicates that the second electronic device is in an active state, then the first electronic device determines that the second electronic device is in an active state. The electronic device cannot assist the first electronic device in implementing application keep-alive.
示例性的,以第二电子设备的信息包括第二电子设备的可用内存的指示信息、第二电子设备是否在线的指示信息和第二电子设备的剩余电量的指示信息,预设置信息指示协助设备的可用内存需要大于或等于1GB、协助设备在线、并且协助设备的剩余电量需要大于或等于80%为例,若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为6GB、第二电子设备是否在线的指示信息指示第二电子设备在线、第二电子设备的剩余电量的指示信息指示第二电子设备的剩余电量为80%,则第一电 子设备确定第二电子设备能够协助第一电子设备实现应用保活。若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为4GB、第二电子设备是否在线的指示信息指示第二电子设备在线、第二电子设备的剩余电量的指示信息指示第二电子设备的剩余电量为60%,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。Exemplarily, the information of the second electronic device includes the indication information of the available memory of the second electronic device, the indication information of whether the second electronic device is online, and the indication information of the remaining power of the second electronic device, and the preset information indicates that the auxiliary device The available memory of the second electronic device needs to be greater than or equal to 1GB, the assisting device is online, and the remaining power of the assisting device needs to be greater than or equal to 80%. The indication information indicating whether the second electronic device is online indicates that the second electronic device is online, and the indication information indicating the remaining power of the second electronic device indicates that the remaining power of the second electronic device is 80%, then the first electronic device determines that the second electronic device can assist The first electronic device implements application keep-alive. If the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 4GB, the indication information of whether the second electronic device is online indicates that the second electronic device is online, and the indication information of the remaining power of the second electronic device indicates that the second electronic device is online. If the remaining power of the second electronic device is 60%, the first electronic device determines that the second electronic device cannot assist the first electronic device in implementing application keep-alive.
示例性的,以第二电子设备的信息包括第二电子设备的可用内存的指示信息和第二电子设备的CPU占用率的指示信息,预设置信息指示协助设备的可用内存需要大于或等于1GB,并且协助设备的CPU占用率需要小于或等于20%为例,若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为4GB、第二电子设备的CPU占用率的指示信息指示第二电子设备的CPU占用率为10%,则第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活。若第二电子设备的可用内存的指示信息指示第二电子设备的可用内存为4GB、第二电子设备的CPU占用率的指示信息指示第二电子设备的CPU占用率为25%,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。Exemplarily, the information of the second electronic device includes the indication information of the available memory of the second electronic device and the indication information of the CPU usage rate of the second electronic device, and the preset information indicates that the available memory of the assisting device needs to be greater than or equal to 1GB, And the CPU usage rate of the assisting device needs to be less than or equal to 20%. If the CPU usage rate of the second electronic device is 10%, the first electronic device determines that the second electronic device can assist the first electronic device in implementing application keep-alive. If the indication information of the available memory of the second electronic device indicates that the available memory of the second electronic device is 4GB, and the indication information of the CPU usage rate of the second electronic device indicates that the CPU usage rate of the second electronic device is 25%, then the first electronic device The device determines that the second electronic device cannot assist the first electronic device in implementing application keep-alive.
对于上述情况2,第一电子设备可以根据第一指示信息确定第二电子设备能否协助第一电子设备实现应用保活。也就是说,第二电子设备可以采用与第一电子设备相同的方法确定第二电子设备能否协助第一电子设备实现应用保活。例如,第二电子设备可以根据预设置信息确定第二电子设备能够协助第一电子设备实现应用保活。其中,预设置信息可以是在第二电子设备初次执行本申请实施例提供的数据处理方法之前,用户设置的,或者预先存储在第二电子设备中的,或者第二电子设备从第一电子设备获取的。后续,预设置信息可以被修改。可以理解的,若第二电子设备能够满足预设置信息指示的条件,则第二电子设备向第一电子设备指示第二电子设备能够协助第一电子设备实现应用保活;若第二电子设备不能满足预设置信息指示的条件,则第二电子设备向第一电子设备指示第二电子设备不能协助第一电子设备实现应用保活。示例性的,若第一指示信息指示第二电子设备能够协助第一电子设备实现应用保活,则第一电子设备确定第二电子设备能够协助第一电子设备实现应用保活。若第一指示信息指示第二电子设备不能协助第一电子设备实现应用保活,则第一电子设备确定第二电子设备不能协助第一电子设备实现应用保活。For the above case 2, the first electronic device may determine whether the second electronic device can assist the first electronic device in implementing application keep-alive according to the first indication information. That is to say, the second electronic device may use the same method as that of the first electronic device to determine whether the second electronic device can assist the first electronic device in implementing application keep-alive. For example, the second electronic device may determine according to preset information that the second electronic device can assist the first electronic device in implementing application keep-alive. Wherein, the preset information may be set by the user or pre-stored in the second electronic device before the second electronic device executes the data processing method provided by the embodiment of the present application for the first time, or the second electronic device obtains the data from the first electronic device. acquired. Subsequently, the preset information can be modified. It can be understood that if the second electronic device can meet the conditions indicated by the preset information, the second electronic device indicates to the first electronic device that the second electronic device can assist the first electronic device in implementing application keep-alive; if the second electronic device cannot If the condition indicated by the preset information is satisfied, the second electronic device indicates to the first electronic device that the second electronic device cannot assist the first electronic device in implementing application keep-alive. Exemplarily, if the first indication information indicates that the second electronic device can assist the first electronic device in implementing application keep-alive, the first electronic device determines that the second electronic device can assist the first electronic device in implementing application keep-alive. If the first indication information indicates that the second electronic device cannot assist the first electronic device to implement application keep-alive, the first electronic device determines that the second electronic device cannot assist the first electronic device to implement application keep-alive.
可选的,第二电子设备接收到第一应用的数据后,将第一应用的数据存储在第二电子设备的内存缓冲区(memory base)中。Optionally, after receiving the data of the first application, the second electronic device stores the data of the first application in a memory buffer (memory base) of the second electronic device.
S503:第一电子设备删除第一应用的数据。S503: The first electronic device deletes data of the first application.
可以理解的,第一电子设备可以从第一电子设备的内存中删除第一应用的数据,使得第一电子设备的内存有更多空闲的存储空间。如此,第一电子设备就不需要杀死应用,可以使得第一电子设备中的应用保活。It can be understood that the first electronic device may delete the data of the first application from the memory of the first electronic device, so that the memory of the first electronic device has more free storage space. In this way, the first electronic device does not need to kill the application, and the application in the first electronic device can be kept alive.
基于图5所示的方法,第一电子设备在第二电子设备能够协助第一电子设备实现应用保活的情况下,向第二电子设备发送第一应用的数据,使得第一电子设备能够共享第二电子设备的内存。因此,第一电子设备可以释放第一应用的数据,来获得更多空闲的存储空间。避免了第一电子设备的后台应用因为运行内存不足而被杀,实现了应用保活,提高了用户体验。另外,图5所示的方法不需要对第一电子设备上的应用 进行任何修改或适配,操作简单,使用方便。Based on the method shown in Figure 5, the first electronic device sends the data of the first application to the second electronic device under the condition that the second electronic device can assist the first electronic device in keeping the application alive, so that the first electronic device can share memory of the second electronic device. Therefore, the first electronic device can release the data of the first application to obtain more free storage space. This prevents the background application of the first electronic device from being killed due to insufficient running memory, realizes application keeping alive, and improves user experience. In addition, the method shown in FIG. 5 does not require any modification or adaptation to the application on the first electronic device, and is simple to operate and convenient to use.
可选的,S503之后,若第一应用切换至第一电子设备的前台运行,则第一电子设备可以从第二电子设备获取第一应用的数据,以便第一应用在第一电子设备的前台运行。例如,图5所示的方法还包括S504-S505。Optionally, after S503, if the first application is switched to run in the foreground of the first electronic device, the first electronic device may obtain the data of the first application from the second electronic device, so that the first application is in the foreground of the first electronic device run. For example, the method shown in FIG. 5 further includes S504-S505.
S504:第一电子设备向第二电子设备发送第一请求信息。对应的,第二电子设备接收来自第一电子设备的第一请求信息。S504: The first electronic device sends first request information to the second electronic device. Correspondingly, the second electronic device receives the first request information from the first electronic device.
本申请实施例中,第一请求信息可以用于请求第一应用的数据。例如,第一请求信息可以包括第一应用对应的匿名页的标识。如此,第二电子设备接收到第一请求信息后,可以根据第一应用对应的匿名页的标识,获取第一应用对应的匿名页(即第一应用的数据)。In this embodiment of the present application, the first request information may be used to request data of the first application. For example, the first request information may include the identifier of the anonymous page corresponding to the first application. In this way, after receiving the first request information, the second electronic device may acquire the anonymous page corresponding to the first application (ie, the data of the first application) according to the identifier of the anonymous page corresponding to the first application.
S505:第二电子设备向第一电子设备发送第一应用的数据。对应的,第一电子设备接收来自第二电子设备的第一应用的数据。S505: The second electronic device sends data of the first application to the first electronic device. Correspondingly, the first electronic device receives data from the first application of the second electronic device.
本申请实施例中,第二电子设备向第一电子设备发送第一应用的数据也可以称为ap-wbw。ap-wbw的介绍可以参考前文所述。In this embodiment of the present application, the data of the first application sent by the second electronic device to the first electronic device may also be referred to as ap-wbw. The introduction of ap-wbw can refer to the above.
可选的,S502之后,第一电子设备继续向第二电子设备发送第一电子设备上的应用的数据,使得第一电子设备可以释放更多的内存。例如,图5所示的方法还包括S506。Optionally, after S502, the first electronic device continues to send data of applications on the first electronic device to the second electronic device, so that the first electronic device can release more memory. For example, the method shown in FIG. 5 further includes S506.
S506:第一电子设备向第二电子设备发送第二应用的数据。对应的,第二电子设备接收来自第一电子设备的第二应用的数据。S506: The first electronic device sends the data of the second application to the second electronic device. Correspondingly, the second electronic device receives data from the second application of the first electronic device.
本申请实施例中,第二应用可以是第一电子设备上运行的至少一个应用中的应用。第二应用在第一电子设备的后台运行。In this embodiment of the present application, the second application may be an application in at least one application running on the first electronic device. The second application runs in the background of the first electronic device.
可以理解的,第二应用的数据可以发送给第二电子设备,也可以发送给其他满足预设置信息指示的条件的设备,不予限制。It can be understood that the data of the second application may be sent to the second electronic device, and may also be sent to other devices that meet the conditions indicated by the preset information, without limitation.
可选的,S506之后,若第一电子设备需要调度第二应用的部分进程,则第一电子设备可以从第二电子设备获取这些进程对应的匿名页。例如,图5所示的方法还包括S507-S508。Optionally, after S506, if the first electronic device needs to schedule some processes of the second application, the first electronic device may obtain anonymous pages corresponding to these processes from the second electronic device. For example, the method shown in FIG. 5 further includes S507-S508.
S507:第一电子设备向第二电子设备发送第二请求信息。对应的,第二电子设备接收来自第一电子设备的第二请求信息。S507: The first electronic device sends second request information to the second electronic device. Correspondingly, the second electronic device receives the second request information from the first electronic device.
本申请实施例中,第二请求信息可以用于请求第一数据。例如,第二请求信息可以包括第一数据对应的匿名页的标识。如此,第二电子设备接收到第二请求信息后,可以根据第一数据对应的匿名页的标识,获取第一数据。其中,第一数据为第二应用的数据中的部分数据。例如,第一数据为第二应用的部分进程对应的匿名页。In this embodiment of the application, the second request information may be used to request the first data. For example, the second request information may include the identifier of the anonymous page corresponding to the first data. In this way, after receiving the second request information, the second electronic device may acquire the first data according to the identifier of the anonymous page corresponding to the first data. Wherein, the first data is part of the data of the second application. For example, the first data is an anonymous page corresponding to a partial process of the second application.
S508:第二电子设备向第一电子设备发送第一数据。对应的,第一电子设备接收来自第二电子设备的第一数据。S508: The second electronic device sends the first data to the first electronic device. Correspondingly, the first electronic device receives the first data from the second electronic device.
本申请实施例中,第二电子设备向第一电子设备发送第一数据也可以称为ap-fault写入。ap-fault写入的介绍可以参考前文所述。In this embodiment of the present application, sending the first data from the second electronic device to the first electronic device may also be referred to as ap-fault writing. For the introduction of ap-fault writing, please refer to the above.
可以理解的,本申请实施例中,若第一电子设备上运行多个应用,则会存在ap-wbr、ap-fault写入和ap-wbw同时出现的情况。由前文描述可知,用户对ap-wbr和ap-fault写入是不感知的。而用户对ap-wbw有感知,若ap-wbw不能及时执行,会导致应用响应过慢,影响用户体验。因此,可以为ap-wbr、ap-fault写入和ap-wbw配置不同的优 先级,使得优先级高的操作可以先执行,以提高用户体验。It can be understood that, in this embodiment of the present application, if multiple applications are running on the first electronic device, ap-wbr, ap-fault writing, and ap-wbw may occur simultaneously. As can be seen from the previous description, the user is not aware of the writing of ap-wbr and ap-fault. However, users are aware of ap-wbw. If ap-wbw cannot be executed in time, the application response will be too slow and user experience will be affected. Therefore, different priorities can be configured for ap-wbr, ap-fault write, and ap-wbw, so that operations with higher priority can be executed first to improve user experience.
一种可能的实现方式,ap-wbw的优先级高于ap-wbr和ap-fault写入的优先级。In a possible implementation, the priority of ap-wbw is higher than that of ap-wbr and ap-fault.
ap-fault写入的优先级高于ap-wbr的优先级。如此,可以优先执行ap-wbw,并降低执行ap-wbw时的干扰,提高ap-wbw的执行效率。那么,应用从后台切换到前台后,第一电子设备就可以及时获取到应用的数据,并及时在前台运行该应用,以提高用户体验。The priority of ap-fault writing is higher than that of ap-wbr. In this way, the ap-wbw can be executed preferentially, the interference during the execution of the ap-wbw can be reduced, and the execution efficiency of the ap-wbw can be improved. Then, after the application is switched from the background to the foreground, the first electronic device can obtain the data of the application in time, and run the application in the foreground in time, so as to improve user experience.
作为一种示例,若ap-wbr、ap-fault写入和ap-wbw同时出现,则优先执行ap-wbw,并将ap-wbr和ap-fault写入设置为超时等待。在等待超时后,再执行ap-wbr和ap-fault。As an example, if ap-wbr, ap-fault writing and ap-wbw occur at the same time, ap-wbw is executed first, and ap-wbr and ap-fault writing are set to wait for a timeout. After waiting for a timeout, execute ap-wbr and ap-fault.
作为另一种示例,若ap-wbr、ap-fault写入和ap-wbw同时出现,则优先执行ap-wbw,并将ap-wbr和ap-fault写入设置为等待。在ap-wbw执行完成后再执行ap-wbr和ap-fault。As another example, if ap-wbr, ap-fault write, and ap-wbw occur at the same time, ap-wbw is executed first, and ap-wbr and ap-fault write are set to wait. Execute ap-wbr and ap-fault after ap-wbw is executed.
作为另一种示例,若ap-wbr、ap-fault写入和ap-wbw同时出现,则优先执行ap-wbw,将ap-fault写入设置为超时等待,并将ap-wbr设置为等待。后续,在等待超时后,执行ap-fault写入,在ap-wbw执行完成后再执行ap-wbr。As another example, if ap-wbr, ap-fault write and ap-wbw occur at the same time, ap-wbw is executed first, ap-fault write is set to timeout wait, and ap-wbr is set to wait. Subsequently, after waiting for the timeout, execute ap-fault write, and execute ap-wbr after the execution of ap-wbw is completed.
可以理解的,在上述示例中,若ap-wbw和ap-fault写入对应的应用相同,可以停止执行ap-fault写入,执行ap-wbw即可。因为ap-fault写入的数据是包括在ap-wbw的数据中的,第一电子设备执行了ap-wbw,就可以获取到执行ap-fault写入时获取的数据。以ap-wbw和ap-fault写入对应的应用为微信
Figure PCTCN2022106967-appb-000012
为例,微信
Figure PCTCN2022106967-appb-000013
从第一电子设备的前台切换至后台后,第一电子设备可以将微信
Figure PCTCN2022106967-appb-000014
的数据发送给第二电子设备。之后,若微信
Figure PCTCN2022106967-appb-000015
需要调度某些进程以接收云侧的消息,则第一电子设备可以执行ap-fault写入。第一电子设备在执行ap-fault写入的过程中,若微信
Figure PCTCN2022106967-appb-000016
从第一电子设备的后台切换至前台,则第一电子设备可以停止执行ap-fault写入,而是执行ap-wbw即可。
It can be understood that, in the above example, if ap-wbw and ap-fault writing correspond to the same application, execution of ap-fault writing can be stopped and ap-wbw can be executed. Because the data written by the ap-fault is included in the data of the ap-wbw, the first electronic device can obtain the data obtained when the ap-fault write is executed by executing the ap-wbw. Use ap-wbw and ap-fault to write the corresponding application as WeChat
Figure PCTCN2022106967-appb-000012
For example, WeChat
Figure PCTCN2022106967-appb-000013
After switching from the foreground of the first electronic device to the background, the first electronic device can send WeChat
Figure PCTCN2022106967-appb-000014
The data is sent to the second electronic device. After that, if WeChat
Figure PCTCN2022106967-appb-000015
Some processes need to be scheduled to receive messages from the cloud, and the first electronic device can execute ap-fault writing. In the process of executing ap-fault writing on the first electronic device, if WeChat
Figure PCTCN2022106967-appb-000016
Switching from the background of the first electronic device to the foreground, the first electronic device may stop executing ap-fault writing, but execute ap-wbw instead.
下面以图5所示的方法同时包括S504-S508为例,介绍ap-wbr、ap-fault写入和ap-wbw的执行顺序。Taking the method shown in FIG. 5 including S504-S508 at the same time as an example, the execution sequence of ap-wbr, ap-fault writing and ap-wbw will be introduced below.
一种可能的实现方式,第一操作的优先级高于第二操作和第三操作的优先级。第三操作的优先级高于第二操作的优先。其中,第一操作是第一电子设备接收来自第二电子设备的第一应用的数据。第二操作是第一电子设备向第二电子设备发送第二应用的数据。第三操作是第一电子设备接收来自第二电子设备的第一数据。In a possible implementation manner, the priority of the first operation is higher than the priorities of the second operation and the third operation. The priority of the third operation is higher than that of the second operation. Wherein, the first operation is that the first electronic device receives data from the first application of the second electronic device. The second operation is that the first electronic device sends the data of the second application to the second electronic device. The third operation is that the first electronic device receives the first data from the second electronic device.
示例性的,如图6A所示,若第一电子设备在执行第二操作和第三操作的过程中,需要执行第一操作(即第一电子设备执行S505和S508的过程中,需要执行S505),则第一电子设备优先执行第一操作,并将第二操作和第三操作设置为超时等待。在等待超时后,再执行第二操作和第三操作。Exemplarily, as shown in FIG. 6A, if the first electronic device needs to perform the first operation during the process of performing the second operation and the third operation (that is, during the process of performing S505 and S508, the first electronic device needs to perform S505 ), the first electronic device preferentially executes the first operation, and sets the second operation and the third operation as timeout waiting. After waiting for timeout, execute the second operation and the third operation.
示例性的,如图6B所示,若第一电子设备在执行第二操作和第三操作的过程中,需要执行第一操作,则第一电子设备优先执行第一操作,并将第二操作和第三操作设置为等待。在第一操作执行完成后,再执行第二操作和第三操作。Exemplarily, as shown in FIG. 6B, if the first electronic device needs to perform the first operation during the process of performing the second operation and the third operation, the first electronic device will perform the first operation first, and the second operation And the third action is set to wait. After the first operation is executed, the second operation and the third operation are executed.
示例性的,如图6C所示,若第一电子设备在执行第二操作和第三操作的过程中,需要执行第一操作,则第一电子设备优先执行第一操作,将第三操作设置为超时等待,并将第二操作设置为等待。后续,在等待超时后,执行第三操作,在第一操作执行完成后再执行第二操作。Exemplarily, as shown in FIG. 6C, if the first electronic device needs to perform the first operation during the process of performing the second operation and the third operation, the first electronic device performs the first operation first, and sets the third operation to Wait for a timeout and set the second action to wait. Subsequently, after waiting for a timeout, the third operation is performed, and the second operation is performed after the first operation is completed.
通过前文描述可以知道,ap-wbw所花费的时间与用户体验息息相关。ap-wbw所 花费的时间越短,用户体验越好。为了进一步提高用户体验,可以为ap-wbr、ap-fault写入和ap-wbw分别建立不同的传输通道。如此,ap-wbr、ap-fault写入和ap-wbw可以分别通过自己的传输通道处理数据,互不影响。It can be known from the foregoing description that the time spent on ap-wbw is closely related to user experience. The shorter the time spent in ap-wbw, the better the user experience. In order to further improve user experience, different transmission channels can be established for ap-wbr, ap-fault write and ap-wbw respectively. In this way, ap-wbr, ap-fault write, and ap-wbw can process data through their own transmission channels without affecting each other.
可选的,S505之前,第一电子设备和第二电子设备建立第一通道。其中,第一通道用于传输存储在第二电子设备中、第一电子设备上的应用的数据。如此,第二电子设备可以通过第一通道向第一电子设备发送第一应用的数据,第一电子设备可以通过第一通道接收第一应用的数据。例如,S505之前,第一电子设备和第二电子设备建立第一传输控制协议(transmission control protocol,TCP)连接,并建立第一线程。第一TCP连接和第一线程可以用于传输存储在第二电子设备中、第一电子设备上的应用的数据。Optionally, before S505, the first electronic device and the second electronic device establish a first channel. Wherein, the first channel is used to transmit application data stored in the second electronic device and on the first electronic device. In this way, the second electronic device can send the data of the first application to the first electronic device through the first channel, and the first electronic device can receive the data of the first application through the first channel. For example, before S505, the first electronic device and the second electronic device establish a first transmission control protocol (transmission control protocol, TCP) connection, and establish a first thread. The first TCP connection and the first thread may be used to transmit data of an application stored in the second electronic device on the first electronic device.
可选的,S508之前,第一电子设备和第二电子设备建立第二通道。其中,第二通道用于传输存储在第二电子设备中、第一电子设备上的应用的数据中的部分数据。如此,第二电子设备可以通过第二通道向第一电子设备发送第一数据,第一电子设备可以通过第二通道接收第一数据。例如,S508之前,第一电子设备和第二电子设备建立第二TCP连接,并建立第二线程。第二TCP连接和第二线程可以用于传输存储在第二电子设备中、第一电子设备上的应用的数据中的部分数据。Optionally, before S508, the first electronic device and the second electronic device establish a second channel. Wherein, the second channel is used to transmit part of the data stored in the second electronic device and the application data on the first electronic device. In this way, the second electronic device can send the first data to the first electronic device through the second channel, and the first electronic device can receive the first data through the second channel. For example, before S508, the first electronic device and the second electronic device establish a second TCP connection, and establish a second thread. The second TCP connection and the second thread may be used to transmit part of the data stored in the second electronic device and the data of the application on the first electronic device.
可选的,S502之前,第一电子设备和第二电子设备可以建立第三通道。其中,第三通道可以用于传输第一电子设备上的应用的数据。如此,第一电子设备可以通过第三通道向第二电子设备发送第一应用的数据,第二电子设备可以通过第三通道接收第一应用的数据。例如,S502之前,第一电子设备和第二电子设备建立第三TCP连接,并建立第三线程。第三TCP连接和第三线程可以用于传输第一电子设备上的应用的数据。Optionally, before S502, the first electronic device and the second electronic device may establish a third channel. Wherein, the third channel may be used to transmit application data on the first electronic device. In this way, the first electronic device can send the data of the first application to the second electronic device through the third channel, and the second electronic device can receive the data of the first application through the third channel. For example, before S502, the first electronic device and the second electronic device establish a third TCP connection, and establish a third thread. The third TCP connection and the third thread can be used to transmit data of the application on the first electronic device.
可以理解的,为了提高用户体验,还可以根据用户对ap-wbw、ap-wbr和ap-fault写入的敏感性为第一线程、第二线程和第三线程配置不同的优先级。优先级高的线程可以提前被处理。如前文所述,用户对ap-wbr和ap-fault写入是不感知的,对ap-wbw有感知,若ap-wbw不能及时执行,会导致应用响应过慢,影响用户体验。因此,第一线程的优先级可以高于第二线程的优先级和第三线程的优先级。第二线程的优先级高于第三线程的优先级,或者,第二线程的优先级与第三线程的优先级相同。Understandably, in order to improve user experience, different priorities may be configured for the first thread, the second thread, and the third thread according to the user's sensitivity to ap-wbw, ap-wbr, and ap-fault writes. Threads with higher priority can be processed earlier. As mentioned above, users are not aware of ap-wbr and ap-fault writing, but are aware of ap-wbw. If ap-wbw cannot be executed in time, the application response will be too slow and user experience will be affected. Therefore, the priority of the first thread may be higher than the priority of the second thread and the priority of the third thread. The priority of the second thread is higher than the priority of the third thread, or the priority of the second thread is the same as that of the third thread.
可以理解的,为了节约传输资源,可以为ap-wbr和ap-fault写入建立一个传输通道,ap-wbr和ap-fault写入可以通过这个传输通道处理数据。例如,S502之前,第一电子设备和第二电子设备可以建立第四通道。第四通道可以具备上述第二通道和第三通道的功能。Understandably, in order to save transmission resources, a transmission channel may be established for ap-wbr and ap-fault writing, and ap-wbr and ap-fault writing may process data through this transmission channel. For example, before S502, the first electronic device and the second electronic device may establish a fourth channel. The fourth channel may have the functions of the above-mentioned second channel and third channel.
可以理解的,为了进一步提高ap-wbr、ap-fault写入和ap-wbw的速度,可以将数据收发与数据处理解耦,使得数据收发与数据处理互不影响。这样,第一电子设备或第二电子设备可以持续接收或发送数据,使得数据的传输速率可以保持最高,而不会因为要处理数据而中断收发操作。Understandably, in order to further increase the speed of ap-wbr, ap-fault writing, and ap-wbw, data sending and receiving and data processing can be decoupled, so that data sending and receiving and data processing do not affect each other. In this way, the first electronic device or the second electronic device can continuously receive or send data, so that the data transmission rate can be kept at the highest level without interrupting the sending and receiving operation due to data processing.
示例性的,第一电子设备和第二电子设备可以为ap-wbr、ap-fault写入和ap-wbw建立独立的传输通道、独立的数据收发任务和独立的数据处理任务。如图7所示,第一电子设备可以建立数据处理任务1、数据处理任务2、数据发送任务1、数据接收任 务1和数据接收任务2。第二电子设备可以建立数据接收任务3、数据发送任务2和数据发送任务3,第二电子设备中的内存缓冲区可以用于存储第一电子设备中应用的数据。其中,数据处理任务1可以发送第一电子设备中应用的数据,第一电子设备中应用的数据可以通过第三通道传输至第二电子设备。数据接收任务3可以接收第一电子设备中应用的数据。第二电子设备接收到第一电子设备中应用的数据后,可以将该数据写入内存缓冲区中。后续,若第一电子设备上的应用1从后台切换至前台运行,数据发送任务2可以发送应用1的数据,应用1的数据可以通过第一通道传输至第一电子设备。数据接收任务1可以接收应用1的数据,并通知数据处理任务1处理应用1的数据。数据处理任务1可以将应用1的数据存储到第一电子设备的内存中。若第一电子设备需要调度应用2的部分进程,数据发送任务3可以发送应用2的部分进程所需要的数据,应用2的部分进程所需要的数据可以通过第二通道传输至第一电子设备。数据接收任务2可以接收应用2的部分进程所需要的数据,并通知数据处理任务2处理该数据。数据处理任务2可以将该数据存储到第一电子设备的内存中。Exemplarily, the first electronic device and the second electronic device may establish independent transmission channels, independent data sending and receiving tasks, and independent data processing tasks for ap-wbr, ap-fault writing, and ap-wbw. As shown in FIG. 7 , the first electronic device can establish data processing task 1, data processing task 2, data sending task 1, data receiving task 1 and data receiving task 2. The second electronic device can establish the data receiving task 3, the data sending task 2 and the data sending task 3, and the memory buffer in the second electronic device can be used to store the application data in the first electronic device. Wherein, the data processing task 1 may send data applied in the first electronic device, and the data applied in the first electronic device may be transmitted to the second electronic device through a third channel. The data receiving task 3 can receive the data of the application in the first electronic device. After receiving the application data in the first electronic device, the second electronic device may write the data into the memory buffer. Subsequently, if the application 1 on the first electronic device is switched from the background to the foreground, the data sending task 2 can send the data of the application 1, and the data of the application 1 can be transmitted to the first electronic device through the first channel. The data receiving task 1 can receive the data of the application 1, and notify the data processing task 1 to process the data of the application 1. The data processing task 1 may store the data of the application 1 in the memory of the first electronic device. If the first electronic device needs to schedule part of the process of the application 2, the data sending task 3 can send the data required by the part of the process of the application 2, and the data required by the part of the process of the application 2 can be transmitted to the first electronic device through the second channel. The data receiving task 2 may receive data required by some processes of the application 2, and notify the data processing task 2 to process the data. The data processing task 2 may store the data in the memory of the first electronic device.
可选的,对第二电子设备的内存缓冲区构建全索引机制。也就是说,第二电子设备接收并存储了第一电子设备的应用的数据后,不会对存储的数据进行修改、删除或添加等,直到第二电子设备将该应用的数据都发送给第一电子设备。例如,第二电子设备执行ap-wbr,从第一电子设备接收并存储应用1的数据后,又执行ap-fault写入,将应用1中的4k数据发送给第一电子设备。之后,第二电子设备不删除该4k数据。后续,若应用1从第一电子设备的后台切换至前台运行后,第二电子设备执行ap-wbw,将应用1的数据发送给第一电子设备,并删除该应用1的数据。如此,可以避免对同一应用的数据的读写冲突,使得数据的读写操作相互独立,互不影响。例如,在对同一应用,第二电子设备多次执行ap-fault写入的情况下,若每次执行完ap-fault写入,第二电子设备都删除发送给第一电子设备的数据,会导致后续的ap-fault写入操作无法找到对应的数据,对后续的ap-fault写入造成影响。Optionally, a full index mechanism is constructed for the memory buffer of the second electronic device. That is to say, after the second electronic device receives and stores the application data of the first electronic device, it will not modify, delete or add the stored data until the second electronic device sends all the application data to the second electronic device. an electronic device. For example, the second electronic device executes ap-wbr, receives and stores the data of application 1 from the first electronic device, and then executes ap-fault writing to send the 4k data in application 1 to the first electronic device. Afterwards, the second electronic device does not delete the 4k data. Subsequently, if the application 1 is switched from the background of the first electronic device to the foreground, the second electronic device executes ap-wbw, sends the data of the application 1 to the first electronic device, and deletes the data of the application 1. In this way, conflicts between reading and writing data of the same application can be avoided, so that the reading and writing operations of data are independent of each other and do not affect each other. For example, in the case of the same application, the second electronic device performs ap-fault writing multiple times, if the second electronic device deletes the data sent to the first electronic device after each execution of ap-fault writing, it will As a result, subsequent ap-fault write operations cannot find the corresponding data, which affects subsequent ap-fault write operations.
可选的,第一电子设备可以从第二电子设备处获取第二电子设备的信息,或者从本地获取第二电子设备的信息。例如,如图8所示,S501包括S5011或S5012。Optionally, the first electronic device may obtain the information of the second electronic device from the second electronic device, or obtain the information of the second electronic device locally. For example, as shown in FIG. 8, S501 includes S5011 or S5012.
S5011:第一电子设备接收来自第二电子设备的第二电子设备的信息。S5011: The first electronic device receives information from the second electronic device of the second electronic device.
一种可能的实现方式,第二电子设备的信息是第一电子设备触发第二电子设备发送的。也就是说,在第一电子设备需要进行应用保活的情况下,第一电子设备可以向第二电子设备发送第三请求信息。第二电子设备接收到第三请求信息后,向第一电子设备发送响应信息,该响应信息包括第二电子设备的信息。本申请实施例中,第一电子设备需要进行应用保活可以理解为:第一电子设备的可用内存小于或等于第一阈值。也就是说,在第一电子设备的可用内存不足的情况下,第一电子设备可以执行本申请实施例提供的数据处理方法,以使得第一电子设备能够共享第二电子设备的内存,实现应用保活。本申请实施例中,第三请求信息也可以称为寻找设备请求(FindDeviceRequest)消息。第三请求信息可以用于请求第二电子设备的信息。In a possible implementation manner, the first electronic device triggers the second electronic device to send the information about the second electronic device. That is to say, when the first electronic device needs to keep alive the application, the first electronic device may send the third request information to the second electronic device. After receiving the third request information, the second electronic device sends response information to the first electronic device, where the response information includes information of the second electronic device. In this embodiment of the present application, the fact that the first electronic device needs to perform application keep-alive may be understood as: the available memory of the first electronic device is less than or equal to the first threshold. That is to say, when the available memory of the first electronic device is insufficient, the first electronic device can execute the data processing method provided by the embodiment of the present application, so that the first electronic device can share the memory of the second electronic device to realize application keep alive. In this embodiment of the present application, the third request information may also be referred to as a find device request (FindDeviceRequest) message. The third request information may be used to request information of the second electronic device.
可以理解的,对于上述情况1,第二电子设备可以将第二电子设备的信息中的信息分多次发送给第一电子设备。It can be understood that, for the above case 1, the second electronic device may send the information in the information of the second electronic device to the first electronic device in multiple times.
作为一种示例,第二电子设备接收到第三请求信息后,可以先向第一电子设备发 送响应信息1,该响应信息1包括第二电子设备的标识。后续,第二电子设备再向第一电子设备发送响应信息2,该响应信息2包括第二电子设备的可用内存的信息。As an example, after receiving the third request information, the second electronic device may first send response information 1 to the first electronic device, where the response information 1 includes the identifier of the second electronic device. Subsequently, the second electronic device sends response information 2 to the first electronic device, where the response information 2 includes information about the available memory of the second electronic device.
作为另一种示例,第二电子设备接收到第三请求信息后,可以先向第一电子设备发送设备信息响应(DeviceInfoResponse)消息,该设备信息响应消息包括设备信息中的至少一项,例如包括第二电子设备的标识和第二电子设备的IP地址。第一电子设备接收到设备信息响应消息后,向第二电子设备发送获取设备资源请求(GetDeviceResourceRequest)消息。第二电子设备接收到获取设备资源请求消息后,向第一电子设备发送设备资源响应(DeviceResourceResponse)消息,该设备资源响应消息包括设备资源信息中的至少一项,例如包括第二电子设备的可用内存的指示信息,第二电子设备是否处于活动状态的指示信息和第二电子设备的剩余电量的指示信息。其中,设备信息和设备资源信息的介绍可以参考上述S501中所述。As another example, after receiving the third request information, the second electronic device may first send a device information response (DeviceInfoResponse) message to the first electronic device, where the device information response message includes at least one item of device information, for example including The identifier of the second electronic device and the IP address of the second electronic device. After receiving the device information response message, the first electronic device sends a device resource request (GetDeviceResourceRequest) message to the second electronic device. After receiving the device resource acquisition request message, the second electronic device sends a device resource response (DeviceResourceResponse) message to the first electronic device, and the device resource response message includes at least one item of device resource information, for example, the second electronic device's available The indication information of the internal memory, the indication information of whether the second electronic device is in an active state, and the indication information of the remaining power of the second electronic device. For the introduction of device information and device resource information, reference may be made to the above S501.
可选的,第三请求信息还用于订阅第二电子设备的信息。后续,若第二电子设备的信息发生变化,例如,第二电子设备的IP地址发生变化,第二电子设备可以向第一电子设备发送第一更新信息。该第一更新信息包括更新后的第二电子设备的信息,例如,更新后的IP地址。类似的,上述示例中的获取设备资源请求消息还用于订阅设备资源信息。后续,若第二电子设备的设备资源信息发生变化,第二电子设备可以向第一电子设备发送第二更新信息,该第二更新信息包括更新后的设备资源信息。Optionally, the third request information is also used to subscribe to information of the second electronic device. Subsequently, if the information of the second electronic device changes, for example, the IP address of the second electronic device changes, the second electronic device may send the first update information to the first electronic device. The first update information includes updated information of the second electronic device, for example, an updated IP address. Similarly, the device resource acquisition request message in the above example is also used to subscribe to device resource information. Subsequently, if the device resource information of the second electronic device changes, the second electronic device may send second update information to the first electronic device, where the second update information includes updated device resource information.
S5012:第一电子设备从本地获取第二电子设备的信息。S5012: The first electronic device acquires the information of the second electronic device locally.
一种可能的实现方式,第二电子设备周期性地向第一电子设备发送第二电子设备的信息。第一电子设备接收到第二电子设备的信息后,将第二电子设备的信息存储在本地。在第一电子设备需要进行应用保活的情况下,第一电子设备从本地获取最新接收到的第二电子设备的信息。In a possible implementation manner, the second electronic device periodically sends the information of the second electronic device to the first electronic device. After receiving the information of the second electronic device, the first electronic device stores the information of the second electronic device locally. In the case that the first electronic device needs to keep the application alive, the first electronic device acquires the latest received information of the second electronic device locally.
另一种可能的实现方式,第二电子设备与第一电子设备建立连接后,向第一电子设备发送第二电子设备的信息。后续,若第二电子设备的信息发生变化,第二电子设备向第一电子设备发送第三更新信息,第三更新信息包括更新后的第二电子设备的信息。在第一电子设备需要进行应用保活的情况下,第一电子设备从本地获取最新接收到的第二电子设备的信息。In another possible implementation manner, after establishing a connection with the first electronic device, the second electronic device sends information about the second electronic device to the first electronic device. Subsequently, if the information of the second electronic device changes, the second electronic device sends third update information to the first electronic device, where the third update information includes updated information of the second electronic device. In the case that the first electronic device needs to keep the application alive, the first electronic device acquires the latest received information of the second electronic device locally.
可以理解的,本申请实施例提供的数据处理方法是将第一电子设备中的应用的数据发送给第二电子设备,使得第二电子设备可以协助第一电子设备存储应用的数据,实现电子设备之间的内存共享。基于这种思想,电子设备之间也可以共享计算资源。例如,第一电子设备可以将计算任务分成多个子任务,并将多个子任务分配给至少一个第二电子设备,使得至少一个第二电子设备协助第一电子设备完成计算任务。如此,可以提高计算效率。其中,计算任务可以是图形渲染、视频剪辑等。It can be understood that the data processing method provided by the embodiment of the present application is to send the data of the application in the first electronic device to the second electronic device, so that the second electronic device can assist the first electronic device in storing the data of the application, realizing the electronic device memory sharing among them. Based on this idea, computing resources can also be shared between electronic devices. For example, the first electronic device may divide the calculation task into multiple subtasks, and assign the multiple subtasks to at least one second electronic device, so that the at least one second electronic device assists the first electronic device to complete the calculation task. In this way, computational efficiency can be improved. Among them, the computing task may be graphics rendering, video clipping, and the like.
可以理解的是,上述电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。It can be understood that, in order to realize the above-mentioned functions, the above-mentioned electronic device includes corresponding hardware structures and/or software modules for performing each function. Those skilled in the art should easily realize that the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the example units and algorithm steps described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the embodiments of the present application.
本申请实施例可以根据上述方法示例对上述电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiments of the present application may divide the above-mentioned electronic device into functional modules according to the above-mentioned method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
如图9所示,本申请实施例公开了一种电子设备900,该电子设备可以为上述实施例中协同工作的电子设备中的一个。该电子设备900具体可以包括:显示屏901;输入设备902(例如鼠标、键盘或触摸屏等);一个或多个处理器903;存储器904;一个或多个应用程序(未示出);以及一个或多个计算机程序905,上述各器件可以通过一个或多个通信总线906连接。其中,上述一个或多个计算机程序905被存储在上述存储器904中并被配置为被该一个或多个处理器903执行,该一个或多个计算机程序905包括指令,该指令可以用于执行上述实施例中的相关步骤。在一种示例中,该电子设备900可以为图2中电子设备201、电子设备202、电子设备203或电子设备204。As shown in FIG. 9 , the embodiment of the present application discloses an electronic device 900 , and the electronic device may be one of the cooperative electronic devices in the foregoing embodiments. The electronic device 900 may specifically include: a display screen 901; an input device 902 (such as a mouse, a keyboard or a touch screen, etc.); one or more processors 903; a memory 904; one or more application programs (not shown); or a plurality of computer programs 905 , the above-mentioned components may be connected through one or more communication buses 906 . Wherein, the above-mentioned one or more computer programs 905 are stored in the above-mentioned memory 904 and configured to be executed by the one or more processors 903, the one or more computer programs 905 include instructions, and the instructions can be used to execute the above-mentioned Relevant steps in the examples. In an example, the electronic device 900 may be the electronic device 201 , the electronic device 202 , the electronic device 203 or the electronic device 204 in FIG. 2 .
本申请实施例还提供了一种芯片系统,包括:至少一个处理器和接口,该至少一个处理器通过接口与存储器耦合,当该至少一个处理器执行存储器中的计算机程序或指令时,使得上述任一方法实施例中的方法被执行。在一种可能的实现方式中,该芯片系统还包括存储器。可选的,该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件,本申请实施例对此不作具体限定。The embodiment of the present application also provides a chip system, including: at least one processor and an interface, the at least one processor is coupled with the memory through the interface, when the at least one processor executes the computer program or instruction in the memory, the above-mentioned The method in any method embodiment is performed. In a possible implementation manner, the chip system further includes a memory. Optionally, the system-on-a-chip may consist of a chip, or may include a chip and other discrete devices, which is not specifically limited in this embodiment of the present application.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序代码,当处理器执行该计算机程序代码时,电子设备执行上述实施例中的方法。The embodiment of the present application also provides a computer-readable storage medium, where computer program code is stored, and when the processor executes the computer program code, the electronic device executes the method in the foregoing embodiments.
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述实施例中的方法。The embodiment of the present application also provides a computer program product, which causes the computer to execute the method in the foregoing embodiments when the computer program product is run on the computer.
其中,本申请实施例提供的电子设备900、计算机可读存储介质或者计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device 900, the computer-readable storage medium or the computer program product provided in the embodiment of the present application are all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above-mentioned The beneficial effects of the corresponding method will not be repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs 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.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成 的单元既可以使用硬件的形式实现,也可以使用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media capable of storing program codes such as U disks, mobile hard disks, ROMs, magnetic disks, or optical disks.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application . Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (26)

  1. 一种数据处理方法,其特征在于,应用于第一电子设备,所述第一电子设备上运行至少一个应用,所述第一电子设备与第二电子设备连接,所述方法包括:A data processing method, characterized in that it is applied to a first electronic device, at least one application runs on the first electronic device, and the first electronic device is connected to a second electronic device, the method comprising:
    获取第二电子设备的信息,所述第二电子设备的信息用于确定所述第二电子设备能否协助所述第一电子设备实现应用保活;Acquiring information about the second electronic device, where the information about the second electronic device is used to determine whether the second electronic device can assist the first electronic device in implementing application keep-alive;
    若所述第二电子设备能够协助所述第一电子设备实现应用保活,向所述第二电子设备发送第一应用的数据,所述第一应用包括在所述至少一个应用中,所述第一应用在所述第一电子设备的后台运行;If the second electronic device is capable of assisting the first electronic device in implementing application keep-alive, sending data of a first application to the second electronic device, the first application being included in the at least one application, the The first application runs in the background of the first electronic device;
    删除所述第一应用的数据。Delete the data of the first application.
  2. 根据权利要求1所述的方法,其特征在于,若所述第一应用切换至所述第一电子设备的前台运行,所述方法还包括:The method according to claim 1, wherein if the first application is switched to run in the foreground of the first electronic device, the method further comprises:
    向所述第二电子设备发送第一请求信息,所述第一请求信息用于请求所述第一应用的数据;sending first request information to the second electronic device, where the first request information is used to request data of the first application;
    接收来自所述第二电子设备的所述第一应用的数据。Data is received from the first application of the second electronic device.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, further comprising:
    建立第一通道,所述第一通道用于传输存储在所述第二电子设备中、所述第一电子设备上的应用的数据。A first channel is established, and the first channel is used to transmit data of an application stored in the second electronic device on the first electronic device.
  4. 根据权要求2或3所述的方法,其特征在于,所述方法还包括:The method according to claim 2 or 3, wherein the method further comprises:
    向所述第二电子设备发送第二应用的数据,所述第二应用包括在所述至少一个应用中,所述第二应用在所述第一电子设备的后台运行。Sending data of a second application included in the at least one application to the second electronic device, the second application running in the background of the first electronic device.
  5. 根据权利要求4所述的方法,其特征在于,第一操作的优先级高于第二操作的优先级,所述第一操作是接收来自所述第二电子设备的所述第一应用的数据,所述第二操作是向所述第二电子设备发送第二应用的数据。The method according to claim 4, wherein the priority of the first operation is higher than the priority of the second operation, the first operation is receiving data from the first application of the second electronic device , the second operation is to send the data of the second application to the second electronic device.
  6. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, characterized in that the method further comprises:
    向所述第二电子设备发送第二请求信息,所述第二请求信息用于请求第一数据,所述第一数据为所述第二应用的数据中的部分数据;Sending second request information to the second electronic device, where the second request information is used to request first data, where the first data is part of the data of the second application;
    接收来自所述第二电子设备的所述第一数据。The first data is received from the second electronic device.
  7. 根据权利要求6所述的方法,其特征在于,第一操作的优先级高于第三操作的优先级,所述第一操作是接收来自所述第二电子设备的所述第一应用的数据,所述第三操作是接收来自所述第二电子设备的所述第一数据。The method according to claim 6, wherein the priority of the first operation is higher than the priority of the third operation, the first operation is receiving data from the first application of the second electronic device , the third operation is to receive the first data from the second electronic device.
  8. 根据权利要求6或7所述的方法,其特征在于,所述方法还包括:The method according to claim 6 or 7, characterized in that the method further comprises:
    建立第二通道,所述第二通道用于传输存储在所述第二电子设备中、所述第一电子设备上的应用的数据中的部分数据。A second channel is established, and the second channel is used to transmit part of the data stored in the second electronic device and the application data on the first electronic device.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-8, further comprising:
    建立第三通道,所述第三通道用于传输所述第一电子设备上的应用的数据。A third channel is established, the third channel is used to transmit data of the application on the first electronic device.
  10. 根据权利要求1-9中任一项所述的方法,其特征在于,所述获取第二电子设备的信息,包括:The method according to any one of claims 1-9, wherein the acquiring information of the second electronic device comprises:
    接收来自所述第二电子设备的所述第二电子设备的信息。Information is received from the second electronic device of the second electronic device.
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method according to claim 10, characterized in that the method further comprises:
    向所述第二电子设备发送第三请求信息,所述第三请求信息用于请求所述第二电子设备的信息。sending third request information to the second electronic device, where the third request information is used to request information of the second electronic device.
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,The method according to any one of claims 1-11, characterized in that,
    所述第二电子设备的信息指示所述第二电子设备的可用内存;或者,The information of the second electronic device indicates available memory of the second electronic device; or,
    所述第二电子设备的信息指示所述第二电子设备能否协助所述第一电子设备实现应用保活。The information of the second electronic device indicates whether the second electronic device can assist the first electronic device in implementing application keep-alive.
  13. 根据权利要求1-12中任一项所述的方法,其特征在于,所述第一电子设备的可用内存小于或等于第一阈值的情况下,获取所述第二电子设备的信息。The method according to any one of claims 1-12, wherein when the available memory of the first electronic device is less than or equal to a first threshold, the information of the second electronic device is acquired.
  14. 一种数据处理方法,其特征在于,应用于第二电子设备,所述第二电子设备与第一电子设备连接,所述方法包括:A data processing method, characterized in that it is applied to a second electronic device, and the second electronic device is connected to the first electronic device, the method comprising:
    向所述第一电子设备发送所述第二电子设备的信息,所述第二电子设备的信息用于确定所述第二电子设备能否协助所述第一电子设备实现应用保活;Sending information of the second electronic device to the first electronic device, where the information of the second electronic device is used to determine whether the second electronic device can assist the first electronic device in implementing application keep-alive;
    若所述第二电子设备能够协助所述第一电子设备实现应用保活,接收来自所述第一电子设备的第一应用的数据,所述第一应用为所述第一电子设备的后台运行的应用。If the second electronic device can assist the first electronic device to keep the application alive and receive data from the first application of the first electronic device, the first application is running in the background of the first electronic device Applications.
  15. 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method according to claim 14, characterized in that the method further comprises:
    接收来自所述第一电子设备的第一请求信息,所述第一请求信息用于请求所述第一应用的数据;receiving first request information from the first electronic device, where the first request information is used to request data of the first application;
    向所述第一电子设备发送所述第一应用的数据。Send the data of the first application to the first electronic device.
  16. 根据权利要求15所述的方法,其特征在于,所述方法还包括:The method according to claim 15, further comprising:
    建立第一通道,所述第一通道用于传输存储在所述第二电子设备中、所述第一电子设备上的应用的数据。A first channel is established, and the first channel is used to transmit data of an application stored in the second electronic device on the first electronic device.
  17. 根据权要求15或16所述的方法,其特征在于,所述方法还包括:The method according to claim 15 or 16, wherein the method further comprises:
    接收来自所述第一电子设备的第二应用的数据,所述第二应用在所述第一电子设备的后台运行。Data is received from a second application of the first electronic device, the second application running in the background of the first electronic device.
  18. 根据权利要求17所述的方法,其特征在于,第一操作的优先级高于第二操作的优先级,所述第一操作是向所述第一电子设备发送所述第一应用的数据,所述第二操作是接收来自所述第一电子设备的第二应用的数据。The method according to claim 17, wherein the priority of the first operation is higher than that of the second operation, the first operation is sending the data of the first application to the first electronic device, The second operation is receiving data from a second application of the first electronic device.
  19. 根据权利要求17所述的方法,其特征在于,所述方法还包括:The method according to claim 17, further comprising:
    接收来自所述第一电子设备的第二请求信息,所述第二请求信息用于请求第一数据,所述第一数据为所述第二应用的数据中的部分数据;receiving second request information from the first electronic device, where the second request information is used to request first data, where the first data is part of the data in the second application;
    向所述第一电子设备发送所述第一数据。Send the first data to the first electronic device.
  20. 根据权利要求19所述的方法,其特征在于,第一操作的优先级高于第三操作的优先级,所述第一操作是向所述第一电子设备发送所述第一应用的数据,所述第三操作是向所述第一电子设备发送所述第一数据。The method according to claim 19, wherein the priority of the first operation is higher than that of the third operation, the first operation is sending the data of the first application to the first electronic device, The third operation is to send the first data to the first electronic device.
  21. 根据权利要求19或20所述的方法,其特征在于,所述方法还包括:The method according to claim 19 or 20, wherein the method further comprises:
    建立第二通道,所述第二通道用于传输存储在所述第二电子设备中、所述第一电子设备上的应用的数据中的部分数据。A second channel is established, and the second channel is used to transmit part of the data stored in the second electronic device and the application data on the first electronic device.
  22. 根据权利要求14-21中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 14-21, further comprising:
    建立第三通道,所述第三通道用于传输所述第一电子设备上的应用的数据。A third channel is established, the third channel is used to transmit data of the application on the first electronic device.
  23. 根据权利要求14-22中任一项所述的方法,其特征在于,The method according to any one of claims 14-22, characterized in that,
    所述第二电子设备的信息指示所述第二电子设备的可用内存;或者,The information of the second electronic device indicates available memory of the second electronic device; or,
    所述第二电子设备的信息指示所述第二电子设备能否协助所述第一电子设备实现应用保活。The information of the second electronic device indicates whether the second electronic device can assist the first electronic device in implementing application keep-alive.
  24. 根据权利要求14-23中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 14-23, further comprising:
    接收来自所述第一电子设备的第三请求信息,所述第三请求信息用于请求所述第二电子设备的信息。receiving third request information from the first electronic device, where the third request information is used to request information of the second electronic device.
  25. 一种电子设备,其特征在于,包括:包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得所述电子设备执行如权利要求1至13中任一项所述的方法,或者执行如权利要求14至24中任一项所述的方法。An electronic device, characterized in that it includes: a processor, the processor is coupled to a memory, and the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor, the The electronic device executes the method according to any one of claims 1-13, or executes the method according to any one of claims 14-24.
  26. 一种计算机可读存储介质,其上存储有计算机程序或指令,其特征在于,所述计算机程序或指令被执行时使得计算机执行如权利要求1至13中任一项所述的方法或者如权利要求14至24中任一项所述的方法。A computer-readable storage medium, on which are stored computer programs or instructions, characterized in that, when the computer programs or instructions are executed, the computer executes the method according to any one of claims 1 to 13 or the The method according to any one of claims 14 to 24.
PCT/CN2022/106967 2021-07-26 2022-07-21 Data processing method and electronic device WO2023005783A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110846381.5A CN115686765A (en) 2021-07-26 2021-07-26 Data processing method and electronic equipment
CN202110846381.5 2021-07-26

Publications (1)

Publication Number Publication Date
WO2023005783A1 true WO2023005783A1 (en) 2023-02-02

Family

ID=85044409

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106967 WO2023005783A1 (en) 2021-07-26 2022-07-21 Data processing method and electronic device

Country Status (2)

Country Link
CN (1) CN115686765A (en)
WO (1) WO2023005783A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503740A (en) * 2014-12-01 2015-04-08 小米科技有限责任公司 Memory management method and device
US9007239B1 (en) * 2012-07-02 2015-04-14 Amazon Technologies, Inc. Reduction of memory consumption
CN105404551A (en) * 2015-12-11 2016-03-16 Tcl移动通信科技(宁波)有限公司 Processing method and system for switching application between foreground and background of mobile terminal and mobile terminal
CN106201708A (en) * 2016-06-29 2016-12-07 宇龙计算机通信科技(深圳)有限公司 The freezing method of application program, the freezing plant of application program and terminal
CN110865884A (en) * 2019-09-30 2020-03-06 华为技术有限公司 Memory management method and device
CN112231090A (en) * 2020-11-04 2021-01-15 Oppo广东移动通信有限公司 Application process management method and device and terminal equipment
CN112948149A (en) * 2021-03-29 2021-06-11 江苏为是科技有限公司 Remote memory sharing method and device, electronic equipment and storage medium
CN112988282A (en) * 2021-04-27 2021-06-18 荣耀终端有限公司 Application keep-alive method and terminal equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9007239B1 (en) * 2012-07-02 2015-04-14 Amazon Technologies, Inc. Reduction of memory consumption
CN104503740A (en) * 2014-12-01 2015-04-08 小米科技有限责任公司 Memory management method and device
CN105404551A (en) * 2015-12-11 2016-03-16 Tcl移动通信科技(宁波)有限公司 Processing method and system for switching application between foreground and background of mobile terminal and mobile terminal
CN106201708A (en) * 2016-06-29 2016-12-07 宇龙计算机通信科技(深圳)有限公司 The freezing method of application program, the freezing plant of application program and terminal
CN110865884A (en) * 2019-09-30 2020-03-06 华为技术有限公司 Memory management method and device
CN112231090A (en) * 2020-11-04 2021-01-15 Oppo广东移动通信有限公司 Application process management method and device and terminal equipment
CN112948149A (en) * 2021-03-29 2021-06-11 江苏为是科技有限公司 Remote memory sharing method and device, electronic equipment and storage medium
CN112988282A (en) * 2021-04-27 2021-06-18 荣耀终端有限公司 Application keep-alive method and terminal equipment

Also Published As

Publication number Publication date
CN115686765A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
WO2021051989A1 (en) Video call method and electronic device
WO2020143380A1 (en) Data transmission method and electronic device
WO2021185141A1 (en) Wi-fi aware link establishment method and system, electronic device, and storage medium
WO2021052200A1 (en) Device capability scheduling method and electronic device
WO2021052415A1 (en) Resource scheduling method and electronic device
WO2021143314A1 (en) Method for reducing power consumption of mobile terminal and mobile terminal
CN112181616B (en) Task processing method and related device
EP4311314A1 (en) Sleep scheduling method and device
US20240073978A1 (en) Method for monitoring link and terminal device
WO2021104259A1 (en) Method and terminal for data sharing between fast application and native application
WO2021017935A1 (en) Wakelock management method and electronic device
WO2021197071A1 (en) Wireless communication system and method
CN111078376A (en) Process management method and device
WO2020019533A1 (en) Data transmission method and electronic device
WO2022262492A1 (en) Data downloading method and apparatus, and terminal device
CN114449576A (en) Application data sending method, device and equipment
WO2022127632A1 (en) Resource management and control method, and device
CN113596919B (en) Data downloading method and device and terminal equipment
WO2023005783A1 (en) Data processing method and electronic device
WO2023051056A1 (en) Memory management method, electronic device, computer storage medium, and program product
WO2024027544A1 (en) Memory management method and electronic device
WO2024067110A1 (en) Card updating method and related apparatus
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium
WO2023035837A1 (en) Data synchronization method, and device
CN116709557B (en) Service processing method, device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22848388

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE