Data management method and electronic device
By enabling unified management of media data across electronic devices through a unified media framework, the problem of data fragmentation between applications is solved, user experience is improved, and convenient cross-application and cross-device data sharing is supported.
Patent Information
- Application Number
- CN202610578748.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-01-10
- Filing Date
- 2024-06-07
- Publication Date
- 2026-08-25
AI Technical Summary
In the existing technology, the media data management of each application in electronic devices is independent and isolated, which leads to complex data sharing, chaotic formats, and an inability to manage data globally and systematically, thus reducing the user experience.
It adopts a unified media framework and provides a unified media data management platform. Through interfaces, capabilities and mechanisms, it realizes the standardized and unified management of media data, including the unification of processes such as acquisition, encoding, storage, sharing, decoding and playback. It breaks down application and device boundaries and realizes convenient sharing across applications and devices.
It enables unified management of media data across applications, improves user experience, reduces junk data generation, enhances data security, and supports smooth data sharing across applications and devices.
Smart Images

Figure CN122633280A_ABST
Abstract
Description
[0001] This application is a divisional application of the original application, application number 202410745339.8, entitled "Data Management Method and Electronic Device," filed on June 7, 2024, the entire contents of which are incorporated herein by reference. The original application claims priority to Chinese Patent Application No. 202410042134.3, filed on January 10, 2024, entitled "A Method for Implementing a Unified Media Framework," the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal and computer technology, and in particular to data management methods and electronic devices. Background Technology
[0003] With the continuous development of the terminal field, more and more applications are installed in electronic devices, and more and more media data such as text, pictures, videos, and audio are generated in electronic devices. Summary of the Invention
[0004] This application provides a data management method and electronic device, which enables standardized, unified, and convenient management of media data.
[0005] In a first aspect, embodiments of this application provide a data management method. This method is applied to a first electronic device, on which a first operating system runs. A first application runs on the first operating system, which provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, including program code that calls the first interface. The first interface is used to call the media data interface, which encapsulates the second capability. The second capability includes the ability to perform one or more of the following processes on the media data: acquisition, encoding, storage, sharing, decoding, and playback. The method includes: displaying the user interface of the first application, the user interface presenting a first option corresponding to a first function; detecting an operation performed on the first option; and, in response to the operation, activating the first function through the first interface. The first function is used to perform one or more of the following processes on the first media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which, during the activation of the first function, is used to perform one or more of the following: setting the data type of the first media data, managing the lifecycle of the first media data, controlling the security of the first media data, setting the data model of the first media data, and performing distributed management of the first media data.
[0006] Implementing the method provided in the first aspect can provide a unified media data management platform to achieve unified management of media data. This enables applications to process media data according to unified rules and formats, avoiding applications from controlling media data according to their own data management systems. It breaks down the boundaries of media data in applications and devices and improves the user experience of media data.
[0007] In conjunction with the first aspect, in one possible implementation, the parameters passed to the first interface include one or more of the following: device name, application name of the first application, and parameters passed to the first application. The parameters passed to the first application are parameters and parameter content of the first function, and the parameter content includes one or more of the following: description information of the first function, first media data, and indication information of the first media data.
[0008] In conjunction with the first aspect, in one possible implementation, the first function includes a face recognition function, and the parameters passed in by the first application include: parameters of the face recognition function, coordinates of the face, and image of the face; or, the first function includes a beautification function, and the parameters passed in by the first application include: parameters of the beautification function, beautification level, and face information.
[0009] In conjunction with the first aspect, in one possible implementation, the parameters passed to the media data interface include: capability indication information, parameters of the first function, and first media data or indication information of the first media data, wherein the indication information of the first media data is all or part of the parameters passed to the first application, and / or, the indication information of the first media data is determined by the first operating system: the capability indication information is used to indicate the capability invoked by the media data interface in the second capability.
[0010] In conjunction with the first aspect, in one possible implementation, the first function is a photo-taking function, and the first media data includes one or more of the following: photo stream, preview stream, and capability indication information is used to indicate the capability of the second capability to perform acquisition on the first media data; or, the first function is an image viewing function, and the first media data includes one or more of the following: large image, thumbnail, and capability indication information is used to indicate the capability of the second capability to perform storage on the first media data; or, the first function is a music playback function, and the first media data is music, and the indication information of the first media data includes one or more of the following: music name, music size, music duration, and capability indication information is used to indicate the capability of the second capability to perform playback on the first media data; or, the first function is a file creation function or a file deletion function, and the first media data is a file, and the indication information of the first media data includes one or more of the following: file name, file owner, file path, file size, and capability indication information is used to indicate the capability of the second capability to perform storage on the first media data.
[0011] In conjunction with the first aspect, in one possible implementation, the parameters passed to the second capability include: parameters of the first function, and, first media data or indication information of the first media data, wherein the indication information of the first media data is all or part of the parameters passed to the first application, and / or, the indication information of the first media data is determined by the first operating system.
[0012] In conjunction with the first aspect, in one possible implementation, the third capability includes: a media data type capability, which is used to determine the data type of the first media data based on the parameters passed in by the first application. The data type is: text, image, audio, or video.
[0013] It is evident that media data type capabilities enable media data from various applications to be classified according to a unified and standardized type, preventing media data with the same attributes from being distributed discretely across applications and facilitating unified management of various media data within the system.
[0014] In conjunction with the first aspect, in one possible implementation, the third capability includes: a data lifecycle capability, which is used to perform one or more of the following: setting the validity period of the first media data, and processing the first media data when the validity period of the first media data expires.
[0015] It is evident that data lifecycle capabilities can unify the entire process of media data from different applications from generation to destruction, enabling media data from each application to be destroyed according to unified rules, thereby reducing the generation of junk data in the system.
[0016] In conjunction with the first aspect, in one possible implementation, the third capability includes: data security management capability, which is used to verify whether the content of the first media data conforms to preset regulations.
[0017] It is evident that data security management capabilities can enable unified rules to control the security of media data across applications, improve the security of users' media data usage, and reduce the risk of media data leakage or the appearance of illegal information.
[0018] In conjunction with the first aspect, in one possible implementation, the third capability includes: a unified media data capability, which is used to set a data model for the first media data when some or all of the parameters passed in by the first application are empty. The data model for the first media data includes: parameters of the first function, and the first media data or indication information of the first media data; the indication information of the first media data is all or part of the parameters passed in by the first application, and / or the indication information of the first media data is determined by the first operating system.
[0019] It is evident that unified media data capabilities can standardize the media data transmitted by various applications when starting up functions, ensuring that the media data of each application maintains a unified and standardized data format, solving the problem of data fragmentation between applications and devices, and laying the foundation for smooth data sharing between applications and devices.
[0020] In conjunction with the first aspect, in one possible implementation, the third capability includes: a distributed management capability, which provides the ability to perform the first function on a second electronic device, or through a second application on the first electronic device; the second electronic device and the first electronic device are logged into the same account.
[0021] It is evident that distributed management capabilities can break down the boundaries of media data between applications and devices, enabling convenient and seamless sharing of media data across multiple applications and devices.
[0022] In conjunction with the first aspect, in one possible implementation, the first media data is the second media data created by the second application before the first application starts the first function, and the second media data has the same data format as the media data processed by the third capability.
[0023] In other words, the first and second applications can share media data through an access mechanism. Different applications can call the interfaces provided by the first operating system to standardize their media data and achieve media data sharing.
[0024] In conjunction with the first aspect, in one possible implementation, the first media data is obtained by parsing and reconstructing the second media data created by the second application before the first application starts the first function. The second media data has a different data format than the media data processed by the third capability, while the first media data has the same data format as the media data processed by the third capability.
[0025] In other words, the second application can achieve media data sharing through a delegation mechanism. This is because some applications are not adapted to the first operating system and cannot process media data or standardize its format through the first interface, media data interface, second capability, and third capability. Therefore, the media data can be directly parsed and reconstructed, reassembled into a uniformly formatted media data, so that other applications can recognize and use the media data, thus achieving data sharing between applications.
[0026] In conjunction with the first aspect, in one possible implementation, the first media data is media data created by the second application, and the second application has not granted access to the first media data; before starting the first function, the method further includes: querying the second application to obtain permission for the first application to access the first media data.
[0027] In other words, applications can share media data through dynamic mechanisms. When an application needs to access media data across applications, it can use a query-response approach. After obtaining permission from the application to access the media data, a temporary bridge can be established to share the media data, preventing excessive openness and sharing of media data and ensuring media data security.
[0028] In conjunction with the first aspect, in one possible implementation, the second application is an application on the first electronic device or the second electronic device.
[0029] For example, the second electronic device may refer to a device that has logged into the same account as the first electronic device.
[0030] If the second application is an application on the first electronic device, the first electronic device can achieve smooth and simple data sharing between applications through the above-mentioned mechanisms. If the second application is an application on the second electronic device, the first electronic device and the second electronic device can achieve smooth and simple data sharing between devices through the above-mentioned mechanisms.
[0031] Secondly, embodiments of this application provide an electronic device, which includes: a memory, a processor, and a computer program stored in the memory. The computer program includes a first operating system, on which a first application runs. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, which includes program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. The processor executes the computer program to implement the method described in the first aspect or any implementation thereof.
[0032] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. The computer program includes a first operating system, on which a first application runs. The first operating system provides: a first interface, a media data interface, a second capability, and a third capability. The first application is a third-party application, including program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes the third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. When the computer program is executed by a processor, it implements the method described in the first aspect or any implementation thereof.
[0033] Fourthly, embodiments of this application provide a computer program product, which includes a computer program, a first operating system, and a first application running on the first operating system. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, which includes program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. When the computer program is executed by a processor, it implements the method described in the first aspect or any implementation thereof. Attached Figure Description
[0034] Figure 1 A schematic diagram illustrating the differences between a data processing method provided in an embodiment of this application and a data management method provided in an embodiment of this application; Figure 2A A schematic diagram of the software architecture of the electronic device 100 provided in the embodiments of this application; Figure 2B A schematic diagram illustrating the relationship between the various modules in the software architecture provided in the embodiments of this application; Figure 2C A schematic diagram illustrating the calling relationships of the interfaces provided in the embodiments of this application; Figure 3This application provides a schematic diagram illustrating the principle of data sharing between applications under an existing mechanism in its embodiments. Figure 4 This application provides a schematic diagram illustrating the data sharing principle between applications under the access mechanism provided in this embodiment. Figure 5 A schematic diagram illustrating the data sharing principle between applications under the delegation mechanism provided in this application embodiment; Figure 6 A schematic diagram illustrating the data sharing principle between applications under the dynamic mechanism provided in this application embodiment; Figure 7 A flowchart illustrating the data management method provided in this application embodiment; Figure 8 A schematic diagram of interface calls within the operating system of the electronic device 100 provided in this application when it implements the photo-taking function through a camera application; Figure 9 A schematic diagram of the interface calls within the operating system of the electronic device 100 provided in this application embodiment when it implements the image viewing function through a gallery application; Figure 10 A schematic diagram of interface calls within the operating system of the electronic device 100 provided in this application when it implements music playback function through a music application; Figure 11 A schematic diagram of the interface calls inside the operating system when the electronic device 100 provided in this application implements the file creation function through a storage application; Figure 12 A schematic diagram of the interface calls inside the operating system when the electronic device 100 provided in this application implements the file deletion function through a storage application; Figure 13 This is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of this application. Detailed Implementation
[0035] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0036] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0037] Today's electronic devices can install multiple applications to meet different user needs. However, each application has its own data management system, which makes the media data between applications and devices independent, isolated, and inconsistent.
[0038] For example, image M taken by a camera app can be viewed and processed by both a gallery app and an instant messaging app, such as by modification or deletion. However, because the gallery app and the instant messaging app each have their own data management system, the gallery app might be performing operations on image M1.0, while the instant messaging app might be performing operations on image M2.0. Thus, although image M can be viewed through both the gallery app and the instant messaging app, operations on image M within the gallery app, such as deletion, modification, and viewing, are only operations on image M1.0 and do not affect image M2.0. In other words, even if a user deletes image M in the gallery app, the user can still view image M through the instant messaging app; conversely, even if a user modifies image M in the gallery app, the image M viewed through the instant messaging app will still be the unmodified image M.
[0039] For example, if a user downloads video N to their local computer using video playback software 1, but cannot view video N when trying to view the local video using video playback software 2, then...
[0040] It is evident that the independent data management systems of each application lead to problems such as complex operations, chaotic data formats, and confusing interfaces in data sharing and information sharing between applications. Electronic devices cannot systematically manage the media data of applications from a global perspective, which reduces the user experience.
[0041] Therefore, how to manage the media data of various applications in electronic devices is an urgent problem to be solved.
[0042] This application provides a data management method. This method is implemented under the unified media framework constructed in this application, so that each application can manage media data in a standardized, unified and convenient manner through the unified media framework during operation, thereby solving problems such as application silos and data fragmentation.
[0043] The data management method provided in this application involves unified management of media data from generation to destruction, including collection, encoding, storage, sharing, decoding, and playback. This avoids each application controlling media data according to its own data management system, breaks down the boundaries of media data in applications and devices, and improves the user experience of media data.
[0044] Figure 1 This is a schematic diagram illustrating the difference between a data processing method and the data management method provided in the embodiments of this application.
[0045] in, Figure 1 Image (a) shows a schematic diagram illustrating the principle of a data processing method. Figure 1 Figure (b) shows a schematic diagram illustrating the principle of the data management method provided in the embodiments of this application.
[0046] like Figure 1 As shown in (a), any application—whether a system application, a self-developed application, or a third-party application—can select the appropriate framework capabilities to process media data from databases, memory data, and files based on its business requirements. For example, system applications and self-developed applications process media data from databases through different interface capabilities. Therefore, this method lacks a unified management strategy for media data across different applications.
[0047] like Figure 1 As shown in (b), any application, including system applications, self-developed applications, and third-party applications, uses the unified media framework to realize operations such as the production, use, sale, and recovery of media data in databases, memory data, and files. It provides a unified media data management interface for application development, and the interface capability can cover single-device and multi-device combination scenarios, providing a unified system framework capability for the diversion and display of media data between different applications.
[0048] It can be seen that electronic devices, through a unified media framework, provide the ability to process media data from various applications in a unified manner, thereby enabling unified management of media data from various applications by electronic devices. This breaks down the application boundaries of media data and provides a logical foundation for achieving efficient and smooth cross-application and cross-device sharing of media data.
[0049] Electronic devices can be portable terminal devices running HarmonyOS, iOS, Android, Microsoft, or other operating systems, such as mobile phones, tablets, and wearable devices. They can also be non-portable terminal devices such as laptops or desktop computers with touch-sensitive surfaces or touch panels. The software system of the electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture of HarmonyOS as an example to exemplify the software structure of the electronic device 100.
[0050] Figure 2A A schematic diagram of the software architecture of the electronic device 100 provided in the embodiments of this application.
[0051] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, HarmonyOS is divided into four layers, from top to bottom: the application layer, the application framework layer, the service layer, and the kernel layer. Higher layers have more interaction with the user; lower layers represent more system capabilities.
[0052] It should be understood that Figure 2A The software architecture shown is merely an example; it may contain more or fewer modules, which is not limited here.
[0053] The application layer can include a series of application packages. Examples include applications such as camera, calendar, maps, music, SMS, gallery, communication, navigation, Bluetooth, and video.
[0054] like Figure 2A As shown, the application package may include: a camera app, a gallery app, a music app, and a video app. The camera app can be used to capture media data such as images and videos; the gallery app can be used to view, modify, delete, or share media files such as images and videos; the music app can be used to download, play, delete, or share audio; and the video app can be used to download, play, delete, or share videos.
[0055] It should be understood that "camera application" can refer to one or more applications with photo-taking capabilities. In other words, the application package of an electronic device 100 may include one or more camera applications, such as the system camera application, a self-developed camera application, a third-party camera application, etc. Other applications, such as gallery applications, music applications, and video applications, are similar and will not be elaborated upon here.
[0056] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer. The application framework layer includes some predefined functions. It may also include modules such as a window manager, content provider, view system, phone manager, and resource manager, which will not be discussed in detail here.
[0057] like Figure 2A As shown, the application framework layer may include functional interfaces such as: camera function interface (PhotoMode), editing function interface (EditMode), storage function interface (StorageMode), sharing function interface (ShareMode), playback function interface (PlayMode), and file management function interface (FileManageMode). These functional interfaces can be directly called by applications in the application layer.
[0058] For example, the camera function interface can be either an interface (PhotoModeKit) or a selector (PhotoModePicker). The PhotoModePicker can encapsulate multiple shooting function interfaces. Each shooting function interface can be used to activate a specific shooting function, which can include: shooting, video recording, night scene mode, portrait mode, large aperture mode, time-lapse video recording, artificial intelligence (AI) scene recognition, QR code scanning, face recognition, face interaction, etc. The PhotoModePicker can select the corresponding interface from the multiple shooting function interfaces based on the parameters passed in by the application.
[0059] For example, when electronic device 100 initiates portrait shooting through an application with shooting function, namely a camera application, the camera application can call PhotoModePicker and pass the parameters passed in by the application. For example, if the parameter is used to select the front-facing camera, then PhotoModePicker can select the shooting function interface corresponding to the portrait function through this parameter to realize the shooting function of the camera application.
[0060] It should be understood that the descriptions of other functional interfaces such as EditMode, StorageMode, etc., are similar to those of PhotoMode, and will not be repeated here.
[0061] As can be seen, the application framework layer can provide a unified interface for multiple applications in the application layer to call, enabling these applications to achieve the same functionality. For example, in the system camera application, all third-party applications can call PhotoMode to implement the photo-taking function. Compared to different applications calling different interfaces, this solves the problem of interface confusion during application runtime.
[0062] In addition, the application framework layer may also include a media data interface (MediaDataKit). The media data interface can be called by multiple functional interfaces such as PhotoMode, EditMode, StorageMode, ShareMode, PlayMode, and FileManageMode to manage the acquisition, encoding, storage, sharing, decoding, and playback of media data.
[0063] For example, MediaDataKit can be used to implement media data querying, generation, saving, deletion, synchronization, and change monitoring, etc. Specifically, querying media data refers to MediaDataKit's ability to query media data based on conditions; generating media data refers to MediaDataKit's ability to generate media data of a specified type; saving media data refers to MediaDataKit's ability to save media data; deleting media data refers to MediaDataKit's ability to delete media data based on specified conditions; synchronizing data refers to MediaDataKit's ability to synchronize media data end-to-end, ensuring data consistency across devices; and monitoring media data changes refers to MediaDataKit's ability to monitor changes in specified types or specific media data.
[0064] In addition, the application framework layer can also include multiple capabilities such as normal, acquisition, encoding, storage, sharing, decoding, and playback. These capabilities can be called by the media data interface to process media data, including acquisition, encoding, storage, sharing, decoding, and playback.
[0065] The actions performed on media, whether they include acquisition, encoding, storage, sharing, decoding, or playback, can be determined by the functions initiated by the application. For example, if a camera application initiates camera functions, the operations performed on media data could include acquisition. Similarly, if a video application initiates playback functions, the operations performed on media data could include playback.
[0066] Combination Figure 2AThe software architecture shown allows the electronic device 100 to detect when a user views a video through the gallery application. The gallery application then calls the PlayMode interface, which in turn calls MediaDataKit. MediaDataKit determines that the operation performed on the media data is "play" based on PlayMode. Therefore, MediaDataKit then calls the playback capability to play the video.
[0067] In addition, the application framework layer can also include capabilities such as media data types, data lifecycle, data security management, unified media data, and distributed management. Among these: The Media Data Type capability allows you to set the data type of media data so that media data from various applications maintains a consistent data type after unified processing. This data type can include text, images, audio, video, etc. Specifically, the Media Data Type capability can determine the data type of media data based on the information passed from the application. If the Media Data Type capability is invoked by the capture capability, the data type can be determined based on the data type of the media data captured by the application. For example, if a camera application initiates its image capture function, it will invoke the capture capability to capture an image; the captured media data type is thus an image, and therefore, the unified media data data type can be set to an image. Similarly, if the Media Data Type capability is invoked by the encoding capability, the data type can be determined based on the data type of the media data encoded by the application; if it is invoked by the storage capability, the data type can be determined based on the data type of the media data stored by the application; if it is invoked by the sharing capability, the data type can be determined based on the data type of the media data shared by the application; if it is invoked by the decoding capability, the data type can be determined based on the data type of the media data decoded by the application; and if it is invoked by the playback capability, the data type can be determined based on the data type of the media data played by the application.
[0068] It is evident that media data type capabilities enable media data from various applications to be classified according to a unified and standardized type, preventing media data with the same attributes from being distributed discretely across applications and facilitating unified management of various media data within the system.
[0069] Data lifecycle capabilities can be used to manage the lifecycle of media data. Specifically, data lifecycle capabilities can be used to set the validity period of media data and to process the media data when its validity period expires. Processing media data can refer to deleting the media data or extending its validity period. For example, data lifecycle capabilities can customize different validity periods for different media data, or manage the lifecycle of media data for different applications differently, such as setting media data to exist permanently, setting media data to be updated periodically, or setting media data to be deleted or extended after expiration, etc.
[0070] It is evident that data lifecycle capabilities can unify the entire process of media data from different applications from generation to destruction, enabling media data from each application to be destroyed according to unified rules, thereby reducing the generation of junk data in the system.
[0071] Data security management capabilities can be used to uniformly manage the security of media data, specifically including: checking the rationality, compliance, and legality of media data, and controlling the validity period of media data. For example, data security management capabilities can be used to verify whether the content of media data conforms to preset regulations; if it does, the media data is considered secure; if it does not, the media data poses a security risk.
[0072] It is evident that data security management capabilities can enable unified rules to control the security of media data across applications, improve the security of users' media data usage, and reduce the risk of media data leakage or the appearance of illegal information.
[0073] Unified media data capabilities can be used to provide standardized data models and standardized model parameters to achieve the unification and standardization of media data. The data model can be used to standardize the functions initiated by applications and the media data or indication information processed by those functions. The data model can include: function parameters, and media data or indication information. For example, if the parameters passed by the application contain null values, the data model can be set to fill in the missing values. For example, if one of the parameters passed by the application is null, the operating system can automatically fill in the missing value with a default value. Standardized model parameters can include the specific values of the parameters included in the standardized data model. For example, if the parameters passed by the application include the duration of music, and the duration is negative, it indicates that the model parameter is not standardized and its value needs to be readjusted.
[0074] It is evident that unified media data capabilities can standardize the media data transmitted by various applications when starting up functions, ensuring that the media data of each application maintains a unified and standardized data format, solving the problem of data fragmentation between applications and devices, and laying the foundation for smooth data sharing between applications and devices.
[0075] Distributed management capabilities can be used to manage media data in a distributed manner, enabling synchronization of media data across applications and devices, as well as managing cross-application and cross-device sharing of media data. Specifically, distributed management capabilities can provide the ability to process media data on other applications or other devices, where other devices can refer to devices logged into the same account as electronic device 100. For example, if an application calls a storage function interface to store media data, and the local device cannot store the media data due to insufficient storage space, it can use this distributed management capability to store the media data remotely. For instance, distributed management capabilities can be based on a relational database (RDB) to achieve cross-device synchronization of media data. RDB is a relational database, a method of organizing data using a database. Furthermore, in cross-device sharing of media data, distributed management capabilities can be used to determine the device storing the media data.
[0076] It is evident that distributed management capabilities can break down the boundaries of media data between applications and devices, enabling convenient and seamless sharing of media data across multiple applications and devices.
[0077] The unified media framework provided in this application embodiment may include Figure 2A The application framework layer shown contains all interfaces and capabilities. In other embodiments of this application, the names of the unified media framework and the various interfaces or capabilities described above may also be other, and this application embodiment does not limit this. For example, the unified media framework may also be called the unified media management framework. Furthermore, in the unified media framework, the functional interfaces that applications can directly call can be more... Figure 2A The number of functional interfaces shown may be more or less, and the ability of the media data interface to call downwards can be greater than... Figure 2A The embodiments of this application may show more or fewer capabilities, but this application does not limit this.
[0078] As can be seen, the unified media framework provided in this application provides layered interfaces and services, allowing application developers to focus only on the functions provided by the interfaces without having to worry about the complex implementation of the underlying commands. At the same time, each application can call the same interface provided in the unified media framework to achieve the same function, enabling fast, efficient and convenient management and control of media data between different applications, media data between different devices, and different types of media data.
[0079] like Figure 2A As shown, the service layer may include: data type service, lifecycle service, data security service, unified data service, and distributed management service. Specifically, the data type service provides business logic related to standardizing media data types; the lifecycle service provides business logic related to managing the lifecycle of media data; the data security service provides business logic related to managing the security of media data; the unified data service provides business logic related to unifying media data; and the distributed management service provides business logic related to managing the distributed management of media data.
[0080] The kernel layer is the layer between hardware and software. The kernel layer can include display drivers, camera drivers, audio drivers, sensor drivers, and so on. Figure 2A As shown, the kernel layer may include: memory storage driver, disk storage driver, persistent storage driver, and distributed storage driver. Memory storage refers to a storage method that stores media data in memory; disk storage refers to a storage method that stores media data on disk; persistent storage refers to a storage method that saves transient data in memory as persistent data, such as saving it to a database or hard drive to prevent data loss when the device loses power or the application closes; and distributed storage refers to a storage method that saves media data across devices.
[0081] It is understood that the unified media framework provided in this application can be implemented as a system capability, or as a software development kit (SDK), a persistent service, a binary shared object (SO) file, etc. Among these, a persistent service can be viewed as a persistent process that remains running after the electronic device is powered on.
[0082] Figure 2B Taking the processing of media data as an example, it shows... Figure 2A The software architecture shown illustrates the relationships between the various modules.
[0083] like Figure 2B As shown, the business caller can refer to... Figure 2A The applications shown in the application layer include, for example, camera applications, gallery applications, music applications, video applications, and so on.
[0084] If a service caller initiates a service call to collect media data, the entire service call process requires the software framework to provide collection capabilities, media data interfaces, unified data lifecycle management, and support for cross-device and cross-application data collection. This can be achieved through... Figure 2AThe distributed management capabilities in the software architecture shown enable the processing of data across devices and applications.
[0085] In addition, the media data interface needs to support a unified data model and data lifecycle management. The unified data model can be achieved through… Figure 2A The unified media data capabilities shown provide control over the data lifecycle through... Figure 2A This is achieved through the data lifecycle capabilities shown.
[0086] Furthermore, a unified data model needs to consider various characteristics and types of data, including databases, in-memory data, and files. Therefore, a unified data model should provide a consistent data model for persistent data, in-memory data, database data, file library data, and other types of data, unifying and standardizing different types of media data and ensuring the consistency of data sharing across applications. Additionally, a unified data model also needs to support data security through [various means]. Figure 2A The data security management capabilities shown are used to manage the security of media data.
[0087] It should be understood that when processing media data through encoding, storage, sharing, decoding, and playback, the factors that need to be considered during the business process are similar to those described above. Figure 2B The description in the text will not be repeated here.
[0088] To better understand Figure 2A The software architecture shown illustrates the calling relationships between the interfaces of each layer. Figure 2C An example diagram illustrating the call relationship of the interface is shown.
[0089] like Figure 2C As shown, the application can refer to the above. Figure 2A The application layer mentioned above includes camera apps, gallery apps, music apps, or video apps, etc. XXMode can refer to any of the above. Figure 2A MediaDataKit refers to any of the functional interfaces mentioned in the document, such as the camera interface (PhotoMode), editing interface (EditMode), storage interface (StorageMode), sharing interface (ShareMode), playback interface (PlayMode), file management interface (FileManageMode), etc.
[0090] The application can detect user actions and trigger the launch of a certain function, which can be used to perform one or more of the following processes on a certain media data: acquisition, encoding, storage, sharing, decoding, and playback.
[0091] So, after an application detects a user action, it can call the XXMode interface. For example, if a camera application detects a photo-taking action, the XXMode interface can be the PhotoMode interface; if a video application detects a video playback action, the XXMode interface can be the PlayMode interface.
[0092] The XXMode interface takes the form XXMode(DeviceName, AppName, key, value, extend).
[0093] The Device Name can refer to either the local device's device name or the remote device's device name. If the Device Name is the local device's device name, the local device can initiate the corresponding function in response to the operation detected by the application. If the Device Name is the remote device's device name, the remote device can initiate the corresponding function in response to the operation detected by the application.
[0094] The application name (AppName) can refer to the name of the application that calls the XXMode interface.
[0095] The parameters (key, value) passed to the application include one or more parameters that the application passes after detecting a user action. For example, if the user action is a file creation operation, the parameters passed to the application may include the file name, owner, etc.
[0096] The parameters passed in by the application can exist in the form of parameter (key)-parameter content (value). The parameter (key) is the parameter of the function launched by the application, which is used to indicate the function launched by the application. For example, the parameter can be the name, identifier, index or number of the function launched by the application, etc. The parameter content (value) represents the data required to implement the function launched by the application, which may include one or more of the following: description information of the function launched by the application, media data and indication information of the media data.
[0097] Key and value can form a key-value pair. One key can correspond to one or more values. The key and value passed in the XXMode interface can include one or more pairs, such as key1, value1, key2, value2.
[0098] For example, if the application's launch function includes facial recognition, the data required for facial recognition may include one or more of the following: facial coordinates, facial images, etc. As another example, if the application's launch function includes a beautification function, the data required for beautification may include one or more of the following: beautification level, facial information, etc. As yet another example, if the application's launch function includes a camera launch function, the data required for camera launch may include camera information, which indicates the camera that is active on the device, such as a front-facing camera, rear-facing camera, telephoto camera, wide-angle camera, etc.
[0099] Extend fields can be used to build pre-embedded capabilities or differentiated capabilities.
[0100] Understandably, the device name, application name, and extended fields are optional.
[0101] After the application calls the XXMode interface, the XXMode interface can call MediaDataKit. The MediaDataKit interface is in the form of MediaDataKit(type, key, value, extend).
[0102] The type indicates the type of processing performed on the media data. Types can include, but are not limited to, the following: normal, acquisition, code, storage, share, decode, play, and other. The type can be determined by the preceding interface of MediaDataKit. For example, if the preceding interface is PhotoMode, the electronic device can determine that it needs to activate the camera function and perform media data acquisition processing, thus considering it as the acquisition type.
[0103] The function point indicator parameter (key) is used to indicate the function point to be started. It can be obtained from the parameters passed in from the XXMode interface, or determined by the name of the XXMode interface.
[0104] The value required for a function point indicates the data needed to implement that function point. It can be obtained from the parameters passed to the XXMode interface. If it cannot be obtained from the parameters passed to the XXMode interface, it can be determined by the operating system.
[0105] Extend fields can be used to build pre-embedded capabilities or differentiated capabilities.
[0106] After the MediaDataKit interface is invoked, it can continue to call other interfaces provided by the framework layer based on the type. For example, if the type is "capture," the capture capability can be invoked to capture media data; if the type is "encode," the encoding capability can be invoked to encode media data; if the type is "storage," the storage capability can be invoked to store media data; if the type is "share," the sharing capability can be invoked to share media data; if the type is "decode," the decoding capability can be invoked to decode media data; and if the type is "playback," the playback capability can be invoked to play media data. The parameters passed for capture, encoding, storage, sharing, decoding, or playback capabilities can include: key, value, and extend.
[0107] During the process of any of the capabilities such as acquisition, encoding, storage, sharing, decoding, or playback, multiple capabilities can be invoked, including unified media data, media data type, data lifecycle, data security management, and distributed management, to achieve the standardization and unification of media data. Among them, the media data type capability can be used to determine the data type of media data; the data lifecycle capability can be used to determine the lifecycle of media data; the data security management capability can be used to manage the security of media data; the unified media data capability can be used to standardize the data model of media data, which consists of the indicator parameters (keys) of function points and the values (values) required by those function points; and the distributed management capability can be used to provide distributed management for media data.
[0108] In some implementations, during the invocation of any capability such as acquisition, encoding, storage, sharing, decoding, or playback, only a portion of the capabilities—including unified media data, media data type, data lifecycle, data security management, and distributed management—may be invoked. The specific choice can be determined by the application. For example, if the application does not need to set the lifecycle of the media data, it may not need to invoke the data lifecycle capability.
[0109] In some implementations, after the XX Mode interface is invoked, it can bypass MediaDataKit and directly call other framework layer capabilities under MediaDataKit to achieve the application startup function.
[0110] In some implementations, the XXMode interface can be a kit or a picker. When the XXMode interface is implemented as a picker, MediaDataKit can also be subdivided into multiple interfaces with more detailed functions, so that the XXMode interface can select the appropriate interface to call from these multiple interfaces.
[0111] After the framework layer interface is called, it will continue to call the service layer and kernel layer interfaces to implement the corresponding shooting function.
[0112] Specifically regarding Figure 2C Detailed examples can be found in the following sections. Figures 8-12 .
[0113] Depending on the application scenario, the unified media framework provided in this application embodiment can be implemented through any of the following mechanisms: 1) Access Mechanism The access mechanism refers to the ability of applications to actively access the MediaDataKit provided by the unified media framework to perform processing such as media data acquisition, encoding, storage, sharing, decoding, and playback.
[0114] In this way, media data can be managed uniformly according to the unified interface provided by the unified media framework. Furthermore, as long as the application processes media data according to the access mechanism, this data belongs to the data that the application exposes to other applications. Other applications can obtain and use the media data through the unified media framework, thereby realizing the sharing of media data between applications.
[0115] 2) Delegation Mechanism The delegation mechanism refers to the process by which an application does not originally use MediaDataKit provided by the unified media framework to complete the acquisition, encoding, storage, sharing, decoding, and playback of media data. The application's media data is not originally data that has been standardized according to the unified media framework. Therefore, it can be determined whether this part of the media data should be parsed and reconstructed into data that conforms to the unified media framework standard, depending on whether the application has given permission.
[0116] If authorized by the application, its media data can be parsed and reconstructed into data conforming to the unified media framework's specifications. This allows the media data to be reassembled into data that other applications can recognize and use. This media data can then be considered data that the application makes available to other applications, enabling them to access and use it through the unified media framework, thus achieving media data sharing among applications. If the application does not authorize this, its media data cannot be parsed and reconstructed into data conforming to the unified media framework's specifications, and other applications cannot use this media data through the unified media framework.
[0117] 3) Dynamic mechanism The dynamic mechanism is introduced to ensure media data security and prevent applications from excessively opening or sharing media data. Under this dynamic mechanism, applications can open and share media data through a "query-response" approach. Application A (hereinafter referred to as Application A) can query through the unified media framework whether there is any media data that it can share when it needs to use media data from other applications. If there is media data that Application B (hereinafter referred to as Application B) can share, Application B can respond to the query request through the unified media framework and open its media data so that Application A can use it, thus achieving data sharing between applications. Furthermore, the media data opened this time is only for this query by Application A. The next time Application A or another application needs to use the media data again, it needs to query Application B again through the "query-response" approach.
[0118] In this way, for media data between applications, all applications need to complete the data sharing between applications through a "query and response" method.
[0119] For example, in order to better understand these three mechanisms, Figures 3-6 This example illustrates the principles of data sharing between applications under different mechanisms.
[0120] Figure 3 This is a diagram illustrating the principle of data sharing between applications under the existing mechanism.
[0121] like Figure 3 As shown, data in an application can generally be divided into: private data and shared data. Private data is data used internally by the application and cannot be accessed or used by other applications, while shared data is data that can be accessed and used by other applications.
[0122] Under the current mechanism, each application has its own data management system to manage its own media data. Suppose application A's shared data includes media data X1.0. If application B wants to access and use media data X1.0, under the current mechanism, application B will typically save media data X1.0 as media data X2.0. Application A's processing of media data X is processing of media data X1.0, and application B's processing of media data X is processing of media data X2.0. For example, if application A initiates the deletion of media data X, application A can only delete media data X1.0 in its own application directory, and will not delete media data X2.0 in application B's application directory. Similarly, if application B initiates the deletion of media data X, application B can only delete media data X2.0 in its own application directory, and will not delete media data X1.0 in application A's application directory.
[0123] It is evident that, under the existing mechanism, media data between applications is independent, isolated, and inconsistent, resulting in complex and fragmented operations for users to manage, view, add, delete, and modify media data, making it impossible for applications to achieve smooth and simple data sharing.
[0124] Figure 4 This is a schematic diagram illustrating the data sharing principle between applications under the access mechanism provided in this application embodiment.
[0125] like Figure 4 As shown, both application A and application B can achieve unified management of shared data by accessing the unified media framework. Whether application A or application B is processing media data, as long as they access MediaDataKit, the media data of different applications can have the same data format and are all under the unified management of the unified media framework. This media data can be called unified data.
[0126] Taking media data X contained in the unified data as an example, assuming that media data X is the media data processed by application A after it accesses MediaDataKit, then this media data is the data that application A exposes to other applications. Other applications, such as application B, can also access and use media data X by accessing MediaDataKit.
[0127] For example, suppose application A is a camera application, application B is a video call application, and media data X is an image preview stream captured by application A. Since application B also needs to turn on the camera and capture an image preview stream when starting the video call function, application B can directly use the image preview stream captured by application A while application A is capturing the image preview stream, thus realizing media data sharing between applications. In this way, electronic devices can run two applications that require the use of the camera at the same time, improving the user experience.
[0128] Figure 5 This is a schematic diagram illustrating the data sharing principle between applications under the delegation mechanism provided in this application embodiment.
[0129] Considering that the application may not need to process media data according to a unified media framework during operation, the application's media data may still be managed according to its own data management system.
[0130] like Figure 5 As shown, application A is an application that processes media data according to the unified media framework, while application B is not an application that processes media data according to the unified media framework.
[0131] Under the delegation mechanism, if, at the instruction of application B, application B's shared data contains data that is willing to be unified, this portion of data can be parsed and reconstructed, transforming it into data with the same format as the unified data—that is, reassembled into data that other applications can recognize and use. In this way, other applications that process media data according to the unified media framework, such as application A, can access and use this data by connecting to MediaDataKit.
[0132] Figure 6 This is a schematic diagram illustrating the data sharing principle between applications under the dynamic mechanism provided in the embodiments of this application.
[0133] like Figure 6 As shown, application A is an application that processes media data according to the unified media framework, while application B is not an application that processes media data according to the unified media framework.
[0134] Under the dynamic mechanism, when application A wants to use media data from other applications, it can send a query request to the Unified Media Framework, requesting the media data from other applications. The Unified Media Framework then forwards the query request to the other applications. If application B responds, application B and application A can establish a dynamic channel, temporarily opening up the sharing of media data X. The Unified Media Framework can parse and reconstruct media data X on this dynamic channel, converting it into data with the same format as Unified Data. In this way, application A can access and use media data X by connecting to MediaDataKit on this dynamic channel. Furthermore, the dynamic channel will be closed after this sharing ends. If application A or other applications want to use media data X again, they need to re-establish the dynamic channel through the query-response mechanism.
[0135] For example, if application A is a camera application on device A and application B is a camera application on device B, when the camera application on device A wants to use media data collected by the camera application on another device, the camera application on device A can send a query request to the unified media framework. If the camera application on device B responds, the camera application on device A can access the media data collected by the camera application on device B.
[0136] In some implementations, application B can be an application that processes media data according to a unified media framework. In this case, it is equivalent to obtaining the application's permission to access media data by querying the application before accessing media data across applications, based on the access mechanism.
[0137] It is understandable that the above Figures 4-6The mentioned applications A and B can refer to different applications on the same device. For example, application A and application B can be the camera application and the gallery application on the same device, respectively. Alternatively, application A and application B can refer to applications on different devices. For example, application A can be the camera application on device A, and application B can be either the camera application or the gallery application on device B. Therefore, the unified media framework provided in this application can achieve smooth and simple sharing of media data between different applications on the same device, as well as smooth and simple sharing of media data across different devices, breaking down the boundaries of media data between applications and devices, and providing a platform for data sharing between applications and devices.
[0138] Figure 7 This is a flowchart illustrating the data management method provided in an embodiment of this application.
[0139] like Figure 7 As shown, this data management method mainly involves the following steps: S101. Electronic device 100 displays a user interface for a first application, the user interface presenting a first option corresponding to a first function, the first function being used to perform one or more of the following processes on the first media data: acquisition, encoding, storage, sharing, decoding, and playback.
[0140] The electronic device 100 runs a first operating system, on which a first application runs, and the first operating system provides: a first interface, a media data interface, a second capability, and a third capability.
[0141] For example, the first application can be a third-party application, and the first application includes program code that calls the first interface. For instance, the first application could be a camera application, a gallery application, a music application, a video application, and so on.
[0142] First media data can include one or more of the following: text, images, videos, and audio, etc.
[0143] The first function can refer to functions such as taking photos, viewing images, playing music, creating files, and deleting files. For example, if the first function is taking photos, the user interface of the first application can refer to the camera interface, the first option can refer to the photo-taking options, the first media data can include images, and the first function can include capturing images.
[0144] The first interface can be used to launch a first function provided by a first application, and the first interface can be used to call a media data interface. In this embodiment, the first operating system can provide multiple first interfaces, and different first interfaces can be used to launch different functions.
[0145] The media data interface encapsulates secondary capabilities, which include the ability to perform one or more of the following processes on the media data: acquisition, encoding, storage, sharing, decoding, and playback.
[0146] See Figure 2A The first interface can be Figure 2A The camera function interface, editing function interface, storage function interface, sharing function interface, file management function interface, or playback function interface mentioned in the document may include the following secondary capabilities: Figure 3 The above refers to one or more of the following capabilities: acquisition, encoding, storage, sharing, decoding, and playback.
[0147] The second capability includes the third capability, which includes the ability to perform one or more of the following processes on media data: setting the data type of media data, managing the lifecycle of media data, managing the security of media data, setting the data model of media data, and distributing the management of media data.
[0148] For example, the third capability may include one or more of the following: unified media data capability, data lifecycle capability, data security interface, unified media data capability, and distributed management capability.
[0149] For a detailed description of the interfaces and capabilities included in the first operating system, please refer to the above. Figure 2A Related content.
[0150] S102. Electronic device 100 detects an operation performed on the first option.
[0151] This operation can be used to trigger the activation of the first function. This operation can refer to a touch operation on the touchscreen, or it can refer to a user's voice command, etc. This application embodiment does not limit the form of this operation.
[0152] Understandably, besides activating functions through operations on options, electronic device 100 can also activate application functions based on user voice commands or operations on physical buttons when no screen is displayed. For example, electronic device 100 can detect the user's voice command "open camera" in screen-off mode, open the camera application, and activate the camera application's photo preview function, which can be used to perform preview stream acquisition.
[0153] S103. In response to this operation, electronic device 100 activates the first function.
[0154] For example, the electronic device 100 initiates a first function, which specifically includes: the electronic device 100 calls a first interface through a first application, then calls a media data interface through the first interface, then calls one or more capabilities in the second capability through the media data interface, and then calls a third capability while running one or more capabilities in the second capability.
[0155] The first function is used to perform one or more of the following processes on the first media data. During the process of starting the first function, the third capability is used to perform one or more of the following: setting the data type of the first media data, managing the lifecycle of the first media data, controlling the security of the first media data, setting the data model of the first media data, and performing distributed management of the first media data.
[0156] The parameters passed to the first interface may include one or more of the following: device name, application name of the first application, parameters passed by the first application, etc. The parameters passed by the first application may be parameters and parameter content for the first function, where the parameter content includes one or more of the following: description information of the first function, first media data, and indication information for the first media data.
[0157] It should be noted that if the electronic device 100 activates multiple functions in response to an operation on the first option, the parameters passed in by the first application may include multiple key-value pairs. A key-value pair can be used to describe a function and related information under that function.
[0158] As can be seen, when the first application calls the first interface, it can pass device information, application information, and information related to the first function to be started to the first interface. The information related to the first function may include parameters of the first function, as well as the first media data itself, or information used to indicate the first media data. For example, if the first media data is an image, the indication information of the first media data may include the image's address, name, size, etc.
[0159] The device name can be the name of electronic device 100. It is understood that if electronic device 100 cannot activate the first function, and it is determined that another electronic device can respond to the operation and activate the first function, then the device name can be the name of that other electronic device.
[0160] For example, if the first function includes a face recognition function, the parameters passed by the first application include: the name, identifier, index or code of the face recognition function, the coordinates of the face, the image of the face, etc., wherein the name, identifier, index or code of the face recognition function are parameters of the face recognition function, and the coordinates of the face and the image of the face are parameter contents; if the first function includes a beautification function, the parameters passed by the first application include: the name, identifier, index or code of the beautification function, the beautification level, face information, etc., wherein the name, identifier, index or code of the beautification function are parameters of the beautification function, and the beautification level and face information are parameter contents.
[0161] The parameters passed to the media data interface may include: capability indication information, parameters of the first function, and first media data or indication information of the first media data.
[0162] The capability indication information can be used to indicate the capabilities invoked by the media data interface in the second capability. For example, the capability indication information can be determined based on the first interface. For instance, if the capability invoked by the media data interface is an encoding capability, then the capability indication information can be used to indicate the encoding capability.
[0163] It should be noted that when the first interface calls the media data interface, some parameters passed by the first application may be null. Therefore, the first operating system can automatically fill in these parameters with default values. Thus, the indication information of the first media data in the parameters passed to the media data interface can be all or part of the parameters passed by the first application, and / or, the indication information of the first media data is determined by the first operating system.
[0164] The parameters passed in by the second capability may include: parameters of the first function, and first media data or indication information of the first media data.
[0165] As can be seen, the parameters passed to the second capability can be a part of the parameters passed to the media data interface. For a detailed description of the parameters passed to the second capability, please refer to the relevant description of the parameters passed to the media data interface, which will not be repeated here.
[0166] The following examples illustrate the interface call relationships within the operating system and the parameters passed between interfaces when the electronic device 100 activates different functions.
[0167] Example 1: The primary function is taking photos. in, Figure 8 This is a schematic diagram of the interface calls within the operating system of the electronic device 100 provided in this application when it implements the photo-taking function through a camera application.
[0168] like Figure 8As shown, after the camera application detects that the user has started taking a picture, the camera application can call the PhotoMode interface. The parameters passed to the PhotoMode interface include: DeviceName, AppName, key1, value1, key2, value2, and extend.
[0169] After the camera application calls the PhotoMode interface, the PhotoMode interface then calls MediaDataKit. The parameters passed by MediaDataKit include: Acquisition, PhotoMode, [PictureFlow, PreviewFlow, ...], extend.
[0170] Here, `Acquisition` indicates the acquisition capability, which is determined based on the `PhotoMode` interface. `PhotoMode` indicates the photo-taking function, and it can be determined by the interface name of the `PhotoMode` interface or by the parameters `key1`, `value1`, `key2`, and `value2` passed to the `PhotoMode` interface. `PictureFlow` is the photo-taking stream used to store the photo-taking results, and `PreviewFlow` is the preview stream used to display the preview data to the user in real time. `PhotoMode` and `[PictureFlow, PreviewFlow, ...]` form a key-value pair, where `[PictureFlow, PreviewFlow, ...]` represents the media data processed during the camera application's photo-taking function activation.
[0171] Understandably, PictureFlow and PreviewFlow can be determined by the first operating system.
[0172] After the PhotoMode interface calls MediaDataKit, MediaDataKit can determine the next capability to be called based on the Acquisition parameter passed to it. The parameters passed to the acquisition capability can include: PhotoMode, [PictureFlow, PreviewFlow, ...], extend.
[0173] Then, during the acquisition process, one or more of the following capabilities can be invoked: media data type capability, data lifecycle capability, data security management capability, unified media data capability, and distributed management capability, to standardize the media data format. For example, the media data type capability can be invoked to determine that the media data type is an image.
[0174] Understandable Figure 8 This is just one example, for instance, besides Figure 8 The camera app shown, along with other apps that have photo-taking capabilities, such as instant messaging apps, can also trigger photo-taking based on user actions. The parameters passed to MediaDataKit can include more than... Figure 8 Showing more or fewer parameters. (Continued) Figures 9-12 This is just an example, and will not be repeated below.
[0175] from Figure 8 As can be seen, if the first function is the photo-taking function, the parameters passed to the media data interface may include one or more of the following: photo stream, preview stream, and the capability indication information can be used to indicate the capability of the second capability to perform collection on the first media data.
[0176] Example 2: The primary function is image viewing. in, Figure 9 This is a schematic diagram of the interface calls within the operating system of the electronic device 100 provided in this application embodiment when it implements the image viewing function through a gallery application.
[0177] like Figure 9 As shown, after the gallery app detects a user's action of viewing images, the gallery app can call the PhotosMode interface. The parameters passed to the PhotosMode interface include: DeviceName, AppName, key1, value1, key2, value2, and extend.
[0178] For a detailed description of the parameters passed by the PhotosMode interface, please refer to the above. Figure 8 The relevant content will not be repeated here.
[0179] After the camera application calls the PhotoMode interface, the PhotoMode interface then calls MediaDataKit. The parameters passed by MediaDataKit include: Storage, PhotosMode, [BigPicture, ThumbNail, ...], extend.
[0180] Here, Storage indicates storage capacity, PhotosMode indicates image viewing functionality, BigPicture indicates a large image, and ThumbNail indicates a thumbnail. PhotosMode forms a key-value pair with [BigPicture, ThumbNail, ...]. Furthermore, BigPicture and ThumbNail are the media data processed when the gallery application initiates image viewing.
[0181] After the PhotosMode interface calls MediaDataKit, MediaDataKit can determine the next interface to be called as storage capability based on the Storage parameter passed to it. The parameters passed to storage capability can include: PhotosMode, [BigPicture, ThumbNail, ...], extend.
[0182] Then, during the operation of storage capabilities, one or more of the following can be invoked: media data type capabilities, data lifecycle capabilities, data security management capabilities, unified media data capabilities, and distributed management capabilities, to standardize the format of media data.
[0183] from Figure 9 As can be seen, if the first function is the image viewing function, the parameters passed to the media data interface may include one or more of the following: large image, thumbnail, and the capability indication information may be used to indicate the capability to perform storage for the first media data in the second capability.
[0184] Example 3: The primary function is music playback. in, Figure 10 This is a schematic diagram of the interface calls within the operating system of the electronic device 100 provided in this application when it implements music playback function through a music application.
[0185] like Figure 10 As shown, after the music application detects the user's music playback action, it can call the PlayMode interface. After the music application calls the PlayMode interface, the PlayMode interface then calls MediaDataKit. The parameters passed by MediaDataKit include: Play, PlayMusic, [MusicName, size, time, ...], extend.
[0186] Here, Play indicates the playback capability that MediaDataKit will call next, PlayMusic indicates the music playback function, and [MusicName, size, time, ...] indicates the music that needs to be played in this music playback function, where MusicName is the music name, size is the music size, and time is the music duration.
[0187] After the PlayMode interface calls MediaDataKit, MediaDataKit then calls the playback capability. The parameters passed to the playback capability can include: PlayMusic, [MusicName, size, time, ...], extend.
[0188] Then, during the playback process, one or more of the following capabilities can be invoked: media data type capability, data lifecycle capability, data security management capability, unified media data capability, and distributed management capability to standardize the format of media data.
[0189] from Figure 10 As can be seen, if the first function is music playback, the first media data is music, and the parameters passed to the media data interface include one or more of the following: music name, music volume, music duration. The capability indication information can be used to indicate the capability of the second capability to perform playback on the first media data.
[0190] Example 4: The primary function is either file creation or file deletion. in, Figure 11 This is a schematic diagram of the interface calls within the operating system when the electronic device 100 provided in this application implements the file creation function through a storage application.
[0191] like Figure 11 As shown, after a storage application detects a user's file creation operation, it can call the FileManageMode interface. The FileManageMode interface then calls MediaDataKit, which passes the following parameters: Storage, CreateFileMode, [name, owner, position, size…], and extend.
[0192] For example, storage applications can refer to file management applications, but this application embodiment does not limit this.
[0193] Storage indicates the storage capability that MediaDataKit will call next, CreateFileMode indicates the file creation function, and [name, owner, position, size…] indicates the file to be created in this file creation function, where name is the file name, owner is the file owner, position is the file path, and size is the file size.
[0194] After the FileManageMode interface calls MediaDataKit, MediaDataKit then calls the storage capability. The parameters passed to the storage capability can include: CreateFileMode, [name, owner, position, size...], extend.
[0195] Then, during the operation of storage capabilities, one or more of the following can be invoked: media data type capabilities, data lifecycle capabilities, data security management capabilities, unified media data capabilities, and distributed management capabilities, to standardize the format of media data.
[0196] in, Figure 12 This is a schematic diagram of the interface calls within the operating system when the electronic device 100 provided in this application implements the file deletion function through a storage application.
[0197] like Figure 12 As shown, after a storage application detects a user's file deletion operation, it can call the FileManageMode interface. The FileManageMode interface then calls MediaDataKit, which passes the following parameters: Storage, DeleteFileMode, [name, owner, position, size…], and extend.
[0198] Storage indicates the storage capability that MediaDataKit will call next, DeleteFileMode indicates the file deletion function, and [name, owner, position, size…] indicates the file to be deleted in this file deletion function, where name is the file name, owner is the file owner, position is the file path, and size is the file size.
[0199] After the FileManageMode interface calls MediaDataKit, MediaDataKit then calls the storage capability. The parameters passed to the storage capability can include: DeleteFileMode, [name, owner, position, size...], extend.
[0200] Then, during the operation of storage capabilities, one or more of the following can be invoked: media data type capabilities, data lifecycle capabilities, data security management capabilities, unified media data capabilities, and distributed management capabilities, to standardize the format of media data.
[0201] from Figure 11 and Figure 12 As can be seen, if the first function is a file creation function or a file deletion function, and the first media data is a file, the parameters passed to the media data interface may include one or more of the following: file name, file owner, file path, file size. The capability indication information can be used to indicate the capability to perform storage for the first media data in the second capability.
[0202] Specifically regarding Figures 9-12 For details not described in the text, please refer to Figure 8 The relevant content in [the document / document].
[0203] In some implementations, the first media data may be second media data created by a second application before the first application starts the first function, and the second media data has the same data format as the media data processed by the third capability.
[0204] For example, see Figure 4 The first application can refer to application A, and the second application can refer to application B.
[0205] In other words, the first and second applications can share media data through an access mechanism. Different applications can call the interfaces provided by the first operating system to standardize their media data and achieve media data sharing.
[0206] In some implementations, the first media data may be obtained by parsing and reconstructing the second media data created by the second application before the first application starts the first function. The second media data has a different data format than the media data processed by the third capability, while the first media data has the same data format as the media data processed by the third capability.
[0207] For example, see Figure 5 The first application can refer to application A, and the second application can refer to application B.
[0208] In other words, the second application can achieve media data sharing through a delegation mechanism. This is because some applications are not adapted to the first operating system and cannot process media data or standardize its format through the first interface, media data interface, second capability, and third capability. Therefore, the media data can be directly parsed and reconstructed, reassembled into a uniformly formatted media data, so that other applications can recognize and use the media data, thus achieving data sharing between applications.
[0209] In some implementations, the first media data can be media data created by the second application, and the second application does not grant access to the first media data. Before the electronic device 100 starts the first function, the electronic device 100 can first access the second application to obtain the first application's permission to access the first media data. After obtaining the access permission from the second application, the electronic device 100 can start the first function through the first application.
[0210] For example, see Figure 6 The first application can refer to application A, and the second application can refer to application B.
[0211] In other words, applications can share media data through dynamic mechanisms. When an application needs to access media data across applications, it can use a query-response approach. After obtaining permission from the application to access the media data, a temporary bridge can be established to share the media data, preventing excessive openness and sharing of media data and ensuring media data security.
[0212] It should be noted that the second application mentioned above can refer to the application on electronic device 100. In this way, electronic device 100 can achieve smooth and simple data sharing between applications through various mechanisms. Alternatively, the second application mentioned above can refer to other electronic devices, such as the application on a second electronic device. In this way, electronic device 100 can achieve smooth and simple data sharing between devices through various mechanisms. The second electronic device can be a device that has logged into the same account as electronic device 100.
[0213] In summary, the data management method provided in this application provides a unified media data management platform to standardize the media data of various applications, enabling each application to process media data according to unified rules and formats. At the same time, the unified media data management platform realizes unified management of media data, breaks down application boundaries, makes data sharing between applications and devices simpler and smoother, and improves the user's experience of using media data.
[0214] Figure 13 This is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of this application.
[0215] Electronic device 100 may be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, smart home device and / or smart city device. The embodiments of this application do not impose any special restrictions on the specific type of electronic device.
[0216] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.
[0217] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0218] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0219] In some implementations, the processor 110 can be used to manage the operation of applications and launch application functions based on user actions.
[0220] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0221] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0222] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0223] 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 one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0224] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0225] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates 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 processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0226] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0227] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.
[0228] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0229] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1.
[0230] In some implementations, the display screen 194 may be used to display the user interface of the application, which may include options for launching application functions. The electronic device 100 may detect the user's operation on the option to launch the application function.
[0231] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0232] Camera 193 is used to capture still images or videos. In some embodiments, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0233] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).
[0234] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.
[0235] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.
[0236] In some implementations, the internal memory 121 may be used to store media data and computer programs that implement the data management methods provided in the embodiments of this application. The media data may include, but is not limited to, text, images, audio, and video.
[0237] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0238] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0239] This application also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory. The computer program includes a first operating system, on which a first application runs. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, including program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. The processor executes the computer program to implement the method executed by the electronic device 100 in any of the above embodiments.
[0240] This application also provides a chip system including at least one processor for implementing the functions involved in the method performed by the electronic device 100 in any of the above embodiments.
[0241] In one possible design, the chip system also includes a memory for storing program instructions and data, which may be located within or outside the processor.
[0242] The chip system can consist of chips or include chips and other discrete components.
[0243] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0244] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.
[0245] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0246] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). The computer program includes a first operating system, on which a first application runs. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, including program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. When the computer program is executed by a processor, it implements the method executed by the electronic device 100 in any of the above embodiments.
[0247] This application also provides a computer program product, which includes a computer program (also referred to as code or instructions). The computer program includes a first operating system, on which a first application runs. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, which includes program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. When the computer program is executed by a processor, it implements the method executed by the electronic device 100 in any of the above embodiments.
[0248] It should be understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0249] Additionally, this application also provides an apparatus. Specifically, the apparatus may be a component or module, and may include one or more processors and a memory connected together. The memory stores a computer program. When the computer program is executed by one or more processors, the apparatus performs the methods described in the above-described method embodiments.
[0250] The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0251] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.
[0252] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0253] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0254] In summary, the above description is merely an embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made based on the disclosure of this application should be included within the scope of protection of this application.
Claims
1. A data management method, characterized in that, The method is applied to a first electronic device, which runs a first operating system. A first application runs on the first operating system, which provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, which includes program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The method includes: In response to the operation of activating the first function, the first function is activated through the first interface, wherein the first function is used to perform one or more of the following processes on the first media data: acquisition, encoding, storage, sharing, decoding and playback. The second capability also includes a third capability, which is used to perform one or more of the following during the activation of the first function: setting the data type of the first media data, managing the lifecycle of the first media data, controlling the security of the first media data, setting the data model of the first media data, and performing distributed management of the first media data. The activation of the first function includes: calling the first interface through the first application, calling the media data interface through the first interface, calling the second capability through the media data interface, and calling the third capability while running the second capability.
2. The method according to claim 1, characterized in that, The parameters passed to the first interface include one or more of the following: device name, application name of the first application, and parameters passed to the first application. The parameters passed to the first application are the parameters and parameter content of the first function. The parameter content includes one or more of the following: description information of the first function, the first media data, and indication information of the first media data.
3. The method according to claim 2, characterized in that, The first function includes a face recognition function, and the parameters passed in by the first application include: the parameters of the face recognition function, the coordinates of the face, and the image of the face; or, The first function includes a beautification function, and the parameters passed in by the first application include: the parameters of the beautification function, the beautification level, and facial information.
4. The method according to any one of claims 1-3, characterized in that, The parameters passed through the media data interface include: capability indication information, parameters of the first function, and the first media data or indication information of the first media data, wherein the indication information of the first media data is all or part of the parameters passed through the first application, and / or the indication information of the first media data is determined by the first operating system: the capability indication information is used to indicate the capability invoked by the media data interface in the second capability.
5. The method according to claim 4, characterized in that, The first function is a photo-taking function, and the first media data includes one or more of the following: photo stream, preview stream, and the capability indication information is used to indicate the capability of the second capability to perform collection on the first media data; or, The first function is an image viewing function, and the first media data includes one or more of the following: large image, thumbnail image, and the capability indication information is used to indicate the capability of performing storage for the first media data in the second capability; or, The first function is a music playback function, the first media data is music, and the indication information of the first media data includes one or more of the following: music name, music volume, music duration. The capability indication information is used to indicate the capability of the second capability to perform playback for the first media data. or, The first function is a file creation function or a file deletion function, the first media data is a file, and the indication information of the first media data includes one or more of the following: file name, file owner, file path, and file size. The capability indication information is used to indicate the capability of performing storage for the first media data in the second capability.
6. The method according to any one of claims 1-5, characterized in that, The parameters passed in by the second capability include: the parameters of the first function, and the first media data or indication information of the first media data, wherein the indication information of the first media data is all or part of the parameters passed in by the first application, and / or the indication information of the first media data is determined by the first operating system.
7. The method according to any one of claims 1-6, characterized in that, The third capability includes: media data type capability. The media data type capability is used to determine the data type of the first media data based on the parameters passed in by the first application. The data type is: text, image, audio, or video.
8. The method according to any one of claims 1-7, characterized in that, The third capability includes: data lifecycle capabilities. The data lifecycle capability is used to perform one or more of the following: setting the validity period of the first media data, and processing the first media data when the validity period of the first media data expires.
9. The method according to any one of claims 1-8, characterized in that, The third capability includes: data security management capability. The data security management capability is used to verify whether the content of the first media data conforms to preset regulations.
10. The method according to any one of claims 1-9, characterized in that, The third capability includes: a unified media data capability, which is used to set a data model for the first media data when some or all of the parameters passed in by the first application are empty. The data model for the first media data includes: the parameters of the first function, and the first media data or indication information of the first media data; the indication information of the first media data is all or part of the parameters passed in by the first application, and / or the indication information of the first media data is determined by the first operating system.
11. The method according to any one of claims 1-10, characterized in that, The third capability includes: distributed management capability. The distributed management capability is used to provide the ability to execute the first function on a second electronic device, or to execute the first function through a second application on the first electronic device; the second electronic device and the first electronic device are logged into the same account.
12. The method according to any one of claims 1-11, characterized in that, The first media data is the second media data created by the second application before the first application starts the first function, and the second media data has the same data format as the media data processed by the third capability.
13. The method according to any one of claims 1-11, characterized in that, The first media data is obtained by parsing and reconstructing the second media data created by the second application before the first application starts the first function. The second media data has a different data format than the media data processed by the third capability, while the first media data has the same data format as the media data processed by the third capability.
14. The method according to any one of claims 1-11, characterized in that, The first media data is media data created by the second application, and the second application has not granted access to the first media data; Before activating the first function, the method further includes: The second application was queried, and permission for the first application to access the first media data was obtained.
15. The method according to any one of claims 12-14, characterized in that, The second application is an application on the first electronic device or the second electronic device.
16. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored on the memory. The computer program includes a first operating system, on which a first application runs. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, including program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes a third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. The processor executes the computer program to implement the method as described in any one of claims 1-15.
17. A computer-readable storage medium, characterized in that, It stores computer programs, including a first operating system on which a first application runs. The first operating system provides: a first interface, a media data interface, a second capability, and a third capability. The first application is a third-party application, including program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes the third capability, which includes the ability to perform one or more of the following processes on media data: setting the data model of the media data, setting the data type of the media data, managing the lifecycle of the media data, managing the security of the media data, and distributing the management of the media data. When the computer program is executed by a processor, it implements the method as described in any one of claims 1-15.
18. A computer program product, characterized in that, The computer program product includes a computer program, which includes a first operating system on which a first application runs. The first operating system provides: a first interface, a media data interface, and a second capability. The first application is a third-party application, which includes program code that calls the first interface. The first interface is used to call the media data interface. The media data interface encapsulates the second capability, which includes the ability to perform one or more of the following processes on media data: acquisition, encoding, storage, sharing, decoding, and playback. The second capability also includes the third capability, which includes the ability to perform one or more of the following processes on media data: setting a data model for media data, setting a data type for media data, managing the lifecycle of media data, managing the security of media data, and distributing the management of media data. When the computer program is executed by a processor, it implements the method as described in any one of claims 1-15.