Application resource processing method and related equipment

By obtaining and storing target resources from the preset storage area after the application is opened, the problem of excessive APK capacity is solved, push and development costs are reduced, and resource reading efficiency and data security are improved.

CN117707563BActive Publication Date: 2024-09-03HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310750105.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-09-03
Estimated Expiration
2043-06-21

AI Technical Summary

Technical Problem

As application versions are iteratively updated, the APK capacity increases, causing push application updates to consume a lot of time and traffic, resulting in higher push costs, and higher development time and development costs.

Method used

By determining whether the application data includes the target resource after the application is opened, if not, it is obtained from the preset storage area and stored in the application data, thereby reducing the capacity of the APK and reducing push and development costs.

Benefits of technology

It reduces the traffic of application providers pushing application APKs, reduces user download time and development costs, and at the same time improves the reading efficiency and data security of target resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707563B
    Figure CN117707563B
Patent Text Reader

Abstract

The embodiment of the present application provides an application resource processing method and related equipment, the method comprising: after the application is opened, determining whether the application data of the application includes the target resource; if the application data does not include the target resource, determining whether the preset storage area of ​​the electronic device stores the target resource; if the preset storage area stores the target resource, obtaining the target resource from the preset storage area, and storing the target resource in the application data. The embodiment of the present application can store the resources used by the application in the preset storage area, without obtaining the resources from the application, effectively reducing the capacity of the application APK to be pushed, and also reducing the push traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application management technology, and in particular to an application resource processing method and related equipment. Background Art

[0002] To meet users' ever-changing needs, eliminate glitches, and enrich application functionality, application developers continually update their applications. However, as application versions are iterated, the size of the application's APK (Android Application package) increases. An application package typically includes the application's functional code and resources. Each time an application provider updates the application's functional code or resources, they need to package the entire package and push the new version of the application. If the APK size is large, pushing application updates consumes a significant amount of time and data, resulting in higher push costs. Furthermore, the application development time and costs are also high. Summary of the Invention

[0003] In view of the above, it is necessary to provide an application resource processing method and related equipment to solve the problem of high application development costs and high costs of pushing application updates due to excessive APK capacity.

[0004] In a first aspect, the present application provides an application resource processing method, which is applied to an electronic device, and the method includes: after the application is opened, determining whether the application data of the application includes a target resource; if the application data does not include the target resource, determining whether a preset storage area of ​​the electronic device stores the target resource; if the preset storage area stores the target resource, obtaining the target resource from the preset storage area and storing the target resource in the application data.

[0005] Applications usually obtain resources from application data for use. Based on the above implementation method, when the application data does not include the target resources, the target resources are obtained from the preset storage area and stored in the application data. In this way, the target resources do not need to be included in the application APK, which reduces the capacity of the APK, thereby reducing the traffic consumed by the application provider to push the application APK, and reducing the traffic time for users to download the application. At the same time, when the APK capacity is reduced, the development time and development cost of the application are also reduced.

[0006] In a possible implementation, the method further includes: if the application data includes the target resource, or after the target resource is stored in the application data, obtaining the target resource from the application data, and performing a corresponding operation on the target resource.

[0007] Based on the above implementation, after the target resource is stored in the application, the target resource in the application data can be easily read for playback or display without having to read the target resource from the application APK.

[0008] In one possible implementation, the method further includes: determining whether the target resource in the application data is configured to be hidden; if the target resource in the application data is not configured to be hidden, obtaining the target resource from the application data and performing corresponding operations on the target resource; or if the target resource in the application data is configured to be hidden, setting the target resource to be invisible.

[0009] Based on the above implementation, whether to hide the target resource can be determined according to the hiding configuration of the target resource, so that the target resource can be hidden when it is not needed to be displayed, thereby ensuring data security.

[0010] In one possible implementation, determining whether the application data of the application includes the target resource includes: initializing an index of the target resource, scanning the application data according to the index of the target resource, and determining whether the application data includes data corresponding to the data type of the target resource; if the application data is scanned to include data corresponding to the data type of the target resource, determining that the application data includes the target resource; or if the application data is not scanned to include data corresponding to the data type of the target resource, determining that the application data does not include the target resource.

[0011] Based on the above implementation, it is possible to accurately determine whether the application data includes the target resource.

[0012] In one possible implementation, determining whether the preset storage area of ​​the electronic device stores the target resource includes: determining whether the preset storage area includes data corresponding to the data type of the target resource; if the preset storage area includes data corresponding to the data type of the target resource, determining that the preset storage area stores the target resource; or if the preset storage area does not include data corresponding to the data type of the target resource, determining that the preset storage area does not store the target resource.

[0013] Based on the above implementation, the preset storage area is scanned to determine whether the target resource is stored according to the data type of the target resource, thereby effectively improving the scanning efficiency and scanning accuracy.

[0014] In a possible implementation, the data types of the target resources include video, audio, image, motion effect, frame animation, and component.

[0015] Based on the above implementation method, large-capacity data such as video, audio, image, motion effect, frame animation and components are used as target resources and stored in a storage area outside the application APK, effectively reducing the capacity of the application APK.

[0016] In one possible implementation, obtaining the target resource from the preset storage area and storing the target resource in the application data includes: updating the target resource index so that the target resource index points to the storage path of the target resource in the preset storage area; obtaining the target resource from the storage path of the target resource in the preset storage area, and storing the target resource in the application data according to the storage path of the target resource in the application data.

[0017] Based on the above implementation, the target resource index can be set to determine the storage path of the target resource, thereby improving the reading efficiency of the target resource.

[0018] In a possible implementation, the preset storage area includes a storage area where the application APK and version components are located.

[0019] Based on the above implementation method, when the target resources are stored in the version component, the target resources can be downloaded to the electronic device together with the system update, which effectively reduces the capacity of the application APK and facilitates the application to read the target resources. At the same time, the target resources in the application APK can be retained when necessary, so that when the version component is not updated and no cloud-pushed resources are received, the target resources can be obtained from the updated application APK.

[0020] In a possible implementation, the method further includes: responding to an update instruction of the target resource, obtaining an updated target resource, and replacing the original target resource in the application data with the updated target resource.

[0021] Based on the above implementation, when the electronic device generates an update instruction for a target resource, the target resource in the application data can be updated, thereby ensuring the real-time performance of the target resource.

[0022] In a possible implementation, the method further includes: generating the update instruction for the target resource when the application APK is updated, the version component is updated, or the target resource pushed by the cloud server is received.

[0023] Based on the above implementation method, the target resources can be updated when the application APK or version component is updated or when the target resources pushed by the cloud are received, effectively ensuring the real-time performance of the target resources.

[0024] In one possible implementation, when the application APK is updated and an update instruction for the target resource is generated, the response to the update instruction for the target resource obtains the updated target resource and replaces the original target resource in the application data with the updated target resource, including: updating the target resource index, obtaining the updated target resource from the application APK; deleting the original target resource; copying the updated target resource to the application data; marking the target resource in the application APK as having been copied; updating the target resource index, and obtaining the target resource from the application data.

[0025] Based on the above implementation, when the application APK itself is updated, the original target resources in the application data are replaced with the target resources in the updated application APK, which effectively improves the update efficiency of the target resources and ensures the real-time performance of the target resources.

[0026] In one possible implementation, when the version component is updated and generates an update instruction for the target resource, the response to the update instruction for the target resource obtains the updated target resource and replaces the original target resource in the application data with the updated target resource, including: updating the target resource index, obtaining the updated target resource from the version component; deleting the original target resource; copying the updated target resource to the application data; updating the target resource index, and obtaining the target resource from the application data.

[0027] Based on the above implementation method, when the version component is updated, the version component is obtained from the updated system data, and the updated target resource is obtained from the version component, so that the target resource does not need to be updated by the application APK, effectively reducing the capacity of the application APK.

[0028] In one possible implementation, when a target resource pushed by a cloud server is received and an update instruction for the target resource is generated, the update instruction for the target resource is responded to, the updated target resource is obtained, and the original target resource in the application data is replaced with the updated target resource, including: parsing the data pushed by the cloud server to obtain an updated target resource; storing the updated target resource in the application data and marking the updated target resource; determining whether the updated target resource is valid; if the updated target resource is valid, deleting the original target resource; and deleting the mark of the updated target resource.

[0029] Based on the above implementation method, the updated target resources can be pushed by cloud push, which reduces the data capacity of the push. In the process of cloud pushing target resources, the validity of the cloud push data is also detected to ensure that the cloud pushed target resources can be played and displayed normally.

[0030] In one possible implementation, the response to the update instruction of the target resource, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource also includes: if the updated target resource is invalid, deleting the updated target resource and exiting the target resource update; and sending feedback information to the cloud server.

[0031] Based on the above implementation method, when the target resource pushed by the cloud is invalid, the original target resource can be retained, thereby ensuring the normal playback or display of the target resource.

[0032] In one possible implementation, determining whether the updated target resource is valid includes: determining whether the capacity and format of each data item in the updated target resource are correct; if the capacity and format of each data item in the updated target resource are correct, determining that the updated target resource is valid; or if the capacity and format of any data item in the updated target resource are incorrect, determining that the updated target resource is invalid. Based on the above implementation, the validity of the cloud push target resource can be accurately determined.

[0033] In a second aspect, the present application provides an electronic device comprising a memory and a processor: wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device executes the above-mentioned application resource processing method.

[0034] In a third aspect, the present application provides a chip coupled to a memory in an electronic device, wherein the chip is used to control the electronic device to execute the above-mentioned application resource processing method.

[0035] In a fourth aspect, the present application provides a computer storage medium storing program instructions. When the program instructions are executed on an electronic device, the electronic device executes the above-mentioned application resource processing method.

[0036] In addition, the technical effects brought about by the second to fourth aspects can be found in the descriptions of the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a schematic diagram of the data composition of the application APK provided in one embodiment of the present application.

[0038] Figure 2 This is a software architecture diagram of an electronic device provided in one embodiment of the present application.

[0039] Figure 3 This is a schematic diagram of the architecture of an application resource processing system provided in one embodiment of the present application.

[0040] Figure 4 This is a flowchart of an application resource processing method provided by an embodiment of the present application.

[0041] Figure 5 This is a flowchart of an application resource processing method provided by another embodiment of the present application.

[0042] Figure 6 This is a flowchart of replacing an original target resource with an updated target resource provided by an embodiment of the present application.

[0043] Figure 7 This is a flowchart of replacing the original target resource with the updated target resource provided by another embodiment of the present application.

[0044] Figure 8 This is a flowchart of replacing an original target resource with an updated target resource provided by an embodiment of the present application.

[0045] Figure 9 This is a flowchart of an application resource processing method provided by another embodiment of the present application.

[0046] Figure 10 This is a flowchart of an application resource processing method provided by another embodiment of the present application.

[0047] Figure 11 This is another data composition diagram of the application APK provided in one embodiment of the present application.

[0048] Figure 12 This is a hardware architecture diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0049] The terms "first" and "second" involved in the embodiments of the present application are for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can mean A or B. "And / or" in this application is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c, a, b and c. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0051] For detailed implementation of the application resource processing method, please refer to the description in each embodiment below.

[0052] In order to better understand the application resource processing method provided in the embodiment of the present application, Figure 1 The application scenarios of the application resource processing method provided in the embodiments of the present application are described.

[0053] With the development of terminal technology, the development of applications used in terminals is also accelerating. Application developers usually continue to update the application version to meet the ever-changing needs of users, eliminate faults or enrich application functions. However, with the iterative update of application versions, the capacity of application APK is also getting larger and larger. Application APK usually includes the function code and resources of the application. Therefore, every time the application provider updates the function code or resources of the application, it needs to package the function code and resources as a whole and push and release the new version of the application. If the APK capacity is large, pushing the application update will take a lot of time and traffic, resulting in high push costs. At the same time, from the user's perspective, downloading the application also takes a lot of time and traffic, which affects the user experience. In addition, when the APK capacity is large, the development time and cost of the application are also high.

[0054] For example, when terminal manufacturers display terminal products such as smartphones and personal computers in stores, they can effectively attract users through in-store demonstrations. As a window to showcase the store's capabilities, it not only attracts users but also carries the responsibility of promoting the brand and enhancing the store's competitiveness. During the in-store demonstration, users are shown pictures and videos of the terminal product's selling points through experience apps, thereby showcasing the product's key selling points in the store and attracting users to purchase the product.

[0055] The prefabricated selling point resources (such as videos, pictures, audio, etc.) of the experience application of the terminal product are usually packaged together with the function code as APK and published in the application store, and then downloaded and used through the terminal products in the store. Since the capacity of the video, picture, audio and other data in the selling point resources is large, the APK capacity of the experience application is also large. In addition, after the terminal product is released, there is often a need to replace the selling point resources. In this way, the developer of the experience application needs to continuously update the selling point resources, and modify, publish and push the APK of the experience application. In addition, the development iteration cycle and delivery cycle of the experience application are long. When updating the selling point resources, it is necessary to fully replace and push the application APK through cloud push (for example, cloud push). Partial resource updates are not supported. When the application APK capacity is large, pushing the application APK requires a lot of traffic and time, resulting in a high push cost for the application.

[0056] See Figure 1 The figure shows a data composition diagram of the application APK provided by one embodiment of the present application. Taking the experience application mentioned in the above embodiment as an example, the basic function code and application resources (such as entry animation, component (widget) / selling point video, first frame and last frame / frame animation, price tag resources, etc.) of the experience application are packaged in the application APK. For example, the overall capacity of the APK is 1.2G, of which the capacity of the basic function code is 60M and the capacity of the application resources is 1168.8M. Therefore, the application resources account for most of the capacity of the experience application APK. When running the experience application APK for animation demonstration, the frame animation resources are obtained according to the internal path of the APK. When the frame animation resources need to be updated, the frame animation resources corresponding to the internal path of the APK are replaced, and then packaged and archived. The 1.2G capacity APK is pushed to the terminal product as a whole through cloud push. In this way, pushing the experience application requires a lot of traffic and time, resulting in high push costs, and the development time and cost of the application are also high.

[0057] In order to reduce the capacity of the application APK, lower the push cost of the application, shorten the development and delivery cycle of the application, and improve the delivery quality, the embodiment of the present application provides an application resource processing method, which separates the application APK from the application resources, so that the function development of the application and the resource prefabrication are separated and carried out independently, which does not affect the subsequent resource replacement and can also support the update of only part of the resources when the application is pushed in the cloud without the need for full replacement. Separating the function development of the application from the resource prefabrication can also reduce the dependency between function development and resource prefabrication, reducing the difficulty of application development. When the capacity of the application APK is reduced, the development time and cost of the application can also be reduced.

[0058] See Figure 2 , which is a software architecture diagram of an electronic device provided in an embodiment of the present application. A layered architecture divides software into several layers, each with clear roles and division of labor. Layers communicate with each other through software interfaces. For example, the Android system is divided into four layers: application layer 101, framework layer 102, Android runtime and system library 103, hardware abstraction layer 104, kernel layer 105, and hardware layer 106.

[0059] The application layer 101 may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, device control service, etc.

[0060] The framework layer 102 provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, content provider, view system, telephony manager, resource manager, notification manager, etc.

[0061] The window manager manages window programs. It can obtain the display size, determine whether a status bar exists, lock the screen, and take screenshots. The content provider stores and retrieves data and makes it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those for displaying text and images. The view system can be used to build applications. The display interface can consist of one or more views. For example, a display interface containing a text notification icon can include a view for displaying text and a view for displaying images. The call manager provides communication functions for electronic devices, such as managing call status (including connected and ended calls). The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager enables applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the notification manager is used to notify download completions and message reminders. The notification manager can also be a notification that appears in the system's top status bar in the form of an icon or scrolling text bar, such as a notification from an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message may be displayed in the status bar, a notification sound may be emitted, an electronic device may vibrate, an indicator light may flash, etc.

[0062] The Android Runtime consists of a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core library consists of two parts: one for the Java language's callable functions and the other for the Android core library.

[0063] The application layer 101 and the framework layer 102 run in a virtual machine. The virtual machine executes the Java files in the application layer and the framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0064] The system library 103 may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), and the like.

[0065] The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library supports a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D drawing.

[0066] The hardware abstraction layer 104 runs in the user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer.

[0067] The kernel layer 105 is a layer between hardware and software and includes at least a display driver, a camera driver, an audio driver, and a sensor driver.

[0068] The kernel layer 105 is the core of the electronic device's operating system. It is the first layer of software expansion based on the hardware, providing the most basic operating system functions and the foundation of the operating system. It is responsible for managing the system's processes, memory, device drivers, files, and network systems, and determines the system's performance and stability. For example, the kernel can determine the time an application can operate on a certain piece of hardware.

[0069] The kernel layer 105 includes programs closely related to the hardware, such as interrupt handlers and device drivers. It also includes basic, common, and high-frequency modules, such as the clock management module and the process scheduling module, as well as key data structures. The kernel layer can be set in the processor or stored in internal memory.

[0070] The hardware layer 106 includes the hardware of the electronic device, such as a display screen, buttons, a camera, etc.

[0071] See Figure 3 As shown, it is a schematic diagram of the architecture of the application resource processing system provided by one embodiment of the present application. The application resource processing system 10 includes an electronic device 100, a server 200 and a network 300, and the electronic device 100 and the server 200 are communicatively connected via the network 300. The electronic device 100 is an intelligent terminal device installed with at least one application, such as a smart phone, a personal computer, a smart wearable device, a smart home device, etc. The server 200 can be a server operated by a service provider, providing business services for the application. The server 200 can be a single server, a cloud server or a server cluster. The network 300 can be the Internet, a local area network, Wi-Fi, etc.

[0072] See Figure 4 FIG. 1 is a flow chart of an application resource processing method provided in an embodiment of the present application. The method is applied in an electronic device and includes:

[0073] S101: After the application is started, determine whether the application data of the application includes the target resource. If the application data of the application includes the target resource, execute S104. If the application data of the application does not include the target resource, execute S102.

[0074] In one embodiment of the present application, the data types of the target resources may include video, audio, image, motion effect, frame animation, and widget. For example, when the electronic device is a terminal product used for store demonstration, the video may be a selling point video of the terminal product, the audio may be music, the image may be a price tag of the terminal product, the motion effect may be the entrance motion effect of the application when it is opened, the frame animation may be an animation for the introduction of the terminal product, and the widget may be a miniature application view embedded in other applications (such as a display screen) and receiving periodic updates.

[0075] In one embodiment of the present application, application data is data generated during the operation of an application or data generated by a user, and is stored in the application data storage area of ​​the application. Application data may include application settings, configuration files, archive files, temporary files, user files, resource files, etc.

[0076] In one embodiment of the present application, after the application is started, the application begins to load resources, scans the application data, and determines whether the application data includes data corresponding to the data type of the target resource, that is, determines whether the application data includes video, audio, image, motion effect, frame animation or component. If the application data is scanned to include data corresponding to the data type of the target resource, that is, the application data includes video, audio, image, motion effect, frame animation or component, it is determined that the application data includes the target resource. If the application data is not scanned to include data corresponding to the data type of the target resource, it is determined that the application data does not include the target resource.

[0077] In one embodiment of the present application, after the application is started, the index of the target resource is initialized. The initialized target resource index is the index of the application data, which points to the storage path of the target resource in the application data storage area. For example, the storage path of the target resource pointed to by the index of the application data in the application data storage area is " / data / data / package name / ", and the package name is the name of the application. Among them, the index is a data structure used to quickly locate and access stored data. For example, the index includes a set of key-value pairs, the key of which is the identifier of the target resource, and the value is the storage path of the target resource. The application scans the application data according to the storage path of the target resource in the application data storage area to determine whether the application data includes data corresponding to the data type of the target resource.

[0078] S102: Determine whether the preset storage area of ​​the electronic device stores the target resource. If the preset storage area of ​​the electronic device stores the target resource, execute S103; if the preset storage area of ​​the electronic device does not store the target resource, execute S101.

[0079] In one embodiment of the present application, the preset storage area may include at least two areas, namely an area for storing an application APK and an area for a version component. The application APK is an installation package file of the application and may include the application's function code, resource files, configuration files and other necessary components. The application APK is installed on an electronic device, and the application can be run on the electronic device by running the APK. The application APK is usually published on an application store or on the website of the application developer and downloaded and installed by the user, thereby deploying the application on the electronic device. The version component may include the system version data and prefabricated resources of the electronic device. The system version data may include the version code, version name and version number. The prefabricated resources may include video, audio, image, motion effect, frame animation, components, etc. pre-stored in the version component.

[0080] In one embodiment of the present application, when the application data does not include the target resource, the application scans the preset storage area where the application APK and version components are located to determine whether the application APK and version components include data corresponding to the data type of the target resource, that is, to determine whether the application APK and version components include video, audio, image, motion effect, frame animation or component. If the scan shows that the application APK or version component includes data corresponding to the data type of the target resource, that is, it is determined that the application APK or version component includes video, audio, image, motion effect or frame animation, it is determined that the preset storage area stores the target resource. If, after scanning, it is confirmed that the application APK and version component do not include data corresponding to the data type of the target resource, it is determined that the preset storage area does not store the target resource.

[0081] S103: Acquire target resources from a preset storage area and store the target resources in application data.

[0082] In one embodiment of the present application, when the scanned application data does not include a target resource, but the target resource is stored in a preset storage area, the target resource index is updated so that the target resource index points to the storage path of the target resource in the preset storage area. Therefore, the target resource index points to the storage path of the target resource, and the storage path of the target resource can be determined based on the index, and the target resource can be obtained from the storage path of the target resource.

[0083] In one embodiment of the present application, since the preset storage area includes the storage area where the application APK and the version component are located, the index of the target resource includes the index of the application APK and the index of the version component. The index of the application APK points to the storage path of the target resource in the storage area where the application APK is located, and the index of the version component points to the storage path of the target resource in the storage area where the version component is located.

[0084] For example, the storage path of the target resource pointed to by the index of the application APK in the storage area where the application APK is located is " / data / app / package name.apk", and the package name is the name of the application. When the target resource is scanned and stored in the application APK, the target resource is obtained from the application APK according to the storage path of the target resource in the storage area where the application APK is located, and the obtained target resource is copied to the storage area corresponding to the application data, thereby storing the target resource in the application data.

[0085] For another example, the storage path of the target resource pointed to by the index of the version component in the storage area where the version component is located is " / system / framework / version / ". When it is scanned that the target resource is stored in the version component, the target resource is obtained from the version component according to the storage path of the target resource in the storage area where the version component is located, and the obtained target resource is copied to the storage area corresponding to the application data, so that the target resource is stored in the application data.

[0086] In one embodiment of the present application, when the target resource is stored in the storage area where the application APK is located, the target resource is obtained from the application APK; when the target resource is stored in the storage area where the version component is located, the target resource is obtained from the version component; when the target resource is stored in both the storage area where the application APK is located and the storage area where the version component is located, the target resource is obtained from the application APK first. The embodiment of the present application does not limit this. In other embodiments, the target resource can also be obtained from the version component first.

[0087] S104: Acquire target resources from application data, and perform corresponding operations on the target resources.

[0088] In one embodiment of the present application, if the application scans that the application data includes a target resource, the target resource is obtained in the application data storage area according to the storage path of the target resource pointed to by the index of the target resource, and a corresponding operation is performed on the target resource.

[0089] In one embodiment of the present application, if the application scans and finds that the target resource is not included in the application data, and after storing the target resource stored in the preset storage area into the application data, the index of the target resource is updated so that the index of the target resource points to the storage path of the target resource in the application data storage area, the target resource is obtained from the storage path of the target resource in the application data storage area, and the corresponding operation is performed on the target resource.

[0090] In one embodiment of the present application, performing a corresponding operation on a target resource includes performing an operation corresponding to the data type of the target resource. If the target resource includes a video, upon receiving a user operation, the video can be played and displayed on the display screen in response to the user operation. If the target resource includes audio, upon receiving a user operation, the audio playback interface can be displayed on the display screen in response to the user operation, and the audio can be played through a speaker. If the target resource includes an image, upon receiving a user operation, the image can be displayed on the display screen in response to the user operation. If the target resource includes motion effects, the motion effects can be displayed on the application interface when the application is opened. If the target resource includes frame animation, upon receiving a user operation, the frame animation can be played and displayed on the display screen in response to the user operation. If the target resource includes a component, the component can be added to the desktop interface of the electronic device.

[0091] In one embodiment of the present application, the target resources can be displayed in the form of a list on the application interface according to the data type of the target resources. For example, the data of each data type can be arranged in the order of video, audio, image, motion effect, frame animation, and component. Then, in response to the user's operation on part of the data in the target resource (for example, double-clicking, etc.), the part of the data is displayed on the application interface, that is, displayed on the display screen. For example, the part of the data may include video, audio, image, and frame animation.

[0092] Applications usually obtain resources from application data for use. According to the above embodiment, when the application data does not include the target resources, the target resources are obtained from the preset storage area and stored in the application data. In this way, the target resources do not need to be included in the application APK, which reduces the capacity of the APK and thus reduces the traffic consumed by the application provider to push the application APK, reducing the traffic time for users to download the application. At the same time, when the APK capacity is reduced, the development time and development cost of the application are also reduced.

[0093] See Figure 5 FIG. 1 is a flow chart of an application resource processing method provided by another embodiment of the present application. The method is applied to an electronic device and includes:

[0094] S201: After the application is started, determine whether the application data of the application includes the target resource. If the application data of the application includes the target resource, execute S204. If the application data of the application does not include the target resource, execute S202.

[0095] S202: Determine whether the preset storage area of ​​the electronic device stores the target resource. If the preset storage area of ​​the electronic device stores the target resource, execute S203; if the preset storage area of ​​the electronic device does not store the target resource, execute S201.

[0096] S203: Acquire target resources from a preset storage area and store the target resources in application data.

[0097] S204: Acquire target resources from the application data, and perform corresponding operations on the target resources.

[0098] S205 , responding to the target resource update instruction, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource.

[0099] In one embodiment of the present application, when an application APK is updated, an update instruction for a target resource is generated. For example, an application provider can update the application APK in the cloud, i.e., release a new version of the application APK on an app store. The electronic device can then check the app store for updates at a first predetermined interval (e.g., one day). If an update is detected, the updated application APK can be downloaded. After the application APK is downloaded and updated, an update instruction for the target resource is generated. Alternatively, the updated application APK can be downloaded from the app store in response to a user's manual download operation. For another example, if the electronic device is a terminal product displayed in a store, the store typically provides a QR code. The electronic device can scan the QR code to download an updated trial application APK. After scanning the preset QR code, the electronic device obtains a download link for the application APK, downloads the application APK according to the download link, and generates an update instruction for the target resource after the application APK is downloaded and updated. For another example, a user can transfer the updated application APK from another device to the electronic device via Bluetooth, Wi-Fi, or USB cable to replace the original application APK. After the original application APK is replaced with the updated application APK, an update instruction for the target resource is generated.

[0100] In one embodiment of the present application, when the application APK is updated and an update instruction for a target resource is generated, the detailed process of responding to the update instruction for the target resource, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource is as follows: Figure 6 As shown, specifically including:

[0101] S301, updating the target resource index, and obtaining the updated target resource from the application APK.

[0102] In one embodiment of the present application, before updating a target resource in the application data of an application, the target resource index points to the storage path of the target resource in the application data, so that the application can read the target resource from the application data and perform a preset operation. When the application APK is updated, the target resource in the application data needs to be updated. Therefore, by updating the target resource index, the target resource index points to the storage path of the target resource in the application APK, and the target resource is obtained from the storage path of the target resource in the application APK.

[0103] S302: Delete the original target resource.

[0104] In one embodiment of the present application, in order to avoid redundancy of target resources in application data and excessive memory usage when updating target resources, the original target resources are deleted from the application data.

[0105] S303: Copy the updated target resource to the application data.

[0106] In one embodiment of the present application, the updated target resource is copied to the application data according to the storage path pointed to by the updated target resource index.

[0107] S304: Mark that the target resource in the application APK has been copied.

[0108] In one embodiment of the present application, the application APK includes a first configuration file for indicating whether the target resource is stored. The first configuration file includes a field, which is a Boolean value (true / false). When the application APK is updated and the target resource is stored, the field of the first configuration file is true. After the target resource in the application APK is copied to the application data, the target resource in the application APK is deleted, and the field in the first configuration file is modified to false, thereby marking that the target resource in the application APK has been copied.

[0109] S305: Update the target resource index and obtain the target resource from the application data.

[0110] In one embodiment of the present application, after the target resource in the application data is updated, the target resource index is updated so that the updated target resource index points to the storage path of the target resource in the application data, so that the application can read the updated target resource from the application data and play or display it.

[0111] In one embodiment of the present application, when the system version is updated, an update instruction for the target resource is generated. For example, the manufacturer of the electronic device can push updated system data to the electronic device, and the updated system data includes updated operating system files and updated version components, and the updated version components include updated version numbers and prefabricated resources. Among them, the manufacturer of the electronic device can archive the updated target resources in the prefabricated resources of the version component by means of CCM archiving (Component Control Model Archive Resources). The electronic device can detect whether the system data is updated at intervals of a second preset time (for example, thirty minutes). If the system data is updated, the updated system data can be downloaded. After the system data is downloaded and updated, the version component is obtained, and the version number in the version component is compared with the version number obtained last time. If the version number in the version component is different from the version number obtained last time, it is determined that the version number has changed, and an update instruction for the target resource is generated.

[0112] In one embodiment of the present application, when the system version is updated, that is, the version component is updated and an update instruction for the target resource is generated, the update instruction for the target resource is responded to, the updated target resource is obtained, and the original target resource in the application data is replaced with the updated target resource. The detailed process is as follows: Figure 7 As shown, specifically including:

[0113] S401, update the target resource index, and obtain the updated target resource from the version component.

[0114] In one embodiment of the present application, before updating a target resource in the application's application data, the target resource index points to the storage path of the target resource in the application data, so that the application can read the target resource from the application data and perform corresponding operations. When the version number in the version component is updated, the target resource in the application data needs to be updated. Therefore, by updating the target resource index, the target resource index points to the storage path of the target resource in the version component, and the target resource is obtained from the storage path of the target resource in the version component.

[0115] S402: Delete the original target resource.

[0116] In one embodiment of the present application, in order to avoid redundancy of target resources in application data and excessive memory usage when updating target resources, the original target resources are deleted from the application data.

[0117] S403: Copy the updated target resource to the application data.

[0118] In one embodiment of the present application, the updated target resource is copied to the application data according to the storage path pointed to by the updated target resource index.

[0119] S404: Update the target resource index and obtain the target resource from the application data.

[0120] In one embodiment of the present application, after the target resource in the application data is updated, the target resource index is updated so that the updated target resource index points to the storage path of the target resource in the application data, so that the application can read the updated target resource from the application data and play or display it.

[0121] In another embodiment of the present application, after deleting the original target resource, there is no need to copy the updated target resource to the application data, nor is there a need to update the target resource index again. The application can directly obtain the target resource according to the storage path pointed to by the index of the target resource in the version component.

[0122] In one embodiment of the present application, upon receiving a target resource pushed by the cloud, an update instruction for the target resource is generated. For example, the developer of the application can upload the updated target resource to the cloud server (e.g. Figure 3 The server 200 in the embodiment of the present invention configures the parameters of the cloud push target resource, which may include the target device, push content and push time, etc. The cloud server may send the notification of the updated resource to the electronic device that has installed the application corresponding to the updated resource through the push notification mechanism. After the electronic device receives the notification of the updated resource, it establishes a communication connection with the cloud server and receives the updated target resource transmitted by the cloud server. After the electronic device completes receiving the updated target resource, it generates an update instruction for the target resource.

[0123] In one embodiment of the present application, a cloud server for pushing target resources creates a directory under the external storage path " / sdcard / path" of the electronic device, pushes the updated target resources to the / sdcard / path for storage, and in order to reduce the capacity of cloud-pushed data, the updated target resources pushed by the cloud are pushed to the electronic device in the form of a compressed package. The electronic device obtains the compressed package of the updated target resource from the / sdcard / path, decompresses it, and copies the target resource to the application data, so that the target resource can be obtained from the application data and corresponding operations can be performed on the target resource.

[0124] In one embodiment of the present application, when receiving the target resource pushed by the cloud server and generating the target resource update instruction, responding to the target resource update instruction, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource, the detailed process is as follows: Figure 8As shown, specifically including:

[0125] S501: parse the data pushed by the cloud server to obtain updated target resources.

[0126] In one embodiment of the present application, in order to reduce the capacity of the pushed data, the cloud can compress the updated target resource into a compressed file. Therefore, the electronic device downloads the compressed file of the updated target resource from the cloud, parses and decompresses the compressed file, and obtains the updated target resource.

[0127] S502: Store the updated target resource in the application data and mark the updated target resource.

[0128] In one embodiment of the present application, the updated target resource is stored in the application data according to the storage path of the target resource pointed to by the index of the target resource, and "tmp" is added to the name of each data in the updated target resource. The location of adding "tmp" can be before or at the end of the name, thereby temporarily marking the updated target resource.

[0129] In one embodiment of the present application, the updated target resource is contained in a folder. The updated target resource can be temporarily marked by adding "tmp" to the name of the folder. In other embodiments, the updated target resource can also be temporarily marked by adding "tmp" to the name of each data in the target resource. Each data in the target resource is a file, such as a video, a sound, an image, etc.

[0130] S503: Determine whether the updated target resource is valid. If the updated target resource is valid, execute S504; if the updated target resource is invalid, execute S506.

[0131] In one embodiment of the present application, the validity of the updated target resource is determined by determining whether the capacity and format of each data in the updated target resource are correct. If the capacity and format of each data in the updated target resource are correct, the updated target resource is determined to be valid; if the capacity or format of any data in the updated target resource is incorrect, the updated target resource is determined to be invalid.

[0132] For example, for image data, it is determined whether the format of the image data is a specified image format, and whether the capacity of the image data is 0 or a first preset capacity. The specified image format may be JPG, BMP, PNG, GIF, etc. If the format of the image data is the specified image format and the capacity of the image data is not 0 or the first preset capacity, the capacity and format of the image data are determined to be correct. If the format of the image data is not the specified image format, or the capacity of the image data is 0 or the first preset capacity, the capacity and format of the image data are determined to be incorrect. For example, the first preset capacity is 5KB.

[0133] For example, for video data, it is determined whether the format of the video data is a specified video format, and whether the capacity of the video data is 0 or a second preset capacity. The specified video format may be MP4, AVI, FLV, MOV, etc. If the format of the video data is the specified video format and the capacity of the video data is not 0 or the second preset capacity, the capacity and format of the video data are determined to be correct. If the format of the video data is not the specified image format and the capacity of the video data is 0 or the second preset capacity, the capacity and format of the video data are determined to be incorrect. For example, the second preset capacity is 1MB.

[0134] The embodiments of the present application do not limit the method for determining whether the image data and video data are valid. The method for determining whether the image data and video data are valid can be set to other methods according to needs, as long as the validity of the image data and video data can be determined.

[0135] S504: Delete the original target resource.

[0136] In one embodiment of the present application, in order to avoid redundancy of target resources in application data and excessive memory usage when updating target resources, the original target resources are deleted from the application data.

[0137] S505: Delete the mark of the updated target resource.

[0138] In one embodiment of the present application, the "tmp" in the name of each data in the updated target resource is deleted, thereby removing the temporary mark of the updated target resource. After the updated target resource is valid and the original target resource has been deleted, the mark of the updated target resource is deleted, thereby completing the update of the target resource. The target resource can then be read from the application data normally for playback and display.

[0139] S506: Delete the updated target resource.

[0140] In one embodiment of the present application, if any data in the updated target resource is invalid, all data with the name tmp in the application data is deleted to delete the updated target resource.

[0141] S507, exit target resource update.

[0142] In one embodiment of the present application, the electronic device exits the target resource update by stopping the target resource update operation. When the updated target resource is invalid, the updated target resource can be identified in the application data based on the temporary mark, and the updated target resource is deleted. The target resource update is then exited, thereby retaining the original target resource and ensuring that the application can normally read the original target resource and perform corresponding operations.

[0143] See Figure 9 FIG. 1 is a flow chart of an application resource processing method provided by another embodiment of the present application. The method is applied to an electronic device and includes:

[0144] S601: After the application is started, determine whether the application data of the application includes the target resource. If the application data of the application includes the target resource, execute S604. If the application data of the application does not include the target resource, execute S602.

[0145] S602: Determine whether the preset storage area of ​​the electronic device stores the target resource. If the preset storage area of ​​the electronic device stores the target resource, execute S603; if the preset storage area of ​​the electronic device does not store the target resource, the process returns to S601.

[0146] S603: Acquire target resources from a preset storage area and store the target resources in application data.

[0147] S604: Determine whether the target resource is configured to be hidden. If the target resource is not configured to be hidden, execute S605; if the target resource is configured to be hidden, execute S607.

[0148] In one embodiment of the present application, when storing a target resource in an application before the terminal product is released, the target resource can be configured to be hidden to avoid information leakage of the terminal product. In this way, even if the target resource is stored in the application, the target resource will not be displayed on the application interface. After the terminal product is released, the target resource can be configured to be not hidden so that the target resource can be displayed normally on the application interface. Alternatively, the permission to enable the application to play or display the target resource is managed by an administrator. If the terminal product is not operated by the administrator, the target resource can be configured to be hidden. If the terminal product is operated by the administrator, the target resource can be configured to be not hidden.

[0149] In one embodiment of the present application, the target resource further includes a second configuration file for indicating whether to hide. The second configuration file includes a field, which is a Boolean value (true / false). If the field in the second configuration file is true, it indicates that the target resource is configured to be hidden. If the field in the second configuration file is false, it indicates that the target resource is not configured to be hidden. The second configuration file in the target resource is obtained, and it is determined whether the field in the second configuration file is true or false. If the field in the second configuration file is true, it is determined that the target resource is configured to be hidden; if the field in the second configuration file is false, it is determined that the target resource is not configured to be hidden.

[0150] S605: Acquire target resources from the application data, and perform corresponding operations on the target resources.

[0151] S606 , responding to the target resource update instruction, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource.

[0152] S607: Set the target resource to be invisible.

[0153] In one embodiment of the present application, the target resource can be set to invisible by changing its properties, for example, by modifying the file name of the target resource and adding a period (.) before the file name, thereby setting the target resource to invisible. In another embodiment of the present application, the target resource can also be set to invisible by a third-party file management application.

[0154] The specific implementations of S601-S603 and S605-S606 are the same as those of S201-S205 and are not described in detail here.

[0155] See Figure 10 FIG2 is a flowchart of an application resource processing method provided by another embodiment of the present application. The method is applied to an electronic device and is described by taking an application as an experience application in a terminal product for display in a store as an example. The application resource processing method includes:

[0156] S701: Launch the experience application APK and load resources. S702: Scan the version components and application data. S703: Initialize the resource index. S704: Determine whether the application data contains resources and whether the resources are hidden. S705: If the application data contains resources and they are not hidden, display the selling points. S706: If the application data does not contain resources, or if the application data contains resources but they are hidden, hide the resources. S707: Determine whether the APK and application data store resources. S708: If the APK does not store resources but the application data does, use the experience application normally. S709: If the APK does store resources but the application data does not, update the experience application APK via cloud update, store QR code scanning, or APK package replacement. S710: Update the resource index, prioritizing resources from the APK. S711: Delete the original resources. S712: Mark the resources in the APK as copied. S713: Update the resource index, prioritizing resources from the application data. S714, determine whether the resources in the version component have been updated. If the resources in the version component have not been updated, execute S704. S715, if the resources in the version component have been updated, update the resource index and obtain the resources from the version component. S716, delete the original resources. S717, the cloud server obtains the resources. S718, the cloud server performs cloud push processing on the updated resources. S719, parse the updated resources. S720, decompress the updated resources to the application data, and add a temporary mark to the updated resources. S721, determine whether the updated resources are valid. S722, if the updated resources are valid, delete the original resources. S723, delete the temporary mark of the updated resources, and then execute S725. S724, if the updated resources are invalid, delete the updated resources. S725, exit resource update. S726, send feedback information to the cloud to prompt that the currently pushed selling point resources are invalid. S727, use the application normally.

[0157] See Figure 11 As shown, it is another data composition diagram of the application APK provided by one embodiment of the present application. In one application scenario of the embodiment of the present application, the version component prefabricates resources and directly copies the resources to the data (application data) of the internal path of the application for playback and updates the status. In another application scenario, apkM (application package management server) pushes resources from the cloud, decompresses the resources to the data (application data) of the internal path of the application, and marks them as tmp (temporary), plays the resources and updates the status, and the status is updated resources. In another application scenario, resources are stored in advance inside the APK, and the version is not updated, and there is no cloud push action. The resources are copied from the APK resource path to the data of the internal path of the application for playback and update the status.

[0158] The present application also provides an electronic device 100. Figure 12 As shown, the electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.

[0159] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope 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, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0160] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0161] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0162] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0163] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0164] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an Inter-integrated Circuit (I2C) interface, an Inter-integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface.

[0165] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, allowing the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0166] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0167] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0168] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0169] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the Camera Serial Interface (CSI) and the Display Serial Interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0170] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0171] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices 100, such as AR devices.

[0172] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0173] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141.

[0174] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0175] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0176] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0177] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0178] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0179] The wireless communication module 160 can provide wireless communication solutions including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate 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 for radiation through the antenna 2.

[0180] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a Global Positioning System (GPS), a Global Navigation Satellite System (GLONASS), a Beidou Navigation Satellite System (BDS), a Quasi-Zenith Satellite System (QZSS) and / or a Satellite Based Augmentation System (SBAS).

[0181] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor that processes application resources and connects display screen 194 and the application processor. The GPU is 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 modify display information.

[0182] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (FLED), mini-LED, micro-LED, micro-OLED, quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0183] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0184] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0185] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0186] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0187] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0188] The NPU is a neural network (NN) computing processor that rapidly processes input information and continuously self-learns by drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain. The NPU enables intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0189] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0190] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.

[0191] Non-volatile memory may include disk storage devices and flash memory.

[0192] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; it can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage specification; it can be divided into universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

[0193] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0194] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0195] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.

[0196] The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the screen display detection method executed on the electronic device 100 in the above embodiment can be implemented to realize the screen display detection function of the electronic device 100.

[0197] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0198] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0199] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0200] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0201] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0202] The headphone jack 170D is used to connect a wired headphone and 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.

[0203] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0204] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0205] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0206] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100. An embodiment of the present application further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on the electronic device 100, the electronic device 100 executes the above-mentioned related method steps to implement the application resource processing method in the above-mentioned embodiment.

[0207] An embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the application resource processing method in the above-mentioned embodiment.

[0208] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory to enable the chip to execute the application resource processing method in the above-mentioned method embodiments.

[0209] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0210] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0211] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0212] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0213] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0214] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical 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, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0215] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. An application resource processing method, applied to electronic equipment, It is characterized in that The method comprises: After the application is started, determining whether the application data of the application includes the target resource; If the application data does not include the target resource, determining whether a preset storage area of ​​the electronic device stores the target resource; If the target resource is stored in the preset storage area, the target resource is obtained from the preset storage area and stored in the application data, including: updating the target resource index so that the target resource index points to the storage path of the target resource in the preset storage area; obtaining the target resource from the storage path of the target resource in the preset storage area, and storing the target resource in the application data according to the storage path of the target resource in the application data.

2. The application resource processing method according to claim 1, It is characterized in that The method further comprises: If the application data includes the target resource, or after the target resource is stored in the application data, the target resource is obtained from the application data, and a corresponding operation is performed on the target resource.

3. The application resource processing method according to claim 1, It is characterized in that The method further comprises: Determining whether the target resource in the application data is configured to be hidden; If the target resource in the application data is not configured to be hidden, obtaining the target resource from the application data, and performing a corresponding operation on the target resource; or If the target resource in the application data is configured to be hidden, the target resource is set to be invisible.

4. The application resource processing method according to claim 1, It is characterized in that The determining whether the application data of the application program includes the target resource comprises: Initializing an index of the target resource, scanning the application data according to the index of the target resource, and determining whether the application data includes data corresponding to the data type of the target resource; If it is scanned that the application data includes data corresponding to the data type of the target resource, it is determined that the application data includes the target resource; or If the application data is not scanned to include data corresponding to the data type of the target resource, it is determined that the application data does not include the target resource.

5. The application resource processing method according to claim 4, It is characterized in that The determining whether the preset storage area of ​​the electronic device stores the target resource includes: If the preset storage area includes data corresponding to the data type of the target resource, it is determined that the preset storage area stores the target resource; or If the preset storage area does not include data corresponding to the data type of the target resource, it is determined that the preset storage area does not store the target resource.

6. The application resource processing method according to claim 5, It is characterized in that The data types of the target resources include video, audio, image, motion effect, frame animation and component.

7. The application resource processing method according to claim 1, It is characterized in that The preset storage area includes the storage area where the application APK and version components are located.

8. The application resource processing method according to claim 7, It is characterized in that The method further comprises: In response to the update instruction of the target resource, an updated target resource is obtained, and the original target resource in the application data is replaced with the updated target resource.

9. The application resource processing method according to claim 8, It is characterized in that The method further comprises: When the application APK is updated, the version component is updated, or the target resource pushed by the cloud server is received, the update instruction of the target resource is generated.

10. The application resource processing method according to claim 9, It is characterized in that When the application APK is updated and an update instruction of the target resource is generated, the responding to the update instruction of the target resource, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource includes: Updating the target resource index, and obtaining the updated target resource from the application APK; Deleting the original target resource; Copying the updated target resource into the application data; Mark that the target resource in the application APK has been copied; The target resource index is updated, and the updated target resource is obtained from the application data.

11. The application resource processing method according to claim 9, It is characterized in that When the version component is updated and an update instruction of the target resource is generated, the responding to the update instruction of the target resource, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource includes: Updating the target resource index, and acquiring the updated target resource from the version component; Deleting the original target resource; Copying the updated target resource into the application data; The target resource index is updated, and the updated target resource is obtained from the application data.

12. The application resource processing method according to claim 9, It is characterized in that When receiving the target resource pushed by the cloud server and generating an update instruction for the target resource, responding to the update instruction for the target resource, obtaining the updated target resource, and replacing the original target resource in the application data with the updated target resource include: Parsing the data pushed by the cloud server to obtain the updated target resource; storing the updated target resource in the application data, and marking the updated target resource; If the updated target resource is valid, deleting the original target resource; Removes the tag of the target resource of the update.

13. The application resource processing method according to claim 12, It is characterized in that The step of responding to the target resource update instruction, acquiring the updated target resource, and replacing the original target resource in the application data with the updated target resource further includes: If the updated target resource is invalid, delete the updated target resource and exit the target resource update; Send feedback information to the cloud server.

14. The application resource processing method according to claim 12, It is characterized in that The method further includes: determining whether the updated target resource is valid, including: Determining whether the capacity and format of each data in the updated target resource are correct; If the capacity and format of each data in the updated target resource are correct, determining that the updated target resource is valid; or If the capacity or format of any data in the updated target resource is incorrect, it is determined that the updated target resource is invalid.

15. An electronic device, It is characterized in that The electronic device comprises a memory and a processor: Wherein, the memory is used to store program instructions; The processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the electronic device executes the application resource processing method as described in any one of claims 1 to 14.

16. A chip coupled to a memory in an electronic device, It is characterized in that The chip is used to control the electronic device to execute the application resource processing method according to any one of claims 1 to 14.

17. A computer storage medium, It is characterized in that The computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, the electronic device executes the application resource processing method according to any one of claims 1 to 14.