A file management method, an electronic device, a storage medium, and a program product
Patent Information
- Application Number
- CN202510578148.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0112]第九方面,还提供一种芯片,所述芯片用于执行如上述第一方面、第二方面、第三方面、第四方面、第五方面中任一方面所提供的方法。
Smart Images

Figure CN123011834A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a file management method, electronic device, storage medium and program product. Background Technology
[0002] Electronic devices, such as mobile phones and tablets, have gradually become indispensable in people's daily lives and work. For example, users can store various files and folders on electronic devices. With the advancement of storage technology, the number of files and folders stored on electronic devices is increasing, making the convenient management of these files and folders a crucial issue to consider. Summary of the Invention
[0003] This application provides a file management method, electronic device, storage medium, and program product, which provide a convenient way to manage files / folders and help improve user experience.
[0004] Firstly, a file management method is provided, applied to an electronic device. The method includes: receiving a first instruction, the first instruction indicating that a first application has a folder access requirement; displaying a folder selection interface, the folder selection interface including identifiers of N folders, where N is a positive integer, wherein the N folders are folders determined according to first information, the first information including at least one of: the filename of a first file, and the context of the download scenario of the first file, wherein the first file is a file to be downloaded by the first application.
[0005] Therefore, in this embodiment of the application, in a file download scenario, the electronic device can recommend folders to the user. On the one hand, this enables the user to quickly locate the target folder, improving convenience; on the other hand, recommending folders based on the filename of the file to be downloaded and / or the context of the download scenario improves the accuracy of folder recommendations, thus contributing to a better user experience.
[0006] In one possible design, the N folders include: M local folders, which are folders in the electronic device, where M is a positive integer less than or equal to N.
[0007] Therefore, in this way, electronic devices can recommend local folders to users in file download scenarios. This not only helps users quickly locate the target folder and improves convenience, but also improves the accuracy of local folder recommendations based on the filename of the file to be downloaded and / or the context of the download scenario, thus enhancing the user experience.
[0008] In one possible design, before displaying the folder selection interface, the method further includes: obtaining a first condition from the first application, wherein the first condition is a folder filtering condition determined by the first application based on the first information; and determining M local folders based on the first condition, wherein all M local folders satisfy the first condition.
[0009] Therefore, in this way, the first application determines the first condition based on the first information, so that the electronic device recommends local folders based on the first condition provided by the first application. In this process, the first application provides the first condition to the electronic device (e.g., the operating system), but the first information of the first application is not directly exposed to the electronic device (e.g., the operating system), so the information security of the first application can be well protected.
[0010] In one possible design, the first condition includes a first vector, and all M local folders satisfy the first condition, including: the distance between the folder vector of each of the M local folders and the first vector is less than a preset distance.
[0011] Therefore, in this way, the first application determines the first vector based on the first information, so that the electronic device can determine the local folder based on the first vector provided by the first application. In this process, the first information of the first application is not directly exposed to the electronic device (e.g., the operating system), which can effectively protect the information security of the first application.
[0012] In one possible design, the first condition includes a first file type, and all M local folders satisfy the first condition, including: each of the M local folders is suitable for storing files of the first file type.
[0013] Therefore, in this way, the first application determines the first file type based on the first information, so that the electronic device can determine the appropriate local folder based on the first file type provided by the first application. In this process, the first information of the first application is not directly exposed to the electronic device (e.g., the operating system), which can effectively protect the information security of the first application.
[0014] In one possible design, the method further includes: receiving a selection operation for a first folder, the first folder being one of the M local folders; providing the first application with the path of the first folder, so that the first application downloads the first file to the first folder according to the path of the first folder.
[0015] Therefore, in the file download scenario of this application embodiment, the electronic device can recommend a local folder to the user. If the user selects a local folder, the first application will download the file to the local folder selected by the user.
[0016] In one possible design, the N folders include: K cloud-side folders, which are folders of the first application located on the server, where K is a positive integer less than or equal to N.
[0017] Therefore, in this way, in the scenario of downloading files in the first application, the electronic device can recommend the cloud-side folder of the first application to the user, so that the user can choose the cloud-side folder. Moreover, the cloud-side folder is determined based on the file name of the file to be downloaded and / or the context of the download scenario, which has high accuracy and helps to improve the user experience.
[0018] In one possible design, before displaying the folder selection interface, the method further includes: obtaining the identifiers of the K cloud-side folders from the first application.
[0019] For example, the identifier of a cloud-side folder can be the filename of the cloud-side folder.
[0020] Therefore, in this way, in the scenario where the first application is downloading files, the electronic device can recommend the cloud-side folder of the first application to the user. Moreover, in this process, the first application does not expose the file content of the cloud-side folder to the electronic device, but provides the identifier of the cloud-side folder to the electronic device, which can protect the information security of the first application to a certain extent.
[0021] In one possible design, the method further includes: receiving a selection operation for a second folder, the second folder being one of the K cloud-side folders; notifying the first application that the second folder has been selected, so that the first application stores the first file in the second folder.
[0022] Therefore, in the embodiments of this application, in the scenario of the first application downloading files, the electronic device can not only recommend local folders to the user, but also recommend cloud-side folders of the first application, providing more choices; if the user selects a cloud-side folder, the first application is notified so that the first application stores the file in the cloud-side folder.
[0023] In one possible design, the first application is an instant messaging application, the first file is a file sent by a first contact in the instant messaging application, and the context of the download scenario for the first file includes: the chat history with the first contact in the instant messaging application; or, the first application is an email application, the first file is a file in a first email received by the email application, and the context of the download scenario for the first file includes: the email information of the first email; or, the first application is a browser application, the first file is a file to be downloaded within a first interface of the browser application, and the context of the download scenario for the first file includes: the display information in the first interface.
[0024] Therefore, in this way, for different applications, intelligent folder recommendations can be made based on the context of the application's file download scenario, thereby improving the user experience.
[0025] In one possible social context, the N folders are folders that the first application has accessed within a first preset time period and whose access frequency is higher than a preset frequency, and / or folders whose usage time is later than a second preset time period.
[0026] Therefore, in this way, electronic devices can recommend folders that the first application has frequently accessed, and / or folders that the user has recently used, further improving the accuracy of folder recommendations.
[0027] Secondly, a file management method is also provided, applied to a first application in an electronic device. The method includes: receiving a first operation, the first operation being a download operation for a first file; triggering a file manager in the electronic device to display a folder selection interface, the folder selection interface including identifiers of N folders, where N is a positive integer, wherein the N folders are folders determined based on first information, the first information including at least one of: the filename of the first file, and the context of the download scenario of the first file.
[0028] In one possible design, the N folders include: M local folders, which are folders in the electronic device, where M is a positive integer less than or equal to N.
[0029] In one possible design, the method further includes: providing the file manager with a first condition, so that the file manager determines M local folders that satisfy the first condition, wherein the first condition is a folder filtering condition determined by the first application based on the first information.
[0030] In one possible design, the first condition includes a first vector, and M local folders that satisfy the first condition include: the distance between the folder vector of each of the M local folders and the first vector is less than a preset distance.
[0031] In one possible design, the first condition includes a first file type, and M local folders that satisfy the first condition, including: each of the M local folders is suitable for storing files of the first file type.
[0032] In one possible design, the method further includes: obtaining the path of a first folder selected by the user, wherein the first folder is one of the M local folders; and downloading the first file to the first folder according to the path of the first folder.
[0033] In one possible design, the N folders include: K cloud-side folders, which are folders of the first application located on the server, where K is a positive integer less than or equal to N.
[0034] In one possible design, the method further includes: determining K cloud-side folders that satisfy a second condition, wherein the second condition is a folder filtering condition determined based on the first information; and providing the file manager with identifiers of the K cloud-side folders.
[0035] In one possible design, the method further includes: determining that the user selects a second folder, which is one of the K cloud-side folders; and storing the first file in the second folder.
[0036] In one possible design, the first application is an instant messaging application, the first file is a file sent by a first contact in the instant messaging application, and the context of the download scenario for the first file includes: the chat history with the first contact in the instant messaging application; or, the first application is an email application, the first file is a file in a first email received by the email application, and the context of the download scenario for the first file includes: the email information of the first email; or, the first application is a browser application, the first file is a file to be downloaded within a first interface of the browser application, and the context of the download scenario for the first file includes: the display information in the first interface.
[0037] In one possible social context, the N folders are folders that the first application has accessed within a first preset time period and whose access frequency is higher than a preset frequency, and / or folders whose usage time is later than a second preset time period.
[0038] Thirdly, a file management method is also provided, applied to an electronic device. The method includes: receiving a first instruction, the first instruction indicating that a first application has a file access requirement; displaying a file selection interface, the file selection interface including identifiers of N files, where N is a positive integer, wherein the N files are recommended based on first information, the first information including: the context of the file access requirement scenario of the first application.
[0039] Therefore, in this embodiment of the application, in the scenario of a first application requiring a file, the electronic device can recommend files to the user. On the one hand, this enables the user to quickly locate the target file, improving convenience; on the other hand, recommending files based on the context of the first application's file requirement scenario improves the accuracy of file recommendations, thus contributing to a better user experience.
[0040] In one possible design, the N files include: M local files, which are files in the electronic device, where M is a positive integer less than or equal to N.
[0041] Therefore, in this way, in the scenario where the first application requires a file, the electronic device can recommend local files to the user. This not only helps the user quickly locate the target file and improves convenience, but also improves the accuracy of file recommendations based on the context of the first application's file requirement scenario, thus enhancing the user experience.
[0042] In one possible design, before displaying the file selection interface, the method further includes: obtaining a first condition from the first application, wherein the first condition is a file filtering condition determined by the first application based on the first information; and determining M local files based on the first condition, wherein all M local files satisfy the first condition.
[0043] Therefore, in this way, the first application determines the first condition based on the first information, so that the electronic device recommends local files based on the first condition provided by the first application. In this process, the first information of the first application is not directly exposed to the electronic device (e.g., the operating system), so the information security of the first application can be well protected.
[0044] In one possible design, the first condition includes a first vector, and all M local files satisfy the first condition, including: the distance between the file vector of each of the M local files and the first vector is less than a preset distance.
[0045] Therefore, in this way, the first application determines the first vector based on the first information, so that the electronic device can determine the local file based on the first vector provided by the first application. In this process, the first information of the first application is not directly exposed to the electronic device (e.g., the operating system), which can effectively protect the information security of the first application.
[0046] In one possible design, the first condition includes a first file type, and all M local files satisfy the first condition, including: the second file type of each of the M local files matches the first file type.
[0047] Therefore, in this way, the first application determines the first file type based on the first information, so that the electronic device can determine the local file based on the first file type provided by the first application. In this process, the first information of the first application is not directly exposed to the electronic device (e.g., the operating system), which can effectively protect the information security of the first application.
[0048] In one possible design, the method further includes: receiving a selection operation for a first file, the first file being one of the M local files; and providing the first application with the path of the first file so that the first application obtains the first file based on the path of the first file.
[0049] Therefore, in the file request scenario of the first application in this embodiment, the electronic device can recommend local files to the user. If the user selects a local file, the first application obtains the local file selected by the user.
[0050] In one possible design, the N files include: K cloud-side files, which are files of the first application located on the server, where K is a positive integer less than or equal to N.
[0051] Therefore, in this way, in the scenario of the first application's file requirement, the electronic device can recommend the cloud-side file of the first application to the user, so that the user can choose the cloud-side file. Moreover, the cloud-side file is determined according to the context of the file requirement scenario of the first application, which has high accuracy and helps to improve the user experience.
[0052] In one possible design, before displaying the file selection interface, the method further includes: obtaining the identifiers of the K cloud-side files from the first application.
[0053] For example, the identifier of a cloud-side file can be the filename of the cloud-side file.
[0054] Therefore, in this way, in the scenario of the first application requirement file, the electronic device can recommend the cloud-side file of the first application to the user. Moreover, in this process, the first application does not expose the file content of the cloud-side file to the electronic device, but provides the identifier of the cloud-side file to the electronic device, which can protect the information security of the first application to a certain extent.
[0055] In one possible design, the method further includes: receiving a selection operation for a second file, the second file being one of the K cloud-side files; and notifying the first application that the second file has been selected, so that the first application processes the second file.
[0056] Therefore, in the file request scenario of the first application, the electronic device can recommend not only local files to the user, but also cloud-based files of the first application, providing more choices; if the user selects a cloud-based file, the first application is notified so that the first application can process the cloud-based file selected by the user.
[0057] In one possible design, the first application is an instant messaging application that generates a file access request within a chat window with a first contact. The context of the file access request scenario includes the chat history with the first contact within the instant messaging application. Alternatively, the first application is an email application that generates a file access request within the email editing interface of a first email. The context of the file access request scenario includes the content of the first email. Or, the first application is a social application that generates a file access request within a document editing interface. The context of the file access request scenario includes the document content within the document editing interface.
[0058] Therefore, in this way, for different applications, intelligent file recommendations can be made based on the context of the application's file requirements, thereby improving the user experience.
[0059] In one possible social context, the N folders are files that the first application has accessed within a first preset time period and whose access frequency is higher than a preset frequency, and / or files whose usage time is later than a second preset time.
[0060] Therefore, in this way, electronic devices can recommend files that the first application has frequently accessed, and / or files that the user has recently used, further improving the accuracy of file recommendations.
[0061] Fourthly, a file management method is also provided, applied to a first application in an electronic device. The method includes: receiving a first operation, the first operation being a file selection operation; triggering a file manager in the electronic device to display a file selection interface, the file selection interface including identifiers of N files, where N is a positive integer, wherein the N files are recommended based on first information, the first information including: the context of the file requirement scenario of the first application.
[0062] In one possible design, the N files include: M local files, which are files in the electronic device, where M is a positive integer less than or equal to N.
[0063] In one possible design, the method further includes: providing a first condition to the file manager so that the file manager determines M local files based on the first condition, wherein all M local files satisfy the first condition, wherein the first condition is a file filtering condition determined by the first application based on the first information.
[0064] In one possible design, the first condition includes a first vector, and all M local files satisfy the first condition, including: the distance between the file vector of each of the M local files and the first vector is less than a preset distance.
[0065] In one possible design, the first condition includes a first file type, and all M local files satisfy the first condition, including: the second file type of each of the M local files matches the first file type.
[0066] In one possible design, the method further includes: determining the path of a first file selected by the user, wherein the first file is one of the M local files; and obtaining the first file based on the path of the first file.
[0067] In one possible design, the N files include: K cloud-side files, which are files of the first application located on the server, where K is a positive integer less than or equal to N.
[0068] In one possible design, the method further includes: determining K cloud-side files that satisfy a second condition, wherein the second condition is a file filtering condition determined based on the first information; and providing the file manager with the identifiers of the K cloud-side files.
[0069] In one possible design, the method further includes: determining that the user selects a second file, which is one of the K cloud-side files; and processing the second file.
[0070] In one possible design, the first application is an instant messaging application that generates a file access request within a chat window with a first contact. The context of the file access request scenario includes the chat history with the first contact within the instant messaging application. Alternatively, the first application is an email application that generates a file access request within the email editing interface of a first email. The context of the file access request scenario includes the content of the first email. Or, the first application is a social application that generates a file access request within a document editing interface. The context of the file access request scenario includes the document content within the document editing interface.
[0071] In one possible social context, the N folders are files that the first application has accessed within a first preset time period and whose access frequency is higher than a preset frequency, and / or files whose usage time is later than a second preset time.
[0072] Fifthly, a file management method is applied to an electronic device. The method includes: detecting a newly added first file in a management folder; determining a first target folder suitable for storing the first file according to a first preset rule, wherein the first target folder is different from the management folder; and storing the first file in the first target folder.
[0073] Therefore, in this embodiment of the application, the electronic device can reassign paths to files in the management folder so that the files in the management folder can be moved to a suitable folder, providing a convenient file management method.
[0074] In one possible design, after the first file is stored in the first target folder, the management folder does not contain the first file.
[0075] Therefore, in this embodiment of the application, the electronic device can reassign paths to files in the management folder, so that files in the management folder can be moved out and moved to a suitable folder, thereby improving the convenience of file management.
[0076] In one possible design, before the first file is detected to have been added to the management folder, the method further includes: downloading the first file to the management folder.
[0077] Therefore, in this embodiment of the application, the user only needs to download the file to the management folder to trigger the electronic device to reassign the file path so that the file can be moved to the appropriate folder. In this process, the user does not need to manually find the appropriate folder, which improves the convenience of file management.
[0078] In one possible design, before the detection of a new first file in the management folder, the method further includes: moving the first file from the electronic device into the management folder.
[0079] Therefore, in this embodiment of the application, when a user organizes local files, they only need to move the local files to the management folder to trigger the electronic device to reassign the files to the appropriate folder. In this process, the user does not need to manually search for the appropriate folder, which improves the convenience of file management.
[0080] In one possible design, the managed folder can be either the system default folder or a user-specified folder. Therefore, users can set their preferred folder as the managed folder according to their needs, which helps improve the user experience.
[0081] In one possible design, the management folder is an application sandbox for the first application in the electronic device.
[0082] Therefore, in this embodiment of the application, after the application downloads the file to the application sandbox, it triggers the reallocation of the file path so that the file is moved to the appropriate folder. In this process, the user does not need to manually find the appropriate folder, which improves convenience.
[0083] In one possible design, the method further includes setting the application sandbox of the first application as a management folder based on user settings.
[0084] Therefore, users can set an application's sandbox as a managed folder according to their needs. For example, a user can set a browser application's sandbox as a managed folder. In this case, when the browser application downloads files to the application sandbox, it will trigger path reallocation, moving the files to the appropriate folder. Similarly, a user can set the WeChat application's sandbox as a managed folder. This way, when WeChat application downloads files to the application sandbox, it will trigger path reallocation, moving the files to the appropriate folder.
[0085] In one possible design, the metadata of the management folder includes a first tag that indicates the management folder.
[0086] Therefore, in this way, electronic devices can accurately identify which file belongs to the management folder, and thus detect the management folder. For example, if a new file is detected in the management folder, the path of the file is reassigned so that the file is moved to the appropriate folder.
[0087] In one possible design, the method further includes: when the first file is located in the management folder, the first file is invisible to the user; when the first file is located in the first target folder, the first file is visible to the user.
[0088] Therefore, in this way, since the first file is not visible to the user when it is downloaded to the management folder, the user will not be aware that the file has been moved from the management folder to the first target folder, thus avoiding any impact on the user experience.
[0089] In one possible design, the method further includes: renaming the first file according to the file content of the first file.
[0090] Therefore, this method improves the accuracy of downloaded filenames.
[0091] In one possible design, before renaming the first file according to its content, the method further includes: determining that the filename of the first file does not match its content; and / or determining that the first target folder already contains other files with the same filename as the first file.
[0092] Therefore, this method can improve the accuracy of downloaded file names and avoid duplicate file names, making it easier for users to distinguish between them and improving the user experience.
[0093] In one possible design, before downloading the first file to the management folder, the method further includes: receiving a download operation for the first file, displaying a first interface of the file manager, the first interface including an identifier of the management folder; and receiving a selection operation for the identifier.
[0094] Therefore, in this way, when the user selects a management folder, the electronic device downloads the file to the management folder to trigger the reallocation of the file path, resulting in a better user experience.
[0095] In one possible design, before downloading the first file to the management folder, the method further includes: determining a second target folder suitable for storing the first file according to a second preset rule, wherein the second preset rule is different from the first preset rule; the downloading of the first file to the management folder includes: downloading the first file to the management folder if a second target folder suitable for storing the first file cannot be determined according to the second preset rule.
[0096] Therefore, in this way, in a file download scenario, the electronic device first searches for a suitable folder to store the file according to the second preset rule. If no folder is found, the file is downloaded to the management folder to trigger the reallocation of the file path. During this process, the user does not need to manually search for a suitable folder, which improves convenience.
[0097] In one possible design, before downloading the first file to the management folder, the method further includes: outputting a first prompt message, the first prompt message being used to prompt whether to download the first file to the management folder; and receiving a confirmation download instruction.
[0098] Therefore, in this way, with user confirmation, the electronic device downloads the file to the management folder, thereby triggering a path reassignment, which helps improve the user experience.
[0099] In one possible design, determining a second target folder suitable for storing the first file according to a second preset rule includes: determining a second target folder suitable for storing the first file based on the filename of the first file and / or the context of the download scenario of the first file.
[0100] Therefore, in the embodiments of this application, in the file download scenario, the electronic device first searches for a suitable folder based on the file name of the file to be downloaded and / or the context of the download scenario. If no folder is found, the file is downloaded to the management folder, thereby triggering path reallocation so that the file is moved to the appropriate folder. In this process, the user does not need to manually search for the appropriate folder, which improves convenience.
[0101] In one possible design, determining the first target folder suitable for storing the first file according to a first preset rule includes: determining the first target folder suitable for storing the first file based on at least one of the file content of the first file, the historical access records of the first application to the folder, and the user's usage of the folder, wherein the first application is the application that downloaded the first file.
[0102] Therefore, in the embodiments of this application, in the file download scenario, the electronic device first searches for a suitable folder based on the file name of the file to be downloaded and / or the context of the download scenario. If no folder is found, the file is downloaded to the management folder to trigger the reallocation of the file path. Moreover, the reallocation is performed based on the file content, which improves the accuracy of folder determination. Furthermore, the user does not need to manually search for a suitable folder during this process, which improves convenience.
[0103] In one possible design, determining the first target folder suitable for storing the first file according to the first preset rule includes: determining the first target folder suitable for storing the first file within the mapping range of the management folder according to the first preset rule, wherein the mapping range refers to the range of storage space that can be found when searching for storage locations for files within the management folder according to the first preset rule.
[0104] Therefore, in this embodiment of the application, when the electronic device reassigns paths to files in the management folder, it can reassign them within the mapping range of the management folder (e.g., drive D), avoiding reassignment to paths outside the mapping range, which would lead to file management chaos.
[0105] In one possible design, the mapping scope of the management folder is a user-specified scope.
[0106] Therefore, in this embodiment of the application, users can set the mapping range of the management folder according to their own needs, which helps to improve the user experience.
[0107] In one possible design, after the first file is stored in the first target folder, the method further includes: outputting a second prompt message, the second prompt message being used to indicate that the first file has been stored in the first target folder.
[0108] Therefore, in this embodiment of the application, the electronic device can notify the user which path the file has been reassigned to, so as to facilitate the user's query and help improve the user experience.
[0109] Sixthly, an electronic device is also provided for performing the methods provided in any one of the first, second, third, fourth, and fifth aspects described above.
[0110] In a seventh aspect, a computer-readable storage medium is also provided for storing a computer program that, when run on a computer, causes the computer to perform the methods provided in any one of the first, second, third, fourth, and fifth aspects described above.
[0111] Eighthly, a computer program product is also provided, comprising a computer program that, when run on a computer, causes the computer to perform the methods provided in any one of the first, second, third, fourth, and fifth aspects described above.
[0112] Ninthly, a chip is also provided for performing the methods provided in any one of the first, second, third, fourth, and fifth aspects described above.
[0113] For the technical effects that can be achieved by the second to ninth aspects mentioned above, please refer to the description of the technical effects that can be achieved by the corresponding design schemes in the first aspect mentioned above. This application will not repeat them here. Attached Figure Description
[0114] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0115] Figure 2 Another structural schematic diagram of an electronic device provided in an embodiment of this application;
[0116] Figure 3 A schematic diagram illustrating a file download scenario provided in an embodiment of this application;
[0117] Figure 4 A schematic diagram illustrating a file upload scenario provided in an embodiment of this application;
[0118] Figure 5 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application;
[0119] Figure 6 This is a schematic diagram of an application scenario two provided in an embodiment of this application;
[0120] Figure 7 A schematic flowchart of a file management method provided in an embodiment of this application;
[0121] Figure 8 Another flowchart illustrating a file management method provided in an embodiment of this application;
[0122] Figure 9 A schematic diagram illustrating an example of application scenario two provided in an embodiment of this application;
[0123] Figure 10 A schematic diagram illustrating another example of application scenario two provided in an embodiment of this application;
[0124] Figure 11A Another schematic diagram illustrating an application scenario provided by an embodiment of this application;
[0125] Figure 11B Another schematic diagram illustrating an application scenario provided by an embodiment of this application;
[0126] Figure 12 A schematic diagram of a management folder provided in an embodiment of this application;
[0127] Figures 13A to 13B A schematic diagram illustrating the configuration process of a management folder provided in an embodiment of this application;
[0128] Figure 14A This is yet another schematic diagram illustrating an application scenario provided in an embodiment of this application;
[0129] Figure 14B This is yet another schematic diagram illustrating an application scenario provided in an embodiment of this application;
[0130] Figure 15 This is yet another schematic diagram illustrating an application scenario provided in an embodiment of this application;
[0131] Figure 16 This is yet another schematic diagram illustrating application scenario two provided in an embodiment of this application;
[0132] Figure 17 A schematic flowchart of a file management method provided in an embodiment of this application;
[0133] Figure 18 Another flowchart illustrating a file management method provided in an embodiment of this application;
[0134] Figure 19 Another flowchart illustrating a file management method provided in an embodiment of this application;
[0135] Figure 20 Another flowchart illustrating a file management method provided in an embodiment of this application;
[0136] Figure 21 This is a schematic diagram of another structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0137] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0138] A file is a form of content storage. In this application, the file can be of any type, including but not limited to: images, videos, audio, documents, presentations, spreadsheets, etc. Each type of file can include one or more file formats. For example, images can be formatted as JPEG, PNG, BMP, GIF, etc. Videos can be formatted as MPEG, AVI, MP4, WMV, etc. Audio can be formatted as MP3, OGG, AAC, AMR, etc. Documents can be formatted as doc, docx, txt, PDF, HTML, etc. Presentations can be formatted as ppt, pptx, etc. Spreadsheets can be formatted as xlsx, xls, etc.
[0139] A file vector is a digital representation of file content, that is, a visual description of file content using numbers. The process of obtaining a file vector from the file content is called file vectorization. For example, file vectorization maps file content to a multi-dimensional space to obtain the file vector. This multi-dimensional space is a coordinate system containing multiple dimensions. Each dimension can be understood as an axis of the coordinate system, representing a semantic term / keyword. Taking a three-dimensional space as an example, it includes an x-axis, a y-axis, and a z-axis; the x-axis represents semantic term 1 / keyword 1 (e.g., traditional culture), the y-axis represents semantic term 2 / keyword 2 (e.g., opera), and the z-axis represents semantic term 3 / keyword 3 (e.g., art). In one possible implementation, mapping file content to a multi-dimensional space may include: determining multiple different keywords of the file based on the file content, and determining the frequency of each keyword; determining a coordinate point in the multi-dimensional space based on the multiple keywords and the frequency of each keyword. For example, the coordinate point can be represented as (P1, P2, P3…PN), where N represents the number of dimensions of the multi-dimensional space, that is, the number of axes contained in the coordinate system. Wherein, P1 represents the value of the coordinate point on the P1 axis. Assuming the P1 axis corresponds to keyword 1, the value on the P1 axis is proportional to the frequency of keyword 1's occurrences in the file. P2 represents the value of the coordinate point on the P2 axis. Assuming the P2 axis corresponds to keyword 2, the value on the P2 axis is proportional to the frequency of keyword 2's occurrences in the file. P3 represents the value of the coordinate point on the P3 axis. Assuming P3 corresponds to keyword 3, the value on the P3 axis is proportional to the frequency of keyword 3's occurrences in the file. Similarly, PN represents the value of the coordinate point on the PN axis. Assuming PN corresponds to keyword N, the value on the PN axis is proportional to the frequency of keyword N's occurrences in the file. After marking the coordinate points in multidimensional space, the vector from the origin to the coordinate point is the file vector. It should be noted that the above process is only an example of file vectorization, intended to help understand file vectors, and does not constitute a specific limitation on file vectorization. In summary, a file vector is a vector that determines the coordinates of a point in a multidimensional space based on the file content, from the origin of the multidimensional space to that point.
[0140] A folder is a storage format for files; a folder can contain one or more files. In this application's embodiments, the folder can be either uncompressed or compressed; there is no limitation. There are various methods for compressing folders, which will not be elaborated upon here.
[0141] Folder vectors are a digital representation of folder content, providing a visual description of the folder's contents. The process of obtaining a folder vector based on its content is called folder vectorization. Folder content can include the contents of files stored within the folder. A folder may contain multiple files, and the content of each file (e.g., keywords) constitutes the folder content. Folder vectorization shares the same principle as file vectorization, for example, mapping the folder content to a multi-dimensional space to obtain the folder vector. In one possible implementation, mapping the folder content to a multi-dimensional space can include: the folder content includes multiple different keywords; determining the frequency of each keyword; and determining a coordinate point in the multi-dimensional space based on the multiple keywords and their frequency. The vector from the origin to this coordinate point is the folder vector. In another possible embodiment, the folder vector can also be determined based on the file vectors of the files contained within the folder. For example, if a folder contains multiple files, each corresponding to a file vector, the folder vector can be determined based on these multiple file vectors. For instance, the folder vector can be the sum of the multiple file vectors. It should be noted that the aforementioned process is merely an example of folder vectorization, intended to provide an understanding of folder vectors, and does not constitute a specific limitation on folder vectorization. In summary, a folder vector is a vector from the origin of the multidimensional coordinate system to a coordinate point determined based on the folder's contents in a multidimensional space.
[0142] Folder affinity indicates what types of files a folder is suitable for storing. Therefore, folder affinity includes one or more file types. As an example, folder affinity can be determined based on the files already stored in the folder. For instance, if a folder contains three files, the file type of each file can be determined (e.g., based on filename, file content, etc.), thus determining the folder affinity. For example, if the three files are astronomy, geography, and military, then the folder affinity includes astronomy, geography, and military file types, meaning the folder is suitable for storing astronomy, geography, and military type files. As another example, folder affinity can be determined based on the context in which a user saves a file to the folder. For instance, a user chats with a contact through an instant messaging application, and the contact sends the user a file and expresses their opinion on it (e.g., through a text or voice message), such as "I sent you this file, which describes a lot of traditional cultural knowledge; I recommend you take a look." The user downloads the file sent by the contact to folder A. Electronic devices can determine contextual information (e.g., chat content with a contact) and, based on this contextual information, determine the affinity of folder A. For example, based on the contextual information, if the file is determined to be a traditional file, and the user stores the file in folder A, it indicates that folder A is suitable for storing files of the traditional cultural type; that is, the affinity of folder A is determined to include the traditional file type. It should be noted that the methods for determining folder affinity listed above are merely examples and do not constitute a limitation. In practical applications, other methods can also be used to determine folder affinity.
[0143] An application sandbox is used to protect an application's (APP's) data from being accessed or tampered with by other applications. Electronic devices deploy the application's data within a protected sandbox, called an application sandbox. Different applications correspond to different application sandboxes. Other applications can only access an application's application sandbox with authorization. An application's application sandbox can include one or more folders used to store the data generated by that application.
[0144] The embodiments of this application involve at least one, including one or more; where "multiple" means two or more. Furthermore, it should be understood that in the description of this specification, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating relative importance or order. For example, "first document" and "second document" do not represent the degree of importance of the two or their order, but are merely for descriptive distinction. In the embodiments of this application, "and / or" merely describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0145] The directional terms mentioned in the embodiments of this application, such as "up", "down", "left", "right", "inner", and "outer", are only for reference to the directions in the accompanying drawings. Therefore, the directional terms used are for better and clearer explanation and understanding of the embodiments of this application, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0146] References to "one embodiment," "in some examples," or "some embodiments" as described in this specification mean that one or more embodiments of this specification include a particular feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in some examples," "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0147] The above is an explanation of the names involved in the embodiments of this application. Next, the electronic device of the embodiments of this application will be described.
[0148] The file management method provided in this application can be applied to electronic devices. The electronic device can be any device involved in file management. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, personal computer (PC), ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other portable devices; or it can be a wearable device such as a watch or bracelet; or it can be an in-vehicle device; or it can be a smart home device (e.g., a smart TV, smart speaker); or it can be a virtual reality (VR) device, augmented reality (AR) device, mixed reality (MR) device, etc. In short, this application does not limit the specific type of electronic device. The electronic device can use the file management method provided in this application to manage files, which will be explained in detail below.
[0149] Figure 1 This is a hardware structure diagram of an electronic device provided in an embodiment of this application. For example, the electronic device may be any of the various electronic devices listed above. Figure 1 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, 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.
[0150] 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, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has just used or is recurring. If processor 110 needs to reuse an instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.
[0151] Optionally, the processor 110 can be used to execute the file management method provided in the embodiments of this application. For example, the processor 110 can execute the technical solutions provided in Embodiment 1, Embodiment 2 or Embodiment 3 below.
[0152] Taking the processor 100 executing the technical solution of Embodiment 1 described below as an example. For instance, in a file download scenario, the processor 110 can recommend a target folder to the user according to preset rule A (described below). In this process, the user does not need to manually determine the target folder, which helps improve efficiency. As another example, in a file upload scenario, the processor 100 can recommend a target file to the user according to preset rule B (described below). In this process, the user does not need to manually search for the target file, which helps improve efficiency.
[0153] Taking the processor 110 executing the technical solution of Embodiment 2 described below as an example. For instance, in a file download scenario, the processor 110 can detect whether a new file has been added to the management folder. If a new file is detected in the management folder, the processor 110 reallocates a storage location for the file (i.e., re-determines the target folder for storing the file, which is different from the management folder), and moves the file to the reallocated storage location. Therefore, before downloading a file, the user does not need to manually search for the target folder; the file can be directly downloaded to the management folder, making the operation convenient and providing a better user experience.
[0154] Taking the processor 110 executing the technical solution of Embodiment 3 below as an example. Taking a file download scenario as an example, when the processor 110 is running a first application, after the first application receives a download operation for a first file, it can invoke the first interface of the file manager. The first interface includes identifiers of folders recommended based on the filename of the file to be downloaded by the first application and / or the context of the download scenario. Optionally, the folders can be local folders of the electronic device and / or cloud-based folders of the first application. Taking a file upload scenario as an example, when the processor 110 is running a first application, after the first application receives a file selection operation, it can invoke the first interface of the file manager. The first interface includes identifiers of files recommended based on the context of the file request scenario of the first application. Optionally, the files can include local files of the electronic device and / or cloud-based files of the first application.
[0155] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0156] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0157] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0158] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0159] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0160] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0161] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0162] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0163] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0164] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in conjunction with a tuning switch.
[0165] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. 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 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.
[0166] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, 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, performs frequency modulation and filtering of 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, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0167] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling the electronic device to communicate with networks and other devices via wireless communication technology.
[0168] The display screen 194 is used to display the application's interface, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include one or more display screens 194.
[0169] The electronic device 100 can perform shooting functions through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor. The ISP is used to process the data fed back by the camera 193.
[0170] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and software code for at least one application program. The data storage area may store data generated during the use of the electronic device (e.g., images, videos, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, general-purpose flash memory, etc.
[0171] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, videos, and other files can be saved on the external memory card.
[0172] Electronic devices can implement audio functions such as music playback and recording through audio modules 170, speakers 170A, receivers 170B, microphones 170C, headphone jacks 170D, and application processors.
[0173] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0174] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls and other external playback scenarios through one or more speakers 170A.
[0175] The receiver 170B, also known as a "handpiece," can be one or more, and is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0176] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.
[0177] The 170D headphone jack is used to connect wired headphones.
[0178] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.
[0179] The gyroscope sensor 180B can be used to determine the motion attitude of an electronic device. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization.
[0180] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0181] The magnetic sensor 180D includes a Hall effect sensor. Electronic devices can use the magnetic sensor 180D to detect the opening and closing of a flip cover.
[0182] The 180E accelerometer can detect the magnitude of acceleration in various directions (typically three axes) of electronic devices. When the electronic device is stationary, it can detect the magnitude and direction of gravity.
[0183] The 180F distance sensor is used to measure distance. Electronic devices can measure distance using infrared or laser.
[0184] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device emits infrared light outward through the LED. The electronic device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the electronic device. When insufficient reflected light is detected, the electronic device can determine that no object is near the electronic device.
[0185] An ambient light sensor 180L is used to detect ambient light levels. Electronic devices can adaptively adjust the brightness of the display screen 194 based on the detected ambient light levels.
[0186] The fingerprint sensor 180H is used to collect fingerprints.
[0187] The 180J temperature sensor is used to detect temperature.
[0188] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can then transmit the detected touch operation to the application processor to determine the type of touch event.
[0189] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords.
[0190] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. The electronic device can receive button inputs and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device.
[0191] Understandable, Figure 1 The components shown do not constitute a specific limitation on the electronic device. The electronic device in the embodiments of the present invention may include, but is not limited to, components that are more advanced than those shown. Figure 1 More or fewer parts. Furthermore, Figure 1 The combination / connection relationships between the components can also be adjusted and modified.
[0192] Figure 2 This is a software structure diagram of an electronic device provided in an embodiment of this application. For example, the electronic device may be any of the various electronic devices listed above. Figure 2 As shown, the software architecture of an electronic device can be a layered structure. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. The layered architecture can be, for example, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. This application embodiment uses a layered architecture... Taking a system as an example, the software structure of an electronic device is illustrated. In some embodiments, the software structure of the electronic device is... The system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime and system libraries, kernel layer, and hardware layer.
[0193] like Figure 2As shown, the application layer can include a first application and a file manager. The first application can be any application (APP) on the electronic device, including but not limited to: instant messaging applications, email applications, social applications, image capture applications, video playback applications, audio playback applications, shopping applications, etc. Optionally, the first application can be a system application or a third-party application, without limitation. The file manager is used to manage local files / folders on the electronic device. For example, the file manager can access files / folders in various hard drives (e.g., C drive, D drive, etc.) on the electronic device. The file manager can be in APP form or non-APP form, without limitation. As an example, the file manager can be built into the operating system of the electronic device. The first application and the file manager can communicate. For example, the first application can send the identifier of cloud-side files / folders to the file manager to display the cloud-side files / folders through the file manager's interface. As an example, the first application can communicate with the file manager through an interface module in the application framework layer.
[0194] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 2 As shown, the application framework layer may include an algorithm module and an interface module. The algorithm module is used to determine the target file / target folder according to preset rules. These preset rules include one or more of preset rules A, B, C, D, and E (described below). The algorithm module can receive calls from various applications in the application layer. For example, a file manager can call the algorithm module. For instance, when a file manager calls the algorithm module, it can determine the target file / folder within its local files / folders. A first application can also call the algorithm module. If the first application is a third-party application, it can call the algorithm module through the interface module. The interface module is an interface provided by the operating system of the electronic device for calling the algorithm module. For instance, when a first application calls the algorithm module through the interface module, it can determine the target file / folder within its cloud-side files / folders through the algorithm module.
[0195] It should be noted that, Figure 2 Taking the algorithm module and interface module as an example located in the application framework layer, alternatively, the algorithm module and / or interface module can also be located in other layers, such as the system library or kernel layer, without limitation. It is understandable that, although... Figure 2Although not shown in the diagram, the application framework layer may also include content providers, view systems, call managers, resource managers, notification managers, etc. Content providers store and retrieve data, making this data accessible to the application. This data may include videos, images, audio, made and received calls, browsing history and bookmarks, phone books, etc. View systems include visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. The display interface can consist of one or more views. For example, a display interface including a text notification icon may include views for displaying text and views for displaying images. The call manager provides communication functions for electronic devices, such as managing call status (including connection, hang-up, etc.). The resource manager provides the application with various resources, such as localized strings, icons, images, layout files, video files, etc. The notification manager allows the application to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify of download completion, message alerts, etc. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, causing electronic devices to vibrate, and flashing indicator lights.
[0196] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0197] The system library can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. They support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries implement 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0198] The kernel layer is the layer between hardware and software. The kernel layer can contain drivers for Wi-Fi, display, cameras, audio, sensors, etc.
[0199] The hardware layer includes displays, and may also include various other hardware such as cameras and sensors.
[0200] Understandable, Figure 2 The software structure shown does not constitute a specific limitation on the software structure of electronic devices. The software structure of the electronic devices in the embodiments of the present invention may include, but is not limited to, the following: Figure 2 More or fewer modules, for example, than Figure 2 More or fewer layers, or, a layer containing more than Figure 2 More or fewer modules, etc. Furthermore, Figure 2 The combination / connection relationships between modules can also be adjusted and modified.
[0201] The technical solutions provided in the embodiments of this application are described below with reference to the accompanying drawings.
[0202] As described in the background section, with the advancement of storage technology, the number of files / folders stored in electronic devices is increasing. In some scenarios, users need to find a target file / folder among numerous files / folders. Due to the sheer number of files / folders, the search process is time-consuming and inefficient. For ease of understanding, the following text will use... Figure 3 and Figure 4 We will use two scenarios as examples to illustrate this.
[0203] For example, such as Figure 3 In (a), the electronic device displays a browser application window containing file identifiers (e.g., file names) for two files to be downloaded, as well as a download control. Upon receiving an action on the download control for the second file to be downloaded, the electronic device displays as shown below. Figure 3 The file manager window shown in (b) is as follows. Figure 3 (b) In this context, the file manager window includes the electronic device's local files / folders, as well as save and cancel buttons. Users can... Figure 3 In the file manager window shown in (b), the target folder (e.g., folder 3) is located. After the target folder is determined, if the electronic device receives an operation to save the file, the file is downloaded to the target folder; if the electronic device receives an operation to cancel the file manager window, it is closed. Therefore, through... Figure 3 It is evident that in file download scenarios, users need to search for the target folder among numerous folders, which is time-consuming, inefficient, and inconvenient.
[0204] For example, such as Figure 4 In (a), the electronic device displays a window of an instant messaging application, which is a chat window between the user and contact A. This window includes a file transfer identifier 400. After receiving an operation on the file transfer identifier 400, the electronic device displays as follows: Figure 4 The file manager window shown in (b) is as follows. Figure 4 (b) In this context, the file manager window includes the electronic device's local files / folders, as well as upload and cancel buttons. Users can... Figure 4 The file manager window shown in (b) searches for the target file. After identifying the target file, if the electronic device receives an operation to press the upload button, it sends the target file to contact A; if the electronic device receives an operation to press the cancel button, it cancels the display of the file manager window. Therefore, through... Figure 4 It is evident that in file upload scenarios, users need to search for the target file among numerous files, which is time-consuming, inefficient, and inconvenient.
[0205] Therefore, through Figure 3 and Figure 4 As can be seen from the scenario, users need to search for the target file / folder among many files / folders. The search process is time-consuming, inefficient, and results in a poor user experience.
[0206] Therefore, this application provides a file management method, which can be applied to electronic devices, and the electronic devices can be the various electronic devices listed above. Optionally, the electronic device may include... Figure 1 and / or Figure 2The structure is shown below. Specifically, the electronic device can determine the target file / folder from among numerous files / folders based on preset rules (including at least one of preset rules A, B, C, D, and E mentioned below), and recommend the target file / folder to the user. In this way, the user can be minimized from manually searching for the target file / folder, improving convenience; moreover, the automatic search process of the electronic device is quick and efficient, which helps to improve the user experience.
[0207] For ease of understanding, the following text mainly uses a laptop computer as an example of an electronic device, and elaborates on the file management method provided in the embodiments of this application in conjunction with the accompanying drawings.
[0208] Example 1
[0209] This first embodiment illustrates the process by which an electronic device determines a target file / folder. The target file / folder can be a local file / folder, meaning a file / folder stored on the electronic device. The technical solution of this first embodiment is applicable to file / folder selection scenarios. These scenarios can be any application scenario requiring the selection of a file / folder. For example, file / folder selection scenarios include, but are not limited to, file download scenarios and file upload scenarios.
[0210] To facilitate understanding, the following example illustrates the application scenario of this embodiment.
[0211] Application scenario one: file download scenario.
[0212] The file download scenario can be understood as an electronic device downloading a file to its local device. This downloading can include the electronic device downloading the file to its local device via a first application. The first application can be understood as the file provider or download source. For example, the first application can be a browser application, an instant messaging application, an email application, etc., without limitation. Taking a browser application as an example, a user can search for and download files within the browser application window. Taking an instant messaging application as an example, for instance, contact A sends a file to a user, and the user can download the file to their local device. Taking an email application as an example, for instance, contact A sends an email to a user containing a file, and the user can download the file to their local device. Before downloading the file, the electronic device can use the technical solution provided in Embodiment 1 to determine the target folder from among many local folders, and then download the file to the target folder.
[0213] For ease of understanding, the following example uses an electronic device downloading a file through a browser application to illustrate the process of determining the target folder using the technical solution of Embodiment 1.
[0214] For example, such as Figure 5 In (a), the electronic device displays a browser application window containing file identifiers (e.g., file names) for two files to be downloaded, as well as a download control. Upon receiving an action on the download control for the second file to be downloaded, the electronic device displays as shown below. Figure 5 The file manager window shown in (b) is as follows. Figure 5 In (b) of this embodiment, the file manager window includes a smart recommendation option 500. When the smart recommendation option 500 is selected, the file manager window displays the target folder determined in the local folder by the electronic device using the technical solution of this embodiment. For example, in a tablet computer, the target folder is determined in the local folder according to preset rule A. Figure 5 In (b) of the diagram, the folder within the dashed box is the target folder determined by the electronic device within its local folders according to preset rule A. Optionally, preset rule A may include at least one of preset rule A1, preset rule A2, and preset rule A3. Different preset rules result in different target folders. Therefore, as... Figure 5 In (b), the target folder within the dashed box consists of three parts:
[0215] The first part is the target folder determined by the electronic device according to preset rule A1. For example, preset rule A1 might determine the target folder based on the filename of the file to be downloaded and / or the context of the download scenario. To explain preset rule A1 to the user, the first part can display descriptive information about preset rule A1, such as... Figure 5 The heading "These contents may be relevant" in (b) of the document. The specific details of default rule A1 will be explained later.
[0216] The second part is the target folder determined by the electronic device according to preset rule A2. For example, preset rule A2 could be based on the browser application's historical access records to the folder to determine the target folder. To explain preset rule A2 to the user, the second part can display descriptive information about preset rule A2, such as... Figure 5 The heading "These are the ones you often choose" in (b) of the document. Details regarding default rule A2 will be explained later.
[0217] The third part is the target folder determined by the electronic device according to preset rule A3. For example, preset rule A3 could be based on the user's usage of folders to determine the target folder. To explain preset rule A3 to the user, the third part can display descriptive information about preset rule A3, such as... Figure 5 The heading "You have recently used these" in (b) of the document. Details regarding default rule A3 will be explained later.
[0218] Continue as Figure 5 In (b) above, the file manager window includes a smart recommendation option 500. When smart recommendation option 500 is selected, the file manager window displays the target folder determined by the electronic device using the technical solution of Embodiment 1. Besides smart recommendation option 500, the file manager window also includes other options, such as My Computer option 501, Desktop option 502, etc. If the user is not satisfied with the smartly recommended target folder, they can find the target folder manually. For example, if the user selects Desktop option 502, the file manager window displays the folders contained on the desktop, and the user can find the target folder among these folders. Continuing... Figure 5 In (b) of this example, the file manager window also includes save and cancel buttons. After selecting the target folder, the user can click the save button. Upon receiving the save button operation, the electronic device downloads the file to the user-selected target folder. (Comparison) Figure 5 With the previous text Figure 3 . Figure 3 The file manager does not include a smart recommendation option; users need to manually select the target folder in the file manager. Figure 5 The file manager includes a smart recommendation option 500, which displays folders intelligently recommended by the user's electronic device. Users can find their target folders within these recommendations, narrowing the search scope, improving efficiency, and enhancing the user experience.
[0219] Application scenario two: file upload scenario.
[0220] The file upload scenario can be understood as an electronic device sending local files to other devices or uploading them to a social network. Sending local files to other devices or uploading them to a social network can include: the electronic device sending local files to other devices or uploading them to a social network through a first application. For example, the first application can be an instant messaging application, an email application, a social application (e.g., WeChat Moments, Weibo, Douyin), etc., without limitation. Taking an instant messaging application as an example, a user can send a file to contact A through an instant messaging application. Before sending the file, the electronic device can use the technical solution provided in Embodiment 1 to determine the target file to be sent from a large number of local files, and then send the target file to contact A. Taking an email application as an example, a user can send an email to contact A, which may include a file. Before sending the email, the electronic device can use the technical solution provided in Embodiment 1 to determine the target file from a large number of local files, then include the target file in the email, and then send the email to contact A. Taking a social application as an example, a user can upload files to a social network. Before uploading the file, the electronic device can use the technical solution provided in Embodiment 1 to determine the target file from a large number of local files, and then upload the target file to the social network. In summary, in file upload scenarios, electronic devices can use the technical solution provided in Embodiment 1 to determine the target file from among numerous local files, and then process the target file, such as sending it to a contact or uploading it to a social network.
[0221] For ease of understanding, the following example illustrates the process of determining the target file using the technical solution of Embodiment 1 of this embodiment.
[0222] For example, such as Figure 6 In (a), the electronic device displays a window of an instant messaging application, which is a chat window between the user and contact A. This window includes a file transfer identifier 400. After receiving an operation on the file transfer identifier 400, the electronic device displays as follows: Figure 6 The file manager window shown in (b) is as follows. Figure 6 In (b) of this embodiment, the file manager window includes a smart recommendation option 500. When the smart recommendation option 500 is selected, the file manager window includes the target file determined in the local files by the electronic device using the technical solution of this embodiment, for example, the target file determined in the local files by a tablet computer according to preset rule B. For example, Figure 6In (b) of the diagram, the file within the dashed box is the target file determined by the electronic device according to preset rule B. Optionally, preset rule B may include at least one of preset rule B1, preset rule B2, and preset rule B3. Different target files are determined based on different preset rules. Therefore, as shown... Figure 6 In (b), the target file within the dashed box consists of three parts:
[0223] The first part is the target file determined by the electronic device according to preset rule B1. For example, preset rule B1 may determine the target file based on the context of a file upload scenario (or file request scenario) in an instant messaging application. Optionally, to explain preset rule B1 to the user, the first part may display descriptive information about preset rule B1, such as... Figure 6 The heading "These contents may be relevant" in (b) of the document. The specific details of default rule B1 will be explained later.
[0224] The second part is the target file determined by the electronic device according to preset rule B2. For example, preset rule B2 could be based on the historical access records of files by an instant messaging application to determine the target file. To explain preset rule B2 to the user, the second part can display descriptive information about preset rule B2, such as... Figure 6 The heading "These are the ones you often choose" in (b) of the document. The specific details of default rule B2 will be explained later.
[0225] The third part involves the electronic device determining the target file according to preset rule B3. For example, preset rule B3 could be based on the user's usage of the file to determine the target file. To explain preset rule B3 to the user, the third part can display descriptive information about preset rule B3, such as... Figure 6 The heading "You have recently used these" in (b) of the document. Details regarding default rule B3 will be explained later.
[0226] Continue as Figure 6 In (b) above, the file manager window includes a smart recommendation option 500. When smart recommendation option 500 is selected, the file manager window displays target files recommended by the electronic device using the technical solution of Embodiment 1. Besides smart recommendation option 500, the file manager window also includes other options, such as My Computer option 501, Desktop option 502, etc. If the user is not satisfied with the smartly recommended target files, they can find target files themselves. For example, if the user selects Desktop option 502, the file manager window displays the files contained on the desktop, and the user can find the target file among the files on the desktop to upload. Continuing... Figure 6In (b) of this example, the file manager window also includes upload and cancel buttons. After selecting the target file, the user can click the upload button. Upon receiving the upload button operation, the electronic device sends the selected target file to contact A. (Comparison) Figure 6 With the previous text Figure 4 . Figure 4 The file manager does not include a smart recommendation option; users must manually select the target file. Figure 6 The file manager includes a smart recommendation option 500, which displays files intelligently recommended by the user's electronic device. Users can find their target files among the recommended files, narrowing the search scope, improving efficiency, and enhancing the user experience.
[0227] The above lists two application scenarios of this embodiment one. It should be noted that, in addition to the two application scenarios mentioned above, the technical solution of this embodiment one can also be applied to other application scenarios, which will not be listed one by one.
[0228] Next, taking the two application scenarios mentioned above as examples, we will explain the implementation principle of the technical solution in this embodiment one.
[0229] Taking the first application scenario (file download scenario) mentioned earlier as an example, the implementation principle of the first application scenario can be found in [link to relevant documentation]. Figure 7 .like Figure 7 This is a schematic flowchart illustrating a file management method provided in an embodiment of this application. This method can be applied to file download scenarios, such as application scenario one described above. Figure 7 The process includes:
[0230] Step 700: The first application receives a download operation for the first file.
[0231] For example, the first application could be application scenario one mentioned above (i.e. Figure 5 Browser applications in ).
[0232] Step 701: The first application sends a first instruction to the operating system, which indicates that the first application has a folder access requirement.
[0233] Step 702: The operating system determines a suitable target folder for storing the first file in the local folder according to preset rule A.
[0234] Optionally, preset rule A may include at least one of preset rule A1, preset rule A2, and preset rule A3. Preset rule A1 determines the target folder based on the filename of the first file to be downloaded and / or the context of the download scenario. Preset rule A2 determines the target folder based on the first application's historical access records to the local folder. Preset rule A3 determines the target folder based on the user's usage of the local folder.
[0235] For ease of understanding, the following table A briefly explains the preset rules A1, A2 and A3.
[0236] Table A: Preset Rule A
[0237]
[0238] The following sections provide detailed explanations of preset rules A1, A2, and A3.
[0239] Preset rule A1 determines the target folder in the local folder based on the filename of the first file and / or the context of the download scenario of the first file.
[0240] To facilitate understanding, let's first explain the context of the first file download scenario.
[0241] As an example, taking an instant messaging application as the first application, and the first file as a file sent by the first contact in the instant messaging application, the context of the download scenario for the first file can include: the chat history with the first contact in the instant messaging application. For example, a user chats with the first contact through the instant messaging application, and the first contact sends the user a file and expresses their comments on the file, such as "This file describes traditional culture; I recommend you take a look." Therefore, the context of the download scenario for this file includes: the chat history with the first contact. It is understood that there may be a lot of chat history with the first contact, and the context can be all the chat history with the first contact, or a portion of the chat history extracted from all the chat history. One possible extraction method is to extract based on time. For example, the portion of chat history can be chat history within a first time range, which includes the time the first file was received. For example, if the first file was received at 12:00 noon on April 1st, then the first time range can be April 1st. Another possible extraction method is to extract based on content. For example, identify which chat logs are related to a file (e.g., the first file) among all chat logs, and use the identified file-related chat logs as context.
[0242] As another example, taking an email application as the first application, the first file is a file carried in the first email received by the email application. The context of the download scenario for the first file may include: the email information of the first email. Optionally, the email information may include the email subject, email body, etc., of the first email. It is understood that the email information of the first email may be extensive (e.g., the email body may be lengthy), and the context may be all email information, or a portion of email information extracted from all email information. For example, identifying which information in all email information is related to the file (e.g., the first file), and using the identified file-related information as the context.
[0243] As another example, taking a browser application as the first example, the first file is the file to be downloaded within the first interface of the browser application. The context of the download scenario for the first file can include the displayed information in the first interface. It is understood that the first interface displays a lot of information, and the context can be all the displayed information in the first interface, or a portion of the displayed information extracted from all the displayed information. For example, identifying which information is related to the file (e.g., the first file) from all the displayed information, and using the identified file-related information as the context. For example, a user opens an interface in the browser application that includes the first file to be downloaded, as well as summaries and reviews of the first file from other users. In this case, information related to the first file, such as the summaries and reviews, can be extracted. Therefore, the context of the download scenario for the first file includes the summaries and reviews of the first file within the interface.
[0244] The above describes the context of the first file download scenario. It should be noted that before the operating system of the electronic device uses the recommended folder recommended by rule A1, it needs to obtain the filename of the first file and / or the context of the first file download scenario. One possible approach is for the operating system to provide an interface through which it receives the filename of the first file and / or the context of the download scenario sent by the first application. In this approach, the context of the first file download scenario is directly exposed to the operating system, which may affect the information security of the first application. Therefore, in other embodiments, the first application can determine a first condition based on the filename of the first file and / or the context of the download scenario, and send the first condition to the operating system through the interface, so that the operating system can determine the target folder in the local folder based on the first condition.
[0245] Optionally, the first condition may include a first vector and / or a first file type. Taking the first vector as an example, the principle by which the first application determines the first vector based on the filename of the first file and / or the context of the download scenario is the same as the principle of file vectorization in the previous glossary section. For example, the first application determines keywords and the frequency of occurrence of keywords based on the filename of the first file and / or the context of the download scenario. Based on the keywords and the frequency of occurrence of keywords, a coordinate point is determined in a multi-dimensional space, and the vector from the origin to that coordinate point is the first vector. Optionally, the keywords may be keywords related to the file (e.g., the first file to be downloaded).
[0246] As an example, the first condition may include a first vector. Based on the first vector, the operating system determines the target folder within the local folders, where the distance between the target folder's folder vector and the first vector is less than a preset distance. For example, the electronic device determines the folder vector of each local folder and the distance between each local folder's folder vector and the first vector; local folders with a distance less than the preset distance are designated as target folders. Optionally, the preset distance may be an empirical value pre-stored in the electronic device. It should be noted that the first vector and the folder vector belong to the same multidimensional space, and the distance between the two vectors can be determined using the vector distance formula. The calculation process for the distance between two vectors will not be elaborated upon here. In this method, the electronic device needs to determine the folder vector of each local folder. Considering the large number of folders, to improve efficiency, one possible approach is for the electronic device to pre-store the folder vector of each local folder internally. As an example, the electronic device generates a folder vector for each new folder it creates. If files are added, deleted, or modified within a folder, the folder vector can be updated. The method for determining the folder vector has already been described in the glossary section above and will not be repeated here.
[0247] As another example, the first condition can include a first file type. The operating system determines the target folder within the local folders based on the first file type, and the target folder's proximity includes the first file type. Folder proximity describes what types of files are suitable to be stored within the folder. Folder proximity has already been described in the previous explanation of terms and will not be repeated here. For example, an electronic device can determine the proximity of each local folder, and then determine which local folders have proximity that includes the first file type. Folders whose proximity includes the first file type are the target folders. In this method, the electronic device needs to determine the proximity of each local folder. Considering the large number of folders, to improve efficiency, one possible approach is for the electronic device to pre-store the proximity of each local folder. As an example, the electronic device generates the proximity of each new folder it creates. If files are added, deleted, or modified within the folder, the folder's proximity can be updated. The method for determining folder proximity has already been described in the previous explanation of terms and will not be repeated here.
[0248] The two implementation methods described above can be used individually or in combination, without limitation. Taking combined use as an example, the electronic device determines N target folders based on the first vector, and then determines M target folders from the N target folders based on the first file type and the closeness of each folder in the N target folders, where N is a positive integer and M is a positive integer less than or equal to N.
[0249] Preset rule A2 determines the target folder within the local folder based on the first application's historical access records to the local folder.
[0250] The first application's historical access records for local folders are used to record which local folders the first application has accessed within a first preset time period. Optionally, the first preset time period can be the past week, month, year, etc., without limitation. Optionally, the first application's access to local folders can include both automatic and manual access.
[0251] Taking manual access as an example, this refers to the first application accessing a local folder on the electronic device under the user's manual operation. An exemplary scenario is that when a user downloads a file using the first application, they habitually download the file to a specific folder; that is, the first application accesses that folder under the user's manual operation. The electronic device can record which local folders the first application has accessed historically under the user's manual operation.
[0252] Taking automatic access as an example, this means that the first application can automatically access local folders without manual user intervention. An exemplary scenario is that the first application automatically accesses local folders to retrieve relevant data during operation. The electronic device can record which local folders the first application has automatically accessed historically.
[0253] Therefore, the electronic device can obtain the historical access records of the first application to the local folder. As an example, the historical access records can be displayed in the form of a correspondence. For example, please refer to Table 1, which is an example of the first correspondence, namely the historical access records of the first application to the local folder.
[0254] Table 1: First Correspondence
[0255]
[0256] After obtaining the first correspondence, the electronic device determines the target folder based on the application name of the first application and the first correspondence.
[0257] Optionally, the electronic device can also record the access time and / or number of times the first application accesses a local folder within a first preset time period in history, and determine the weight of the folder based on the access time and / or number of accesses. The earlier the access time and / or the fewer the accesses, the lower the weight; conversely, the earlier the access time and / or the more accesses, the higher the weight. Optionally, the weight of the folder can be added to the above first correspondence relationship. Therefore, the above first correspondence relationship can be updated to the second correspondence relationship shown in Table 2 below.
[0258] Table 2: Second Correspondence
[0259]
[0260] In this system, the weight 1 of folder 1 is determined based on the access time and / or number of times the first application accesses folder 1 within the first preset time period; the weight 2 of folder 2 is determined based on the access time and / or number of times the first application accesses folder 2 within the first preset time period; and the weight 3 of folder 3 is determined based on the access time and / or number of times the first application accesses folder 3 within the first preset time period. After obtaining the second correspondence, the electronic device determines the target folder based on the application name of the first application and the second correspondence. Taking a browser application as an example, folder 1 and folder 2 are determined according to the second correspondence (i.e., Table 2 above), and the target folder is determined based on the weights of folder 1 and folder 2. For example, the folder with a weight higher than the preset weight in folder 1 and folder 2 is determined as the target folder. In other words, the local folders that the first application has accessed historically within the first preset time period, and which have a high number of accesses and / or a recent access time, are determined as the target folders.
[0261] Preset rule A3 determines the target folder within the local folder based on the user's usage of local folders.
[0262] In practical applications, when users download files, they may download them to folders they have recently used. Therefore, in this method, the electronic device can determine the user's usage of local folders and, based on this, determine the target folder. For example, the electronic device might determine that the user's most recently used local folder is the target folder. "Most recently used" can be understood as a folder whose usage time is later than a second preset time, such as a folder used within the last week, month, or year. As a specific implementation, the electronic device can record the usage time of local folders and sort them according to that time. For example, sorting the local folders in ascending order of usage time, the folder at the top of the sorted list is the most recently used folder, and this most recently used folder is determined as the target folder.
[0263] The above lists three implementation methods for step 702. Optionally, the above three implementation methods can be used alone or in combination, without limitation.
[0264] Step 703: The operating system displays the folder options interface, which includes an identifier for the target folder.
[0265] For example, the folder selection interface can be a file manager interface. Optionally, the identifier of the target folder may include: the name, type, usage time, etc. of the target folder.
[0266] Step 704: The operating system receives a selection operation for the identifier of the target folder.
[0267] Application Scenario 1 in the previous article Figure 5 For example, in (b) of the above, the file manager window includes an identifier for the target folder determined by the electronic device according to preset rule A. The user can select a target folder and click on its identifier.
[0268] Optionally, steps 703 and 704 can be performed or not, without limitation. Figure 7Steps 703 and 704 are indicated by dashed lines. If steps 703 and 704 are not executed, i.e., after the target folder is determined, the path to the target folder is automatically provided to the first application so that the first application can download the first file to the target folder. If steps 703 and 704 are executed, i.e., after the target folder is determined, the identifier of the target folder is displayed, and after receiving the user's selection operation for the target folder identifier, the path to the target folder is provided to the first application so that the first application can download the first file to the target folder.
[0269] Step 705: The operating system provides the path to the target folder to the first application.
[0270] Step 706: The first application downloads the first file to the target folder.
[0271] Taking the second application scenario (file upload scenario) mentioned earlier as an example, the implementation principle of the second application scenario can be found in [link to relevant documentation]. Figure 8 .like Figure 8 This is another flowchart illustrating a file management method provided in one embodiment of this application. This method can be applied to file upload scenarios, such as application scenario two described above. Figure 8 The process includes:
[0272] Step 800: The first application receives the file selection operation.
[0273] For example, the first application could be application scenario two mentioned above (i.e. Figure 6 Instant messaging applications within [the context of] [the application]. File selection can be [the process described in the original text]. Figure 6 The operation for file transfer icon 400 in (a) of the text.
[0274] Step 801: The first application sends a first instruction to the operating system, which indicates that the first application has a file access requirement.
[0275] Step 802: The operating system determines the target file in the local files according to preset rule B.
[0276] Optionally, preset rule B may include at least one of preset rule B1, preset rule B2, and preset rule B3. Preset rule B1 determines the target file based on the context of the first application's file selection scenario (or file requirement scenario). Preset rule B2 determines the target file based on the first application's historical access records to local files. Preset rule B3 determines the target file based on the user's usage of local files.
[0277] For ease of understanding, Table B briefly explains the preset rules B1, B2, and B3 below.
[0278] Table B: Preset Rule B
[0279]
[0280] The following sections provide detailed explanations of preset rules B1, B2, and B3.
[0281] Preset rule B1 determines the target file in the local file based on the context of the selected scenario from the file of the first application.
[0282] To make it easier to understand, let's first explain the context of the first application download selection scenario.
[0283] As an example, taking an instant messaging application as the first example, a user triggers a file selection button in the chat window with their first contact in the instant messaging application, for example, in application scenario two mentioned above. Figure 6 The file selection button 400 in (a) of the instant messaging application. Therefore, the context of the file selection scenario in the first application may include: the chat history with the first contact in the instant messaging application. It is understood that there may be a lot of chat history with the first contact, and the context may be all the chat history with the first contact, or a portion of the chat history extracted from all the chat history. One possible extraction method is to extract based on time. For example, the portion of chat history may be chat history within a first time range, which includes the moment when the file selection button is triggered. Another possible extraction method is to extract based on content. For example, identifying which chat history is related to files among all chat history, and using the identified file-related chat history as the context.
[0284] As another example, let's consider a scenario where the primary application is a social application. For instance, please see... Figure 9 In (a) of the example, the social application displays a text editing interface, which includes the text content to be published on the social network entered by the user; it also includes a file transfer icon. After receiving an operation on the file transfer icon, the social application determines the context of the file selection scenario, namely, the text content to be published entered by the user in the text editing interface. Optionally, the context can be all the text content, or a portion of the text content extracted from the all text content. For example, the portion of the text content can be content related to the file. Optionally, the social application can send the context of the file selection scenario to the operating system, or the social application can determine a first condition based on the context of the file selection scenario and provide the first condition to the operating system so that the operating system can recommend files. For example, an electronic device can display something like... Figure 9 The interface shown in (b) includes an identifier for the target file determined based on the context of the file selection scenario, which the user can select.
[0285] As another example, taking the first application as an email application, for example, please see... Figure 10 In (a) of the example, the email application displays the email editing interface for the first email. This interface includes the email information to be sent, entered by the user. The email information may include the email subject, email body, etc. It also includes a file transfer icon. After receiving an operation on the file transfer icon, the email application determines the context of the file selection scenario, i.e., the email information within the email editing interface, such as the email subject, email body, etc. Optionally, the context may be all email information, or a portion of the email information extracted from all email information. For example, the portion of the email information includes email information related to the file. Optionally, the email application may provide the context of the file selection scenario to the operating system or determine a first condition based on the context of the file selection scenario and provide the first condition to the operating system, so that the operating system can determine the target file. For example, an electronic device may display... Figure 10 The interface shown in (b) includes an identifier for the target file determined based on the context of the file selection scenario, which the user can select.
[0286] In this approach, before the operating system of the electronic device determines the target file according to preset rule B1, it needs to obtain the context of the file selection scenario of the first application. In one specific implementation, the operating system provides an interface through which the first application, after determining the context of the file selection scenario, sends the context to the operating system so that the operating system can determine the target file based on the context. This approach directly exposes the context of the first application's file selection scenario to the operating system, which may affect the information security of the first application. Therefore, in other embodiments, the first application can determine a first condition based on the context of the file selection scenario and send the first condition to the operating system through the interface so that the operating system can determine the target file from local files based on the first condition.
[0287] Optionally, the first condition may include a first vector and / or a first file type. Taking the first vector as an example, the principle by which the first application determines the first vector based on the context of the file selection scenario is the same as the principle of file vectorization in the previous glossary section. For example, the first application determines the keywords and their frequency based on the context of the file selection scenario, and determines coordinate points in a multi-dimensional space based on the keywords and their frequency. The vector from the origin to this coordinate point is the first vector. Optionally, the keywords may be keywords related to the file.
[0288] As an example, the first condition includes a first vector, which enables the operating system to determine the target file among local files based on the first vector, wherein the distance between the target file's file vector and the first vector is less than a second preset distance. In this approach, the electronic device needs to determine the file vector for each local file. Considering the large number of local files, to improve efficiency, one possible approach is to pre-store the file vector for each local file internally.
[0289] As another example, the first condition includes a first file type, which enables the operating system to determine the target file among the local files based on the first file type, and the second file type of the target file matches the first file type. For example, the second file type of the target file is the same as the first file type, or the second file type of the target file contains the first file type. In this way, the electronic device needs to determine the second file type of each local file. Considering the large number of local files, to improve efficiency, one possible approach is to pre-store the second file type of each local file internally.
[0290] Preset rule B2 determines the target file in the local files based on the first application's historical access records of local files.
[0291] The first application's historical access records for local files are used to record which local files the first application has accessed within a first preset time period. Optionally, the first preset time period can be the past week, month, year, etc., without limitation. Optionally, the first application's access to local files can include both automatic and manual access.
[0292] Take manual access as an example. This means that the first application accesses local files on the electronic device through manual user intervention. An exemplary scenario is that a user sends a local file to a contact via the first application; that is, the first application accesses the local file through manual user intervention. The electronic device can record which local files the first application has accessed historically through manual user intervention.
[0293] Take automatic access as an example. This means that the first application can automatically access local files without manual user intervention. An exemplary scenario is that the first application automatically accesses local files to retrieve relevant data during operation. The electronic device can record which local files the first application has automatically accessed historically.
[0294] Therefore, the electronic device can obtain the historical access records of the first application to local files. As an example, these historical access records can be displayed in the form of a correspondence. For example, please refer to Table 3, which is an example of a third correspondence, namely the historical access records of the first application to local files.
[0295] Table 3: Third Correspondence
[0296]
[0297] After obtaining the third correspondence, the electronic device determines the target file based on the application name of the first application and the third correspondence.
[0298] Optionally, the electronic device can also record the access time and / or number of accesses to local files by the first application within a first preset time period in history, and determine the weight of the file based on the access time and / or number of accesses. The earlier the access time and / or the fewer the accesses, the lower the weight; conversely, the earlier the access time and / or the more accesses, the higher the weight. Optionally, the file weight can be added to the third correspondence relationship mentioned above. Therefore, the third correspondence relationship can be updated to the fourth correspondence relationship shown in Table 4 below.
[0299] Table 4: Fourth Correspondence
[0300]
[0301] In this system, the weight 1 of file 1 is determined based on the access time and / or number of times the first application accesses file 1 within the first preset time period; the weight 2 of file 2 is determined based on the access time and / or number of times the first application accesses file 2 within the first preset time period; and the weight 3 of file 3 is determined based on the access time and / or number of times the first application accesses file 3 within the first preset time period. After obtaining the fourth correspondence, the electronic device determines the target file based on the application name of the first application and the fourth correspondence. Taking a browser application as an example, files 1 and 2 are determined according to the fourth correspondence (i.e., Table 4 above), and the target file is determined based on the weights of files 1 and 2. For example, the file with a weight higher than the preset weight among files 1 and 2 is the target file. In other words, the local files that the first application has accessed within the first preset time period in history, and which have a high number of accesses and / or a recent access time, are determined as the target files.
[0302] Preset rule B3 determines the target file from the local files based on the user's usage of local files.
[0303] In practical applications, when selecting a file, a user might choose a file they have recently used. Therefore, in this approach, the electronic device can determine the user's usage history of local files and identify the target file based on that history. For example, the electronic device might determine that a recently used local file is the target file. "Recently used" can be understood as a file whose usage time is later than a second preset time, such as a folder used within the last week, month, or year. As one possible implementation, the electronic device can record the usage time of local files and sort them according to that time. For example, it could sort the files in ascending order of usage time, and the file at the top of the sorted list would be the most recently used file, thus identifying it as the target file.
[0304] The above lists three implementation methods for step 802. Optionally, the above three implementation methods can be used alone or in combination, without limitation.
[0305] Step 803: The operating system displays a file selection interface, which includes the identifier of the target file.
[0306] For example, the file selection interface can be the interface of a file manager. Optionally, the identifier of the target file may include: the name, type, and usage time of the target file, etc.
[0307] Step 804: The operating system receives a selection operation for the identifier of the target file.
[0308] Application Scenario 2 mentioned above Figure 6 For example, in (b) of the above, the file manager window includes the identifier of the target file determined by the electronic device according to preset rule B. The user can select a target file and click on the identifier of that target file.
[0309] Optionally, steps 803 and 804 can be performed or not, without limitation. Figure 8 Steps 803 and 804 are indicated by dashed lines. If steps 803 and 804 are not executed, i.e., after the target file is determined, step 805 is executed automatically. If steps 803 and 804 are executed, i.e. after the target file is determined, the target file's identifier is displayed. If a user's selection operation for the identifier is received, step 805 is executed.
[0310] Step 805: The operating system provides the path to the target file to the first application.
[0311] Step 806: The first application processes the target file. For example, it sends it to a contact or uploads it to a social network.
[0312] Example 2
[0313] In Embodiment 1 above, for a file download scenario, the electronic device determines the storage location of the first file (i.e., a suitable target folder for storing the first file) before downloading the first file, and then downloads the first file to the storage location. Unlike Embodiment 1, in this Embodiment 2, for a file download scenario, the electronic device can first download the first file, then reallocate a storage location for the first file (i.e., determine a suitable target folder for storing the first file), and move the first file to the reallocated storage location. Therefore, for a file download scenario, the execution timing of the technical solution in Embodiment 2 differs from that in Embodiment 1; the technical solution in Embodiment 1 is executed before file download, while the technical solution in Embodiment 2 is executed after file download.
[0314] As described above, in this second embodiment, the electronic device can first download the first file, then reallocate a storage location for the first file, and move the first file to the storage location. In one possible implementation, the electronic device can first download the first file to a temporary storage location, and after the first file is successfully downloaded, reallocate a storage location for the first file and move the first file to the storage location. Optionally, the temporary storage location may be a storage location arbitrarily selected by the electronic device, or the storage location when the previous file was downloaded, the system default storage location, the user-specified storage location, etc., without limitation. Taking a laptop as an example, the temporary storage location can be any folder on any hard drive, including the laptop's C drive, D drive, etc.
[0315] In some examples, the temporary storage location may be a specific folder. In the embodiments of this application, the specific folder may be called a "universal folder," "management folder," "multi-functional folder," "smart folder," or various other names. For ease of description, the following embodiments will primarily use the name "management folder" as an example.
[0316] Therefore, after the electronic device downloads the first file to the management folder, it reallocates a storage location for the first file and moves it to the newly allocated location. In one specific implementation, the electronic device can detect the management folder; if a new first file is detected in the management folder, it reallocates a storage location for the first file and moves it to the newly allocated location. In other words, once a file is downloaded to the management folder, the reallocation mechanism is automatically triggered, reallocating a storage location for the file and moving it to the newly allocated location.
[0317] To facilitate understanding, the following example illustrates the application scenario of this second embodiment.
[0318] Application Scenario 1: File download scenario.
[0319] Please see Figure 11A This is a schematic diagram illustrating one application scenario of Embodiment 2. For example... Figure 11A In (a) of this embodiment, the electronic device displays a browser application window, which includes file identifiers (e.g., file names) of two files to be downloaded, and a download control. After receiving an operation on the download control for the second file to be downloaded, the electronic device executes the technical solution of this embodiment two, that is, downloads the second file to be downloaded to a management folder, then reallocates a storage location for the file, and moves the file to the newly allocated storage location. Optionally, after moving the file to the newly allocated storage location, the electronic device can output a prompt message to inform the user of the file's storage location (i.e., the newly allocated storage location). For example, the electronic device can display something like... Figure 11A The interface shown in (b) displays the message: Download successful, storage path is C drive / folder1. Folder1 on the C drive is the newly allocated storage location for the file. Optional, Figure 11A The interface shown in (b) may also include a button to open a folder. Upon receiving an operation on this button, the electronic device opens folder 1. Therefore, Figure 11A In the scenario shown, after receiving a file download request, the electronic device automatically downloads the file to the management folder, then reallocates the file to a new storage location and moves it there. This process is highly convenient; the user only needs to trigger the file download, requiring no other steps.
[0320] Please see Figure 11B This is a schematic diagram illustrating another application scenario of Embodiment 2. For example... Figure 11B In (a), the electronic device displays a browser application window containing file identifiers (e.g., file names) for two files to be downloaded, as well as a download control. Upon receiving an action on the download control for the second file to be downloaded, the electronic device displays as shown below. Figure 11B The file manager window shown in (b) includes a managed folder option 1100. When the managed folder option 1100 is selected, the file manager window displays an identifier 1101 for the managed folder. After receiving a selection operation for identifier 1101, the electronic device downloads the file to the managed folder, then reassigns a storage location for the file and moves the file to the reassigned storage location. Optionally, after moving the file to the reassigned storage location, the electronic device may output a prompt message to inform the user of the file's storage location (i.e., the reassigned storage location). For example, the electronic device may display a prompt message such as... Figure 11B The interface shown in (c) displays the message: Download successful, storage path is C drive / folder1. Folder1 on C drive is the newly allocated storage location for the file. Optional, Figure 11B The interface in (b) also includes a button to open a folder. Upon receiving an operation on this button, the electronic device opens folder 1. Therefore, Figure 11B In the scenario shown, after the electronic device receives a file download request, it displays a management folder icon for the user to select. If the user selects a management folder, the file is downloaded to that folder. Then, a new storage location is allocated for the file, and the file is moved to the newly allocated location. This process requires the user to trigger both the file download and the selection of the management folder icon. With the user's consent, the file is downloaded to the management folder, demonstrating strong interactivity and a good user experience.
[0321] therefore, Figure 11A and Figure 11B The difference is: Figure 11A In this system, after receiving a file download request, the electronic device automatically downloads the file to the management folder without requiring the user to select one. Then, it reallocates the storage location for the file and moves it to the newly allocated storage location. Figure 11B In this process, after the electronic device receives a file download request, it can bring up the file manager window and display the icons of the managed folders for the user to select. The user can choose the managed folder or other folders. If the user selects the managed folder, the file is downloaded to the managed folder. Then, the electronic device reallocates the storage location for the file and moves the file to the reallocated storage location.
[0322] Application Scenario 2: File organization scenario.
[0323] When electronic devices have a large number of local files, users may want to organize them, for example, by storing each file in its designated storage location. An example scenario is a laptop: when downloading files, users habitually save them to the desktop. Over time, the number of files on the desktop increases, leading to clutter. To organize the desktop, users could manually move each file to its corresponding storage location. However, this process requires manually finding the correct storage location for each file, which is tedious and time-consuming.
[0324] If the electronic device adopts the technical solution of Embodiment 2, then when the user organizes local files, they can directly move the local files into the management folder. When the electronic device detects a new file in the management folder, it triggers a relocation mechanism to reallocate the storage location for the file and moves it to the newly relocated storage location. Continuing with the example of organizing a laptop desktop, the user can move each file on the desktop into the management folder, thereby triggering the electronic device to automatically reallocate the storage location for the file and move it to the newly relocated storage location. Therefore, in this way, for each file, the user does not need to manually search for the corresponding storage location; they can simply move it into the management folder. Optionally, to facilitate the user's search for the management folder, the electronic device can display the management folder in a location easily accessible to the user, or create a shortcut to the management folder and display the shortcut in a location easily accessible to the user. For example, on a laptop, the management folder or its shortcut can be displayed on the desktop, taskbar, etc. For a mobile phone, the management folder or its shortcut can be displayed on the phone's desktop, negative one screen, drop-down menu, control center, application interface (e.g., the homepage of a settings application), etc. Optionally, users can set the display location of the managed folder or its shortcuts so that the managed folder or its shortcuts are displayed in a familiar location.
[0325] The above lists two application scenarios of this embodiment two. It should be noted that, in addition to the two application scenarios mentioned above, the technical solution of this embodiment two can also be applied to other application scenarios, which will not be listed one by one.
[0326] Next, the implementation principle of the technical solution in this second embodiment will be explained.
[0327] As mentioned earlier, electronic devices can detect the management folder. If a new first file is detected in the management folder, a reallocation mechanism is triggered, that is, the storage location of the first file is reallocated and the first file is moved to the reallocated storage location. To make it easier to understand, let's first explain the management folder.
[0328] In this embodiment, the managed folder is different from other folders. As an example, the metadata of the managed folder differs from that of other folders. For ease of understanding, the metadata of folders is explained first. Each folder has corresponding metadata. The metadata of a folder includes descriptive information, which includes, but is not limited to, the folder's type, location, size, occupied space, number of files contained, creation time, modification time, etc. In this embodiment, the metadata of the managed folder includes a marker used to indicate the managed folder; the metadata of other folders does not include this marker. Optionally, the electronic device can visualize the metadata of the managed folder, so that the user can view the metadata of the managed folder. For example, as... Figure 12 In (a), after receiving an operation on folder A, the electronic device displays operation options for folder A, including attribute options. After receiving an operation on the attribute options, the electronic device displays as follows: Figure 12 The properties window shown in (b) includes metadata for the managed folder, including identifier 1200, which indicates that folder A is a managed folder.
[0329] Therefore, the electronic device can obtain the metadata of each folder and determine whether each folder is a managed folder based on the metadata. For example, a folder whose metadata includes the aforementioned mark is a managed folder; a folder whose metadata does not contain the aforementioned mark is not a managed folder. Optionally, the number of managed folders can be one or more, without limitation. After the electronic device determines the managed folder, it can perform detection on the managed folder. For example, the detection of the managed folder can be handled by the operating system of the electronic device. In a specific implementation, the file manager in the electronic device can detect the managed folder. The file manager can be a component of the operating system of the electronic device. The file manager can also have other names, such as file explorer, file system, etc. Taking a laptop as an example, the file manager can be the file explorer in the laptop; taking a mobile phone as an example, the file manager can be the file system in the mobile phone. Generally, the file manager can access each folder in the electronic device and can detect the dynamics of each folder, including adding, deleting, and modifying files within the folder. In this second embodiment, for a managed folder, once the file manager detects a new file in the managed folder, a reallocation mechanism is triggered, that is, the storage location of the file in the managed folder is reallocated, and the file is moved to the reallocated storage location.
[0330] As an example, the management folder is the default folder. For instance, electronic devices are configured with a management folder at the factory, eliminating the need for the user to specify it.
[0331] As another example, a managed folder is a user-specified folder. For instance, after an electronic device receives an operation to set a folder as a managed folder, it sets that folder as a managed folder. For example, as... Figure 13A After receiving an operation on folder A, the electronic device displays operation options for folder A, including the option to set it as a managed folder. Upon receiving an operation on this option, the electronic device sets folder A as a managed folder. Setting folder A as a managed folder can include adding a marker to folder A's metadata; this marker indicates that it is a managed folder. For details on folder metadata, please refer to the previous description. Since users can specify managed folders, they can designate folders that meet their needs as managed folders. For example, a user creates a new folder on the electronic device's desktop and sets it as a managed folder. In this case, the user only needs to download files to the folder on the desktop to trigger a relocation mechanism, causing the electronic device to reallocate storage locations for the files and move them to the newly allocated storage locations.
[0332] As another example, the management folder is the application sandbox of the primary application. For more information on application sandboxes, please refer to the glossary section above. The primary application can be any application on the electronic device, including system applications and third-party applications, without limitation. When the application sandbox of the primary application is the management folder, when the electronic device downloads a file through the primary application, the file will be downloaded to the application sandbox of the primary application. Since the application sandbox of the primary application is the management folder, adding a new file to the application sandbox will trigger a reallocation mechanism, that is, reallocating the storage location of the file and moving the file to the newly allocated storage location. Taking WeChat as an example, generally, when an electronic device downloads a file through WeChat, it will default to downloading the file to the WeChat application sandbox. The user needs to find the WeChat application sandbox and then search for the downloaded file within it. If the user is unfamiliar with the storage location of the WeChat application sandbox, finding it can be difficult. With the technical solution of this second embodiment, when an electronic device downloads a file through the WeChat application, the file is downloaded to the application sandbox of the WeChat application. Since the application sandbox of the WeChat application is a management folder, after the file is downloaded to the application sandbox of the WeChat application, a relocation mechanism will be triggered, that is, the storage location of the file will be reallocated and the file will be moved to the reallocated storage location.
[0333] It's understandable that electronic devices contain a large number of applications. Among all these applications, perhaps only one application's application sandbox is the managed folder, or perhaps multiple applications' application sandboxes are both managed folders, such as the application sandboxes of WeChat and browser applications. One possible approach is for users to set which application sandboxes are managed folders. For example, regarding how users can set managed folders on a laptop, please refer to the previous text. Figure 13A Taking a mobile phone as an example, users can, for instance, configure which apps' application sandboxes are managed folders in the phone's settings app or other apps. For example, such as... Figure 13B (a) shows the settings app interface displayed on the phone, which includes application sandboxes for one or more apps on the phone. The user can choose which app sandboxes to set as management folders. For example, ... Figure 13B In (a), after the phone receives an operation targeting the application sandbox for the browser application, it displays as follows: Figure 13B The operation options for the application sandbox shown in (b) include the option to set it as a management folder. After the phone receives the operation for this option, it sets the browser application's application sandbox as a management folder.
[0334] The above describes the management folder. As mentioned earlier, after the electronic device detects the addition of the first file in the management folder, it reallocates a storage location for the first file and moves it to the newly allocated storage location. Optionally, after the first file is moved to the new storage location, the management folder no longer contains the first file. That is, the first file is only temporarily stored in the management folder for a short time before being moved to the new storage location. Considering that the user might perceive the file movement process, which could negatively impact the user experience, one possible approach is to make the file movement process imperceptible to the user. When the first file is in the management folder, it is invisible to the user; after being moved to the new storage location, it becomes visible to the user. This way, the user will not be aware of the file movement, thus improving the user experience.
[0335] As mentioned earlier, when the first file is located in the management folder, it is invisible to the user. One possible approach is to configure the entire management folder as invisible to the user, so the files contained within it are also invisible. Another possible approach is to make the entire management folder visible to the user, but the first file contained within it is configured to be invisible. Configuring the management folder or the first file within it to be invisible can include using a hiding tool to hide the management folder or the first file within it. This hiding tool can be a software program for hiding files / folders, such as Wise Folder Hider, Hide Files, etc., and is not limited to any particular program. If the entire management folder is configured as invisible to the user, then the user cannot see the management folder based on its storage path. In this case, the storage path of the management folder can be called a virtual path.
[0336] Optionally, after the electronic device detects the addition of a first file in the management folder, it can reallocate a storage location for the first file within the mapped range of the management folder. The mapped range refers to the range of storage space that can be searched when looking for a storage location for a file within the management folder. For example, the mapped range of the management folder can be the entire disk (e.g., including all drives such as C drive and D drive), a portion of the disk, or a portion of folders within a portion of the disk. Taking the entire disk as an example, after the electronic device detects the addition of a first file in the management folder, it reallocates a storage location for the first file within the entire disk. Taking a portion of the disk as an example, for instance, if the mapped range of the management folder is the C drive, then after the electronic device detects the addition of a first file in the management folder, it reallocates a storage location for the first file within the C drive. Taking a portion of folders within the C drive as an example, after the electronic device detects the addition of a first file in the management folder, it reallocates a storage location for the first file within the specified folders within the C drive. Optionally, the mapped range of the management folder can be a user-specified range or a system default range, without limitation. For example, after a user sets the browser application's application sandbox as a managed folder, if the user wants files within the browser application's application sandbox to be moved to a folder on drive D, then that folder on drive D is designated as the mapping scope of the browser application's application sandbox. In this way, when the electronic device detects a new file in the browser application's application sandbox, it moves the file to that folder on drive D.
[0337] Optionally, after the electronic device detects the addition of a first file in the management folder, it can also rename the first file. For example, the electronic device can rename the first file based on its content. For instance, if the content of the first file includes "traditional culture," then the first file can be renamed to "Traditional Culture." Optionally, before renaming the first file, the electronic device can first determine whether the first file meets certain conditions. If it does, then the first file is renamed; otherwise, there is no need to rename the first file. For example, the conditions may include: the filename of the first file does not match the file content of the first file, and / or, the path reassigned to the first file already contains other files with the same filename as the first file. Taking the filename of the first file not matching its content as an example, for instance, the content of the first file is "traditional culture," but the filename of the first file is "12345." In this case, the electronic device can rename the first file, for example, renaming it to "Traditional Culture" based on its content. Taking the case that the path reassigned to the first file already contains other files with the same filename as the first file as an example, for instance, the filename of the first file is "Traditional Culture," and the path reassigned to the first application by the electronic device already contains other files named "Traditional Culture." In this case, the electronic device can rename the first file. For example, if the content of the first file is related to traditional culture, such as opera, then the first file can be renamed "Traditional Culture: Opera".
[0338] As mentioned earlier, the electronic device detects the managed folder. If a new first file is detected in the managed folder, a new storage location is allocated for the first file, and the first file is moved to the newly allocated storage location. This reallocation of the first file's storage location includes: reallocating the storage location according to preset rule C; in other words, determining a suitable target folder for storing the first file within the local folder according to preset rule C. Optionally, preset rule C includes at least one of preset rule C1, preset rule C2, and preset rule C3. Preset rule C1 reallocates the storage location for the first file based on its content. Preset rule C2 reallocates the storage location for the first file based on the first application's historical access records to the local folder. Preset rule C3 reallocates the storage location for the first file based on the user's usage of the local folder.
[0339] For ease of understanding, the following table C briefly explains the preset rules C1, C2 and C3.
[0340] Table C: Preset Rule C
[0341]
[0342]
[0343] The following sections provide detailed explanations of preset rules C1, C2, and C3.
[0344] Preset rule C1 reassigns a storage location for the first file based on its content. It should be noted that since the first file has already been downloaded, the electronic device can directly read its content. Therefore, the electronic device can determine a suitable target folder for storing the first file within its local folders based on its content. In one specific implementation, the electronic device can determine a first vector of the first file based on its content, and then determine the target folder based on this first vector. If the distance between the second vector of the target folder and the first vector is less than a preset distance, the target folder is the reassigned storage location for the first file.
[0345] Preset rule C2 reallocates the storage location of the first file based on the historical access records of the first application to the local folder. Taking WeChat as an example, if the electronic device downloads the first file through WeChat, the storage location of the first file will be reallocated based on the historical access records of WeChat to the local folder. The implementation principle of preset rule C2 is the same as that of preset rule A2 in the previous embodiment, and will not be repeated.
[0346] Preset rule C3 reallocates the storage location of the first file based on the user's usage of local folders. For example, the electronic device determines that a folder recently used by the user is the target folder, and thus reallocates the storage location for the first file. The implementation principle of preset rule C3 is the same as that of preset rule A3 in Example 1 above, and will not be repeated.
[0347] The technical solutions of Embodiment 1 and Embodiment 2 have been described above. For file download scenarios, the technical solutions of Embodiment 1 and Embodiment 2 can be used individually or in combination. The following explanation uses the combination of the technical solutions of Embodiment 1 and Embodiment 2 as an example.
[0348] One possible combination is that the technical solutions of Embodiment 1 and Embodiment 2 are parallel solutions, and the electronic device determines whether to use the technical solution of Embodiment 1 or Embodiment 2 based on the user's selected operation. As an example, such as... Figure 14A In (a), the electronic device displays a browser application window containing file identifiers (e.g., file names) for two files to be downloaded, as well as a download control. Upon receiving an action on the download control for the second file to be downloaded, the electronic device displays as shown below. Figure 14AThe file manager window shown in (b) includes a smart recommendation option 1400 and a management folder option 1401. For the functions of the smart recommendation option 1400 and the management folder option 1401, please refer to the previous description; they will not be repeated here. After receiving a selection operation for the smart recommendation option 1400, the electronic device uses the technical solution of Embodiment 1 to determine a suitable target folder for storing the second file to be downloaded in the local folder, and displays the identifier of the target folder in the file manager window for the user to select. After the user selects the target folder, the file is downloaded to the selected target folder. After receiving a selection operation for the management folder option 1401, the electronic device displays the identifier of the management folder. Upon receiving a selection operation for the identifier of the management folder, the electronic device uses the technical solution of Embodiment 2 to download the second file to be downloaded to the management folder, then reallocates a storage location for the file and moves the file to the newly allocated storage location.
[0349] Another possible combination is that the technical solution of Embodiment 2 is a refinement of the technical solution of Embodiment 1. For example, before downloading the first file, the electronic device uses the technical solution of Embodiment 1 to determine a suitable target folder for storing the first file in the local folder. If no target folder is determined, the technical solution of Embodiment 2 is used to download the first file to the management folder, then a storage location is reallocated for the first file, and the first file is moved to the reallocated storage location. As an example, such as... Figure 14B In (a), the electronic device displays a browser application window containing file identifiers (e.g., file names) for two files to be downloaded, as well as a download control. Upon receiving an action on the download control for the second file to be downloaded, the electronic device displays as shown below. Figure 14B The file manager window shown in (b) includes a smart recommendation option 1400. When the smart recommendation option 1400 is selected, the technical solution of Embodiment 1 is used to determine a suitable target folder for storing the second file to be downloaded in the local folder. If no target folder is determined, a management folder can be recommended to the user. For example, such as... Figure 14B In (b), the file manager window includes a "Cannot recommend" message, a "We recommend using the management folder" message, and an identifier for the management folder. After receiving the selection operation for the management folder identifier, the electronic device downloads the first file to the management folder, then reallocates the storage location for the first file and moves it to the newly allocated storage location.
[0350] As described above, before downloading the first file, the electronic device uses the technical solution of Embodiment 1 to determine the target folder. If the target folder cannot be determined, the technical solution of Embodiment 2 is used to download the first file to the management folder, then reallocate a storage location for the first file, and move the first file to the reallocated storage location. In one specific implementation, before downloading the first file, the electronic device uses preset rule A1 of Embodiment 1 to determine the target folder. If the target folder cannot be determined according to preset rule A1, the technical solution of Embodiment 2 is used to download the first file to the management folder, then determine the target folder according to preset rule C (e.g., preset rule C1), and then move the first file to the target folder.
[0351] Example 3
[0352] In the preceding Embodiment 1, in the file download scenario, the electronic device downloads the file to a local folder; in the file upload scenario, the electronic device uploads the local file. Therefore, Embodiment 1 addresses local files / folders. Unlike Embodiment 1, this Embodiment 3 can address not only local files / folders but also cloud-based files / folders. For example, in the file download scenario, when the first application downloads a file, it can download the file to a local folder or store the file in the first application's cloud-based folder. In the file upload scenario, the first application can send or upload local or cloud-based files to a social network.
[0353] Therefore, the technical solution of this embodiment three can be applied to both file download and file upload scenarios. Next, examples illustrating the application scenarios of this embodiment three will be provided.
[0354] Application scenario one: file download scenario.
[0355] For example, such as Figure 15 In (a), the electronic device displays a browser application window containing file identifiers (e.g., file names) for two files to be downloaded, as well as a download control. Upon receiving an action on the download control for the second file to be downloaded, the electronic device displays as shown below. Figure 15 The file manager window shown in (b) is as follows. Figure 15In (b) of this example, the file manager window includes a smart recommendation option 500. When the smart recommendation option 500 is selected, the file manager window includes N target folders. These N target folders include target folders determined in the local folder using the technical solution of Embodiment 1 (e.g., determined according to preset rule A), and / or target folders determined in the cloud-side folder of the browser application using the technical solution of Embodiment 3 (e.g., determined according to preset rule D). For example, Figure 15 In (b) of the diagram, the folder within the dashed box is the target folder determined by the electronic device according to preset rule A and / or preset rule D. Preset rule D operates on the same principle as preset rule A, as will be discussed later. Figure 17 Detailed description is provided. Therefore, as... Figure 15 In (b), the target folder within the dashed box consists of three parts:
[0356] The first part is the target folder determined by the electronic device according to preset rule A1 and / or preset rule D1. This part of the target folder includes: the target folder determined in the local folder, and / or the target folder determined in the cloud-side folder of the browser application.
[0357] The second part is the target folder determined by the electronic device according to preset rule A2 and / or preset rule D2. This part of the target folder includes: the target folder determined in the local folder, and / or the target folder determined in the cloud-side folder of the browser application.
[0358] The third part is the target folder determined by the electronic device according to preset rule A3 and / or preset rule D3. This part of the target folder includes: the target folder determined in the local folder, and / or the target folder determined in the cloud-side folder of the browser application.
[0359] Application scenario two: file upload scenario.
[0360] For example, such as Figure 16 In (a), the electronic device displays a window of an instant messaging application, which is a chat window between the user and contact A. This window includes a file transfer identifier 400. After receiving an operation on the file transfer identifier 400, the electronic device displays as follows: Figure 16 The file manager window shown in (b) is as follows. Figure 16In (b) of this example, the file manager window includes a smart recommendation option 500. When the smart recommendation option 500 is selected, the file manager window includes N target files. These N target files include target files determined in the local files by the electronic device using the technical solution of Embodiment 1 (e.g., determined according to preset rule B), and / or target files determined in the cloud-side files of the browser application by the electronic device using the technical solution of Embodiment 3 (e.g., determined according to preset rule E). For example, Figure 16 In (b) of this diagram, the folder within the dashed box represents the target file determined by the electronic device according to preset rule B and / or preset rule E. Preset rule E operates on the same principle as preset rule B, and will be discussed later. Figure 18 Detailed description is provided. Therefore, as... Figure 16 In (b), the target file within the dashed box consists of three parts:
[0361] The first part is the target file determined by the electronic device according to preset rule B1 and / or preset rule E1. This part of the target file includes: the target file determined in the local file, and / or the target file determined in the cloud-side file of the browser application.
[0362] The second part is the target file determined by the electronic device according to preset rule B2 and / or preset rule E2. This part of the target file includes: the target file determined in the local file, and / or the target file determined in the cloud-side file of the browser application.
[0363] The third part is the target file determined by the electronic device according to preset rule B3 and / or preset rule E3. This part of the target file includes: the target file determined in the local file, and / or the target file determined in the cloud-side file of the browser application.
[0364] Next, taking the two application scenarios mentioned above as examples, we will explain the implementation principle of the technical solution in this embodiment three.
[0365] Taking the first application scenario (file download scenario) mentioned earlier as an example, the implementation principle of the first application scenario can be found in [link to relevant documentation]. Figure 17 .like Figure 17 This is a schematic flowchart illustrating a file management method provided in an embodiment of this application. This method can be applied to file download scenarios, such as application scenario one described above. Figure 17 The process includes:
[0366] Step 1700: The first application receives a download operation for the first file.
[0367] Step 1701: The first application determines the first target folder in the cloud-side folder of the first application according to the preset rule D.
[0368] One possible implementation is that the electronic device provides an interface (e.g., an API interface) to a first application. The first application, through this interface, calls an algorithm module within the electronic device. This algorithm module determines a first target folder within the cloud-side folder of the first application according to a preset rule D. Optionally, preset rule D may include at least one of preset rule D1, preset rule D2, and preset rule D3. Preset rule D1 determines the target folder within the cloud-side folder based on the filename of the first file to be downloaded and / or the context of the download scenario. Preset rule D2 determines the target folder based on the first application's historical access records to the cloud-side folder. Preset rule D3 determines the target folder based on the user's usage of the cloud-side folder. For example, preset rule D is based on the same principle as preset rule A in the first embodiment described above, and will not be repeated. Thus, the first application can determine the first target folder within its cloud-side folder using the algorithm module.
[0369] As another possible implementation, the first application can send all cloud-side folders to the file manager, which then calls an algorithm module to determine the first target folder within the cloud-side folders. Optionally, considering application data security, sending the cloud-side folders to the file manager can include the first application sending the folder information of the cloud-side folders to the file manager. For example, the folder information includes the folder name, the file names of the files contained within the folder, etc.
[0370] Step 1702: The first application sends a first instruction, which indicates that the first application has a folder access request. Optionally, the first instruction may include an identifier of the first target folder.
[0371] Step 1703: The operating system determines the second target folder in the local folder according to preset rule A.
[0372] Optionally, the implementation principle of step 1703 is the same as that in Embodiment 1 above. Figure 7 The implementation principle of step 702 is the same.
[0373] Step 1704: The operating system displays a folder selection interface, which includes the identifiers of the first target folder and the second target folder.
[0374] For example, the folder selection interface can be the interface of a file manager.
[0375] Step 1705: The operating system receives a selection operation for the identifier of the first target folder.
[0376] Step 1706: The operating system sends a first message to the first application, which is used to notify the user that the first target folder has been selected.
[0377] Step 1707: The first application stores the first file in the first target folder.
[0378] It is understandable that the first file is a file to be downloaded and is located on the server of the first application, while the first target folder selected by the user is the cloud-side folder. Therefore, step 1707 can be understood as the process of transferring the first file from one server to another.
[0379] Optional, Figure 17 Steps 1702 to 1706 can be executed or not, so Figure 17 Steps 1702 to 1706 are indicated by dashed lines. If steps 1702 to 1706 are not executed, that is, after the first application determines the target folder in the cloud-side folder, the file is directly downloaded and stored in the target folder.
[0380] As an example, please see Figure 18The electronic device includes an operating system and a first application. For example, the first application is a third-party application. In the file download scenario of the first application, the processing flow may include: (1) After receiving a file download operation (e.g., a download operation for a first file), the first application runs an algorithm module. For example, the input parameters of the algorithm module include the file name of the first file and / or the context of the download scenario of the first file. (2) The first application obtains the output parameters of the algorithm module. The output parameters include a first condition, i.e., a folder filtering condition. Optionally, the first condition may include a first vector and / or a first file type. (3) The first application determines the cloud-side folder that meets the first condition based on the first condition. (4) The first application sends a first instruction to the operating system. The first instruction is used to indicate that the first application has a folder access requirement. Optionally, the first instruction may include the first condition and / or the identifier of the cloud-side folder determined according to the first condition. (5) The file manager determines the local folder that meets the first condition based on the first condition. (6) The file manager displays a folder selection interface, which includes the cloud-side folder that meets the first condition and / or the local folder that meets the first condition. (7) The file manager sends a first message to the first application, which indicates the folder selected by the user. Optionally, if the user selects a local folder, the first message indicates the storage path of the local folder; if the user selects a cloud-side folder, the first message is the identifier of the cloud-side folder. (8) The first application stores the first file in the folder selected by the user. It should be noted that if the user selects a local folder, the first application downloads the first file to the local folder according to the storage path of the local folder; if the user selects a cloud-side folder, the first application does not need to download the first file and can store the first file in the cloud-side folder, that is, the process of the first folder moving from one server to another.
[0381] Taking the second application scenario (file upload scenario) mentioned earlier as an example, the implementation principle of the second application scenario can be found in [link to relevant documentation]. Figure 19 .like Figure 19 This is a schematic flowchart illustrating a file management method provided in one embodiment of this application. This method can be applied to file upload scenarios, such as application scenario two described above. Figure 19 The process includes:
[0382] Step 1900: The first application receives a file selection operation.
[0383] Step 1901: The first application determines the first target file in the cloud-side file of the first application according to the preset rule E.
[0384] One possible implementation is that the electronic device provides an interface (e.g., an API interface) to a first application. The first application, through this interface, calls an algorithm module within the electronic device. This algorithm module determines a first target file in the cloud-side files of the first application according to a preset rule E. Optionally, the preset rule E may include at least one of preset rule E1, preset rule E2, and preset rule E3. Preset rule E1 determines the target file in the cloud-side files based on the context of the first application's file selection scenario. Preset rule E2 determines the target file in the cloud-side files based on the first application's historical access records of the cloud-side files. Preset rule E3 determines the target file in the cloud-side files based on the user's usage of the cloud-side files. For example, preset rule E is based on the same principle as preset rule B in the first embodiment described above, and will not be repeated. Thus, the first application can determine the first target file in the cloud-side files of its own through the algorithm module.
[0385] As another possible implementation, the first application can send all cloud-side files to the file manager, which then calls an algorithm module to determine the first target file from among the cloud-side files. Optionally, considering application data security, sending the cloud-side files to the file manager by the first application may include: the first application sending the file information of the cloud-side files to the file manager, for example, the file information includes the filename.
[0386] Step 1902: The first application sends a first instruction to the operating system, indicating that the first application has a file access requirement. Optionally, the first instruction may include an identifier of the first target file.
[0387] Step 1903: The operating system determines the second target file in the local files according to preset rule B.
[0388] Optionally, the implementation principle of step 1903 is the same as that in Embodiment 1 above. Figure 8 The implementation principle of step 802 is the same.
[0389] Step 1904: The operating system displays a file selection interface, which includes identifiers for the first target file and the second target file. For example, the file selection interface could be the interface of a file manager.
[0390] Step 1905: The operating system receives a selection operation for the identifier of the first target folder.
[0391] Step 1906: The operating system sends a first message to the first application, which is used to notify the user that the first target file has been selected.
[0392] Step 1907: The first application processes the first target file, for example, by sending the first target file to a contact or uploading the first target file to a social network.
[0393] Optional, Figure 19 Steps 1902 to 1906 can be executed or not, so Figure 19 Steps 1902 to 1906 are represented by dashed lines. If steps 1902 to 1906 are not executed, that is, after the first application determines the target file in the cloud-side file, it directly processes the target file, for example, by sending the first target file to the contact person.
[0394] As an example, please see Figure 20 The electronic device includes an operating system and a first application. For example, the first application is a third-party application. In the file selection scenario of the first application, the processing flow may include: (1) After receiving the file selection operation, the first application runs the algorithm module. For example, the input parameters of the algorithm module include the context of the file demand scenario of the first application. (2) The first application obtains the output parameters of the algorithm module. The output parameters include the first condition, i.e., the file filtering condition. Optionally, the first condition may include the first vector and / or the first file type. (3) The first application determines the cloud-side file that meets the first condition according to the first condition. (4) The first application sends a first instruction to the operating system. The first instruction is used to indicate that the first application has a file access demand. Optionally, the first instruction may include the first condition and / or the identifier of the cloud-side file determined according to the first condition. (5) The file manager determines the local file that meets the first condition according to the first condition. (6) The file manager displays the file selection interface, which includes the cloud-side file that meets the first condition and / or the local file that meets the first condition. (7) The file manager sends a first message to the first application. The first message is used to indicate the file selected by the user. Optionally, if the user selects a local file, the first message indicates the storage path of the local file selected by the user; if the user selects a cloud-side file, the first message is the identifier of the cloud-side file selected by the user. (8) The first application processes the file selected by the user, such as sending it to a contact.
[0395] Figure 21 This is a schematic diagram of the structure of the electronic device 2100 provided in an embodiment of this application. The electronic device 2100 can be one of the electronic devices described above, such as a laptop or a mobile phone. Figure 21As shown, electronic device 2100 may include: one or more processors 2101; one or more memories 2102; a communication interface 2103; and one or more computer programs 2104. These devices can be connected via one or more communication buses 2105. The one or more computer programs 2104 are stored in the memory 2102 and configured to be executed by the one or more processors 2101. The one or more computer programs 2104 include instructions. For example, when electronic device 2000 is the electronic device described above, the instructions can be used to perform relevant steps of the electronic device as described in the corresponding embodiments above, such as executing the technical solutions of Embodiment 1, Embodiment 2, or Embodiment 3 described above. The communication interface 2103 is used to enable communication between electronic device 2100 and other devices; for example, the communication interface may be a transceiver.
[0396] Based on the above, this application also provides a computer-readable storage medium storing instructions that, when executed, cause the method provided in any of the above-described method embodiments to be implemented. The computer-readable storage medium may include various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory, random access memory, magnetic disk, or optical disk.
[0397] Based on the above, this application also provides a computer program product, which includes: a computer program (also referred to as code or instructions), which, when run on a computer, causes the computer to perform the method provided in any of the above method embodiments. Optionally, the computer can be a terminal device, such as a tablet computer.
[0398] The methods provided in the embodiments of this application above are described from the perspective of an electronic device (e.g., a laptop or mobile phone) as the executing entity. To implement the functions of the methods provided in the embodiments of this application above, the electronic device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is implemented in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.
[0399] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of 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 the embodiments of the present invention 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 (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access 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)). Where there is no conflict, the solutions in the above embodiments can be used in combination.
[0400] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0401] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0402] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0403] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0404] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope and intent of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and variations.
Claims
1. A file management method, characterized in that, Applied to electronic devices, the method includes: Receive a first instruction, the first instruction being used to indicate that the first application has a folder access requirement; A folder selection interface is displayed, which includes the identifiers of N folders, where N is a positive integer. The N folders are determined based on first information, which includes at least one of the following: the filename of the first file and the context of the download scenario of the first file. The first file is the file to be downloaded by the first application.
2. The method according to claim 1, characterized in that, The N folders include: M local folders, where the local folders are folders in the electronic device, and M is a positive integer less than or equal to N.
3. The method according to claim 2, characterized in that, Before displaying the folder selection interface, the method further includes: Obtain the first condition from the first application, wherein the first condition is a folder filtering condition determined by the first application based on the first information; Based on the first condition, M local folders are determined, and all M local folders satisfy the first condition.
4. The method according to claim 3, characterized in that, The first condition includes a first vector, and all M local folders satisfy the first condition, including: The distance between the folder vector of each of the M local folders and the first vector is less than a preset distance.
5. The method according to claim 3 or 4, characterized in that, The first condition includes a first file type, and all M local folders satisfy the first condition, including: Each of the M local folders is suitable for storing files of the first file type.
6. The method according to any one of claims 2-5, characterized in that, The method further includes: Receive a selection operation for a first folder, where the first folder is one of the M local folders; Provide the first application with the path to the first folder so that the first application can download the first file to the first folder based on the path to the first folder.
7. The method according to claim 1, characterized in that, The N folders include: K cloud-side folders, which are folders of the first application located on the server, where K is a positive integer less than or equal to N.
8. The method according to claim 7, characterized in that, Before displaying the folder selection interface, the method further includes: Obtain the identifiers of the K cloud-side folders from the first application.
9. The method according to claim 7 or 8, characterized in that, The method further includes: Receive a selection operation for a second folder, where the second folder is one of the K cloud-side folders; The first application is notified that the second folder has been selected, so that the first application stores the first file in the second folder.
10. The method according to any one of claims 1-9, characterized in that, The first application is an instant messaging application, the first file is a file sent by the first contact in the instant messaging application, and the context of the download scenario of the first file includes: the chat history with the first contact in the instant messaging application; or, The first application is an email application, the first file is a file in a first email received by the email application, and the context of the download scenario of the first file includes: the email information of the first email; or, The first application is a browser application, the first file is a file to be downloaded within the first interface of the browser application, and the context of the download scenario of the first file includes: the display information in the first interface.
11. A file management method, characterized in that, Applied to electronic devices, the method includes: Receive a first instruction, the first instruction being used to indicate that the first application has a file access requirement; The file selection interface is displayed, which includes the identifiers of N files, where N is a positive integer. The N files are determined based on first information, which includes the context of the file requirement scenario of the first application.
12. The method according to claim 11, characterized in that, The N files include M local files, which are files stored in the electronic device, where M is a positive integer less than or equal to N.
13. The method according to claim 12, characterized in that, Before displaying the file selection interface, the method further includes: Obtain a first condition from the first application, wherein the first condition is a file filtering condition determined by the first application based on the first information; Based on the first condition, M local files are determined, and all M local files satisfy the first condition.
14. The method according to claim 13, characterized in that, The first condition includes a first vector, and all M local files satisfy the first condition, including: The distance between the file vector of each of the M local files and the first vector is less than a preset distance.
15. The method according to claim 13 or 14, characterized in that, The first condition includes a first file type, and all M local files satisfy the first condition, including: The second file type of each of the M local files matches the first file type.
16. The method according to any one of claims 12-15, characterized in that, The method further includes: Receive a selection operation for a first file, where the first file is one of the M local files; Provide the first application with the path to the first file so that the first application can obtain the first file based on the path to the first file.
17. The method according to claim 11, characterized in that, The N files include: K cloud-side files, which are files of the first application located on the server, where K is a positive integer less than or equal to N.
18. The method according to claim 17, characterized in that, Before displaying the file selection interface, the method further includes: Obtain the identifiers of the K cloud-side files from the first application.
19. The method according to claim 17 or 18, characterized in that, The method further includes: Receive a selection operation for a second file, where the second file is one of the K cloud-side files; The first application is notified that the second file has been selected, so that the first application can process the second file.
20. The method according to any one of claims 11-19, characterized in that, The first application is an instant messaging application. The first application generates a file access request in the chat window with the first contact. The context of the file access request scenario of the first application includes: the chat history with the first contact in the instant messaging application. or, The first application is an email application. The first application generates a file access request in the email editing interface of the first email. The context of the file request scenario of the first application includes: the email content of the first email. or, The first application is a social application. The first application generates a file access request in the text editing interface. The context of the file request scenario of the first application includes: the text content in the text editing interface.
21. A file management method, characterized in that, Applied to electronic devices, the method includes: A new file has been detected in the management folder; According to the first preset rule, a first target folder suitable for storing the first file is determined, and the first target folder is different from the management folder; Save the first file into the first target folder.
22. The method according to claim 21, characterized in that, After the first file is stored in the first target folder, the management folder does not contain the first file.
23. The method according to claim 21 or 22, characterized in that, Before detecting the addition of the first file to the management folder, the method further includes: Download the first file to the management folder.
24. The method according to claim 21 or 22, characterized in that, Before detecting the addition of the first file to the management folder, the method further includes: Move the first file from the electronic device into the management folder.
25. The method according to any one of claims 21-24, characterized in that, The management folder is either the system default folder or a user-specified folder.
26. The method according to any one of claims 21-24, characterized in that, The management folder is the application sandbox of the first application in the electronic device.
27. The method according to claim 26, characterized in that, The method further includes: Based on the user's settings, the application sandbox of the first application is set as the management folder.
28. The method according to any one of claims 21-27, characterized in that, The metadata of the management folder includes a first tag, which is used to indicate the management folder.
29. The method according to any one of claims 21-28, characterized in that, The method further includes: When the first file is located in the management folder, the first file is invisible to the user; When the first file is located in the first target folder, the first file is visible to the user.
30. The method according to any one of claims 21-29, characterized in that, The method further includes: Rename the first file according to its contents.
31. The method according to claim 30, characterized in that, Before renaming the first file according to its content, the method further includes: It is determined that the filename of the first file does not match the file content of the first file; and / or, It is determined that the first target folder already contains other files with the same filename as the first file.
32. The method according to claim 22, characterized in that, Before downloading the first file to the management folder, the method further includes: Upon receiving a download request for the first file, the first interface of the file manager is displayed, which includes an identifier for the managed folder. Receive a selection operation for the identifier.
33. The method according to claim 22, characterized in that, Before downloading the first file to the management folder, the method further includes: According to the second preset rule, a second target folder suitable for storing the first file is determined. The second preset rule is different from the first preset rule. The step of downloading the first file to the management folder includes: If, according to the second preset rule, a suitable second target folder for storing the first file cannot be determined, the first file is downloaded to the management folder.
34. The method according to claim 23, characterized in that, Before downloading the first file to the management folder, the method further includes: Output a first prompt message, which prompts whether to download the first file to the management folder; Received confirmation of download instruction.
35. The method according to claim 23, characterized in that, The step of determining a second target folder suitable for storing the first file according to a second preset rule includes: Based on the filename of the first file and / or the context of the download scenario of the first file, determine a second target folder suitable for storing the first file.
36. The method according to any one of claims 21-25, characterized in that, The step of determining a first target folder suitable for storing the first file according to a first preset rule includes: Based on at least one of the following: the file content of the first file, the historical access records of the first application to the folder, and the user's usage of the folder, a first target folder suitable for storing the first file is determined, and the first application is the application that downloaded the first file.
37. The method according to any one of claims 21-26, characterized in that, The step of determining a first target folder suitable for storing the first file according to a first preset rule includes: According to the first preset rule, within the mapping range of the management folder, a first target folder suitable for storing the first file is determined. The mapping range refers to the range of storage space that can be found when searching for storage locations for files within the management folder according to the first preset rule.
38. The method according to claim 27, characterized in that, The mapping range of the management folder is a user-specified range.
39. The method according to any one of claims 21-28, characterized in that, After the first file is stored in the first target folder, the method further includes: Output a second prompt message, which indicates that the first file has been saved to the first target folder.
40. An electronic device, characterized in that, Used to perform the method as described in any one of claims 1-39.
41. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 39.
42. A computer program product, characterized in that, Includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 39.
