CN116737257A - Customized resource processing method and device, electronic equipment and storage medium - Google Patents
Customized resource processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116737257A CN116737257A CN202211213786.6A CN202211213786A CN116737257A CN 116737257 A CN116737257 A CN 116737257A CN 202211213786 A CN202211213786 A CN 202211213786A CN 116737257 A CN116737257 A CN 116737257A
- Authority
- CN
- China
- Prior art keywords
- customized
- electronic device
- path
- resource
- disk
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44594—Unloading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种定制资源的处理方法、装置、电子设备及可存储介质。The present application relates to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for processing customized resources.
背景技术Background technique
随着科技的发展,电子设备的用户使用需求越来越多样化。用户在购买电子设备后可能存在有定制资源的需求。电子设备的厂商可以根据用户的需求在电子设备中定制各种资源,例如开机动画定制、开机铃声定制和锁屏壁纸定制等媒体资源的定制。用户在使用电子设备后,可能对电子设备上的定制资源存在更新的需求。但目前对电子设备的定制资源的处理方法无法实现对电子设备上定制资源的卸载,因此也无法实现对定制资源的更新,用户的使用体验较低。With the development of science and technology, the needs of users of electronic devices are becoming more and more diverse. After purchasing electronic equipment, users may have needs for customized resources. Manufacturers of electronic devices can customize various resources in electronic devices according to user needs, such as customization of startup animations, startup ringtones, lock screen wallpapers and other media resources. After using the electronic device, the user may have updated needs for customized resources on the electronic device. However, the current method of processing customized resources of electronic devices cannot uninstall the customized resources on the electronic device, so it is also impossible to update the customized resources, and the user experience is low.
发明内容Contents of the invention
本申请提供了一种定制资源的处理方法、装置、电子设备及可存储介质,用于实现对电子设备中定制资源的卸载。This application provides a method, device, electronic device, and storage medium for processing customized resources, which are used to uninstall customized resources in electronic devices.
第一方面,本申请提供了一种定制资源的处理方法,该方法包括:电子设备获得第一定制路径,第一定制路径指示电子设备中的预设目录;电子设备根据第一定制路径卸载预设目录中的定制资源磁盘;定制资源磁盘包含定制资源,定制资源根据电子设备的用户的配置信息生成;电子设备在外存的扫描路径列表中添加电子设备存储的第二定制路径,第二定制路径指示定制资源磁盘;电子设备根据第二定制路径卸载定制资源。In a first aspect, this application provides a method for processing customized resources. The method includes: an electronic device obtains a first customized path, and the first customized path indicates a preset directory in the electronic device; and the electronic device uninstalls the preset directory according to the first customized path. Assume a customized resource disk in the directory; the customized resource disk contains customized resources, and the customized resources are generated according to the configuration information of the user of the electronic device; the electronic device adds the second customized path stored by the electronic device in the scan path list of the external storage, and the second customized path Instruct the customized resource disk; the electronic device unloads the customized resource according to the second customized path.
申请实施例中的电子设备在根据第一定制路径卸载定制资源磁盘后,还将电子设备中存储的第二定制路径添加至外存的扫描路径列表中。第二定制路径对应定制资源磁盘,如此,电子设备可以根据扫描路径列表中第二定制路径查询得到定制资源磁盘已被卸载,并对定制资源在外存中的信息进行更新,从而实现在电子设备中对定制资源的有效卸载。第二定制路径为预先存储在电子设备中的路径,本申请实施例并不限定电子设备存储第二定制路径的时机。在一些可能的实施例中,第二定制路径为电子设备安装定制资源的过程中存储。After the electronic device in the application embodiment unloads the customized resource disk according to the first customized path, it also adds the second customized path stored in the electronic device to the scan path list of the external storage. The second customized path corresponds to the customized resource disk. In this way, the electronic device can query according to the second customized path in the scan path list to find out that the customized resource disk has been uninstalled, and update the information of the customized resource in the external memory, thereby realizing in the electronic device Efficient uninstallation of custom resources. The second customized path is a path pre-stored in the electronic device. The embodiment of the present application does not limit the timing when the electronic device stores the second customized path. In some possible embodiments, the second customization path is stored during a process of installing customization resources on the electronic device.
在一些可能的实施例中,电子设备在外存的扫描路径列表中添加电子设备存储的第二定制路径,包括:电子设备读取预设目录中的磁盘对应的挂载路径;电子设备读取挂载路径失败后,在外存的扫描路径列表中添加电子设备存储的第二定制路径。当电子设备查询挂载的定制资源磁盘的路径失败时,电子设备无法获得被卸载的定制资源磁盘的信息,因此无法对电子设备外存的扫描路径列表进行更新。因此在电子设备卸载定制资源时,电子设备已经在内存中卸载了定制资源磁盘,但未能对外存中的定制资源磁盘对应的信息进行更新,因此未能彻底卸载电子设备已安装的定制资源,可能会导致电子设备在用户媒体数据库中依然保留了相应的定制资源对应的信息。为了避免上述的技术问题,本申请实施例在电子设备查询挂载的定制磁盘路径失败时,为了更新电子设备外存中定制资源对应的信息,将在外存的扫描路径列表中添加第二定制路径。In some possible embodiments, the electronic device adds the second customized path stored by the electronic device to the scan path list in the external storage, including: the electronic device reads the mount path corresponding to the disk in the preset directory; the electronic device reads the mount path. After the download path fails, add the second customized path stored in the electronic device to the scan path list in the external storage. When the electronic device fails to query the path of the mounted customized resource disk, the electronic device cannot obtain the information of the uninstalled customized resource disk, and therefore cannot update the scan path list of the electronic device's external storage. Therefore, when the electronic device uninstalls the customized resources, the electronic device has already uninstalled the customized resource disk in the memory, but failed to update the information corresponding to the customized resource disk in the external memory. Therefore, it failed to completely uninstall the customized resources installed by the electronic device. This may cause the electronic device to still retain information corresponding to the corresponding customized resources in the user media database. In order to avoid the above technical problems, in this embodiment of the present application, when the electronic device fails to query the mounted customized disk path, in order to update the information corresponding to the customized resources in the external storage of the electronic device, a second customized path will be added to the scan path list of the external storage. .
在一些可能的实施例中,电子设备可以获得空资源对应的空资源版本号;电子设备读取预设目录中的磁盘对应的挂载路径,包括:当空资源版本号与电子设备中存储的历史版本号不一致时,将电子设备存储的历史版本号更新为空资源版本号,并读取预设目录中的磁盘对应的挂载路径。在另一些可能的实施例中,当空资源版本号和电子设备存储的历史版本号一致时,电子设备结束对定制资源的处理。电子设备可以根据空资源版本号和电子设备存储的历史版本号来判断电子设备的定制资源版本是否存在更新。如果电子设备的定制资源版本未更新,即电子设备未挂载或卸载定制资源磁盘,电子设备便可以终止此次进程,如此可以避免在电子设备的定制资源版本未更新时,浪费电子设备过多的性能开销。In some possible embodiments, the electronic device can obtain the empty resource version number corresponding to the empty resource; the electronic device reads the mounting path corresponding to the disk in the preset directory, including: when the empty resource version number matches the history stored in the electronic device When the version numbers are inconsistent, the historical version number stored in the electronic device is updated to the empty resource version number, and the corresponding mounting path of the disk in the preset directory is read. In other possible embodiments, when the version number of the empty resource is consistent with the historical version number stored by the electronic device, the electronic device ends processing the customized resource. The electronic device can determine whether there is an update to the customized resource version of the electronic device based on the empty resource version number and the historical version number stored by the electronic device. If the customized resource version of the electronic device has not been updated, that is, the electronic device has not mounted or unmounted the customized resource disk, the electronic device can terminate the process. This can avoid excessive waste of electronic equipment when the customized resource version of the electronic device has not been updated. performance overhead.
在一些可能的实施例中,本申请实施例提供的定制资源的处理方法,还包括:电子设备获得定制资源磁盘对应的第二定制路径;电子设备根据第二定制路径在预设目录中挂载定制资源磁盘;电子设备存储第二定制路径,并在外存的扫描路径列表中添加第二定制路径;电子设备根据第二定制路径安装定制资源。需要说明的是,电子设备在安装定制资源的过程中,可以先存储第二定制路径,以便电子设备在卸载定制资源时,利用存储的第二定制路径,删除定制资源在电子设备外存中存储的相关信息。In some possible embodiments, the method for processing customized resources provided by the embodiments of the present application further includes: the electronic device obtains a second customized path corresponding to the customized resource disk; the electronic device mounts it in a preset directory according to the second customized path. Customized resource disk; the electronic device stores the second customized path and adds the second customized path in the scan path list of the external storage; the electronic device installs customized resources according to the second customized path. It should be noted that during the process of installing customized resources, the electronic device can first store the second customized path, so that when the electronic device uninstalls the customized resources, it can use the stored second customized path to delete the customized resources and store them in the external memory of the electronic device. related information.
在一些可能的实施例中,电子设备存储第二定制路径,并在外存的扫描路径列表中添加第二定制路径,包括:电子设备读取预设目录中的磁盘对应的挂载路径;电子设备获得预设目录中磁盘对应的第二定制路径后,存储第二定制路径;电子设备在外存的扫描路径列表中添加第二定制路径。In some possible embodiments, the electronic device stores the second customized path and adds the second customized path to the scan path list in the external storage, including: the electronic device reads the mount path corresponding to the disk in the preset directory; After obtaining the second customized path corresponding to the disk in the preset directory, the second customized path is stored; the electronic device adds the second customized path to the scan path list in the external storage.
在一些可能的实施例中,本申请实施例提供的定制资源的处理方法,还包括:电子设备获得定制资源对应的定制版本号;电子设备读取预设目录中的磁盘对应的挂载路径,包括:当定制版本号与电子设备中存储的历史版本号不一致时,将电子设备存储的历史版本号更新为定制版本号,并读取预设目录中的磁盘对应的挂载路径。In some possible embodiments, the method for processing customized resources provided by the embodiments of the present application also includes: the electronic device obtains the customized version number corresponding to the customized resource; the electronic device reads the mounting path corresponding to the disk in the preset directory, Including: when the customized version number is inconsistent with the historical version number stored in the electronic device, update the historical version number stored in the electronic device to the customized version number, and read the mounting path corresponding to the disk in the preset directory.
在一些可能的实施例中,本申请实施例提供的定制资源的处理方法,还包括:当定制版本号和电子设备存储的历史版本号一致时,电子设备结束对定制资源的处理。In some possible embodiments, the method for processing customized resources provided by embodiments of the present application further includes: when the customized version number is consistent with the historical version number stored by the electronic device, the electronic device ends processing the customized resource.
第二方面,本申请还提供了一种定制资源的处理装置,该装置包括:获得模块,用于电子设备获得第一定制路径,第一定制路径指示电子设备中的预设目录;第一卸载模块,用于根据第一定制路径卸载预设目录中的定制资源磁盘;定制资源磁盘包含定制资源,定制资源根据电子设备的用户的配置信息生成;添加模块,用于在外存的扫描路径列表中添加电子设备存储的第二定制路径,第二定制路径指示定制资源磁盘;第二卸载模块,用于根据第二定制路径卸载定制资源。In a second aspect, this application also provides a device for processing customized resources. The device includes: an acquisition module for the electronic device to obtain a first customized path, where the first customized path indicates a preset directory in the electronic device; a first uninstaller Module, used to uninstall the customized resource disk in the preset directory according to the first customized path; the customized resource disk contains customized resources, and the customized resources are generated according to the configuration information of the user of the electronic device; add a module, used to add a module to the scan path list of the external storage Add a second customized path stored in the electronic device, the second customized path indicates the customized resource disk; a second uninstall module is used to uninstall the customized resource according to the second customized path.
第三方面,本申请还提供了一种电子设备,设备包括处理器以及存储器:存储器用于存储计算机程序;处理器用于根据计算机程序执行上述的定制资源的处理方法。In a third aspect, this application also provides an electronic device, which includes a processor and a memory: the memory is used to store a computer program; and the processor is used to execute the above customized resource processing method according to the computer program.
第四方面,本申请还提供了一种计算机可读存储介质,计算机可读存储介质用于存储计算机程序,计算机程序用于执行上述的定制资源的处理方法。In a fourth aspect, this application also provides a computer-readable storage medium. The computer-readable storage medium is used to store a computer program. The computer program is used to execute the above-mentioned processing method of customized resources.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some implementations recorded in the present application. For example, those of ordinary skill in the art can also obtain other drawings based on these drawings.
图1为本申请实施例提供的一种电子设备的硬件示意图;Figure 1 is a hardware schematic diagram of an electronic device provided by an embodiment of the present application;
图2为本申请实施例提供的一种电子设备的框架示意图;Figure 2 is a schematic framework diagram of an electronic device provided by an embodiment of the present application;
图3为本申请实施例提供的一种定制资源的挂载方法的信令图;Figure 3 is a signaling diagram of a method for mounting customized resources provided by an embodiment of the present application;
图4为本申请实施例提供的一种定制资源的卸载方法的信令图;Figure 4 is a signaling diagram of a method for uninstalling customized resources provided by an embodiment of the present application;
图5为本申请实施例提供的一种电子设备的界面示意图;Figure 5 is a schematic interface diagram of an electronic device provided by an embodiment of the present application;
图6为本申请实施例提供的一种定制资源的处理方法的流程图;Figure 6 is a flow chart of a method for processing customized resources provided by an embodiment of the present application;
图7为本申请实施例提供的一种定制资源的处理装置的示意图。FIG. 7 is a schematic diagram of a customized resource processing device provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请说明书和权利要求书及附图说明中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于限定特定顺序。The terms “first”, “second”, “third”, etc. in the description, claims and drawings of this application are used to distinguish different objects, rather than to limit a specific order.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in the embodiments of the present application is not to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
电子设备的厂商可以根据用户的需求在电子设备中定制各种资源。例如企业用户可能需要电子设备的厂商根据企业的标识或其他的配置信息定制电子设备的开机动画、开机铃声或锁屏壁纸等媒体资源。用户在使用电子设备后,可能对电子设备上的定制资源存在更新的需求。相关技术中电子设备在接收后端服务器发送的卸载数据包后,仅对电子设备挂载的定制资源磁盘进行了卸载。由于电子设备上挂载的定制资源磁盘被卸载,电子设备在刷新时,不会对电子设备上存储的定制资源磁盘相关的信息进行更新,从而导致电子设备上依旧存储有定制资源磁盘的相关信息,导致电子设备显示或运行中存在错误,例如电子设备依旧显示定制资源对应的图标。因此,相关技术对电子设备的定制资源的处理方法无法实现对电子设备上定制资源的卸载,在定制资源无法卸载的情况下,被卸载不完全的定制资源也会影响新的定制资源的安装,因此相关技术也无法实现对定制资源的更新,用户的使用体验较低。Manufacturers of electronic equipment can customize various resources in electronic equipment according to user needs. For example, enterprise users may need electronic device manufacturers to customize media resources such as startup animations, startup ringtones, or lock screen wallpapers of electronic devices based on the enterprise's logo or other configuration information. After using the electronic device, the user may have updated needs for customized resources on the electronic device. In the related art, after receiving the uninstallation data packet sent by the back-end server, the electronic device only uninstalls the customized resource disk mounted on the electronic device. Since the customized resource disk mounted on the electronic device has been uninstalled, the information related to the customized resource disk stored on the electronic device will not be updated when the electronic device is refreshed, resulting in the information related to the customized resource disk still being stored on the electronic device. , causing errors in the display or operation of the electronic device. For example, the electronic device still displays the icon corresponding to the customized resource. Therefore, the processing method of the customized resources of the electronic device in the related technology cannot realize the uninstallation of the customized resources on the electronic device. When the customized resources cannot be uninstalled, the incompletely uninstalled customized resources will also affect the installation of new customized resources. Therefore, the related technology cannot update the customized resources, and the user experience is low.
为了解决上述的技术问题,本申请的技术方案提供了一种新的思路,本申请实施例中的电子设备在安装定制资源时,将保存定制资源对应的定制资源磁盘对应的定制磁盘路径,即第二定制路径。在电子设备卸载定制资源磁盘后,将电子设备保存的第二定制路径添加至电子设备外存的扫描路径列表中,如此,电子设备可以根据扫描路径列表中第二定制路径查询得到定制资源磁盘已被卸载,并对定制资源在外存中的信息进行更新,从而实现对定制资源的有效卸载。In order to solve the above technical problems, the technical solution of the present application provides a new idea. When the electronic device in the embodiment of the present application installs customized resources, it will save the customized disk path corresponding to the customized resource disk corresponding to the customized resource, that is, Second custom path. After the electronic device unloads the customized resource disk, the second customized path saved by the electronic device is added to the scan path list of the electronic device's external storage. In this way, the electronic device can query and obtain the customized resource disk according to the second customized path in the scan path list. be uninstalled, and the information in the external memory of the customized resources is updated to achieve effective uninstallation of the customized resources.
为了更好地理解本申请实施例提供案,先对本申请实施例提供的方案的应用场景进行介绍。本申请实施例所提供的方法应用于电子设备中,本申请实施例中的电子设备可以包括手机、平板电脑和笔记本等。In order to better understand the solutions provided by the embodiments of this application, the application scenarios of the solutions provided by the embodiments of this application are first introduced. The methods provided in the embodiments of the present application are applied to electronic devices. The electronic devices in the embodiments of the present application may include mobile phones, tablet computers, notebooks, etc.
如图1所示,电子设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。As shown in Figure 1, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142. Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, Display 194, and subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本实施例示意的结构并不构成对电子设备的具体限定。在另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, some components may be combined, some components may be separated, or components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
本申请实施例中的处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphicsprocessing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 in this embodiment of the present application may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, and a graphics processor (graphics processing unit, GPU). , image signal processor (ISP), controller, video codec, digital signal processor (DSP), etc. Among them, different processing units can be independent devices or integrated in one or more processors.
参见图2,该图为本申请实施例提供的一种电子设备的框架示意图。Refer to Figure 2, which is a schematic diagram of the frame of an electronic device provided by an embodiment of the present application.
电子设备的软件架构可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备的软件结构。The software architecture of electronic devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. The embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在本申请实施例中,如图2所示,Android的分层架构包括:应用程序层(Application)100,应用程序框架层(Framework)200、系统库300和内核层(HAL)400等等。The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In the embodiment of this application, as shown in Figure 2, the layered architecture of Android includes: application layer (Application) 100, application framework layer (Framework) 200, system library 300, kernel layer (HAL) 400, and so on.
应用程序层100可安装有多个应用程序,在本申请实施例中设计到的应用层程序主要为定制客户端101。定制客户端在电子设备接收到定制资源后,自动在电子设备上进行安装。定制客户端101在安装成功后,可以发起电子设备中媒体资源的更新服务。应用程序框架层200中可以包括MediaProvider(媒体资源扫描模块)201和偏好服务(property服务)模块202。MediaProvider201用于扫描电子设备的系统中系统分区和用户分区的多媒体文件信息。属性服务模块202用于存储电子设备挂载的定制资源磁盘对应的定制版本号。系统库300中可以包括表面管理器、三维图像处理库、二维图形引擎和媒体库等。内核层400中包括系统服务模块401。系统服务模块401主要用于挂载配置定制资源磁盘。The application layer 100 can be installed with multiple application programs. The application layer program designed in the embodiment of this application is mainly a customized client 101. After the electronic device receives the customized resources, the customized client is automatically installed on the electronic device. After successful installation, the customized client 101 can initiate an update service of media resources in the electronic device. The application framework layer 200 may include a MediaProvider (media resource scanning module) 201 and a preference service (property service) module 202. MediaProvider201 is used to scan the multimedia file information of the system partition and user partition in the system of electronic equipment. The attribute service module 202 is used to store the customized version number corresponding to the customized resource disk mounted on the electronic device. The system library 300 may include a surface manager, a three-dimensional image processing library, a two-dimensional graphics engine, a media library, etc. The kernel layer 400 includes a system service module 401. The system service module 401 is mainly used to mount and configure customized resource disks.
为了更好地理解本申请实施例提供的定制资源的处理方法,下面将结合附图分别对本申请实施例提供的定制资源的挂载方法和卸载方法进行具体介绍。In order to better understand the processing method of customized resources provided by the embodiments of the present application, the mounting method and the uninstalling method of the customized resources provided by the embodiments of the present application will be introduced in detail below with reference to the accompanying drawings.
参见图3,该图为本申请实施例提供的一种定制资源的挂载方法的信令图。Refer to Figure 3, which is a signaling diagram of a method for mounting customized resources provided by an embodiment of the present application.
如图3所示,本申请实施例提供的定制资源的挂载方法,包括:As shown in Figure 3, the method for mounting customized resources provided by the embodiment of this application includes:
S301:定制客户端101向系统服务模块401下发定制资源磁盘的挂载路径。S301: The customization client 101 delivers the mounting path of the customized resource disk to the system service module 401.
定制客户端101位于电子设备的应用层100。系统服务模块401位于电子设备的内核层400。需要说明的是,电子设备在接收到定制资源数据包后,将在电子设备上自动安装定制客户端101。然后定制客户端向系统服务模块401下发定制资源数据包中获得定制资源磁盘的挂载路径,即第二定制路径。系统服务模块401可以根据第二定制路径挂载定制资源磁盘。为了方便系统服务模块401进行挂载,定制客户端101在向系统服务模块401下发第二定制路径后,还会控制电子设备的系统进行重启,以便系统服务模块401挂载定制磁盘。The custom client 101 is located in the application layer 100 of the electronic device. The system service module 401 is located in the kernel layer 400 of the electronic device. It should be noted that after receiving the customized resource data package, the electronic device will automatically install the customized client 101 on the electronic device. Then the customization client sends the customization resource data package to the system service module 401 to obtain the mounting path of the customization resource disk, that is, the second customization path. The system service module 401 can mount the customized resource disk according to the second customized path. In order to facilitate the system service module 401 to mount, the customization client 101, after delivering the second customization path to the system service module 401, will also control the system of the electronic device to restart so that the system service module 401 can mount the customized disk.
S302:系统服务模块401挂载定制资源磁盘到预设目录。S302: The system service module 401 mounts the customized resource disk to the default directory.
需要说明的是,本申请实施例中的预设目录位于电子设备的系统区,电子设备的系统区可以位于电子设备的内存中。预设目录可以为技术人员在电子设备中预设的目录,预设目录在系统区的具体位置本申请实施例在此不做限定。系统服务模块401可以在电子设备的系统重启时,将定制资源磁盘挂载至预设目录。具体地,电子设备的系统重启可以为电子设备关机并进行重启,也可以为电子设备不进行关机,仅对系统进行重启,本申请实施例在此不做限定。It should be noted that the default directory in the embodiment of the present application is located in the system area of the electronic device, and the system area of the electronic device may be located in the memory of the electronic device. The preset directory may be a directory preset by technicians in the electronic device. The specific location of the preset directory in the system area is not limited in this embodiment of the present application. The system service module 401 can mount the customized resource disk to the default directory when the system of the electronic device is restarted. Specifically, the system restart of the electronic device may be to shut down the electronic device and restart it, or it may be to not shut down the electronic device and only restart the system, which is not limited in the embodiments of the present application.
S303:定制客户端101下发定制资源磁盘的定制版本号至属性服务模块202。S303: The customization client 101 delivers the customized version number of the customized resource disk to the attribute service module 202.
属性服务模块202位于电子设备的应用程序框架层200。作为一个示例,定制客户端101可以在电子设备的系统重启后,将定制资源磁盘的定制版本号发送至属性服务模块202。需要说明的是,不同的定制资源磁盘的定制版本号均不相同,当电子设备挂载或卸载定制资源磁盘时,定制客户端101下发的定制版本号均不相同。The attribute service module 202 is located in the application framework layer 200 of the electronic device. As an example, the customization client 101 can send the customized version number of the customized resource disk to the attribute service module 202 after the system of the electronic device is restarted. It should be noted that the customized version numbers of different customized resource disks are different. When the electronic device mounts or uninstalls the customized resource disk, the customized version numbers issued by the customized client 101 are different.
S304:属性服务模块202存储定制客户端101下发的定制版本号。S304: The attribute service module 202 stores the customized version number issued by the customized client 101.
需要说明的是,如果客户端101在本次下发定制版本号之前,下发过其他定制版本号,属性服务模块202将根据本次下发的定制版本号更新属性服务模块202中存储的定制版本号,即数据服务模块202可以根据新接收的定制版本号,更新其存储的定制版本号,因此属性服务模块202中存储的定制版本号为电子设备定制资源的最新版本对应的版本号。It should be noted that if the client 101 has issued other customized version numbers before issuing the customized version number this time, the attribute service module 202 will update the customized version stored in the attribute service module 202 according to the customized version number issued this time. Version number, that is, the data service module 202 can update its stored customized version number according to the newly received customized version number. Therefore, the customized version number stored in the attribute service module 202 is the version number corresponding to the latest version of the electronic device customized resource.
S305:MediaProvider201读取属性服务模块202中存储的定制版本号,和电子设备数据区中存储的历史版本号。S305: MediaProvider 201 reads the customized version number stored in the attribute service module 202 and the historical version number stored in the electronic device data area.
MediaProvider201位于电子设备的应用程序框架层200。当电子设备的系统重启时,MediaProvider201可以读取位于属性服务模块202中的定制版本号和电子设备的数据区中的历史版本号。需要说明的是,属性服务模块202中存储的定制版本号为定制客户端101下发的最新的定制版本号,即电子设备新挂载的定制资源磁盘对应的版本号。历史版本号为MediaProvider201在上次定制资源版本更新时,存储至电子设备的数据区中的历史版本号。作为一个示例,电子设备中用于存储历史版本号的数据区可以为sharePerference、Database或settingProvider。MediaProvider 201 is located in the application framework layer 200 of the electronic device. When the system of the electronic device is restarted, the MediaProvider 201 can read the customized version number located in the attribute service module 202 and the historical version number in the data area of the electronic device. It should be noted that the customized version number stored in the attribute service module 202 is the latest customized version number issued by the customized client 101, that is, the version number corresponding to the customized resource disk newly mounted on the electronic device. The historical version number is the historical version number stored in the data area of the electronic device when MediaProvider201 last updated the customized resource version. As an example, the data area used to store historical version numbers in the electronic device may be sharePerference, Database or settingProvider.
S306:当定制版本号和历史版本号不一致时,MediaProvider201查询挂载的定制磁盘路径。S306: When the customized version number is inconsistent with the historical version number, MediaProvider201 queries the mounted customized disk path.
当定制版本号和历史版本号一致时,说明电子设备的定制资源版本未更新,即电子设备未在此次系统重启时挂载或卸载定制资源磁盘,MediaProvider201可以直接结束此次进程。但当定制版本号与历史版本号不一致时,说明电子设备的定制资源版本已更新,即电子设备在此次系统重启时挂载或卸载了定制资源磁盘。此时MediaProvider201可以遍历所有可能的挂载定制资源磁盘的目录,当MediaProvider201在这些目录中查询得到了定制磁盘路径时,说明此次电子设备在此次系统重启时挂载了定制资源磁盘。在本申请实施例中定制磁盘路径即为定制资源磁盘对应的第二定制路径,MediaProvider201可以获得新增的定制资源磁盘的挂载路径。在实际的应用中,电子设备中的定制资源磁盘通常被挂载在预设目录下。因此MediaProvider201可以在预设目录中查询得到了磁盘时,MediaProvider201将该磁盘的路径确定为定制磁盘路径。When the customized version number is consistent with the historical version number, it means that the customized resource version of the electronic device has not been updated, that is, the electronic device has not mounted or unmounted the customized resource disk during this system restart, and MediaProvider201 can directly end this process. However, when the customized version number is inconsistent with the historical version number, it means that the customized resource version of the electronic device has been updated, that is, the electronic device has mounted or unmounted the customized resource disk during this system restart. At this time, MediaProvider201 can traverse all possible directories for mounting customized resource disks. When MediaProvider201 queries these directories and obtains the customized disk path, it means that the electronic device has mounted the customized resource disk when the system is restarted. In the embodiment of this application, the customized disk path is the second customized path corresponding to the customized resource disk, and MediaProvider 201 can obtain the mounting path of the newly added customized resource disk. In actual applications, customized resource disks in electronic devices are usually mounted in a preset directory. Therefore, when MediaProvider201 can query the preset directory and obtain a disk, MediaProvider201 determines the path of the disk as a customized disk path.
S307:MediaProvider201将定制版本号和定制磁盘路径存储至电子设备的数据区。S307: MediaProvider201 stores the customized version number and customized disk path to the data area of the electronic device.
MediaProvider201在查询到定制版本号和历史版本号不一致时后,还可以将定制版本号存储至电子设备的数据区,更新电子设备的数据区中的历史版本号。在电子设备的数据区中的历史版本号被更新后,电子设备系统重启时,MedaProvider201查询到电子设备的数据区中的历史版本号与属性服务模块202中的定制版本号一致,MediaProvider201将不再进行后续更新的流程,减少了电子设备在定制资源上的性能开销。直到当电子设备下一次更新定制资源版本时,属性服务模块202中的定制版本号被更新,此时MediaProvider201查询到电子设备的数据区中的历史版本号与属性服务模块202中的定制版本号不一致,MediaProvider201将重新进行后续的更新流程。After MediaProvider201 queries that the customized version number is inconsistent with the historical version number, it can also store the customized version number in the data area of the electronic device and update the historical version number in the data area of the electronic device. After the historical version number in the data area of the electronic device is updated, when the electronic device system restarts, MedaProvider201 queries that the historical version number in the data area of the electronic device is consistent with the customized version number in the attribute service module 202, and MediaProvider201 will no longer The process of subsequent updates reduces the performance overhead of electronic devices on customized resources. Until the next time the electronic device updates the customized resource version, the customized version number in the attribute service module 202 is updated. At this time, the MediaProvider 201 queries that the historical version number in the data area of the electronic device is inconsistent with the customized version number in the attribute service module 202 , MediaProvider201 will go through the subsequent update process again.
MediaProvider201还可以将定制磁盘路径存储电子设备的数据区。MediaProvider201可以将定制版本号和定制磁盘路径存储至相同的数据区,也可以将定制版本号和定制磁盘路径存储至不同的数据区,本申请实施例在此不做限定。需要说明的是,数据区中存储的定制磁盘路径用于卸载该定制资源磁盘,具体的方式在下述步骤S401至S409中进行阐述,本申请实施例在此不再赘述。MediaProvider201 can also store customized disk paths in the data area of electronic devices. MediaProvider 201 can store the customized version number and the customized disk path in the same data area, or it can store the customized version number and the customized disk path in different data areas. This is not limited in the embodiment of the present application. It should be noted that the customized disk path stored in the data area is used to uninstall the customized resource disk. The specific method is explained in the following steps S401 to S409, and the embodiments of the present application will not be repeated here.
S308:MediaProvider201在电子设备的用户区中的扫描路径列表中添加定制磁盘路径。S308: MediaProvider201 adds a customized disk path in the scan path list in the user area of the electronic device.
电子设备的用户区可以位于电子设备的外存中。MediaProvider201在电子设备中的扫描路径列表中添加定制磁盘路径后,电子设备根据扫描路径列表便可以查询到定制资源磁盘,对外存中定制资源磁盘的信息进行更新,实现了定制资源磁盘中定制资源的安装。需要说明的是,本申请实施例不限定步骤S307和步骤S308的先后顺序关系,电子设备可以先执行步骤S307,也可以先执行步骤S308,甚至可以同时执行步骤307和步骤S308,本申请实施例在此不做限定。The user area of the electronic device may be located in the external memory of the electronic device. After MediaProvider201 adds the customized disk path to the scan path list in the electronic device, the electronic device can query the customized resource disk according to the scan path list, update the information of the customized resource disk in the external memory, and realize the customization of the customized resource disk in the customized resource disk. Install. It should be noted that the embodiment of the present application does not limit the order of step S307 and step S308. The electronic device may perform step S307 first, or may perform step S308 first, or even perform step 307 and step S308 at the same time. The embodiment of the present application No limitation is made here.
S309:MediaProvider201刷新电子设备中的用户媒体数据库。S309: MediaProvider201 refreshes the user media database in the electronic device.
MediaProvider201刷新电子设备中的用户媒体数据库后,电子设备会根据扫描路径列表中的定制磁盘路径显示定制资源。电子设备便可以在用户媒体数据库中展示新挂载的定制资源磁盘对应的定制资源。作为一个示例,MediaProvider201可以刷新电子设备的相册,如此电子设备在相册中便可以展示新的定制资源,如锁屏壁纸等。After MediaProvider201 refreshes the user media database in the electronic device, the electronic device will display customized resources according to the customized disk path in the scan path list. The electronic device can then display the customized resources corresponding to the newly mounted customized resource disk in the user media database. As an example, MediaProvider201 can refresh the photo album of the electronic device, so that the electronic device can display new customized resources, such as lock screen wallpaper, etc. in the photo album.
上述实施例为定制资源的挂载方法的介绍,本申请实施例还提供了一种定制资源的卸载方法。The above embodiment is an introduction to the method of mounting customized resources. The embodiment of the present application also provides a method of uninstalling customized resources.
参见图4,该图为本申请实施例提供的一种定制资源的卸载方法的信令图。Refer to Figure 4, which is a signaling diagram of a customized resource offloading method provided by an embodiment of the present application.
如图4所示,本申请实施例提供的定制资源的卸载方法,包括:As shown in Figure 4, the method for uninstalling customized resources provided by the embodiment of the present application includes:
S401:定制客户端101向系统服务模块401下发第一定制路径。S401: The customization client 101 delivers the first customization path to the system service module 401.
定制客户端101位于电子设备的应用层100。系统服务模块401位于电子设备的内核层400。需要说明的是,第一定制路径为空资源对应的路径。第一定制路径可以指示电子设备中用于挂载定制资源磁盘的目录,例如本申请中的预设目录。具体地,电子设备在接收到定制资源数据包后,将在电子设备上自动安装定制客户端101。然后定制客户端向系统服务模块401下发定制资源数据包中空资源对应的第一定制路径,以便系统服务模块401根据第一定制路径卸载电子设备之前挂载在预设目录下的定制资源磁盘。为了方便系统服务模块401进行卸载,定制客户端101在向系统服务模块401下发第一定制路径后,还会控制电子设备的系统进行重启,以便系统服务模块401卸载定制资源磁盘。The custom client 101 is located in the application layer 100 of the electronic device. The system service module 401 is located in the kernel layer 400 of the electronic device. It should be noted that the first customized path is the path corresponding to the empty resource. The first customized path may indicate a directory in the electronic device used to mount the customized resource disk, such as the default directory in this application. Specifically, after receiving the customized resource data package, the electronic device will automatically install the customized client 101 on the electronic device. The customization client then delivers the first customization path corresponding to the empty resource in the customization resource data package to the system service module 401, so that the system service module 401 uninstalls the customization resource disk previously mounted in the default directory of the electronic device according to the first customization path. In order to facilitate the uninstallation of the system service module 401, after delivering the first customization path to the system service module 401, the customization client 101 will also control the system of the electronic device to restart so that the system service module 401 can uninstall the customized resource disk.
S402:系统服务模块401卸载预设目录中的定制资源磁盘。S402: The system service module 401 uninstalls the customized resource disk in the default directory.
系统服务模块401可以在电子设备的系统重启时,根据第一定制路径将预设目录中定制资源磁盘卸载。具体地,电子设备的系统重启可以为电子设备关机并进行重启,也可以为电子设备不进行关机,仅对系统进行重启,本申请实施例在此不做限定。需要说明的是,本申请实施例中的预设目录位于电子设备的系统区,电子设备的系统区可以位于电子设备的内存中。预设目录可以为技术人员在电子设备中预设的目录,预设目录在系统区的具体位置本申请实施例在此不做限定。The system service module 401 can uninstall the customized resource disk in the default directory according to the first customized path when the system of the electronic device is restarted. Specifically, the system restart of the electronic device may be to shut down the electronic device and restart it, or it may be to not shut down the electronic device and only restart the system, which is not limited in the embodiments of the present application. It should be noted that the default directory in the embodiment of the present application is located in the system area of the electronic device, and the system area of the electronic device may be located in the memory of the electronic device. The preset directory may be a directory preset by technicians in the electronic device. The specific location of the preset directory in the system area is not limited in this embodiment of the present application.
S403:定制客户端101下发第一定制路径对应的空资源版本号至属性服务模块202。S403: The customization client 101 delivers the empty resource version number corresponding to the first customization path to the attribute service module 202.
需要说明的是,本申请实施例中电子设备根据第一定制路径卸载定制资源磁盘,第一定制路径对应唯一且有效的空资源版本号。本申请实施例中的空资源版本号仅为第一定制路径对应的版本号的名称,不对版本号进行限制。步骤S403的具体实施方式与步骤S303类似,本申请实施例在此不再赘述。It should be noted that in the embodiment of the present application, the electronic device uninstalls the customized resource disk according to the first customized path, and the first customized path corresponds to a unique and valid empty resource version number. The empty resource version number in the embodiment of this application is only the name of the version number corresponding to the first customization path, and there is no restriction on the version number. The specific implementation of step S403 is similar to step S303, and will not be described again in the embodiment of this application.
S404:属性服务模块202存储定制客户端101下发的空资源版本号。S404: The attribute service module 202 stores the empty resource version number issued by the customized client 101.
S405:MediaProvider201读取属性服务模块202中存储的空资源版本号,和电子设备数据区中存储的历史版本号。S405: MediaProvider 201 reads the empty resource version number stored in the attribute service module 202 and the historical version number stored in the electronic device data area.
步骤S404的具体实施方式与步骤S304类似,步骤S405的具体实施方式与步骤S305类似,本申请实施例在此不再赘述。The specific implementation of step S404 is similar to step S304, and the specific implementation of step S405 is similar to step S305. The embodiments of this application will not be repeated here.
S406:当空资源版本号和历史版本号不一致时,MediaProvider201查询挂载的路径。S406: When the version number of the empty resource is inconsistent with the historical version number, MediaProvider201 queries the mounting path.
需要说明的是,在本申请实施例中定制资源磁盘已被卸载,预设目录下不存在挂载的磁盘。因此MediaProvider201此时无法在预设目录下查询到挂载的磁盘对应的路径。当空资源版本号和历史版本号一致时,说明电子设备的定制资源版本未更新,即电子设备未在此次系统重启时挂载或卸载定制资源磁盘,MediaProvider201可以直接结束此次进程。但当空资源版本号与历史版本号不一致时,说明电子设备的定制资源版本已更新,即电子设备在此次系统重启时挂载或卸载了定制资源磁盘。此时MediaProvider201可以遍历所有可能的定制挂载路径列表,当MediaProvider201无法查询得到挂载的定制磁盘路径时,说明电子设备在此次系统重启时可能未挂载定制资源磁盘,而是卸载了定制资源磁盘。It should be noted that in the embodiment of this application, the customized resource disk has been unmounted, and there is no mounted disk in the default directory. Therefore, MediaProvider201 cannot query the path corresponding to the mounted disk in the default directory at this time. When the empty resource version number is consistent with the historical version number, it means that the customized resource version of the electronic device has not been updated, that is, the electronic device has not mounted or unmounted the customized resource disk during this system restart, and MediaProvider201 can directly end the process. However, when the empty resource version number is inconsistent with the historical version number, it means that the customized resource version of the electronic device has been updated, that is, the electronic device has mounted or unmounted the customized resource disk during this system restart. At this time, MediaProvider201 can traverse the list of all possible customized mounting paths. When MediaProvider201 cannot query the mounted customized disk path, it means that the electronic device may not have mounted the customized resource disk during the system restart, but has uninstalled the customized resource. disk.
S407:当MediaProvider201查询挂载的定制资源磁盘的路径失败时,MediaProvider201获得电子设备的数据区中存储的第二定制路径。S407: When MediaProvider201 fails to query the path of the mounted customized resource disk, MediaProvider201 obtains the second customized path stored in the data area of the electronic device.
当MediaProvider201查询挂载的定制资源磁盘的路径失败时,MediaProvider201无法获得被卸载的定制资源磁盘的信息,因此无法对电子设备外存的扫描路径列表进行更新。因此在电子设备卸载定制资源时,电子设备已经在内存中卸载了定制资源磁盘,但未能对外存中的定制资源磁盘对应的信息进行更新,因此未能彻底卸载电子设备已安装的定制资源,可能会导致电子设备在用户媒体数据库中依然保留了相应的定制资源对应的信息。When MediaProvider201 fails to query the path of the mounted custom resource disk, MediaProvider201 cannot obtain the information of the unmounted custom resource disk, and therefore cannot update the scan path list of the electronic device's external memory. Therefore, when the electronic device uninstalls the customized resources, the electronic device has already uninstalled the customized resource disk in the memory, but failed to update the information corresponding to the customized resource disk in the external memory. Therefore, it failed to completely uninstall the customized resources installed by the electronic device. This may cause the electronic device to still retain information corresponding to the corresponding customized resources in the user media database.
为了避免上述的技术问题,本申请实施例在MediaProvider201查询挂载的定制磁盘路径失败时,为了更新电子设备外存中定制资源对应的信息,将获得电子设备的数据区中存储的第二定制路径。需要说明的是,由于本申请实施例中在挂载定制资源磁盘时,会在电子设备的数据区中存储被挂载的定制资源磁盘的定制磁盘路径,即第二定制路径。因此MediaProvider201可以在数据区中获得电子设备挂载的定制资源磁盘的第二定制路径。In order to avoid the above technical problems, in this embodiment of the present application, when MediaProvider 201 fails to query the mounted customized disk path, in order to update the information corresponding to the customized resources in the external memory of the electronic device, the second customized path stored in the data area of the electronic device will be obtained. . It should be noted that when mounting a customized resource disk in this embodiment of the present application, the customized disk path of the mounted customized resource disk, that is, the second customized path, will be stored in the data area of the electronic device. Therefore, MediaProvider201 can obtain the second customized path of the customized resource disk mounted by the electronic device in the data area.
在一些实施例中,电子设备的数据区中存储的数据出现异常丢失,此时MediaProvider201无法获得数据区中存储的定制磁盘路径,MediaProvider201可以直接结束此次更新进程。In some embodiments, the data stored in the data area of the electronic device is abnormally lost. At this time, Media Provider 201 cannot obtain the customized disk path stored in the data area, and Media Provider 201 can directly end the update process.
S408:MediaProvider201在扫描路径列表中添加定制磁盘路径。S408: MediaProvider201 adds a custom disk path to the scan path list.
电子设备的用户区可以位于电子设备的外存中。MediaProvider201在电子设备中的扫描路径列表中添加定制磁盘路径后,电子设备根据扫描路径列表便可以查询到定制资源磁盘已被卸载,如此可以对外存中定制资源磁盘中定制资源对应的信息进行更新,实现了定制资源磁盘中定制资源的卸载。The user area of the electronic device may be located in the external memory of the electronic device. After MediaProvider201 adds the customized disk path to the scan path list in the electronic device, the electronic device can query based on the scan path list that the customized resource disk has been uninstalled, so that the information corresponding to the customized resource in the customized resource disk in the external memory can be updated. Implemented the uninstallation of customized resources in customized resource disks.
S409:MediaProvider201将定制版本号存储至电子设备的数据区。S409: MediaProvider201 stores the customized version number in the data area of the electronic device.
MediaProvider201在查询到定制版本号和历史版本号不一致时后,还可以将定制版本号存储至电子设备的数据区,更新电子设备的数据区中的历史版本号。在电子设备的数据区中的历史版本号被更新后,电子设备系统重启时,MediaProvider201查询到电子设备的数据区中的历史版本号与属性服务模块202中的定制版本号一致,MediaProvider201将不再进行后续更流程,减少了电子设备在定制资源上的性能开销。需要说明的是,电子设备可以先执行步骤S409,也可以先执行步骤S407和步骤S408,本申请实施例在此不做限定。After MediaProvider201 queries that the customized version number is inconsistent with the historical version number, it can also store the customized version number in the data area of the electronic device and update the historical version number in the data area of the electronic device. After the historical version number in the data area of the electronic device is updated, when the electronic device system restarts, MediaProvider201 queries that the historical version number in the data area of the electronic device is consistent with the customized version number in the attribute service module 202, and MediaProvider201 will no longer The subsequent update process reduces the performance overhead of electronic devices on customized resources. It should be noted that the electronic device may first perform step S409, or may first perform step S407 and step S408. The embodiment of the present application is not limited here.
S410:MediaProvider201刷新电子设备中的用户媒体数据库。S410: MediaProvider201 refreshes the user media database in the electronic device.
MediaProvider201刷新电子设备中的用户媒体数据库后,电子设备会根据扫描路径列表中的定制磁盘路径指示的定制资源磁盘显示定制资源。电子设备根据扫描路径列表中的定制磁盘路径确定定制资源磁盘已被卸载时,便可以在用户媒体数据库中删除新挂载的定制资源磁盘对应的定制资源。作为一个示例,MediaProvider201可以刷新电子设备的相册,如此电子设备在相册中便可以不再显示被删除的定制资源,如锁屏壁纸等。After MediaProvider201 refreshes the user media database in the electronic device, the electronic device will display the customized resource according to the customized resource disk indicated by the customized disk path in the scan path list. When the electronic device determines that the customized resource disk has been unmounted based on the customized disk path in the scan path list, it can delete the customized resource corresponding to the newly mounted customized resource disk in the user media database. As an example, MediaProvider201 can refresh the photo album of the electronic device, so that the electronic device can no longer display deleted customized resources, such as lock screen wallpaper, etc. in the photo album.
在实际的应用中,当电子设备接收到定制资源数据包后,将在电子设备上自动安装定制客户端101,此时电子设备显示如图5中的(a)所示的界面。当电子设备检测到用户点击界面中的定制客户端(定制)APP时,电子设备显示如图5中的(b)所示的界面。然后电子设备检测到用户点击界面中的“定制配置生效”按键时,电子设备显示如图5中的(c)所示的界面,提醒用户定制资源生效的过程中需要重启系统,并引导用户重启系统。当电子设备检测到用户点击“是”按键时,电子设备重启系统并执行上述的S301-S309的步骤或S401-S410的步骤。当上述的步骤执行完成后,电子设备将自动删除定制客户端(定制)APP,电子设备显示如图5中的(d)所示的界面。In actual applications, after the electronic device receives the customized resource data package, the customized client 101 will be automatically installed on the electronic device. At this time, the electronic device displays the interface shown in (a) in Figure 5 . When the electronic device detects that the user clicks on the customized client (customized) APP in the interface, the electronic device displays an interface as shown in (b) in Figure 5 . Then when the electronic device detects that the user clicks the "Customized configuration takes effect" button on the interface, the electronic device displays the interface shown in (c) in Figure 5, reminding the user that the system needs to be restarted during the process of customizing the resource to take effect, and guiding the user to restart. system. When the electronic device detects that the user clicks the "Yes" button, the electronic device restarts the system and executes the above-mentioned steps S301-S309 or steps S401-S410. When the above steps are completed, the electronic device will automatically delete the customized client (customized) APP, and the electronic device will display the interface shown in (d) in Figure 5.
参见图6,该图为本申请实施例提供的一种定制资源的处理方法的流程图。Refer to Figure 6, which is a flow chart of a custom resource processing method provided by an embodiment of the present application.
如图6所示,本申请实施例提供的定制资源的处理方法,包括:As shown in Figure 6, the method for processing customized resources provided by the embodiment of this application includes:
S601:电子设备获得第一定制路径,第一定制路径指示电子设备中的预设目录。S601: The electronic device obtains a first customized path, and the first customized path indicates a preset directory in the electronic device.
电子设备对于的后端系统在接收到用户的定制请求后,将根据用户的定制请求定制相应的定制资源数据包,然后将该定制资源数据包下发至该电子设备。具体地,电子设备在接收到定制资源数据包后,电子设备将根据该定制资源数据包获得第一定制路径。第一定制路径指示电子设备中的的预设目录,而且第一定制路径对应空资源。因此电子设备可以根据第一定制路径,将预设目录中的磁盘进行卸载。After receiving the user's customization request, the back-end system of the electronic device will customize the corresponding customized resource data package according to the user's customization request, and then deliver the customized resource data package to the electronic device. Specifically, after the electronic device receives the customized resource data package, the electronic device will obtain the first customized path based on the customized resource data package. The first customized path indicates a default directory in the electronic device, and the first customized path corresponds to an empty resource. Therefore, the electronic device can uninstall the disk in the preset directory according to the first customized path.
S602:电子设备根据第一定制路径卸载预设目录中的定制资源磁盘;定制资源磁盘包含定制资源,定制资源根据电子设备的用户的配置信息生成。S602: The electronic device uninstalls the customized resource disk in the preset directory according to the first customized path; the customized resource disk contains customized resources, and the customized resources are generated according to the configuration information of the user of the electronic device.
电子设备根据接收到的定制资源数据包获得定制资源磁盘。步骤S602的具体实施方式可以参考步骤S401和步骤S402。在电子设备卸载定制资源磁盘后,电子设备还可以存储第一定制路径对应的空资源版本号,具体的实施方式可以参考步骤S403和步骤S404,本申请实施例在此不再赘述。The electronic device obtains the customized resource disk according to the received customized resource data package. For the specific implementation of step S602, reference may be made to step S401 and step S402. After the electronic device unloads the customized resource disk, the electronic device can also store the empty resource version number corresponding to the first customized path. For specific implementation methods, refer to step S403 and step S404, which will not be described again in the embodiment of the present application.
S603:电子设备在外存的扫描路径列表中添加电子设备存储的第二定制路径,第二定制路径指示定制资源磁盘。S603: The electronic device adds the second customized path stored by the electronic device to the scan path list of the external storage, and the second customized path indicates the customized resource disk.
本申请实施例中的第二定制路径为电子设备预先存储的路径,具体地可以为电子设备在安装定制资源的过程中存储的。电子设备安装定制资源的过程具体可以参考步骤S301至步骤S309。电子设备读取存储的第二定制路径的具体过可以参考步骤S407和S408所示。电子设备在扫描路径列表中添加第二定制路径的前,电子设备还可以根据空资源版本号和电子设备存储的历史版本号来判断电子设备的定制资源版本是否存在更新。如果电子设备的定制资源版本未更新,即电子设备未挂载或卸载定制资源磁盘,电子设备便可以终止此次进程,如此可以避免在电子设备的定制资源版本未更新时,浪费电子设备过多的性能开销。检测电子设备的定制资源版本的具体方式可以如步骤S405、S406和S409所示,本申请实施在此不再赘述。The second customized path in the embodiment of the present application is a path pre-stored by the electronic device. Specifically, it may be stored by the electronic device during the process of installing customized resources. For details, please refer to steps S301 to S309 for the process of installing customized resources on the electronic device. The specific process of the electronic device reading the stored second customized path may refer to steps S407 and S408. Before the electronic device adds the second customized path to the scan path list, the electronic device can also determine whether there is an update to the customized resource version of the electronic device based on the empty resource version number and the historical version number stored by the electronic device. If the customized resource version of the electronic device has not been updated, that is, the electronic device has not mounted or unmounted the customized resource disk, the electronic device can terminate the process. This can avoid excessive waste of electronic equipment when the customized resource version of the electronic device has not been updated. performance overhead. The specific method of detecting the customized resource version of the electronic device can be as shown in steps S405, S406 and S409, which will not be described again in the implementation of this application.
S604:电子设备根据第二定制路径卸载定制资源。S604: The electronic device uninstalls the customized resources according to the second customized path.
电子设备会根据扫描路径列表中的定制磁盘路径指示的定制资源磁盘显示定制资源。电子设备根据扫描路径列表中的定制磁盘路径确定定制资源磁盘已被卸载时,便可以在用户媒体数据库中删除新挂载的定制资源磁盘对应的定制资源,具体地的实施方式可以参考步骤S410所示,本申请实施在此不再赘述。The electronic device displays custom resources based on the custom resource disk indicated by the custom disk path in the scan path list. When the electronic device determines that the customized resource disk has been uninstalled based on the customized disk path in the scan path list, it can delete the customized resources corresponding to the newly mounted customized resource disk in the user media database. For specific implementation methods, please refer to step S410. The implementation of this application will not be repeated here.
综上所述,本申请实施例中的电子设备在安装定制资源时,将保存定制资源对应的定制资源磁盘对应的定制磁盘路径,即第二定制路径。在电子设备卸载定制资源磁盘后,将电子设备保存的第二定制路径添加至电子设备外存的扫描路径列表中,如此,电子设备可以根据扫描路径列表中第二定制路径查询得到定制资源磁盘已被卸载,并对定制资源在外存中的信息进行更新,从而实现对定制资源的有效卸载。To sum up, when the electronic device in the embodiment of the present application installs customized resources, it will save the customized disk path corresponding to the customized resource disk corresponding to the customized resource, that is, the second customized path. After the electronic device unloads the customized resource disk, the second customized path saved by the electronic device is added to the scan path list of the electronic device's external storage. In this way, the electronic device can query and obtain the customized resource disk according to the second customized path in the scan path list. be uninstalled, and the information in the external memory of the customized resources is updated to achieve effective uninstallation of the customized resources.
根据上述实施例提供的定制资源的处理方法,本申请实施例还提供了一种定制资源的处理装置。According to the method for processing customized resources provided in the above embodiments, embodiments of the present application also provide a device for processing customized resources.
参见图7,该图为本申请实施例提供的一种定制资源的处理装置的示意图。Refer to Figure 7, which is a schematic diagram of a customized resource processing device provided by an embodiment of the present application.
如图7所示,本申请实施例提供的定制资源的处理装置,包括:As shown in Figure 7, the customized resource processing device provided by the embodiment of the present application includes:
获得模块701,用于电子设备获得第一定制路径,第一定制路径指示电子设备中的预设目录;Obtaining module 701 is used for the electronic device to obtain a first customized path, where the first customized path indicates a preset directory in the electronic device;
第一卸载模块702,用于根据第一定制路径卸载预设目录中的定制资源磁盘;定制资源磁盘包含定制资源,定制资源根据电子设备的用户的配置信息生成;The first uninstall module 702 is used to uninstall the customized resource disk in the preset directory according to the first customized path; the customized resource disk contains customized resources, and the customized resources are generated according to the configuration information of the user of the electronic device;
添加模块703,用于在外存的扫描路径列表中添加电子设备存储的第二定制路径,第二定制路径指示定制资源磁盘;Adding module 703, configured to add a second customized path stored in the electronic device to the scan path list in external storage, where the second customized path indicates a customized resource disk;
第二卸载模块704,用于根据第二定制路径卸载定制资源。The second uninstall module 704 is used to uninstall customized resources according to the second customized path.
由此可知,本申请实施例中的电子设备在安装定制资源时,将保存定制资源对应的定制资源磁盘对应的定制磁盘路径,即第二定制路径。在电子设备卸载定制资源磁盘后,将电子设备保存的第二定制路径添加至电子设备外存的扫描路径列表中,如此,电子设备可以根据扫描路径列表中第二定制路径查询得到定制资源磁盘已被卸载,并对定制资源在外存中的信息进行更新,从而实现对定制资源的有效卸载。It can be seen from this that when the electronic device in the embodiment of the present application installs customized resources, it will save the customized disk path corresponding to the customized resource disk corresponding to the customized resource, that is, the second customized path. After the electronic device unloads the customized resource disk, the second customized path saved by the electronic device is added to the scan path list of the electronic device's external storage. In this way, the electronic device can query and obtain the customized resource disk according to the second customized path in the scan path list. be uninstalled, and the information in the external memory of the customized resources is updated to achieve effective uninstallation of the customized resources.
根据上述的定制资源的处理方法和定制资源的处理装置,本申请实施例还提供了一种电子设备,该设备包括处理器以及存储器:存储器用于存储计算机程序;处理器用于根据计算机程序执行上述的定制资源的处理方法。According to the above-mentioned customized resource processing method and customized resource processing device, embodiments of the present application also provide an electronic device, which includes a processor and a memory: the memory is used to store the computer program; the processor is used to execute the above-mentioned method according to the computer program. How to handle customized resources.
根据上述的定制资源的处理方法和定制资源的处理装置,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质用于存储计算机程序,计算机程序用于执行上述的定制资源的处理方法。According to the above-mentioned customized resource processing method and customized resource processing device, embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium is used to store a computer program. The computer program is used to execute the above-mentioned customized resources. processing method.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the above description of the embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated as needed. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working processes of the systems, devices and units described above, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be described again here.
在本实施例所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this embodiment, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be The combination can either be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of this embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. . Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211213786.6A CN116737257B (en) | 2022-09-30 | 2022-09-30 | Customized resource processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211213786.6A CN116737257B (en) | 2022-09-30 | 2022-09-30 | Customized resource processing method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN116737257A true CN116737257A (en) | 2023-09-12 |
| CN116737257B CN116737257B (en) | 2024-07-05 |
Family
ID=87915699
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211213786.6A Active CN116737257B (en) | 2022-09-30 | 2022-09-30 | Customized resource processing method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116737257B (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107479868A (en) * | 2017-06-23 | 2017-12-15 | 阿里巴巴集团控股有限公司 | An interface loading method, device and equipment |
| CN109189342A (en) * | 2018-08-30 | 2019-01-11 | 郑州云海信息技术有限公司 | A kind of disk hanging method, device, equipment and storage medium |
| CN113010223A (en) * | 2021-02-24 | 2021-06-22 | 福州汇思博信息技术有限公司 | Android system-based uninstalled resource customization method and terminal |
| CN113727333A (en) * | 2021-07-31 | 2021-11-30 | 荣耀终端有限公司 | Downloading method and system of customized application |
| CN114417335A (en) * | 2022-01-19 | 2022-04-29 | 杭州安恒信息技术股份有限公司 | A malicious file detection method, device, electronic device and storage medium |
-
2022
- 2022-09-30 CN CN202211213786.6A patent/CN116737257B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107479868A (en) * | 2017-06-23 | 2017-12-15 | 阿里巴巴集团控股有限公司 | An interface loading method, device and equipment |
| CN109189342A (en) * | 2018-08-30 | 2019-01-11 | 郑州云海信息技术有限公司 | A kind of disk hanging method, device, equipment and storage medium |
| CN113010223A (en) * | 2021-02-24 | 2021-06-22 | 福州汇思博信息技术有限公司 | Android system-based uninstalled resource customization method and terminal |
| CN113727333A (en) * | 2021-07-31 | 2021-11-30 | 荣耀终端有限公司 | Downloading method and system of customized application |
| CN114417335A (en) * | 2022-01-19 | 2022-04-29 | 杭州安恒信息技术股份有限公司 | A malicious file detection method, device, electronic device and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116737257B (en) | 2024-07-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3716656B1 (en) | Profile generation method, profile acquisition method, and related device and storage medium | |
| CN102521031B (en) | Management method of mobile terminal preset application program and mobile terminal | |
| CN101636720A (en) | Terminal having application update managing function, and application update managing program and system | |
| CN102945182B (en) | App update method and device | |
| CN110569130A (en) | A method, apparatus and device for cross-process communication | |
| EP3399408B1 (en) | Information processing apparatus and computer readable storage medium | |
| CN102981880B (en) | A kind of method and apparatus realizing the renewal of application program | |
| WO2021022729A1 (en) | Root permission assignment method and apparatus, storage medium, and terminal device | |
| CN108595113A (en) | A kind of method and terminal of subregion adjustment | |
| CN111694585A (en) | Method, system, terminal and storage medium for replacing system partition file | |
| WO2019071609A1 (en) | Method and terminal device for loading application and upgrading application | |
| CN110764825B (en) | Starting method and terminal equipment | |
| CN105740027A (en) | Application program updating method and device | |
| CN114443081A (en) | Terminal upgrading method and terminal | |
| CN114096946A (en) | Method and apparatus for managing applications | |
| CN109117153B (en) | Application processing method, device, terminal and storage medium | |
| KR20190098516A (en) | Method for managing data related to application and electronic device thereof | |
| US20220334820A1 (en) | System and method for intermediate software upgrades for information handling systems | |
| CN108021372A (en) | The management method and device of a kind of application program | |
| CN118132204A (en) | A container management method, device, equipment and medium | |
| CN106933636A (en) | Start method, device and the terminal device of plug-in services | |
| WO2012065464A1 (en) | Software installation method and device | |
| CN115357295B (en) | System rollback method, device and storage medium | |
| CN113094064A (en) | Gateway software module upgrading method, device, equipment and storage medium | |
| WO2021057411A1 (en) | Component loading method, device, and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
| CP03 | Change of name, title or address |