A data sharing method and device, electronic equipment and storage medium for an application
Patent Information
- Application Number
- CN202110555586.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-21
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2041-05-21
AI Technical Summary
[0004]为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种应用的数据共享方法、装置、电子设备和存储介质,解决了无法共享分身应用存储数据的技术问题,通过将共享应用的多媒体进程标识添加到目标应用对应进程的群体标识数组中以实现对共享应用存储的数据进行读取,提升了应用间数据共享的便利性,增强应用间的协作能力
[0039] The technical solution provided in this disclosure has the following advantages compared with the prior art:
Smart Images

Figure CN113296852B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of terminal technology, and in particular to an application of data sharing method, apparatus, electronic device and storage medium. Background Technology
[0002] Currently, with the continuous development of technologies such as the Internet and terminals, the types of applications installed on terminals are constantly increasing, and users' demands for applications are also increasing. For example, users may use the same application on the same mobile phone. As an example, user A may simultaneously launch the main WeChat application 1 and the WeChat clone application 2 on the same mobile phone and log in to different WeChat accounts.
[0003] In the scenario described above, for example, after opening WeChat clone app 2 and saving chat files and pictures, the folder for WeChat clone app 2 is not found in the file manager, and the saved pictures are not displayed in the gallery. This means that the main WeChat app 1 cannot share the data stored in WeChat clone app 2. Summary of the Invention
[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a data sharing method, apparatus, electronic device, and storage medium for applications. This solves the technical problem of being unable to share the stored data of cloned applications. By adding the multimedia process identifier of the shared application to the group identifier array of the corresponding process of the target application, the data stored in the shared application can be read, thereby improving the convenience of data sharing between applications and enhancing the collaborative capabilities between applications.
[0005] The first aspect of this disclosure proposes an application data sharing method, including:
[0006] When the target application is launched, the application type of the target application is obtained;
[0007] The shared application is determined based on the application type;
[0008] Obtain the multimedia process identifier of the shared application and add it to the group identifier array of the process corresponding to the target application.
[0009] In one optional embodiment of this disclosure, before obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the process corresponding to the target application, the method further includes: running the multimedia process through the file system to call an interface function to create a file directory of the application on the terminal; setting a directory permission value in the interface function; and determining the directory permissions of the file directory based on the directory permission value.
[0010] In one optional embodiment of this disclosure, determining the shared application based on the application type includes:
[0011] Based on the application type, the target application is determined to be a preset management application, and the user identifier of the target application is obtained;
[0012] Based on the user identifier, the target application is determined to be in main user mode, and the clone application corresponding to the clone user identifier is obtained as the shared application.
[0013] The step of obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the process corresponding to the target application includes:
[0014] Obtain the multimedia process identifier of the cloned application and add it to the group identifier array of the corresponding process of the preset management application.
[0015] In one optional embodiment of this disclosure, determining the shared application based on the application type includes:
[0016] Based on the application type, the target application is determined to be a multimedia application, and the user identifier of the target application is obtained;
[0017] Based on the user identifier, the target application is determined to be in primary user mode, and the cloned application corresponding to the cloned user is obtained as the shared application; or...
[0018] Based on the user identifier, the target application is determined to be in clone user mode, and the main application corresponding to the main user is obtained as the shared application.
[0019] The step of obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the process corresponding to the target application includes:
[0020] The multimedia process identifier of the cloned application or the main application is calculated based on the target multimedia process identifier and the cloned user identifier of the target application, and the multimedia process identifier is added to the group identifier array of the corresponding process of the multimedia application.
[0021] In an optional embodiment of this disclosure, calculating the multimedia process identifier of the cloned application or the main application based on the target application's target multimedia process identifier and the cloned user identifier includes:
[0022] When the target application is in main user mode, the sum of the products of the main application's main multimedia process identifier and the clone user identifier multiplied by a preset value is obtained as the multimedia process identifier; or,
[0023] When the user identifier is in clone user mode, the difference between the clone application's clone multimedia process identifier and the clone user identifier multiplied by a preset value is obtained as the multimedia process identifier.
[0024] In one optional embodiment of this disclosure, the data sharing method of the application further includes:
[0025] After the target application starts, the file system receives the data retrieval request sent by the target application;
[0026] The shared application is determined based on the data acquisition request, and the target application is queried from the group identifier array to determine whether it has read permissions for the file directory of the shared application.
[0027] If the target application has read permissions to the file directory of the shared application, the target application reads the target data from the file directory of the shared application.
[0028] In an optional embodiment of this disclosure, querying the group identifier array to determine whether the target application has read permissions for the file directory of the shared application includes:
[0029] Obtain the multimedia process identifier of the shared application;
[0030] Determine whether the group identifier array includes the multimedia process identifier;
[0031] If the group identifier array includes the multimedia process identifier, it is determined that the target application has read permissions for the file directory of the shared application;
[0032] If the multimedia process identifier is not included in the group identifier array, it is determined that the target application does not have read permissions for the file directory of the shared application.
[0033] A second aspect of this disclosure provides an application-specific data sharing apparatus, comprising:
[0034] The acquisition module is used to acquire the application type of the target application when the target application is detected to start.
[0035] A determination module is used to determine the shared application based on the application type.
[0036] The processing module is used to obtain the multimedia process identifier of the shared application and add it to the group identifier array of the corresponding process of the target application.
[0037] A third aspect of this disclosure provides an electronic device, including a processor and a memory; the processor executes steps of a data sharing method as described in the foregoing embodiments by invoking a program or instructions stored in the memory.
[0038] A fourth aspect of this disclosure provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a program or instructions that cause a computer to perform the steps of the data sharing method applied as described in the foregoing embodiments.
[0039] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0040] When a target application is launched, its application type is obtained; based on the application type, the shared application is identified; the multimedia process identifier of the shared application is obtained and added to the group identifier array of the corresponding process of the target application. Thus, by adding the multimedia process identifier of the shared application to the group identifier array of the corresponding process of the target application, data stored in the shared application can be read, improving the convenience of data sharing between applications and enhancing their collaborative capabilities. Attached Figure Description
[0041] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0042] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a flowchart illustrating the data sharing method used in the embodiments of this disclosure;
[0044] Figure 2 This is a flowchart illustrating the data sharing method used in the embodiments of this disclosure;
[0045] Figure 3a This is a schematic diagram illustrating a scenario of the data sharing method described in an embodiment of this disclosure;
[0046] Figure 3b This is a schematic diagram illustrating a scenario of the data sharing method described in an embodiment of this disclosure;
[0047] Figure 4 This is a flowchart illustrating the data sharing method used in the embodiments of this disclosure;
[0048] Figure 5 This is a schematic diagram illustrating a scenario of the data sharing method described in an embodiment of this disclosure;
[0049] Figure 6 This is a flowchart illustrating the data sharing method used in the embodiments of this disclosure;
[0050] Figure 7 This is a schematic diagram of the structure of the data sharing device used in the embodiments of this disclosure. Detailed Implementation
[0051] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0052] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0053] In practical applications, to improve the security of the Android system, partitioned storage can be implemented. Typically, partitioned storage is based on a user file system, whose main logic resides in the MediaProvider module (process name, for example, com.android.providers.media.module). To meet user needs, multiple identical applications can be installed on the terminal—the main application and multiple cloned applications. The application cloning module is implemented based on Android's multi-user working mode. However, the cloned directory (multi-user directory) is not displayed in applications such as Documents and Images, meaning the data stored in the cloned applications cannot be accessed.
[0054] As an example, after installing WeChat and enabling WeChat clone, and successfully saving chat files and pictures in the WeChat clone application, the clone application folder is not found in the file manager, and the saved pictures are not displayed in the gallery.
[0055] To address the aforementioned issues, this disclosure proposes a data sharing method for applications. By detecting the startup of a target application, the method obtains the application type of the target application, determines the sharing application based on the application type, obtains the multimedia process identifier of the sharing application, and adds it to the group identifier array of the corresponding process of the target application to enable reading the data stored in the sharing application. This improves the convenience of data sharing between applications and enhances the collaboration capabilities between applications.
[0056] The following description, with reference to the accompanying drawings, describes a data sharing method, apparatus, electronic device, server, and storage medium used in embodiments of this disclosure.
[0057] Figure 1 This is a flowchart illustrating the data sharing method for the application described in the embodiments of this disclosure.
[0058] The data sharing method disclosed in this embodiment can be applied to electronic devices. The electronic device can be any device with computing capabilities, such as a PC (Personal Computer), a mobile terminal, etc. The mobile terminal can be a mobile phone, tablet computer, personal digital assistant, wearable device, or other hardware device with various operating systems, touchscreens, and / or displays.
[0059] like Figure 1 As shown, the data sharing method of this application may include the following steps:
[0060] Step 101: When the target application is launched, obtain the application type of the target application.
[0061] In this embodiment of the disclosure, any target application can be launched according to the application scenario requirements. The target application is any application installed on the electronic device, such as multimedia applications like WeChat and Taobao, or document applications like memos and office applications.
[0062] In this embodiment of the disclosure, the launch of the target application can be understood as opening the target application, that is, the process of the target application starts running. The method of launching the target application can be selected and set as needed, such as single click, double click, and long press for a preset time, etc., and the specific settings are selected according to the user's usage needs.
[0063] In this embodiment of the disclosure, the application type refers to the distinction between multimedia applications, document applications, etc. There are many ways to obtain the application type of the target application, which can be selected according to the actual application needs. Examples are given below.
[0064] The first example involves obtaining the application identifier of the target application. The application identifier can uniquely identify an application. The matching application type is obtained by querying a preset application identifier and application type mapping table based on the application identifier.
[0065] The second example involves obtaining the process information of the target application and identifying the application type of the target application based on the process information.
[0066] In this embodiment of the disclosure, the target application can be a main application, that is, the application corresponding to the main user, which is only one, or it can be a clone application, that is, the application corresponding to the clone user, which can be one or more.
[0067] Step 102: Determine the shared application based on the application type.
[0068] Step 103: Obtain the multimedia process identifier of the shared application and add it to the group identifier array of the corresponding process of the target application.
[0069] In this embodiment of the disclosure, a shared application refers to an application that can share stored data, that is, an application whose stored data can be read.
[0070] In the disclosed embodiments, one or more applications will be determined according to the application scenario, and the file directory of the determined application will be created by calling the interface function through the file system running the multimedia process. The directory permission value is set in the interface function, and the directory permission of the file directory is determined according to the directory permission value. That is to say, the shared application in this disclosed embodiment is the application whose directory permission has been set. By setting the directory permission to read permission, subsequent data sharing is guaranteed.
[0071] In this embodiment of the disclosure, different methods are used to determine the shared application for different application types of the target application, and the way to obtain the multimedia process identifier of the shared application and add it to the group identifier array of the corresponding process of the target application is also different. Examples are given below.
[0072] In the first example, the target application is determined to be a preset management application based on the application type. The user identifier of the target application is obtained. Based on the user identifier, the target application is determined to be in the main user mode. The clone application corresponding to the clone user identifier is obtained as a shared application. The multimedia process identifier of the clone application is obtained and added to the group identifier array of the corresponding process of the preset management application.
[0073] The second example involves determining the target application as a multimedia application based on the application type, obtaining the user identifier of the target application, determining the target application as a primary user based on the user identifier, and obtaining the clone application corresponding to the clone user as a shared application; or, determining the target application as a clone user based on the user identifier, obtaining the primary application corresponding to the clone user as a shared application, calculating the multimedia process identifier of the clone application or the primary application based on the target multimedia process identifier of the target application and the clone user identifier, and adding the multimedia process identifier to the group identifier array of the corresponding process of the multimedia application.
[0074] In summary, the data sharing method of this disclosure improves the convenience of data sharing between applications and enhances the collaboration capabilities between applications by obtaining the application type of the target application when it is launched, determining the sharing application based on the application type, obtaining the multimedia process identifier of the sharing application, and adding it to the group identifier array of the corresponding process of the target application to enable reading the data stored in the sharing application.
[0075] Based on the description of the above embodiments, in one possible implementation of this disclosure, in order to be able to read the data of the shared application, it is necessary to grant the application's file directory a read permission attribute. More specifically, the application's file directory on the terminal is created by calling an interface function through the file system running a multimedia process, setting the directory permission value in the interface function, and determining the directory permissions of the file directory based on the directory permission value.
[0076] In this embodiment, applications on the terminal can configure which applications can be granted read permissions to file directories based on usage needs. In other words, when creating a file directory, the directory permissions are set to be readable by other users. Specifically, for the Android system, all file operations are implemented through media storage. When the multimedia process running on the media storage calls the interface function to create the application's file directory, the directory permission value is set in the interface function. The directory permissions are determined based on this value, such as through interfaces like `pf_lookup`, `pf_create`, and `EnsureDefaultFolders`. Directory permission values can be, for example, 0770 for read-only permissions, 077 for read-write permissions, etc., selected according to specific needs. This further ensures the reliability of application data sharing.
[0077] Based on the above embodiments, different methods are used to determine the shared application for different application types of the target application. Therefore, the methods for obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the corresponding process of the target application also differ. The following will combine... Figure 2 Provide a detailed description of how, when the target application is a preset management application, the shared application is identified, and how the multimedia process identifier of the shared application is obtained and added to the group identifier array of the corresponding process of the target application. The specific description is as follows:
[0078] Figure 2 This is a flowchart illustrating the data sharing method for the application described in the embodiments of this disclosure.
[0079] like Figure 2 As shown, the data sharing method of this application may include the following steps:
[0080] Step 201: When the target application is detected to start, obtain the application type of the target application.
[0081] In this embodiment of the disclosure, any target application can be launched according to the application scenario requirements. The target application is any application installed on the electronic device, such as multimedia applications like WeChat and Taobao, or document applications like memos and office applications.
[0082] In this embodiment of the disclosure, the launch of the target application can be understood as opening the target application, that is, the process of the target application starts running. The method of launching the target application can be selected and set as needed, such as single click, double click, and long press for a preset time, etc., and the specific settings are selected according to the user's usage needs.
[0083] In this embodiment of the disclosure, the application type refers to the distinction between multimedia applications, document applications, etc. There are many ways to obtain the application type of the target application, which can be selected according to the actual application needs. Examples are given below.
[0084] The first example involves obtaining the application identifier of the target application. The application identifier can uniquely identify an application. The matching application type is obtained by querying a preset application identifier and application type mapping table based on the application identifier.
[0085] The second example involves obtaining the process information of the target application and identifying the application type of the target application based on the process information.
[0086] In this embodiment of the disclosure, the target application can be a main application, that is, the application corresponding to the main user, which is only one, or it can be a clone application, that is, the application corresponding to the clone user, which can be one or more.
[0087] Step 202: Determine the target application as a preset management application based on the application type, and obtain the user identifier of the target application.
[0088] Step 203: Determine the target application as the primary user mode based on the user identifier, and obtain the clone application corresponding to the clone user identifier as the shared application.
[0089] In this embodiment of the disclosure, it is possible to preset which applications are management applications, such as file management applications. Typically, these management applications only have a main application and do not have clone applications. The target application is determined to be in main user mode or clone user mode by obtaining the user identifier of the target application. The user identifier is a unique identifier that can identify the main user or clone user and can be set as needed. For example, 00 represents the main user and 999 represents the clone user. The main user 00 is only associated with one application as the main application, while the clone user 999 can be associated with one or more clone applications.
[0090] In this embodiment of the disclosure, the target application can be determined to be in the main user mode based on the user identifier, such as 00, and the clone application with the clone user identifier, such as 999, can be obtained as the shared application.
[0091] Step 204: Obtain the multimedia process identifier of the cloned application and add it to the group identifier array of the corresponding process of the preset management application.
[0092] In this embodiment of the disclosure, after determining that the cloned application is a shared application, the multimedia process identifier of the cloned application is obtained from the multimedia memory. The multimedia process identifier is used to uniquely identify the multimedia process of the application. For example, the multimedia process identifier of cloned application A1 is 0101a and the multimedia process identifier of cloned application A2 is 0202a. Finally, the multimedia process identifier of the cloned application is added to the group identifier array of the corresponding process of the preset management application.
[0093] In this embodiment of the disclosure, each application's corresponding process has a group identifier array, which includes one or more fields. By adding the multimedia process identifier of the cloned application to the group identifier array of the process corresponding to the preset management application, the preset management application has the permission to read the stored data of the cloned application.
[0094] As a scenario example, such as Figure 3a As shown, the default management application is the document application Q1, and the cloned application is the WeChat cloned application R1. The multimedia process identifier of the WeChat cloned application R1 is obtained as 0101r. The group identifier array of the corresponding process of the document application Q1 is [00 11]. Adding 0101r to the group identifier array can be [00 11 0101r] or [00 0101r11]. The multimedia process identifier of the cloned application can be added to any position in the group identifier array as needed. The specific setting can be selected according to the needs. Thus, as... Figure 3b After launching the document application Q1, you can read information such as pictures and chat files stored in the WeChat clone application R1.
[0095] In summary, the data sharing method of this disclosure improves the convenience of data sharing between applications and enhances the collaboration capabilities between applications by obtaining the application type of the target application when it is launched, determining the target application as a preset management application based on the application type, obtaining the user identifier of the target application, determining the target application as the main user mode based on the user identifier, obtaining the clone application corresponding to the clone user identifier as a shared application, obtaining the multimedia process identifier of the clone application, and adding it to the group identifier array of the corresponding process of the preset management application to enable the management application to read the data stored in the clone application.
[0096] Based on the above embodiments, different methods are used to determine the shared application for different application types of the target application. Therefore, the methods for obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the corresponding process of the target application also differ. The following will combine... Figure 4 Provide a detailed description of how, when the target application is a multimedia application, the sharing application is identified, and how the multimedia process identifier of the sharing application is obtained and added to the group identifier array of the corresponding process of the target application. The specific description is as follows:
[0097] Figure 4 This is a flowchart illustrating the data sharing method for the application described in the embodiments of this disclosure.
[0098] like Figure 4 As shown, the data sharing method of this application may include the following steps:
[0099] Step 301: When the target application is detected to start, obtain the application type of the target application.
[0100] In this embodiment of the disclosure, any target application can be launched according to the application scenario requirements. The target application is any application installed on the electronic device, such as multimedia applications like WeChat and Taobao, or document applications like memos and office applications.
[0101] In this embodiment of the disclosure, the launch of the target application can be understood as opening the target application, that is, the process of the target application starts running. The method of launching the target application can be selected and set as needed, such as single click, double click, and long press for a preset time, etc., and the specific settings are selected according to the user's usage needs.
[0102] In this embodiment of the disclosure, the application type refers to the distinction between multimedia applications, document applications, etc. There are many ways to obtain the application type of the target application, which can be selected according to the actual application needs. Examples are given below.
[0103] The first example involves obtaining the application identifier of the target application. The application identifier can uniquely identify an application. The matching application type is obtained by querying a preset application identifier and application type mapping table based on the application identifier.
[0104] The second example involves obtaining the process information of the target application and identifying the application type of the target application based on the process information.
[0105] In this embodiment of the disclosure, the target application can be a main application, that is, the application corresponding to the main user, which is only one, or it can be a clone application, that is, the application corresponding to the clone user, which can be one or more.
[0106] Step 302: Determine the target application as a multimedia application based on the application type, and obtain the user identifier of the target application.
[0107] Step 303: Determine the target application as the primary user mode based on the user identifier, and obtain the clone application corresponding to the clone user as the shared application; or, determine the target application as the clone user mode based on the user identifier, and obtain the primary application corresponding to the primary user as the shared application.
[0108] In this embodiment of the disclosure, a multimedia application typically has a main application and may also have multiple clone applications. The target application is determined to be in main user mode or clone user mode by obtaining the user identifier of the target application. The user identifier is a unique identifier that can identify the main user or clone user and can be set as needed. For example, 00 represents the main user and 999 represents the clone user. The main user 00 is only associated with one application as the main application, while the clone user 999 can be associated with one or more clone applications.
[0109] In this embodiment of the disclosure, if the target application can be determined to be in main user mode based on the user identifier, such as 00, the clone application with the clone user identifier, such as 999, is obtained as a shared application. If the target application is determined to be in clone user mode based on the user identifier, such as 999, the main application with the user identifier, such as 00, is obtained as a shared application.
[0110] Step 304: Calculate the multimedia process identifier of the cloned application or the main application based on the target multimedia process identifier of the target application and the cloned user identifier, and add the multimedia process identifier to the group identifier array of the corresponding process of the multimedia application.
[0111] In this embodiment of the disclosure, there are many ways to calculate the multimedia process identifier of the cloned application or the main application based on the target multimedia process identifier of the target application and the cloned user identifier. Examples are given below.
[0112] In the first example, when the target application is in main user mode, the sum of the products of the main application's main multimedia process identifier and the clone user identifier multiplied by a preset value is obtained as the multimedia process identifier.
[0113] In the second example, when the user is identified as a cloned user, the difference between the cloned application's multimedia process identifier and the cloned user identifier multiplied by a preset value is obtained as the multimedia process identifier.
[0114] In this embodiment of the disclosure, when the target application starts, for example, if it is determined to be a multimedia application by its package name and process name com.android.providers.media.module, the current user identifier of the target application B is obtained (e.g., the main user identifier is 0). If the current user identifier of the target application B is the main user, i.e., 0, then the multimedia process identifier meidID of the clone user (clone user identifier is 999) is obtained = main multimedia process identifier of the main application + clone user identifier * 100000, and then meidID is added to the group identifier array of process B; or, if the current user ID of the target application B is the clone user, i.e., 999, then the multimedia process identifier meidID of the main user (ID is 0) is obtained = UID of application B - clone user ID * 100000, and then meidID is added to the group identifier array of process B.
[0115] As an example of a scenario, let's continue with... Figure 3a Taking the example shown, the multimedia application is the main WeChat application R2, and the cloned application is the WeChat cloned application R1. The multimedia process identifier of the WeChat cloned application R1 is 0101r. The group identifier array of the corresponding process of the main WeChat application R2 is [00 22]. Adding 0101r to the group identifier array can be [00 22 0101r] or [00 0101r 22]. The multimedia process identifier of the cloned application can be added to any position in the group identifier array as needed, and the specific setting can be selected according to the needs. Thus, as shown... Figure 5 After the main WeChat application R2 is displayed, it can read information such as pictures and chat files stored in the WeChat clone application R1.
[0116] In summary, the data sharing method of this disclosure embodiment, when detecting the startup of a target application, determines that the target application is a multimedia application based on the application type, obtains the user identifier of the target application, determines that the target application is in main user mode based on the user identifier, and obtains the clone application corresponding to the clone user as a shared application; or, determines that the target application is in clone user mode based on the user identifier, obtains the main application corresponding to the main user as a shared application, calculates the multimedia process identifier of the clone application or the main application based on the target multimedia process identifier of the target application and the clone user identifier, and adds the multimedia process identifier to the group identifier array of the corresponding process of the multimedia application to realize mutual reading of data stored between multimedia applications, thereby improving the convenience of data sharing between applications and enhancing the collaboration capability between applications.
[0117] Continuing the description of the above embodiments, after obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the corresponding process of the target application, the target application can read the data stored in the shared application. The following describes how... Figure 6 Provide a detailed description.
[0118] Figure 6 This is a flowchart illustrating the data sharing method for the application described in the embodiments of this disclosure.
[0119] like Figure 6 As shown, the data sharing method of this application may include the following steps:
[0120] Step 401: After the target application starts, the data acquisition request sent by the target application is received through the file system.
[0121] Step 402: Determine the shared application based on the data acquisition request, and query the group identifier array to determine whether the target application has read permissions for the file directory of the shared application.
[0122] Step 403: If the target application has read permissions to the shared application's file directory, the target application reads the target data from the shared application's file directory.
[0123] In this embodiment of the disclosure, after the target application is started, a data acquisition request sent by the target application is received through the file system. The data acquisition request includes a sharing application identifier, a data acquisition content identifier, etc.
[0124] In this embodiment of the disclosure, determining the shared application based on the data acquisition request can be understood as obtaining the shared application identifier by parsing the data acquisition request, determining the shared application based on the shared application identifier, and further querying the group identifier array to determine whether the target application has read permissions for the file directory of the shared application.
[0125] In one possible implementation of this disclosure, the multimedia process identifier of the shared application is obtained; it is determined whether the group identifier array includes the multimedia process identifier; if the group identifier array includes the multimedia process identifier, it is determined that the target application has read permissions to the file directory of the shared application; if the group identifier array does not include the multimedia process identifier, it is determined that the target application does not have read permissions to the file directory of the shared application.
[0126] In this embodiment of the disclosure, when the target application has read permissions to the file directory of the shared application, the target application reads the target data from the file directory of the shared application.
[0127] Therefore, by adding the multimedia process identifier of the shared application to the group identifier array of the corresponding process of the target application to read the data stored in the shared application, the convenience of data sharing between applications is improved and the collaboration ability between applications is enhanced.
[0128] With the above Figures 1 to 6Corresponding to the data sharing method for applications provided in the embodiments, this disclosure also provides a data sharing device for applications. Since the data sharing device for applications provided in the embodiments of this disclosure is similar to the one described above... Figures 1 to 6 The data sharing method provided in the embodiments corresponds to the data sharing device provided in the embodiments of this disclosure, and will not be described in detail in the embodiments of this disclosure.
[0129] Figure 7 This is a schematic diagram of the structure of the data sharing device for the application described in the embodiments of this disclosure.
[0130] like Figure 7 As shown, the data sharing device of this application is used in an electronic device and includes: an acquisition module 701, a determination module 702, and a processing module 703.
[0131] The acquisition module 701 is used to acquire the application type of the target application when the target application is detected to start.
[0132] The determination module 702 is used to determine the shared application based on the application type.
[0133] The processing module 703 is used to obtain the multimedia process identifier of the shared application and add it to the group identifier array of the process corresponding to the target application.
[0134] In summary, the data sharing device of this disclosure improves the convenience of data sharing between applications and enhances the collaboration capabilities between applications by detecting when the target application starts, obtaining the application type of the target application, determining the sharing application based on the application type, obtaining the multimedia process identifier of the sharing application, and adding it to the group identifier array of the corresponding process of the target application.
[0135] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0136] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data sharing method for an application, characterized in that, include: When the target application is launched, the application type of the target application is obtained; The shared application is determined based on the application type; Obtain the multimedia process identifier of the shared application and add it to the group identifier array of the process corresponding to the target application. Query the group identifier array to determine whether the target application has read permissions for the file directory of the shared application.
2. The data sharing method for the application according to claim 1, characterized in that, Before adding the multimedia process identifier of the shared application to the group identifier array of the process corresponding to the target application, the method further includes: The multimedia process runs through the file system and calls interface functions to create the application's file directory on the terminal. In the interface function, directory permission values are set, and the directory permissions of the file directory are determined based on the directory permission values.
3. The data sharing method for the application according to claim 1, characterized in that, The step of determining the shared application based on the application type includes: Based on the application type, the target application is determined to be a document application, and the user identifier of the target application is obtained; Based on the user identifier, the target application is determined to be in main user mode, and the clone application corresponding to the clone user identifier is obtained as the shared application. The step of obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the process corresponding to the target application includes: Obtain the multimedia process identifier of the cloned application and add it to the group identifier array of the corresponding process of the document application.
4. The data sharing method for the application according to claim 1, characterized in that, The step of determining the shared application based on the application type includes: Based on the application type, the target application is determined to be a multimedia application, and the user identifier of the target application is obtained; Based on the user identifier, the target application is determined to be in primary user mode, and the cloned application corresponding to the cloned user is obtained as the shared application; or... Based on the user identifier, the target application is determined to be in clone user mode, and the main application corresponding to the main user is obtained as the shared application. The step of obtaining the multimedia process identifier of the shared application and adding it to the group identifier array of the process corresponding to the target application includes: The multimedia process identifier of the cloned application or the main application is calculated based on the target multimedia process identifier and the cloned user identifier of the target application, and the multimedia process identifier is added to the group identifier array of the corresponding process of the multimedia application.
5. The data sharing method for the application according to claim 4, characterized in that, The step of calculating the multimedia process identifier of the cloned application or the main application based on the target application's target multimedia process identifier and the cloned user identifier includes: When the target application is in main user mode, the sum of the products of the main application's main multimedia process identifier and the clone user identifier multiplied by a preset value is obtained as the multimedia process identifier; or, When the user identifier is in clone user mode, the difference between the clone application's clone multimedia process identifier and the clone user identifier multiplied by a preset value is obtained as the multimedia process identifier.
6. The data sharing method for the application according to claim 1, characterized in that, Also includes: After the target application starts, the file system receives the data retrieval request sent by the target application; The shared application is determined based on the data acquisition request, and the target application is queried from the group identifier array to determine whether it has read permissions for the file directory of the shared application. If the target application has read permissions to the file directory of the shared application, the target application reads the target data from the file directory of the shared application.
7. The data sharing method for the application according to claim 6, characterized in that, The step of querying the group identifier array to determine whether the target application has read permissions for the file directory of the shared application includes: Obtain the multimedia process identifier of the shared application; Determine whether the group identifier array includes the multimedia process identifier; If the group identifier array includes the multimedia process identifier, it is determined that the target application has read permissions for the file directory of the shared application; If the multimedia process identifier is not included in the group identifier array, it is determined that the target application does not have read permissions for the file directory of the shared application.
8. A data sharing device for an application, characterized in that, include: The acquisition module is used to acquire the application type of the target application when the target application is detected to start. A determination module is used to determine the shared application based on the application type. The processing module is used to obtain the multimedia process identifier of the shared application, add it to the group identifier array of the corresponding process of the target application, and query the group identifier array to determine whether the target application has read permissions for the file directory of the shared application.
9. An electronic device, characterized in that, include: Processor and memory; The processor executes the steps of the data sharing method of the application as described in any one of claims 1 to 7 by invoking programs or instructions stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that cause a computer to perform the steps of the data sharing method of the application as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Access management method and system for multiple application systems
CN105225072A
Sharing method and sharing device for application data and terminal
CN106446158A