File access method and device, equipment and storage medium
By modifying the interaction between the file manager and the emulator, seamless file access between the Android emulator and the PC was achieved, solving the problems of cumbersome operation and low efficiency, and improving user experience and system stability.
Patent Information
- Application Number
- CN202411552914.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing file import methods in Android emulators are cumbersome, inefficient, and provide a poor user experience. They also rely on external tools or settings, increasing the complexity of configuration and management.
By modifying the file manager to intercept application file open requests, a seamless connection is achieved directly between the emulator and the PC, simplifying the file access process, reducing manual user operations, and utilizing the interaction between the emulator and the file manager to automatically add data files and provide their addresses.
It simplifies the file access process, improves file import efficiency, enhances user experience, reduces reliance on external tools, and makes the system more concise and stable.
Smart Images

Figure CN119597709A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a file access method, device, equipment and storage medium. Background Art
[0002] At present, Android (Android) simulators are widely used in PC (Personal Computer) environments to test and run Android applications. In these simulators, users usually need to transfer files from PC to the mobile phone Android simulator environment through complicated steps.
[0003] In the related art, users need to manually copy the required files from the PC to a specific shared folder or transfer the files to the simulator environment through physical media such as USB (Universal Serial Bus). In the simulator, the application calls the file through the standard file access API (Application Programming Interface), which usually depends on the simulator to correctly simulate the Android file system interface.
[0004] However, the above method requires multiple steps, which is cumbersome and inefficient. Summary of the invention
[0005] The embodiment of the present application provides a file access method, device, equipment and storage medium. The technical solution provided by the embodiment of the present application is as follows:
[0006] According to one aspect of an embodiment of the present application, a file access method is provided, the method comprising:
[0007] The file manager obtains a file access request sent by a first application, the file access request is used to request access to a data file stored in a first storage space, the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator is running in the first operating environment, the simulator is used to create and manage a second operating environment, the second operating environment is different from the first operating environment, the first application and the file manager are running in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment;
[0008] The file manager sends the file access request to the simulator;
[0009] The simulator adds the first data file to a second storage space based on the file access request, the second storage space being accessible to applications in the first operating environment and applications in the second operating environment, the first data file being a data file selected in the first storage space;
[0010] The simulator sends a second storage address of the first data file to the file manager, where the second storage address is a storage address of the first data file in the second storage space;
[0011] The file manager provides the second storage address to the first application.
[0012] According to one aspect of an embodiment of the present application, a file access method is provided, the method comprising:
[0013] Obtaining a file access request sent by a first application, the file access request being used to request access to a data file stored in a first storage space, the first storage space being accessible to applications in a first operating environment and being inaccessible to applications in a second operating environment; wherein a simulator is running in the first operating environment, the simulator being used to create and manage the second operating environment, the first application and a file manager being running in the second operating environment, the first application being supported to run in the second operating environment but not in the first operating environment, and the second operating environment being different from the first operating environment;
[0014] Sending the file access request to the simulator;
[0015] Receiving a second storage address of a first data file sent by the simulator, where the second storage address is a storage address of the first data file in a second storage space, the first data file is a data file selected in the first storage space, and the first data file is added to the second storage space by the simulator based on the file access request;
[0016] The second storage address is provided to the first application.
[0017] According to one aspect of an embodiment of the present application, a file access method is provided, the method comprising:
[0018] Receive a file access request sent by a file manager, the file access request is sent by a first application to the file manager, the file access request is used to request access to a data file stored in a first storage space, the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator runs in the first operating environment, the simulator is used to create and manage the second operating environment, the first application and the file manager run in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment;
[0019] Based on the file access request, adding a first data file to a second storage space, the second storage space allowing the application in the first operating environment and the application in the second operating environment to access, the first data file being a data file selected in the first storage space;
[0020] The second storage address of the first data file is sent to the file manager, where the second storage address is the storage address of the first data file in the second storage space, and the second storage address is provided by the file manager to the first application.
[0021] According to one aspect of an embodiment of the present application, a file access device is provided, the device comprising:
[0022] an acquisition module, configured to acquire a file access request sent by a first application, wherein the file access request is used to request access to a data file stored in a first storage space, wherein the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator runs in the first operating environment, the simulator is used to create and manage the second operating environment, the first application and a file manager run in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment;
[0023] A first sending module, used for sending the file access request to the simulator;
[0024] A first receiving module is used to receive a second storage address of a first data file sent by the simulator, where the second storage address is a storage address of the first data file in a second storage space, the first data file is a data file selected in the first storage space, and the first data file is added to the second storage space by the simulator based on the file access request;
[0025] A module is provided, configured to provide the second storage address to the first application.
[0026] According to one aspect of an embodiment of the present application, a file access device is provided, the device comprising:
[0027] a second receiving module, configured to receive a file access request sent by a file manager, wherein the file access request is sent by a first application to the file manager, and the file access request is used to request access to a data file stored in a first storage space, and the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator is running in the first operating environment, and the simulator is used to create and manage the second operating environment, and the first application and the file manager are running in the second operating environment, and the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment;
[0028] an adding module, configured to add a first data file to a second storage space based on the file access request, wherein the second storage space allows the application in the first operating environment and the application in the second operating environment to access the first data file, and the first data file is a data file selected in the first storage space;
[0029] The second sending module is used to send the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space, and the second storage address is provided by the file manager to the first application.
[0030] According to one aspect of an embodiment of the present application, a terminal device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned file access method.
[0031] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned file access method.
[0032] According to one aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned file access method.
[0033] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0034] After obtaining the file access request, the file manager can forward the file access request to the simulator, and the simulator interacts with the first operating environment to obtain the first data file stored in the first storage space. The simulator adds the first data file in the first storage space to the second storage space, and provides the second storage address corresponding to the first data file in the second storage space to the first application through the file manager. This allows the first application to access the first data file based on the second storage address. There is no need for the user to manually copy the first data file to the second storage space, which simplifies the file access operation process and improves operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a schematic diagram of a file access system provided by an embodiment of the present application;
[0036] Figure 2 is a flowchart of a file access method provided by an embodiment of the present application;
[0037] Figure 3 is a flowchart of a file access method provided by another embodiment of the present application;
[0038] Figure 4 is a schematic diagram of a user interface of a first application provided by an embodiment of the present application;
[0039] Figure 5 is a schematic diagram of a file selection interface provided by an embodiment of the present application;
[0040] Figure 6 is a schematic diagram of a file access process provided by an embodiment of the present application;
[0041] Figure 7 is a flowchart of a file access method provided by another embodiment of the present application;
[0042] Figure 8 is a flowchart of a file access method provided by another embodiment of the present application;
[0043] Fig. 9 is a flowchart of a file access method provided by another embodiment of the present application;
[0044] Fig.10 is a flowchart of a file access method provided by another embodiment of the present application;
[0045] Fig.11 is a flowchart of a file access method provided by another embodiment of the present application;
[0046] Fig.12 is a block diagram of a file access device provided by another embodiment of the present application;
[0047] Fig.13 is a block diagram of a file access device provided by another embodiment of the present application;
[0048] Fig.14 This is a block diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0050] First, the nouns involved in the embodiments of the present application are briefly introduced:
[0051] Android system: Android system is an open source operating system based on the Linux kernel, mainly used in mobile devices (such as smartphones and tablets) and other embedded devices. Android is developed and maintained by Google and promoted in cooperation with the Open Handset Alliance. Android system provides a rich application framework that allows developers to build a variety of applications and games.
[0052] PC: A multi-purpose electronic computing device, mainly used for personal daily computing tasks, such as document processing, Internet browsing, media playback, games, etc.
[0053] Mobile Android Emulator: Mobile Android Emulator is a software application that runs on a PC, which allows the computer to simulate a smartphone's operating system, allowing users to install and run Android applications on the computer.
[0054] Mobile Android emulator Host: refers to the emulator software itself running on the computer, as well as the hardware abstraction layer, operating system and user interface components that are compatible with it. The Host is responsible for creating and managing the virtual mobile phone environment (Guest), and provides a series of tools and interfaces so that users can interact with the virtual mobile phone. The Host described in this patent is a PC software implemented on the Windows platform, and the product form is a PC application store, hereinafter referred to as the Host.
[0055] Mobile Android emulator Guest: refers to the virtual mobile phone environment created by the emulator software on the computer. In this environment, mobile phone applications can be installed and run, and various operations and experiences can be performed, just like using a real mobile phone. The Guest described in this patent is an Android system implemented based on the vbox virtualization solution, which is expressed as a vdi file that complies with the VDI file format specification. The Host loads this vdi file to load and run it, hereinafter referred to as the Guest.
[0056] Mobile Launcher: A mobile Launcher is a mobile application used to customize and manage the home screen and application menu of a smartphone. It allows users to change icons, layouts, animations, and other visual elements to create a personalized user interface experience.
[0057] Mobile application: refers to an application designed specifically for devices running on the Android operating system (such as smartphones, tablets, etc.) and developed using the API provided by the Android SDK (Software Development Kit).
[0058] Please refer to Figure 1 , which shows a schematic diagram of a file access system provided by an embodiment of the present application. The file access system may include: a terminal device 100 and a server 200.
[0059] The terminal device 100 may be an electronic device such as a PC (Personal Computer), a mobile phone, a wearable device, a vehicle terminal, a VR (Virtual Reality) device, an AR (Augmented Reality) device, an MR (Mixed Reality) device, etc. The terminal device 100 runs a simulator, a file manager, and a first application. In some embodiments, the simulator runs in a first operating environment provided by the terminal device 100, and the simulator is used to create and manage a second operating environment, which is different from the first operating environment. In some embodiments, the first application and the file manager run in a second operating environment provided by the simulator. In some embodiments, the first application supports running in the second operating environment and does not support running in the first operating environment. Among them, the file manager is used to obtain a file access request sent by the first application, and the file access request is used to request access to a data file stored in the first storage space. The first storage space allows applications in the first operating environment to access, and does not allow applications in the second operating environment to access; the file access request is sent to the simulator. The simulator is used to add the first data file to the second storage space based on the file access request, the second storage space allows the application in the first operating environment and the application in the second operating environment to access, and the first data file is a data file selected in the first storage space; send the second storage address of the first data file to the file manager, the second storage address is the storage address of the first data file in the second storage space. The file manager is also used to provide the second storage address to the first application.
[0060] In addition, the present application does not limit the form of the first application, including but not limited to App (Application) installed in the terminal device 100, mini-programs, etc., and can also be in the form of a web page.
[0061] The server 200 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The server 200 may be a background server of the above simulator, used to provide background services for the simulator's client.
[0062] The terminal device 100 and the server 200 may communicate via a network, such as a wired or wireless network.
[0063] The file access method provided in the embodiment of the present application can be executed by a terminal device. Figure 1Taking the solution implementation environment shown as an example, the file access method can be executed by the terminal device 100 (such as the simulator installed and running in the terminal device 100 executes the file access method).
[0064] Currently, Android emulators are widely used in PC environments to test and run Android applications. In these emulators, users usually need to transfer files from the PC to the mobile Android emulator environment through complicated steps. Traditional file import methods usually involve the following aspects:
[0065] 1. Physical file copying: Users need to manually copy the required files from the PC to a specific shared folder or transfer the files to the environment where the simulator is located via physical media such as USB.
[0066] 2. File access method: In the emulator, applications call files through standard file access APIs, which usually relies on the emulator's ability to correctly simulate the Android file system interface.
[0067] 3. Complicated user operations: Users need to perform multiple steps when importing files, which is not only cumbersome but also inefficient.
[0068] The above technology has the following problems:
[0069] 1. Operational complexity: The existing file import method in the Android emulator usually involves multiple steps, including manual file copying, configuration of shared folders, etc., which increases the user's operational burden.
[0070] 2. Time-consuming: The process of transferring files from PC to simulator takes a long time because it involves multiple steps and manual operations.
[0071] 3. Poor user experience: The complex operation process and long file transfer time directly affect the user experience, making users feel inconvenient and frustrated when using simulator applications.
[0072] 4. Dependence on external tools: Existing methods may need to rely on specific external tools or settings to complete file import, which increases the complexity of configuration and management.
[0073] The present application embodiment provides a file access method, and the application program running in the simulator can directly access the files stored on the PC, achieving the following technical effects:
[0074] 1. Simplify the operation process: By modifying the file manager inside the Android emulator to directly intercept the application's file opening request, the operation process of file import is significantly simplified. Users do not need to perform complex file copying and configuration, and can complete the import by simply selecting the file through the file selection box on the PC.
[0075] 2. Improve file import efficiency: Due to the reduction of manual operations and intermediate steps, the time to import files from PC to simulator is greatly shortened, thereby improving overall efficiency, especially in scenarios where files need to be frequently operated.
[0076] 3. Improve user experience: Users can import files without leaving the application interface, which greatly improves user experience and satisfaction.
[0077] 4. Reduce dependence on external tools: This application reduces dependence on external tools and additional configurations through built-in message communication channels and file manager interception mechanisms, making the system more concise and stable.
[0078] Please refer to Figure 2 , which shows a flow chart of a file access method provided by an embodiment of the present application. The method includes at least one of the following steps 210 to 250.
[0079] Step 210: The file manager obtains a file access request sent by the first application, where the file access request is used to request access to a data file stored in a first storage space. The first storage space allows access by applications in a first operating environment but does not allow access by applications in a second operating environment.
[0080] The method is executed by a first device that provides a first operating environment. The first device can be implemented as Figure 1 In some embodiments, a simulator is running in the first operating environment, the simulator is used to create and manage a second operating environment, the second operating environment is different from the first operating environment, a first application and a file manager are running in the second operating environment, and the first application supports running in the second operating environment but not in the first operating environment.
[0081] In some embodiments, the operating environment refers to an environment for running semi-compiled operating codes on a target machine. The operating environment is an operating mode between a compiler and an interpreter. There are differences between the processes supported by different operating environments.
[0082] In some embodiments, the first application may be any application. Exemplarily, the first application may be a social application, a music application, a learning application, a video application, a reading application, and the like. In some embodiments, the first application can only run in the second operating environment and cannot run in the first operating environment. In some embodiments, the first application may have different versions. The first version of the first application can run in the first operating environment, and the second version of the first application can run in the second operating environment. Corresponding to this situation, the embodiments of the present application consider the two versions of the first application to be two different applications, and the second version of the first application cannot run in the first operating environment. In some embodiments, the first application may be an application provided by a simulator, or an application provided by a third party other than the simulator, and the present application does not limit this.
[0083] In some embodiments, the file manager is used to manage persistent or continuous data in a management database, a persistent message queue, or a transactional file system in the second operating environment. The file manager stores data and performs fault recovery. The file manager can be regarded as a management tool for the second operating environment.
[0084] In some embodiments, in response to the first application triggering a file access request, the file manager obtains the file access request. In some embodiments, the file manager receives the file access request triggered by the first application. In some embodiments, the file manager is used to intercept the file access request.
[0085] Step 220: The file manager sends the file access request to the simulator.
[0086] In the related art, after receiving a file access request, the file manager will provide the user with the path address of the second storage space so that the user can select the corresponding file (first data file) therein. The second storage space is for applications in the first operating environment and applications in the second operating environment to access. In this case, if the first data file that the file access request needs to access is not stored in the second storage space, the first application cannot access the first data file. If the first application is to be able to access the first data file, the user needs to manually add the first data file to the second storage space.
[0087] In some embodiments, the file manager is used to intercept and process the file access request, and appropriately perform user guidance and data transmission. In some embodiments, the file manager sends the intercepted file access request to the simulator, and the simulator obtains the first data file in the first operating environment.
[0088] Step 230: The simulator adds the first data file to the second storage space based on the file access request. The second storage space allows the application in the first operating environment and the application in the second operating environment to access the first data file. The first data file is a data file selected in the first storage space.
[0089] In some embodiments, after receiving the file access request sent by the file manager, the simulator determines the first data file based on the file access request and adds the first data file to the second storage space. In some embodiments, the simulator determines the first data file in the first storage space and copies the first data file to the second storage space.
[0090] In some embodiments, the first data file is selected by a user in the first storage space. Exemplarily, the simulator displays a file selection interface based on the file access request, wherein the file selection interface displays at least one data file stored in the first storage space, and in response to a selection operation for a first data file in the at least one data file, the simulator adds the first data file to the second storage space.
[0091] In some embodiments, the first data file is automatically determined by the simulator based on the file access request. In some embodiments, the file access request carries relevant information of the first data file, and the simulator determines the first data file in the first storage space based on the relevant information of the first data file, and adds the first data file to the second storage space.
[0092] Step 240: The simulator sends the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space.
[0093] In some embodiments, the simulator sends the storage address of the first data file in the second storage space to the file manager, and the file manager provides the second storage address to the first application. In some embodiments, the simulator can also directly send the second storage address to the first application.
[0094] In step 250, the file manager provides the second storage address to the first application.
[0095] In some embodiments, the first application is used to access the first data file in the second storage space based on the second storage address. In some embodiments, the first application can also import the first data file based on the second storage address.
[0096] According to the technical solution provided by the embodiment of the present application, after obtaining a file access request, the file manager can forward the file access request to the simulator, and the simulator interacts with the first operating environment to obtain the first data file stored in the first storage space. The simulator adds the first data file in the first storage space to the second storage space, and provides the second storage address corresponding to the first data file in the second storage space to the first application through the file manager. This allows the first application to access the first data file based on the second storage address. There is no need for the user to manually copy the first data file to the second storage space, which simplifies the operation process of file access and improves operation efficiency.
[0097] Please refer to Figure 3 , which shows a schematic diagram of a file access method provided by an embodiment of the present application. Taking the first operating environment as a PC end operating environment and the second operating environment as a mobile end operating environment as an example, the file access method provided by the embodiment of the present application is exemplarily described.
[0098] Step 210: The file manager obtains a file access request sent by the first application, where the file access request is used to request access to a data file stored in a first storage space. The first storage space allows access by applications in a first operating environment but does not allow access by applications in a second operating environment.
[0099] In some embodiments, the file manager intercepts a file access request sent by the first application. In some embodiments, the file manager obtains the first information sent by the first application, parses the first information, and obtains the parameter content contained in the first information. Based on the parameter content contained in the first information, the purpose of the first information is determined. Exemplarily, the first information carries the first indication information, indicating that the first information is used to access a data file and is a file access request. Exemplarily, the first information does not carry the first indication information, indicating that the first information is not used to access a data file and is not a file access request.
[0100] In some embodiments, the first indication information may be a bit of information. For example, if the bit is 1, it indicates that the first information is a file access request; if the bit is 0, it indicates that the first information is not a file access request.
[0101] In some embodiments, the file access request may be triggered by the first application, or by a user operating the first application. Exemplarily, the file access request may be actively triggered by the first application during operation. Exemplarily, the file access request may be triggered by a user through a control displayed in a user interface of the first application.
[0102] Step 220: The file manager sends the file access request to the simulator.
[0103] In some embodiments, when the first information is a file access request, the file access request is sent to the simulator. In some embodiments, the file manager does not process the file access request and directly forwards the file access request to the simulator.
[0104] In some embodiments, the file manager processes the file access request and then forwards it to the simulator. Exemplarily, the file manager recompresses the parsed file access request into a format that the simulator can receive and then sends it to the simulator.
[0105] In some embodiments, a second application is also running in the second execution environment, and the second application is used to manage the applications running in the second execution environment.
[0106] In some embodiments, the file manager sends a file access request to the second application through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the second operating environment; the second application sends the file access request to the simulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the simulator.
[0107] In some embodiments, since the file manager runs in the second operating environment and the simulator runs in the first operating environment, when information is exchanged between the two, the second application program is required to implement information forwarding.
[0108] In some embodiments, the first interface language is used to implement cross-process communication in the same operating environment. In the following embodiments, the first communication channel is used to implement communication between application programs in different operating environments.
[0109] Step 230: The simulator adds the first data file to the second storage space based on the file access request. The second storage space allows the application in the first operating environment and the application in the second operating environment to access the first data file. The first data file is a data file selected in the first storage space.
[0110] In some embodiments, the simulator determines a first storage address of the first data file in the first storage space based on the file access request, and copies the first data file from the first storage space to the second storage space.
[0111] Exemplarily, step 230 may include at least one of the following steps 1 to 3.
[0112] Step 1: The simulator determines a first storage address of a first data file based on a file access request, where the first storage address is a storage address of the first data file in a first storage space.
[0113] In some embodiments, after receiving the file access request, the simulator determines the defined storage address of the first data file. In some embodiments, the first storage address is determined based on the parameters carried in the file access request. Exemplarily, the parameters include at least one of the following: a first file type, a file size limit. The first file type is used to indicate the file type of the first data file, and the file size limit is used to indicate the requirements that the file size of the first data file needs to meet. The simulator determines a data file with the same file type as the first file type, and then determines the first data file in the above data files based on the file size limit, and determines the storage address of the first data file in the first storage space as the first storage address. In some embodiments, since a large number of data files will be stored in the first storage space, the above parameters may not be able to uniquely determine the first data file in the first storage space. At this time, it can be considered to introduce user operation, and the user selects a suitable data file as the first data file.
[0114] In some embodiments, the first data file is selected and determined by a user in the first storage space. Exemplarily, the method includes at least one of the following steps a to b.
[0115] In step a, the simulator displays a file selection interface based on the file access request, wherein the file selection interface displays at least one data file stored in the first storage space.
[0116] In some embodiments, the at least one data file is all data files in the first storage space, or may be part of the data files in the first storage space, which is not limited in the present application.
[0117] In some embodiments, at least one data file classified by directory is displayed in the file selection interface. In some embodiments, the file selection interface can display the interface where the root directory is located, or can display the interface where any subdirectory is located, which is not limited in this application.
[0118] In some embodiments, the storage address corresponding to the file selection interface may be a default storage address. In some embodiments, the default storage address may be set by the simulator, or by the first device, or based on the type of the first application, which is not limited in this application.
[0119] Exemplarily, the simulator screens and obtains at least one candidate data file from the data files stored at a third storage address based on the parameters carried in the file access request, where the third storage address is a default storage address corresponding to the file access request in the first storage space; the simulator displays a file selection interface, in which at least one candidate data file is displayed.
[0120] In some embodiments, the parameters include at least one of: a first file type, a file size limit.
[0121] In some embodiments, the simulator screens and obtains at least one candidate data file from the data files stored at the third storage address based on the first file type and the file size limit, wherein the file type of at least one candidate data file is the same as the first file type, and the size of at least one candidate data file meets the file size limit. Exemplarily, if the first file type is pdf, then the file types of the candidate data files are all pdf. Exemplarily, if the file size limit is less than 1GB, then the sizes of the candidate data files are all less than 1GB.
[0122] For example, Figures 4 to 6 As shown, Figure 4 4 is a schematic diagram of a user interface of a first application. In some embodiments, a file access control 410 is displayed in the user interface 400 of the first application. In response to an operation on the file access control 410, a file access request is triggered, and the following is displayed: Figure 5 The file selection interface 500 shown in FIG. 5 shows at least one candidate data file 510 and a data file directory 520. In response to the selection operation for the first data file in the file selection interface 500, the following is displayed: Figure 6 The user interface 600 of the first application is shown. At this time, the user interface 600 of the first application displays the access process 610 of the first data file.
[0123] Step b: in response to a selection operation on a first data file among the at least one data file, the simulator determines a first storage address of the first data file.
[0124] In some embodiments, the first data file may include one data file or multiple data files. Exemplarily, the parameter further includes a multiple selection parameter, and the multiple selection parameter is used to indicate whether multiple selection of data files is supported. Exemplarily, if the multiple selection parameter indicates that multiple selection of data files is supported, then the user can select multiple data files as the first data file in the file selection interface.
[0125] In some embodiments, the multiple first data files may correspond to the same first storage address or to different first storage addresses. If the multiple first data files correspond to different first storage addresses, the simulator needs to operate respectively for the different first data files. If the multiple first data files correspond to the same first storage address, the simulator can add the multiple first data files to the second storage space at the same time.
[0126] In some embodiments, if the data file that the user wants to select does not exist in the third storage address, the user can also switch to other paths to select the first data file.
[0127] In some embodiments, in response to a path switching operation on a file selection interface, the simulator switches the file selection interface from displaying at least one candidate data file at a third storage address to displaying at least one candidate data file at a fourth storage address. The path switching operation is used to switch the storage address of the source of the candidate data files displayed in the file selection interface. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0128] In some embodiments, a path switching control is also displayed in the file selection interface. In response to an operation on the path switching control, a path selection interface is displayed, and at least one storage address is displayed in the path selection interface. In response to a selection operation on a fourth storage address among the at least one storage address, the simulator switches the file selection interface from displaying at least one candidate data file of the third storage address to displaying at least one candidate data file of the fourth storage address.
[0129] In some embodiments, at least one candidate storage address is also displayed in the file selection interface. In response to a selection operation on a fourth storage address among the at least one candidate storage address, the simulator switches the file selection interface from displaying at least one candidate data file of the third storage address to displaying at least one candidate data file of the fourth storage address.
[0130] In some embodiments, a data file directory is also displayed in the file selection interface, and the data file directory includes storage addresses of each level corresponding to the first storage space. In response to a selection operation on a fourth storage address in the data file directory, the simulator switches the file selection interface from displaying at least one candidate data file of the third storage address to displaying at least one candidate data file of the fourth storage address.
[0131] Step 2: The simulator obtains the first data file from the first storage address.
[0132] Step 3: The simulator adds the first data file to the second storage space.
[0133] In some embodiments, the simulator copies the first data file from the first storage address and adds it to the second storage space.
[0134] In some embodiments, if there are multiple first data files, when the multiple first data files correspond to the same first storage address, the simulator simultaneously copies the multiple first data files and adds them to the second storage space. When the multiple first data files correspond to different first storage addresses, for each first storage address, the simulator performs the operation of copying the first data file and adding it to the second storage space.
[0135] Step 240: The simulator sends the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space.
[0136] In some embodiments, a second application is also running in the second execution environment.
[0137] In some embodiments, the simulator sends the second storage address to the second application through the first communication channel; the second application sends the second storage address to the file manager through the cross-process communication mechanism implemented by the first interface language.
[0138] In step 250, the file manager provides the second storage address to the first application.
[0139] In some embodiments, since the file manager is adjusted, in order to reduce the user's learning cost, the file manager can also provide prompt information to the user to assist the user in performing file access operations.
[0140] In some embodiments, the file manager displays first prompt information, and the first prompt information is used to indicate an operation corresponding to accessing a data file stored in the first storage space. Exemplarily, the file manager displays a first user interface, and the first prompt information is displayed in the first user interface.
[0141] In some embodiments, before the file manager obtains the file access request, the file manager displays the first prompt information. In some embodiments, the first prompt information is displayed only when the user triggers the file access request. When the first application triggers the file access request by itself, the first prompt information is not displayed. Exemplarily, in response to the user's triggering operation on the file access request, the first prompt information is displayed, and in response to the completion of reading the first prompt information, the file selection interface is displayed.
[0142] The technical solution provided by the embodiment of the present application, on the one hand, transforms the file manager so that after the file manager obtains the file access request, it forwards it to the simulator, and the simulator obtains the first data file in the first storage space. The user does not need to perform complicated file copying and configuration, and only needs to select the data file through the file selection interface to complete the file access, which significantly simplifies the operation process of file access. On the other hand, since the user's manual operation and the intermediate steps of obtaining the first data file are reduced, the import time of the data file from the first storage space to the simulator is greatly shortened, thereby improving the overall efficiency, especially in scenarios where data files need to be frequently operated. The user can complete the file access without leaving the user interface of the first application, which greatly improves the user experience and satisfaction. Moreover, the above functions are completed only through the built-in message communication channel and the file manager interception mechanism, which reduces the dependence on external tools and additional configurations, making the system more concise and stable.
[0143] Next, the functions of the file manager, the second application and the simulator will be described respectively.
[0144] 1. File Manager
[0145] In some embodiments, the method is performed by a file manager running on a first device, the first device provides a first operating environment, a simulator runs in the first operating environment, the simulator is used to create and manage a second operating environment, the second operating environment is different from the first operating environment, a first application and a file manager run in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment.
[0146] Exemplarily, the file manager is used to perform at least one of the following steps a to d.
[0147] Step a, obtaining a file access request sent by a first application, the file access request is used to request access to a data file stored in a first storage space, the first storage space allows applications in a first operating environment to access, and does not allow applications in a second operating environment to access.
[0148] In some embodiments, the file manager is responsible for intercepting and processing the file access request from the first application and performing appropriate user guidance and data transfer.
[0149] Step b, sending the file access request to the simulator.
[0150] Step c, receiving the second storage address of the first data file sent by the simulator, the second storage address is the storage address of the first data file in the second storage space, the first data file is a data file selected in the first storage space, and the first data file is added to the second storage space by the simulator based on a file access request.
[0151] Step d: providing the second storage address to the first application.
[0152] In some embodiments, the file manager is further configured to perform the following step e.
[0153] Step e: displaying first prompt information, where the first prompt information is used to indicate an operation corresponding to accessing a data file stored in the first storage space.
[0154] For a detailed description of the above steps, please refer to the content of the above embodiments. Next, an exemplary description will be given by taking the first operating environment as a PC operating environment, the second operating environment as a mobile operating environment, the first application as a mobile application, and the second application as a mobile launcher. Figure 7 As shown, the file manager is used to perform the following operations:
[0155] Intercept Intent information: In the onCreate method of the PickActivity class of the file manager, first intercept the Intent request initiated by the mobile application. This step is completed by parsing the parameter content carried in the Intent, which may include the requested file type, file size limit, whether multiple selection is supported, etc. This information will be used for subsequent file selection and verification.
[0156] User operation guidance: Add a user guidance interface or prompt information in the root layout of the file manager. This guidance content is used to inform users how to operate to meet the file access needs of the application.
[0157] Cross-process communication forwarding request: The request information parsed from the Intent is transmitted to the mobile Launcher through the cross-process communication (IPC) mechanism implemented by the Android Interface Definition Language (AIDL). This step is the key to ensure the correctness and security of information transmission between the file manager and the Launcher.
[0158] Processing file selection results: After the user selects a file, the file path will be transmitted to the file manager through the inter-process communication (IPC) mechanism implemented by the Android Interface Definition Language (AIDL), and then received and processed by the onActivityResult method of the Activity. This method returns the selected file path as result data to the mobile application that initiated the request, allowing the application to access and process the file selected by the user.
[0159] 2. Second Application
[0160] In some embodiments, a second application is also running in the second execution environment, and the second application is used to manage the applications running in the second execution environment.
[0161] In some embodiments, the file manager sends a file access request to the second application through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the second operating environment; the second application sends the file access request to the simulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the simulator.
[0162] In some embodiments, the simulator sends a second storage address to the second application through a first communication channel; wherein the first communication channel is used for data transmission between the second application and the simulator, and the second application is used to send the second storage address to the file manager through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the second operating environment.
[0163] Next, an example will be given in which the first operating environment is a PC operating environment, the second operating environment is a mobile operating environment, the first application is a mobile application, and the second application is a mobile launcher. Figure 8 As shown, the second application is used to perform the following operations:
[0164] The key to implementing the mobile launcher is to establish a stable service process to handle file access requests received from the file manager and accurately transmit these file access requests to the host side of the simulator. The specific implementation steps are as follows:
[0165] Start receiving service: When the mobile launcher is started, it will initialize and start a background service. The main responsibility of this service is to detect the request information from the modified file manager. The service needs to be efficient and stable to ensure that all requests can be processed in time.
[0166] Receive request information from the file manager: When an Android app attempts to open or access a file through the file manager, the file manager will capture the relevant parameters of this operation and send them to the receiving service of the mobile launcher. These parameters include information such as file type and whether multiple selections are allowed.
[0167] Transmit information through Socket communication: After receiving the file access request from the file manager, the receiving service transparently transmits the file access request to the host of the simulator through the established Socket communication channel. Socket communication needs to ensure the security and reliability of data transmission and ensure that all sent file access requests are not tampered with or lost during the transmission process.
[0168] 3. Simulator
[0169] In some embodiments, the method is performed by a simulator running on a first device, the first device provides a first operating environment, a simulator runs in the first operating environment, the simulator is used to create and manage a second operating environment, the second operating environment is different from the first operating environment, a first application and a file manager run in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment.
[0170] Exemplarily, the simulator is used to perform at least one of the following steps a to c.
[0171] Step a, receiving a file access request sent by a file manager, wherein the file access request is sent by a first application to the file manager, and the file access request is used to request access to a data file stored in a first storage space, and the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment.
[0172] Step b: based on the file access request, adding the first data file to the second storage space, the second storage space allowing the application in the first operating environment and the application in the second operating environment to access, the first data file is a data file selected in the first storage space.
[0173] In some embodiments, based on a file access request, a first storage address of a first data file is determined, where the first storage address is a storage address of the first data file in a first storage space; the first data file is obtained from the first storage address; and the first data file is added to a second storage space.
[0174] In some embodiments, based on a file access request, a file selection interface is displayed, in which at least one data file stored in a first storage space is displayed; in response to a selection operation on a first data file among the at least one data file, a first storage address of the first data file is determined.
[0175] In some embodiments, based on the parameters carried in the file access request, at least one candidate data file is screened from the data files stored at the third storage address, and the third storage address is the default storage address corresponding to the file access request in the first storage space; a file selection interface is displayed, and at least one candidate data file is displayed in the file selection interface.
[0176] Step c: sending the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space, and the second storage address is provided by the file manager to the first application.
[0177] In some embodiments, in response to a path switching operation on a file selection interface, the file selection interface is switched from displaying at least one candidate data file at a third storage address to displaying at least one candidate data file at a fourth storage address. The path switching operation is used to switch the storage address of the source of the candidate data files displayed in the file selection interface. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0178] For a detailed description of the above steps, please refer to the content of the above embodiments. Next, an exemplary description will be given by taking the first operating environment as a PC operating environment, the second operating environment as a mobile operating environment, the first application as a mobile application, and the second application as a mobile launcher. Fig. 9 As shown, the file manager is used to perform the following operations:
[0179] Call PC file selection box: The host uses the received parameters to call the system's file selection box. This step is the key to user interaction. The system will filter the selectable file types according to the parameter restrictions to ensure that the user's selection meets the needs of the mobile application. The file selection box provides a graphical interface that allows users to intuitively browse and select files stored on the PC.
[0180] File copying and path return: After the user selects a file in the file selection box, the host will automatically perform the file copy operation and copy the file from the original location to the preset shared directory between the Android emulator and the PC. This shared directory is a storage location that can be accessed by both parties, ensuring the availability of the file.
[0181] After the file is copied, the host will generate a new path for the file in the shared directory and send the path information back to the mobile Launcher through the message communication channel.
[0182] The technical solution provided by the embodiment of the present application greatly simplifies the access process of data files by directly intercepting file opening requests in the Android emulator and realizing seamless connection with the PC client. Users can quickly complete file selection, access and import without leaving the emulator interface, thus providing a smoother and more intuitive operating experience.
[0183] Direct file access between PC and Android emulator is realized, breaking the data isolation caused by operating system and environment restrictions. This cross-platform file access capability makes file processing more flexible and improves work adaptability.
[0184] Through the built-in file processing mechanism, the reliance on third-party tools or external storage devices is reduced, and the risk of data leakage or damage is reduced. At the same time, as the operation is more centralized and internalized, the management and control of data is more stringent and secure.
[0185] Simplified operational processes and improved efficiency directly lead to increased user satisfaction.
[0186] In addition, the technical solution provided in the embodiments of the present application is not only applicable to Android emulators, but also has the potential to be applied to other types of virtual environments or system emulators, and has good adaptability and scalability.
[0187] Regarding possible application scenarios of the technical solutions provided in the embodiments of the present application, the present application also provides exemplary embodiments.
[0188] 1. The first operating environment is the PC operating environment, and the second operating environment is the mobile operating environment
[0189] In some embodiments, the first operating environment is a PC operating environment, and the second operating environment is a mobile operating environment. Exemplarily, the first operating environment is a Windows operating environment, and the second operating environment is an Android operating environment. Exemplarily, Fig.10 As shown, the method includes at least one of the following steps 1010 to 1050.
[0190] Step 1010: The file manager obtains a file access request sent by an Android application, where the file access request is used to request access to a data file stored in a first storage space. The first storage space allows access by applications in a Windows operating environment, but does not allow access by applications in an Android operating environment.
[0191] In some embodiments, the file manager intercepts a file access request sent by an Android application. In some embodiments, the file manager obtains a first message sent by an Android application, parses the first message, and obtains a parameter content contained in the first message. Based on the parameter content contained in the first message, the purpose of the first message is determined. Exemplarily, the first message carries a first indication information, indicating that the first message is used to access a data file and is a file access request. Exemplarily, the first message does not carry the first indication information, indicating that the first message is not used to access a data file and is not a file access request.
[0192] In some embodiments, the file access request may be triggered by an Android application or by a user operating the Android application. Exemplarily, the file access request may be actively triggered by the Android application during operation. Exemplarily, the file access request may be triggered by a user through a control displayed in the user interface of the Android application.
[0193] Step 1020: The file manager sends the file access request to the Android emulator.
[0194] In some embodiments, a second application is also running in the Android operating environment, and the second application is used to manage the applications running in the Android operating environment.
[0195] In some embodiments, the file manager sends a file access request to the second application through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the Android operating environment; the second application sends the file access request to the Android emulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the Android emulator.
[0196] In some embodiments, since the file manager runs in the Android operating environment and the Android emulator runs in the Windows operating environment, when information is exchanged between the two, the second application needs to be used to forward the information.
[0197] In some embodiments, the first interface language is used to implement cross-process communication in the same operating environment. In the following embodiments, the first communication channel is used to implement communication between application programs in different operating environments.
[0198] Step 1030, the Android simulator adds the first data file to the second storage space based on the file access request, the second storage space allows applications in the Windows operating environment and the Android operating environment to access, and the first data file is a data file selected in the first storage space.
[0199] In some embodiments, the Android emulator determines a first storage address of the first data file in the first storage space based on the file access request, and copies the first data file from the first storage space to the second storage space.
[0200] Exemplarily, step 1030 may include at least one of the following steps 1 to 3.
[0201] Step 1: The Android simulator determines a first storage address of a first data file based on a file access request, where the first storage address is a storage address of the first data file in a first storage space.
[0202] In some embodiments, after receiving the file access request, the Android simulator determines the defined storage address of the first data file. In some embodiments, the first storage address is determined based on the parameters carried in the file access request. Exemplarily, the parameters include at least one of the following: a first file type, a file size limit. The first file type is used to indicate the file type of the first data file, and the file size limit is used to indicate the requirements that the file size of the first data file needs to meet. The Android simulator determines a data file with the same file type as the first file type, and then determines the first data file in the above data file based on the file size limit, and determines the storage address of the first data file in the first storage space as the first storage address. In some embodiments, since a large number of data files will be stored in the first storage space, the above parameters may not be able to uniquely determine the first data file in the first storage space. At this time, it can be considered to introduce user operations, and the user selects a suitable data file as the first data file.
[0203] In some embodiments, the first data file is selected and determined by a user in the first storage space. Exemplarily, the method includes at least one of the following steps a to b.
[0204] In step a, the Android simulator displays a file selection interface based on the file access request, wherein the file selection interface displays at least one data file stored in the first storage space.
[0205] In some embodiments, the at least one data file is all data files in the first storage space, or may be part of the data files in the first storage space, which is not limited in the present application.
[0206] In some embodiments, at least one data file classified by directory is displayed in the file selection interface. In some embodiments, the file selection interface can display the interface where the root directory is located, or can display the interface where any subdirectory is located, which is not limited in this application.
[0207] In some embodiments, the storage address corresponding to the file selection interface may be a default storage address. In some embodiments, the default storage address may be set by an Android simulator, may be set by the first device, or may be set based on the type of Android application, which is not limited in this application.
[0208] Exemplarily, the Android emulator filters out at least one candidate data file from the data files stored at a third storage address based on the parameters carried in the file access request, where the third storage address is a default storage address corresponding to the file access request in the first storage space; the Android emulator displays a file selection interface, in which at least one candidate data file is displayed.
[0209] In some embodiments, the parameters include at least one of: a first file type, a file size limit.
[0210] In some embodiments, the Android emulator, based on the first file type and the file size limit, screens and obtains at least one candidate data file from the data files stored at the third storage address, wherein the file type of at least one candidate data file is the same as the first file type, and the size of at least one candidate data file meets the file size limit. Exemplarily, if the first file type is pdf, then the file types of the candidate data files are all pdf. Exemplarily, if the file size limit is less than 1GB, then the sizes of the candidate data files are all less than 1GB.
[0211] Step b: in response to a selection operation on a first data file among the at least one data file, the Android simulator determines a first storage address of the first data file.
[0212] In some embodiments, in response to a path switching operation on a file selection interface, the Android emulator switches the file selection interface from displaying at least one candidate data file at a third storage address to displaying at least one candidate data file at a fourth storage address. The path switching operation is used to switch the storage address of the source of the candidate data files displayed in the file selection interface. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0213] Step 2: The Android simulator obtains the first data file from the first storage address.
[0214] Step 3: The Android emulator adds the first data file to the second storage space.
[0215] In some embodiments, the Android emulator copies the first data file from the first storage address and adds it to the second storage space.
[0216] In some embodiments, if there are multiple first data files, when the multiple first data files correspond to the same first storage address, the Android emulator simultaneously copies the multiple first data files and adds them to the second storage space. When the multiple first data files correspond to different first storage addresses, for each first storage address, the Android emulator separately performs the operation of copying the first data file and adding it to the second storage space.
[0217] Step 1040: The Android simulator sends the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space.
[0218] In some embodiments, a second application is also running in the Android operating environment.
[0219] In some embodiments, the Android emulator sends the second storage address to the second application through the first communication channel; the second application sends the second storage address to the file manager through the cross-process communication mechanism implemented by the first interface language.
[0220] Step 1050: The file manager provides the second storage address to the Android application.
[0221] In some embodiments, since the file manager is adjusted, in order to reduce the user's learning cost, the file manager can also provide prompt information to the user to assist the user in performing file access operations.
[0222] In some embodiments, the file manager displays first prompt information, and the first prompt information is used to indicate an operation corresponding to accessing a data file stored in the first storage space. Exemplarily, the file manager displays a first user interface, and the first prompt information is displayed in the first user interface.
[0223] In some embodiments, before the file manager obtains the file access request, the file manager displays the first prompt information. In some embodiments, the first prompt information is displayed only when the user triggers the file access request. When the Android application triggers the file access request by itself, the first prompt information is not displayed. Exemplarily, in response to the user's triggering operation on the file access request, the first prompt information is displayed, and in response to the completion of reading the first prompt information, the file selection interface is displayed.
[0224] 2. The first operating environment is the first PC operating environment, and the second operating environment is the second PC operating environment
[0225] In some embodiments, the first operating environment is a first PC operating environment, the second operating environment is a second PC operating environment, and the first PC operating environment is different from the second PC operating environment. Exemplarily, the first operating environment is a Windows operating environment, and the second operating environment is a Linux operating environment. Exemplarily, Fig.11 As shown, the method includes at least one of the following steps 1110 to 1150.
[0226] Step 1110, the file manager obtains a file access request sent by a Linux application, where the file access request is used to request access to a data file stored in a first storage space, and the first storage space is accessible to applications in a Windows operating environment but not to applications in a Linux operating environment.
[0227] In some embodiments, the file manager intercepts a file access request sent by a Linux application. In some embodiments, the file manager obtains a first message sent by a Linux application, parses the first message, and obtains a parameter content contained in the first message. Based on the parameter content contained in the first message, the purpose of the first message is determined. Exemplarily, the first message carries the first indication information, indicating that the first message is used to access a data file and is a file access request. Exemplarily, the first message does not carry the first indication information, indicating that the first message is not used to access a data file and is not a file access request.
[0228] In some embodiments, the file access request may be triggered by a Linux application, or may be triggered by a user operating the Linux application. Exemplarily, the file access request may be actively triggered by the Linux application during operation. Exemplarily, the file access request may be triggered by a user through a control displayed in a user interface of the Linux application.
[0229] Step 1120: The file manager sends the file access request to the Linux simulator.
[0230] In some embodiments, a second application is also running in the Linux operating environment, and the second application is used to manage the applications running in the Linux operating environment.
[0231] In some embodiments, the file manager sends a file access request to a second application through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the Linux operating environment; the second application sends the file access request to a Linux simulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the Linux simulator.
[0232] In some embodiments, since the file manager runs in a Linux operating environment and the Linux simulator runs in a Windows operating environment, when information is exchanged between the two, the second application program is required to implement information forwarding.
[0233] In some embodiments, the first interface language is used to implement cross-process communication in the same operating environment. In the following embodiments, the first communication channel is used to implement communication between application programs in different operating environments.
[0234] Step 1130, the Linux simulator adds the first data file to the second storage space based on the file access request, the second storage space allows applications in the Windows operating environment and applications in the Linux operating environment to access, and the first data file is a data file selected in the first storage space.
[0235] In some embodiments, the Linux simulator determines a first storage address of the first data file in the first storage space based on the file access request, and copies the first data file from the first storage space to the second storage space.
[0236] Exemplarily, step 1130 may include at least one of the following steps 1 to 3.
[0237] Step 1: The Linux simulator determines a first storage address of a first data file based on a file access request, where the first storage address is a storage address of the first data file in a first storage space.
[0238] In some embodiments, after receiving the file access request, the Linux simulator determines the defined storage address of the first data file. In some embodiments, the first storage address is determined based on the parameters carried in the file access request. Exemplarily, the parameters include at least one of the following: a first file type, a file size limit. The first file type is used to indicate the file type of the first data file, and the file size limit is used to indicate the requirements that the file size of the first data file needs to meet. The Linux simulator determines a data file with the same file type as the first file type, and then determines the first data file in the above data file based on the file size limit, and determines the storage address of the first data file in the first storage space as the first storage address. In some embodiments, since a large number of data files will be stored in the first storage space, the above parameters may not be able to uniquely determine the first data file in the first storage space. At this time, it can be considered to introduce user operations, and the user selects a suitable data file as the first data file.
[0239] In some embodiments, the first data file is selected and determined by a user in the first storage space. Exemplarily, the method includes at least one of the following steps a to b.
[0240] In step a, the Linux simulator displays a file selection interface based on the file access request, wherein the file selection interface displays at least one data file stored in the first storage space.
[0241] In some embodiments, the at least one data file is all data files in the first storage space, or may be part of the data files in the first storage space, which is not limited in the present application.
[0242] In some embodiments, at least one data file classified by directory is displayed in the file selection interface. In some embodiments, the file selection interface can display the interface where the root directory is located, or can display the interface where any subdirectory is located, which is not limited in this application.
[0243] In some embodiments, the storage address corresponding to the file selection interface may be a default storage address. In some embodiments, the default storage address may be set by a Linux simulator, may be set by the first device, or may be set based on the type of Linux application, which is not limited in this application.
[0244] Exemplarily, the Linux simulator filters out at least one candidate data file from the data files stored at a third storage address based on the parameters carried in the file access request, where the third storage address is a default storage address corresponding to the file access request in the first storage space; the Linux simulator displays a file selection interface, in which at least one candidate data file is displayed.
[0245] In some embodiments, the parameters include at least one of: a first file type, a file size limit.
[0246] In some embodiments, the Linux simulator screens and obtains at least one candidate data file from the data files stored at the third storage address based on the first file type and the file size limit, wherein the file type of at least one candidate data file is the same as the first file type, and the size of at least one candidate data file meets the file size limit. Exemplarily, if the first file type is pdf, then the file types of the candidate data files are all pdf. Exemplarily, if the file size limit is less than 1GB, then the sizes of the candidate data files are all less than 1GB.
[0247] Step b: in response to a selection operation on a first data file among the at least one data file, the Linux simulator determines a first storage address of the first data file.
[0248] In some embodiments, in response to a path switching operation on a file selection interface, the Linux emulator switches the file selection interface from displaying at least one candidate data file at a third storage address to displaying at least one candidate data file at a fourth storage address. The path switching operation is used to switch the storage address of the source of the candidate data files displayed in the file selection interface. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0249] Step 2: The Linux simulator obtains the first data file from the first storage address.
[0250] Step 3: The Linux simulator adds the first data file to the second storage space.
[0251] In some embodiments, the Linux emulator copies the first data file from the first storage address and adds it to the second storage space.
[0252] In some embodiments, if there are multiple first data files, when the multiple first data files correspond to the same first storage address, the Linux simulator simultaneously copies the multiple first data files and adds them to the second storage space. When the multiple first data files correspond to different first storage addresses, for each first storage address, the Linux simulator performs the operation of copying the first data file and adding it to the second storage space.
[0253] Step 1140: The Linux simulator sends the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space.
[0254] In some embodiments, a second application is also running in the Linux operating environment.
[0255] In some embodiments, the Linux simulator sends the second storage address to the second application through the first communication channel; the second application sends the second storage address to the file manager through the cross-process communication mechanism implemented by the first interface language.
[0256] Step 1150: The file manager provides the second storage address to the Linux application.
[0257] In some embodiments, since the file manager is adjusted, in order to reduce the user's learning cost, the file manager can also provide prompt information to the user to assist the user in performing file access operations.
[0258] In some embodiments, the file manager displays first prompt information, and the first prompt information is used to indicate an operation corresponding to accessing a data file stored in the first storage space. Exemplarily, the file manager displays a first user interface, and the first prompt information is displayed in the first user interface.
[0259] In some embodiments, before the file manager obtains the file access request, the file manager displays the first prompt information. In some embodiments, the first prompt information is displayed only when the user triggers the file access request. When the Linux application triggers the file access request by itself, the first prompt information is not displayed. Exemplarily, in response to the user's triggering operation on the file access request, the first prompt information is displayed, and in response to the first prompt information being read, the file selection interface is displayed.
[0260] In some embodiments, the technical solution provided in the embodiments of the present application can also be applied to other operating environments. For example, it can be applied to the operating environment of VR and MR devices, which is not limited in the present application.
[0261] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0262] Please refer to Fig.12 , which shows a block diagram of a file access device provided by an embodiment of the present application. The device can be set in a file manager. Fig.12 As shown, the device 1200 includes: an acquisition module 1210 , a first sending module 1220 , a first receiving module 1230 and a providing module 1240 .
[0263] The acquisition module 1210 is used to obtain a file access request sent by a first application, wherein the file access request is used to request access to a data file stored in a first storage space, wherein the first storage space allows access by applications in a first operating environment but does not allow access by applications in a second operating environment; wherein a simulator runs in the first operating environment, and the simulator is used to create and manage the second operating environment, wherein the first application and a file manager run in the second operating environment, wherein the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment.
[0264] The first sending module 1220 is configured to send the file access request to the simulator.
[0265] The first receiving module 1230 is used to receive the second storage address of the first data file sent by the simulator, the second storage address is the storage address of the first data file in the second storage space, the first data file is a data file selected in the first storage space, and the first data file is added to the second storage space by the simulator based on the file access request.
[0266] The providing module 1240 is used to provide the second storage address to the first application.
[0267] In some embodiments, a second application is also running in the second operating environment, and the second application is used to manage the applications running in the second operating environment. The first sending module 1220 is used to send the file access request to the second application through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the second operating environment. The second application is used to send the file access request to the simulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the simulator.
[0268] In some embodiments, the device 1200 further includes a display module (not shown).
[0269] The display module is used to display first prompt information, where the first prompt information is used to indicate an operation corresponding to accessing the data file stored in the first storage space.
[0270] According to the technical solution provided by the embodiment of the present application, after obtaining a file access request, the file manager can forward the file access request to the simulator, and the simulator interacts with the first operating environment to obtain the first data file stored in the first storage space. The simulator adds the first data file in the first storage space to the second storage space, and provides the second storage address corresponding to the first data file in the second storage space to the first application through the file manager. This allows the first application to access the first data file based on the second storage address. There is no need for the user to manually copy the first data file to the second storage space, which simplifies the operation process of file access and improves operation efficiency.
[0271] Please refer to Fig.13 , which shows a block diagram of a file access device provided by another embodiment of the present application. The device can be set in a simulator. Fig.13 As shown, the device 1300 includes: a second receiving module 1310 , an adding module 1320 and a second sending module 1330 .
[0272] The second receiving module 1310 is used to receive a file access request sent by a file manager, wherein the file access request is sent by a first application to the file manager, and the file access request is used to request access to a data file stored in a first storage space, and the first storage space allows access by applications in a first operating environment but does not allow access by applications in a second operating environment; wherein a simulator is running in the first operating environment, and the simulator is used to create and manage the second operating environment, and the first application and the file manager are running in the second operating environment, and the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment.
[0273] The adding module 1320 is used to add the first data file to the second storage space based on the file access request, the second storage space allows the application in the first operating environment and the application in the second operating environment to access, and the first data file is a data file selected in the first storage space.
[0274] The second sending module 1330 is used to send the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space, and the second storage address is provided by the file manager to the first application.
[0275] In some embodiments, the adding module 1320 is used to determine a first storage address of the first data file based on the file access request, where the first storage address is a storage address of the first data file in the first storage space; obtain the first data file from the first storage address; and add the first data file to the second storage space.
[0276] In some embodiments, adding module 1320 is used to display a file selection interface based on the file access request, wherein the file selection interface displays at least one data file stored in the first storage space; and in response to a selection operation on the first data file among the at least one data file, determine the first storage address of the first data file.
[0277] In some embodiments, an adding module 1320 is used to filter out at least one candidate data file from the data files stored at a third storage address based on the parameters carried in the file access request, where the third storage address is a default storage address corresponding to the file access request in the first storage space; and display the file selection interface, in which the at least one candidate data file is displayed.
[0278] In some embodiments, the adding module 1320 is also used to switch the file selection interface from displaying at least one candidate data file of the third storage address to displaying at least one candidate data file of the fourth storage address in response to a path switching operation on the file selection interface, wherein the path switching operation is used to switch the storage address of the source of the candidate data files displayed in the file selection interface, and the fourth storage address is the storage address in the first storage space selected by the path switching operation.
[0279] In some embodiments, a second application is also running in the second operating environment, and the second application is used to manage the applications running in the second operating environment. The second sending module 1330 is used to send the second storage address to the second application through the first communication channel. The first communication channel is used for data transmission between the second application and the simulator, and the second application is used to send the second storage address to the file manager through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the second operating environment.
[0280] According to the technical solution provided by the embodiment of the present application, after obtaining a file access request, the file manager can forward the file access request to the simulator, and the simulator interacts with the first operating environment to obtain the first data file stored in the first storage space. The simulator adds the first data file in the first storage space to the second storage space, and provides the second storage address corresponding to the first data file in the second storage space to the first application through the file manager. This allows the first application to access the first data file based on the second storage address. There is no need for the user to manually copy the first data file to the second storage space, which simplifies the operation process of file access and improves operation efficiency.
[0281] Please refer to Fig.14 , which shows a block diagram of a terminal device 1400 provided in one embodiment of the present application. The terminal device 1400 may be any electronic device having data calculation, processing and storage functions. The terminal device 1400 may be used to implement the above-mentioned file access method provided in the above-mentioned embodiment. Exemplarily, the terminal device may be implemented as the above-mentioned first device.
[0282] Typically, the terminal device 1400 includes: a processor 1401 and a memory 1402 .
[0283] The processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1401 may be integrated with a GPU (Graphic Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0284] The memory 1402 may include one or more computer-readable storage media, which may be non-transitory. The memory 1402 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1402 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned file access method.
[0285] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technology, CD-ROM, DVD (Digital Video Disc) or other optical storage, tape cassettes, magnetic tapes, disk storage or other magnetic storage devices. Those skilled in the art will appreciate that Fig.14 The structure shown in the figure does not constitute a limitation on the terminal device 1400, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0286] The memory also includes a computer program, which is stored in the memory and configured to be executed by one or more processors to implement the above file access method.
[0287] In an exemplary embodiment, a computer program product is also provided, the computer program comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a terminal device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the terminal device executes the above-mentioned file access method.
[0288] It should be noted that, before collecting the relevant data of the user and during the process of collecting the relevant data of the user, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that the relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining the relevant data of the user after obtaining the confirmation operation issued by the user on the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the relevant data of the user are terminated, that is, the relevant data of the user is not obtained. In other words, all user data collected by this application (including the first storage space, the first storage address, the second storage space, the second storage address, etc.) are processed strictly in accordance with the requirements of the laws and regulations of relevant countries, and the informed consent or separate consent of the subject of personal information is obtained with the consent and authorization of the user. The subsequent data use and processing behavior is carried out within the scope of authorization of laws and regulations and the subject of personal information, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0289] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0290] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A file access method, characterized in that: The method comprises: The file manager obtains a file access request sent by a first application, the file access request is used to request access to a data file stored in a first storage space, the first storage space is accessible to applications in a first operating environment, and is not accessible to applications in a second operating environment; wherein a simulator is running in the first operating environment, the simulator is used to create and manage the second operating environment, the second operating environment is different from the first operating environment, the first application and the file manager are running in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment; The file manager sends the file access request to the simulator; The simulator adds the first data file to a second storage space based on the file access request, the second storage space being accessible to applications in the first operating environment and applications in the second operating environment, the first data file being a data file selected in the first storage space; The simulator sends a second storage address of the first data file to the file manager, where the second storage address is a storage address of the first data file in the second storage space; The file manager provides the second storage address to the first application.
2. The method according to claim 1, characterized in that The simulator adds the first data file to the second storage space based on the file access request, including: The simulator determines, based on the file access request, a first storage address of the first data file, where the first storage address is a storage address of the first data file in the first storage space; The simulator obtains the first data file from the first storage address; The simulator adds the first data file to the second storage space.
3. The method according to claim 2, characterized in that The simulator determines, based on the file access request, a first storage address of the first data file, including: The simulator displays a file selection interface based on the file access request, wherein the file selection interface displays at least one data file stored in the first storage space; In response to a selection operation on the first data file among the at least one data file, the simulator determines the first storage address of the first data file.
4. The method according to claim 3, characterized in that The simulator displays a file selection interface based on the file access request, including: The simulator selects and obtains at least one candidate data file from data files stored at a third storage address based on the parameters carried in the file access request, wherein the third storage address is a default storage address corresponding to the file access request in the first storage space; The simulator displays the file selection interface, and the at least one candidate data file is displayed in the file selection interface.
5. The method according to claim 4, characterized in that The parameters include at least one of the following: a first file type, a file size limit; The simulator selects and obtains at least one candidate data file from the data files stored at the third storage address based on the parameters carried in the file access request, including: Based on the first file type and the file size limit, the simulator filters out at least one candidate data file from the data files stored at the third storage address, the file type of the at least one candidate data file is the same as the first file type, and the size of the at least one candidate data file meets the file size limit.
6. The method according to claim 4 or 5, characterized in that: The method further comprises: In response to a path switching operation on the file selection interface, the simulator switches the file selection interface from displaying at least one candidate data file of the third storage address to displaying at least one candidate data file of a fourth storage address. The path switching operation is used to switch the storage address of the source of the candidate data files displayed in the file selection interface. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
7. The method according to any one of claims 1 to 6, characterized in that: A second application is also running in the second operating environment, and the second application is used to manage the applications running in the second operating environment; The file manager sends the file access request to the simulator, including: The file manager sends the file access request to the second application program through a cross-process communication mechanism implemented by a first interface language, wherein the first interface language is adapted to the second operating environment; The second application sends the file access request to the simulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the simulator.
8. The method according to claim 7, characterized in that The simulator sends the second storage address of the first data file to the file manager, including: The simulator sends the second storage address to the second application through the first communication channel; The second application sends the second storage address to the file manager through a cross-process communication mechanism implemented by the first interface language.
9. The method according to any one of claims 1 to 8, characterized in that: Before the file manager obtains the file access request sent by the first application, the method further includes: The file manager displays first prompt information, where the first prompt information is used to indicate an operation corresponding to accessing a data file stored in the first storage space.
10. The method according to any one of claims 1 to 9, characterized in that: The first operating environment is a personal computer PC operating environment, and the second operating environment is a mobile terminal operating environment; or The first operating environment is a first PC-side operating environment, and the second operating environment is a second PC-side operating environment. The first PC-side operating environment is different from the second PC-side operating environment.
11. A file access method, characterized in that: The method comprises: Obtaining a file access request sent by a first application, the file access request being used to request access to a data file stored in a first storage space, the first storage space being accessible to applications in a first operating environment and being inaccessible to applications in a second operating environment; wherein a simulator is running in the first operating environment, the simulator being used to create and manage the second operating environment, the first application and a file manager being running in the second operating environment, the first application being supported to run in the second operating environment but not in the first operating environment, and the second operating environment being different from the first operating environment; Sending the file access request to the simulator; Receiving a second storage address of a first data file sent by the simulator, where the second storage address is a storage address of the first data file in a second storage space, the first data file is a data file selected in the first storage space, and the first data file is added to the second storage space by the simulator based on the file access request; The second storage address is provided to the first application.
12. The method according to claim 11, characterized in that A second application is also running in the second operating environment, and the second application is used to manage the applications running in the second operating environment; The sending the file access request to the simulator comprises: sending the file access request to the second application program through a cross-process communication mechanism implemented in a first interface language, wherein the first interface language is compatible with the second operating environment; The second application is used to send the file access request to the simulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the simulator.
13. A file access method, characterized in that: The method comprises: Receive a file access request sent by a file manager, the file access request is sent by a first application to the file manager, the file access request is used to request access to a data file stored in a first storage space, the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator runs in the first operating environment, the simulator is used to create and manage the second operating environment, the first application and the file manager run in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment; Based on the file access request, adding a first data file to a second storage space, the second storage space allowing the application in the first operating environment and the application in the second operating environment to access, the first data file being a data file selected in the first storage space; The second storage address of the first data file is sent to the file manager, where the second storage address is the storage address of the first data file in the second storage space, and the second storage address is provided by the file manager to the first application.
14. The method according to claim 13, characterized in that The adding the first data file to the second storage space based on the file access request includes: Determine, based on the file access request, a first storage address of the first data file, where the first storage address is a storage address of the first data file in the first storage space; Acquire the first data file from the first storage address; Add the first data file to the second storage space.
15. The method according to claim 13 or 14, characterized in that A second application is also running in the second operating environment, and the second application is used to manage the applications running in the second operating environment; The sending the second storage address of the first data file to the file manager includes: sending the second storage address to the second application via the first communication channel; Among them, the first communication channel is used for data transmission between the second application and the simulator, the second application is used to send the second storage address to the file manager through a cross-process communication mechanism implemented by a first interface language, and the first interface language is adapted to the second operating environment.
16. A file access device, characterized in that: The device comprises: an acquisition module, configured to acquire a file access request sent by a first application, wherein the file access request is used to request access to a data file stored in a first storage space, wherein the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator runs in the first operating environment, the simulator is used to create and manage the second operating environment, the first application and a file manager run in the second operating environment, the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment; A first sending module, used for sending the file access request to the simulator; A first receiving module is used to receive a second storage address of a first data file sent by the simulator, where the second storage address is a storage address of the first data file in a second storage space, the first data file is a data file selected in the first storage space, and the first data file is added to the second storage space by the simulator based on the file access request; A module is provided, configured to provide the second storage address to the first application.
17. A file access device, characterized in that: The device comprises: a second receiving module, configured to receive a file access request sent by a file manager, wherein the file access request is sent by a first application to the file manager, and the file access request is used to request access to a data file stored in a first storage space, and the first storage space allows access by applications in a first operating environment, but does not allow access by applications in a second operating environment; wherein a simulator is running in the first operating environment, and the simulator is used to create and manage the second operating environment, and the first application and the file manager are running in the second operating environment, and the first application supports running in the second operating environment but does not support running in the first operating environment, and the second operating environment is different from the first operating environment; an adding module, configured to add a first data file to a second storage space based on the file access request, wherein the second storage space allows the application in the first operating environment and the application in the second operating environment to access the first data file, and the first data file is a data file selected in the first storage space; The second sending module is used to send the second storage address of the first data file to the file manager, where the second storage address is the storage address of the first data file in the second storage space, and the second storage address is provided by the file manager to the first application.
18. A terminal device, characterized in that: The terminal device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the file access method as described in any one of claims 1 to 10, or to implement the file access method as described in any one of claims 11 to 12, or to implement the file access method as described in any one of claims 13 to 15.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the file access method as described in any one of claims 1 to 10, or to implement the file access method as described in any one of claims 11 to 12, or to implement the file access method as described in any one of claims 13 to 15.
20. A computer program product, characterized in that The computer program product comprises a computer program, which is loaded and executed by a processor to implement the file access method as described in any one of claims 1 to 10, or to implement the file access method as described in any one of claims 11 to 12, or to implement the file access method as described in any one of claims 13 to 15.
Citation Information
Patent Citations
Method and device for creating virtual machine
CN103970585A
File sharing method, communication system and electronic equipment
CN114374690A
Method for accessing file directory in application, computing device and storage medium
CN116841959A
File transmission method and device, electronic equipment and storage medium
CN116980391A
Systems and methods for providing access to a data file stored at a data storage system
US20180232394A1