File access method, device, equipment and storage medium
By modifying the interaction mechanism between the file manager and the emulator, files on the PC can be accessed directly in the Android emulator, solving the problems of cumbersome operation and low efficiency in the existing technology, and achieving the effect of simplifying the operation process and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-10-31
- Publication Date
- 2026-05-19
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 and have complex configurations.
By modifying the file manager, the application's file open requests are intercepted, allowing direct interaction between the emulator and the first runtime environment. Data files are then retrieved and added to the second storage space, and the storage address is provided to the application, simplifying the operation process and reducing manual copying and configuration.
It simplifies file access operations, improves efficiency, enhances user experience, reduces reliance on external tools, and makes the system more concise and stable.
Smart Images

Figure CN119597709B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a file access method, apparatus, device, and storage medium. Background Technology
[0002] Currently, Android emulators are widely used in PC (Personal Computer) environments to test and run Android applications. In these emulators, users typically need to go through a complex process to transfer files from their PC to the Android emulator environment on their phone.
[0003] In related technologies, users need to manually copy the required files from their PC to a specific shared folder or transfer the files to the emulator environment via a physical medium such as USB (Universal Serial Bus). Within the emulator, applications access files through standard file access APIs (Application Programming Interfaces), which typically relies on the emulator's ability to correctly emulate Android's file system interface.
[0004] However, the above method requires multiple steps, which is cumbersome and inefficient. Summary of the Invention
[0005] This application provides a file access method, apparatus, device, and storage medium. The technical solutions provided by this application are as follows:
[0006] According to one aspect of the embodiments of this application, a file access method is provided, the method comprising:
[0007] The file manager receives 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 from applications in a first runtime environment but does not allow access from applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage a second runtime environment. The second runtime environment is different from the first runtime environment. The second runtime environment runs the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment.
[0008] The file manager sends the file access request to the emulator;
[0009] Based on the file access request, the simulator adds a first data file to a second storage space. The second storage space is accessible to applications in both the first and second runtime environments. The first data file is a data file selected from the first storage space.
[0010] 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;
[0011] The file manager provides the second storage address to the first application.
[0012] According to one aspect of the embodiments of this application, a file access method is provided, the method comprising:
[0013] A file access request sent by a first application is obtained. 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment has an emulator running. The emulator is used to create and manage the second runtime environment. The second runtime environment has the first application and a file manager running. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment.
[0014] Send the file access request to the simulator;
[0015] The simulator receives 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. The first data file is added to the second storage space by the simulator based on the file access request.
[0016] Provide the second storage address to the first application.
[0017] According to one aspect of the embodiments of this application, a file access method is provided, the method comprising:
[0018] The system receives a file access request sent by a file manager. The file access request is sent by a first application to the file manager and is used to request access to a data file stored in a first storage space. The first storage space allows access from applications in a first runtime environment but does not allow access from applications in a second runtime environment. The first runtime environment contains an emulator used to create and manage a second runtime environment. The second runtime environment contains the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment.
[0019] Based on the file access request, the first data file is added to the second storage space, which is accessible to applications in the first and second runtime environments. The first data file is 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. 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 to the first application by the file manager.
[0021] According to one aspect of the embodiments of this application, a file access apparatus is provided, the apparatus comprising:
[0022] The acquisition module is used to acquire 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage a second runtime environment. The second runtime environment runs the first application and a file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment.
[0023] The first sending module is used to send the file access request to the simulator;
[0024] The first receiving module 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. 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 for providing the second storage address to the first application.
[0026] According to one aspect of the embodiments of this application, a file access apparatus is provided, the apparatus comprising:
[0027] The second receiving module is used to receive a file access request sent by the file manager. The file access request is sent by the 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage the second runtime environment. The second runtime environment runs the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment.
[0028] An add module is used to add a first data file to a second storage space based on the file access request. The second storage space allows access from applications in the first runtime environment and applications in the second runtime environment. 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. 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 to the first application by the file manager.
[0030] According to one aspect of the embodiments of this application, a terminal device is provided, the terminal device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described file access method.
[0031] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the above-described file access method.
[0032] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program, the computer program being loaded and executed by a processor to implement the above-described file access method.
[0033] The technical solutions provided in this application embodiment may have the following beneficial effects:
[0034] After receiving a file access request, the file manager can forward it to the emulator. The emulator then interacts with the first runtime environment to retrieve the first data file stored in the first storage space. The emulator adds the first data file from the first storage space to the second storage space and provides the corresponding second storage address of 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. This eliminates the need for the user to manually copy the first data file to the second storage space, simplifying the file access process and improving operational efficiency. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of a file access system provided in one embodiment of this application;
[0036] Figure 2 This is a flowchart of a file access method provided in one embodiment of this application;
[0037] Figure 3 This is a flowchart of a file access method provided in another embodiment of this application;
[0038] Figure 4 This is a schematic diagram of the user interface of a first application provided in one embodiment of this application;
[0039] Figure 5 This is a schematic diagram of a file selection interface provided in one embodiment of this application;
[0040] Figure 6 This is a schematic diagram of a file access process provided in one embodiment of this application;
[0041] Figure 7 This is a flowchart of a file access method provided in another embodiment of this application;
[0042] Figure 8 This is a flowchart of a file access method provided in another embodiment of this application;
[0043] Figure 9 This is a flowchart of a file access method provided in another embodiment of this application;
[0044] Figure 10 This is a flowchart of a file access method provided in another embodiment of this application;
[0045] Figure 11 This is a flowchart of a file access method provided in another embodiment of this application;
[0046] Figure 12 This is a block diagram of a file access device provided in another embodiment of this application;
[0047] Figure 13 This is a block diagram of a file access device provided in another embodiment of this application;
[0048] Figure 14 This is a block diagram of a terminal device provided in one embodiment of this application. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0050] First, a brief introduction to the terms used in the embodiments of this application:
[0051] Android is an open-source operating system based on the Linux kernel, primarily used for mobile devices (such as smartphones and tablets) and other embedded devices. Developed and maintained by Google, and promoted in partnership with the Open Handset Alliance, Android provides a rich application framework that allows developers to build a wide variety of applications and games.
[0052] PC: A multi-purpose electronic computing device, mainly used for personal daily computing tasks, such as document processing, web browsing, media playback, and games.
[0053] Android emulator: An Android emulator is a software application that runs on a PC. It allows the computer to simulate the operating system of a smartphone, enabling users to install and run Android applications on their computers.
[0054] The Android emulator host side refers to the emulator software itself running on a computer, along with its associated hardware abstraction layer, operating system, and user interface components. The host side is responsible for creating and managing the virtual phone environment (guest side) and provides a series of tools and interfaces so that users can interact with the virtual phone. The host side described in this patent is a PC software implemented on the Windows platform, and its product form is a PC application store; hereinafter referred to as the host side.
[0055] Android emulator Guest: This refers to the virtual mobile phone environment created on a computer by emulator software. In this environment, mobile 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 scheme. Its form is a VDI file, which conforms to the VDI file format specification. The Host terminal loads and runs this VDI file. Hereinafter referred to as the Guest terminal.
[0056] Mobile Launcher: A mobile launcher is a mobile application used to customize and manage a smartphone's home screen and app menus. It allows users to change icons, layouts, animations, and other visual elements to create a personalized user interface experience.
[0057] Mobile applications refer to applications designed specifically for devices running the Android operating system (such as smartphones, tablets, etc.) and developed using the APIs provided by the Android SDK (Software Development Kit).
[0058] Please refer to Figure 1 The diagram illustrates a file access system provided in one embodiment of this application. The file access system may include a terminal device 100 and a server 200.
[0059] Terminal device 100 can be an electronic device such as a PC (Personal Computer), mobile phone, wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, or MR (Mixed Reality) device. Terminal device 100 runs an emulator, a file manager, and a first application. In some embodiments, the emulator runs in a first runtime environment provided by terminal device 100, and the emulator is used to create and manage a second runtime environment, which is different from the first runtime environment. In some embodiments, the first application and the file manager run in the second runtime environment provided by the emulator. In some embodiments, the first application supports running in the second runtime environment but does not support running in the first runtime environment. The file manager is used to receive file access requests sent by the first application, which request access to data files stored in a first storage space. The first storage space allows access from applications in the first runtime environment but not from applications in the second runtime environment; and sends the file access requests to the emulator. The emulator adds a first data file to a second storage space based on a file access request. This second storage space is accessible to applications in both the first and second runtime environments. The first data file is the one selected within the first storage space. The emulator then sends the second storage address of the first data file to the file manager. This second storage address is the location of the first data file within the second storage space. The file manager also provides this second storage address to the first application.
[0060] Furthermore, this application does not limit the form of the first application, including but not limited to Apps (Applications), mini-programs, etc. installed on the terminal device 100, and may also be in the form of a webpage.
[0061] Server 200 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Server 200 can be the backend server of the aforementioned emulator, used to provide backend services for the emulator's clients.
[0062] Terminal device 100 and server 200 can communicate via a network, such as a wired or wireless network.
[0063] The file access method provided in this application embodiment can be executed by a terminal device at each step. Figure 1Taking the implementation environment of the scheme shown as an example, the file access method can be executed by the terminal device 100 (such as the file access method being executed by the emulator installed and running in the terminal device 100).
[0064] Currently, Android emulators are widely used in PC environments for testing and running Android applications. Within these emulators, users typically need to go through complex steps to transfer files from their PC to the Android emulator environment on their mobile phone. 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 emulator environment via physical media such as USB.
[0066] 2. File access method: In the emulator, the application calls files through the standard file access API, which usually depends on the emulator being able to correctly simulate the Android file system interface.
[0067] 3. Cumbersome user operation: 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: Existing Android emulators typically involve multiple steps when importing files, including manually copying files and configuring shared folders, which increases the user's workload.
[0070] 2. Time consumption: Due to the involvement of multiple steps and manual operations, the process of transferring files from the PC to the emulator takes a long time.
[0071] 3. Poor user experience: The complex operation process and long file transfer time directly affect the user experience, which may make users feel inconvenienced and frustrated when using emulator applications.
[0072] 4. Dependence on external tools: Existing methods may require specific external tools or settings to complete the file import, which increases the complexity of configuration and management.
[0073] This application provides a file access method that allows applications running in an emulator to directly access files stored on a PC, achieving the following technical effects:
[0074] 1. Simplified Operation Process: By modifying the file manager within the Android emulator to directly intercept application file open requests, the file import process is significantly simplified. Users no longer need to perform complex file copying and configuration; they can simply select the file using the file selection box on the PC to complete the import.
[0075] 2. Improved file import efficiency: By reducing manual operations and intermediate steps, the time for importing files from the PC to the emulator is greatly shortened, thereby improving overall efficiency, especially in scenarios where frequent file operations are required.
[0076] 3. Improved user experience: Users can import files with almost no need to leave the application interface, which greatly improves user experience and satisfaction.
[0077] 4. Reduced 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 simpler and more stable.
[0078] Please refer to Figure 2 The diagram illustrates a flowchart of a file access method provided in one embodiment of this 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. The file access request is used to request access to the data file stored in the first storage space. The first storage space allows access by applications in the first runtime environment but does not allow access by applications in the second runtime environment.
[0080] This method is executed by a first device that provides a first operating environment, and the first device can be implemented as follows: Figure 1 The terminal device shown. In some embodiments, a simulator runs in the first runtime environment. The simulator is used to create and manage a second runtime environment, which is different from the first runtime environment. A first application and a file manager run in the second runtime environment. The first application supports running in the second runtime environment but does not support running in the first runtime environment.
[0081] In some embodiments, a runtime environment refers to an environment in which semi-compiled runtime code is run on a target machine. A runtime environment is a mode of operation that falls between a compiler and an interpreter. Different runtime environments support different processes.
[0082] In some embodiments, the first application can be any application. For example, the first application can be a social application, a music application, a learning application, a video application, a reading application, etc. In some embodiments, the first application can only run in the second runtime environment and cannot run in the first runtime environment. In some embodiments, the first application can have different versions; a first version of the first application can run in the first runtime environment, and a second version of the first application can run in the second runtime environment. Correspondingly, in this embodiment, the two versions of the first application are considered as two different applications, and the second version of the first application cannot run in the first runtime environment. In some embodiments, the first application can be an application provided by an emulator, or an application provided by a third party other than an emulator; this application does not limit this.
[0083] In some embodiments, the file manager is used to manage persistent or continuous data in a management database, persistent message queue, or transactional file system within a second runtime environment. The file manager stores data and performs fault recovery. The file manager can be viewed as a management tool for the second runtime environment.
[0084] In some embodiments, in response to a file access request triggered by a first application, 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 a file access request to the emulator.
[0086] In related technologies, after receiving a file access request, the file manager provides the user with the path address of a second storage space, allowing the user to select the corresponding file (the first data file). This second storage space is accessible to applications in both the first and second runtime environments. In this case, if the first data file requested by the file access request is not stored in the second storage space, the first application cannot access it. To enable the first application 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 file access requests, and to perform user guidance and data transfer as appropriate. In some embodiments, the file manager sends the intercepted file access requests to the emulator, which then retrieves the first data file from the first runtime environment.
[0088] Step 230: Based on the file access request, the emulator adds the first data file to the second storage space. The second storage space allows applications in both the first and second runtime environments to access the data file. The first data file is the data file selected in the first storage space.
[0089] In some embodiments, after receiving a file access request from the file manager, the emulator determines a first data file based on the file access request and adds the first data file to the second storage space. In some embodiments, the emulator 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 the user in a first storage space. Exemplarily, the simulator displays a file selection interface based on a file access request, which displays at least one data file stored in the first storage space. In response to a selection operation for the first data file among the at least one data file, the simulator adds the first data file to a second storage space.
[0091] In some embodiments, the first data file is automatically determined by the simulator based on a file access request. In some embodiments, the file access request carries information related to the first data file, and the simulator determines the first data file in the first storage space based on the 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. The second storage address is the storage address of the first data file in the second storage space.
[0093] In some embodiments, the emulator sends the storage address of the first data file in the second storage space to the file manager, which then provides the second storage address to the first application. In some embodiments, the emulator may also directly send the second storage address to the first application.
[0094] Step 250: The file manager provides the second storage address to the first application.
[0095] In some embodiments, the first application accesses a first data file in a second storage space based on a second storage address. In some embodiments, the first application may also import the first data file based on the second storage address.
[0096] The technical solution provided in this application embodiment allows the file manager to forward a file access request to the emulator after receiving it. The emulator then interacts with the first runtime environment to obtain a first data file stored in the first storage space. The emulator adds the first data file from the first storage space to a 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 enables the first application to access the first data file based on the second storage address. The user does not need to manually copy the first data file to the second storage space, simplifying the file access process and improving operational efficiency.
[0097] Please refer to Figure 3 This illustration shows a schematic diagram of a file access method provided in one embodiment of this application. The first operating environment is a PC-based operating environment, and the second operating environment is a mobile operating environment, which serve as examples to illustrate the file access method provided in this application embodiment.
[0098] Step 210: The file manager obtains a file access request sent by the first application. The file access request is used to request access to the data file stored in the first storage space. The first storage space allows access by applications in the first runtime environment but does not allow access by applications in the second runtime environment.
[0099] In some embodiments, the file manager intercepts file access requests sent by a first application. In some embodiments, the file manager obtains 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. For example, the first information carries first indication information, indicating that the first information is used to access a data file, and is a file access request. For example, the first information does not carry 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 information. For example, if the bit is 1, it indicates that the first information is a file access request, and if the bit is 0, it indicates that the first information is not a file access request.
[0101] In some embodiments, a file access request may be triggered by a first application or by a user interacting with the first application. For example, a file access request may be actively triggered by the first application during runtime. For example, a file access request may be triggered by a user through controls displayed in the user interface of the first application.
[0102] Step 220: The file manager sends a file access request to the emulator.
[0103] In some embodiments, if the first information is a file access request, the file access request is sent to the emulator. In some embodiments, the file manager does not process the file access request and directly forwards it to the emulator.
[0104] In some embodiments, the file manager processes the file access request and then forwards it to the emulator. For example, the file manager re-compresses the parsed file access request into a format that the emulator can accept before sending it to the emulator.
[0105] In some embodiments, a second application also runs in the second runtime environment, which is used to manage the applications running in the second runtime environment.
[0106] In some embodiments, the file manager sends file access requests to the second application through a cross-process communication mechanism implemented in a first interface language, which is adapted to the second runtime environment; the second application sends file access requests to the emulator through a first communication channel, which is used for data transmission between the second application and the emulator.
[0107] In some embodiments, since the file manager runs in a second runtime environment and the emulator runs in a first runtime environment, information exchange between the two requires the forwarding of information through a second application.
[0108] In some embodiments, the first interface language is used to implement cross-process communication within the same runtime environment. In the following embodiments, the first communication channel is used to implement communication between applications in different runtime environments.
[0109] Step 230: Based on the file access request, the emulator adds the first data file to the second storage space. The second storage space allows applications in both the first and second runtime environments to access the data file. The first data file is the data file selected in the first storage space.
[0110] In some embodiments, the simulator determines the 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] For example, step 230 may include at least one of steps 1 to 3 below.
[0112] Step 1: The simulator determines the first storage address of the first data file based on the file access request. The first storage address is the storage address of the first data file in the first storage space.
[0113] In some embodiments, after receiving a 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 parameters carried in the file access request. Exemplarily, the parameters include at least one of the following: a first file type and a file size limit. The first file type indicates the file type of the first data file, and the file size limit indicates the required size of the first data file. The simulator determines a data file with the same file type as the first file type, and then determines the first data file from among the aforementioned data files based on the file size limit, thus determining the storage address of the first data file in the first storage space as the first storage address. In some embodiments, since the first storage space may store a large number of data files, the above parameters may not be able to uniquely determine the first data file in the first storage space. In this case, user operation can be considered, allowing the user to select a suitable data file as the first data file.
[0114] In some embodiments, the first data file is selected and determined by the user in a first storage space. Exemplarily, the method includes at least one of steps a to b.
[0115] Step a: Based on the file access request, the simulator displays a file selection interface, which shows at least one data file stored in the first storage space.
[0116] In some embodiments, the above-mentioned at least one data file may be all the data files in the first storage space, or it may be a portion of the data files in the first storage space; this application does not limit this.
[0117] In some embodiments, the file selection interface displays at least one data file categorized by directory. In some embodiments, the file selection interface may display the interface containing the root directory, or it may display the interface containing any subdirectory; this application does not limit this.
[0118] In some embodiments, the storage address corresponding to the file selection interface can be a default storage address. In some embodiments, the default storage address can be set by the emulator, the first device, or based on the type of the first application; this application does not limit this.
[0119] For example, the simulator filters out 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. The third storage address is the default storage address corresponding to the file access request in the first storage space. The simulator displays a file selection interface, which shows at least one candidate data file.
[0120] In some embodiments, the parameters include at least one of the following: a first file type and a file size limit.
[0121] In some embodiments, the simulator, based on a first file type and a file size limit, filters data files stored at a third storage address to obtain at least one candidate data file. The at least one candidate data file has the same file type as the first file type, and its size meets the file size limit. For example, if the first file type is PDF, then all candidate data files will be PDF. For example, if the file size limit is less than 1GB, then all candidate data files will be less than 1GB.
[0122] For example, such as Figures 4-6 As shown, Figure 4 This is a schematic diagram of the user interface of the first application. In some embodiments, the user interface 400 of the first application displays a file access control 410. 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 displays at least one candidate data file 510 and a data file directory 520. In response to a selection operation on 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] In step b, in response to the selection operation for the first data file among at least one data file, the simulator determines the 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 parameters also include a multi-selection parameter, which indicates whether multi-selection of data files is supported. For example, if the multi-selection parameter indicates support for multi-selection of data files, 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 different first storage addresses. When multiple first data files correspond to different first storage addresses, the simulator needs to operate on each first data file separately. When multiple first data files correspond to the same first storage address, the simulator can add multiple first data files to the second storage space simultaneously.
[0126] In some embodiments, if the data file the user wants to select is not found in the third storage address, the user can switch to another path to select the first data file.
[0127] In some embodiments, in response to a path switching operation on the file selection interface, the 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 from which the candidate data files displayed in the file selection interface originate. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0128] In some embodiments, the file selection interface also displays a path switching control. In response to an operation on the path switching control, a path selection interface is displayed, which displays at least one storage address. 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 at a third storage address to displaying at least one candidate data file at a fourth storage address.
[0129] In some embodiments, the file selection interface also displays at least one candidate storage address. In response to a selection operation for 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 at a third storage address to displaying at least one candidate data file at a fourth storage address.
[0130] In some embodiments, the file selection interface also displays a data file directory, which includes storage addresses at various levels corresponding to the first storage space. In response to a selection operation for a fourth storage address in the data file directory, the simulator switches the file selection interface from displaying at least one candidate data file at the third storage address to displaying at least one candidate data file at the fourth storage address.
[0131] Step 2: The simulator retrieves 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 a first data file from a first storage address and adds it to a second storage space.
[0134] In some embodiments, if there are multiple first data files, and these 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. If the multiple first data files correspond to different first storage addresses, the simulator performs the operation of copying the first data file and adding it to the second storage space for each first storage address.
[0135] Step 240: The simulator sends 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.
[0136] In some embodiments, a second application also runs in the second runtime environment.
[0137] In some embodiments, the emulator sends a second storage address to the second application through a first communication channel; the second application sends the second storage address to the file manager through a cross-process communication mechanism implemented in a first interface language.
[0138] Step 250: The file manager provides the second storage address to the first application.
[0139] In some embodiments, due to adjustments made to the file manager, in order to reduce the learning curve for users, the file manager may also provide prompts to assist users in performing file access operations.
[0140] In some embodiments, the file manager displays a first prompt message, which indicates the operation corresponding to accessing a data file stored in the first storage space. For example, the file manager displays a first user interface, which shows the first prompt message.
[0141] In some embodiments, the file manager displays a first prompt message before the file manager receives a file access request. In some embodiments, the first prompt message is displayed only when the user triggers a file access request. The first prompt message is not displayed when the first application triggers a file access request on its own. Exemplarily, the first prompt message is displayed in response to the user's triggering action for a file access request, and a file selection interface is displayed in response to the completion of reading the first prompt message.
[0142] The technical solution provided in this application, on the one hand, modifies the file manager so that after the file manager receives a file access request, it forwards it to the emulator, which then retrieves the first data file from the first storage space. Users no longer need to perform complex file copying and configuration; they can simply select the data file through the file selection interface to complete file access, significantly simplifying the file access process. On the other hand, by reducing manual user operations and the intermediate steps of retrieving the first data file, the import time of the data file from the first storage space to the emulator is greatly shortened, thereby improving overall efficiency, especially in scenarios requiring frequent data file operations. Users can complete file access with almost no need to leave the user interface of the first application, greatly improving user experience and satisfaction. Moreover, by using only the built-in message communication channel and file manager interception mechanism to accomplish the above functions, the reliance on external tools and additional configurations is reduced, making the system simpler and more stable.
[0143] The functions of the file manager, the second application, and the emulator will be explained separately below.
[0144] I. File Manager
[0145] In some embodiments, the method is performed by a file manager running on a first device, the first device providing a first runtime environment, an emulator running in the first runtime environment, the emulator being used to create and manage a second runtime environment, the second runtime environment being different from the first runtime environment, the second runtime environment running a first application and a file manager, the first application supporting running in the second runtime environment but not supporting running in the first runtime environment.
[0146] For example, the file manager is used to perform at least one of the following steps a to d.
[0147] Step a: Obtain a file access request sent by the first application. The file access request is used to request access to a data file stored in the first storage space. The first storage space allows access by applications in the first runtime environment but does not allow access by applications in the second runtime environment.
[0148] In some embodiments, the file manager is responsible for intercepting and processing file access requests from the first application, and for performing appropriate user guidance and data transfer.
[0149] Step b: Send the file access request to the emulator.
[0150] Step c: 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 the data file selected in the first storage space. The first data file is added to the second storage space by the simulator based on the file access request.
[0151] Step d: Provide the second storage address to the first application.
[0152] In some embodiments, the file manager is also used to perform the following step e.
[0153] Step e: Display the first prompt message, which indicates the operation corresponding to accessing the data file stored in the first storage space.
[0154] For a detailed description of the above steps, please refer to the content in the above embodiments. The following will be illustrated using an example where the first runtime environment is a PC-based runtime environment, the second runtime environment is a mobile runtime environment, the first application is a mobile application, and the second application is a mobile launcher. For example, as shown... Figure 7 As shown, the file manager is used to perform the following operations:
[0155] Intercepting Intent Information: In the `onCreate` method of the `PickActivity` class in the file manager, the Intent request initiated by the mobile application is intercepted first. This step is accomplished by parsing the parameters carried in the Intent, which may include information such as the requested file type, file size limit, and whether multiple selection is supported. This information will be used for subsequent file selection and validation.
[0156] User guidance: Add a user guidance interface or prompt message to the root layout of the file manager. This guidance content is used to tell the user how to operate to meet the application's file access needs.
[0157] Inter-process communication (IPC) request forwarding: The request information parsed from the Intent is transmitted to the mobile Launcher via an IPC mechanism implemented using the Android Interface Definition Language (AIDL). This step is crucial for ensuring the correctness and security of information transmission between the file manager and the Launcher.
[0158] Handling file selection results: After the user selects a file, the file path is transmitted to the file manager via the inter-process communication (IPC) mechanism implemented in the Android Interface Definition Language (AIDL), and then received and processed by the Activity's onActivityResult method. This method returns the selected file path as result data to the requesting mobile application, enabling the application to access and process the user-selected file.
[0159] II. Second Application
[0160] In some embodiments, a second application also runs in the second runtime environment, which is used to manage the applications running in the second runtime environment.
[0161] In some embodiments, the file manager sends file access requests to the second application through a cross-process communication mechanism implemented in a first interface language, which is adapted to the second runtime environment; the second application sends file access requests to the emulator through a first communication channel, which is used for data transmission between the second application and the emulator.
[0162] In some embodiments, the emulator 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 emulator, and the second application sends the second storage address to the file manager through a cross-process communication mechanism implemented by a first interface language, the first interface language being adapted to the second runtime environment.
[0163] The following example will illustrate the process, using a PC-based runtime environment as the first example, a mobile runtime environment as the second example, a mobile application as the first application, and a mobile launcher as the second application. For example, as shown... Figure 8 As shown, the second application is used to perform the following operations:
[0164] The key to implementing the mobile launcher lies in establishing a stable service process to handle file access requests received from the file manager and accurately transmit these requests to the emulator's host. The specific implementation steps are as follows:
[0165] Starting the receiving service: When the mobile launcher starts, it initializes and starts a background service. The main responsibility of this service is to detect request information from the revamped file manager. This service needs to remain efficient and stable to ensure that all requests are processed in a timely manner.
[0166] Receiving file manager request information: When an Android application attempts to open or access a file through the file manager, the file manager captures relevant parameters of this operation and sends these parameters to the receiving service of the mobile launcher. These parameters include information such as file type and whether multiple selections are possible.
[0167] Information is transmitted via Socket communication: After receiving a file access request from the file manager, the receiving service forwards the request to the emulator's host via the established Socket communication channel. Socket communication must ensure the security and reliability of data transmission, ensuring that all sent file access requests are not tampered with or lost during transmission.
[0168] III. Simulator
[0169] In some embodiments, the method is executed by an emulator running on a first device, the first device providing a first runtime environment, the first runtime environment running an emulator, the emulator being used to create and manage a second runtime environment, the second runtime environment being different from the first runtime environment, the second runtime environment running a first application and a file manager, the first application supporting running in the second runtime environment but not supporting running in the first runtime environment.
[0170] For example, the simulator is used to perform at least one of the following steps a to c.
[0171] Step a: Receive a file access request sent by the file manager. The file access request is sent by the first application to the file manager. The file access request is used to request access to the data file stored in the first storage space. The first storage space allows access by applications in the first runtime environment, but does not allow access by applications in the second runtime environment.
[0172] Step b: Based on the file access request, add the first data file to the second storage space. The second storage space allows applications in both the first and second runtime environments to access the data file. The first data file is the 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, the first storage address being the storage address of the first data file in a first storage space; the first data file is retrieved 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, which displays at least one data file stored in a first storage space; in response to a selection operation for 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 selected from the data files stored at the third storage address, where 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, in which at least one candidate data file is displayed.
[0176] Step c: 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, and the second storage address is provided to the first application by the file manager.
[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 from which the candidate data files displayed in the file selection interface originate, and 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 in the above embodiments. The following will be illustrated using an example where the first runtime environment is a PC-based runtime environment, the second runtime environment is a mobile runtime environment, the first application is a mobile application, and the second application is a mobile launcher. For example, as shown... Figure 9 As shown, the file manager is used to perform the following operations:
[0179] Invoking the PC File Selection Box: The host uses the received parameters to invoke the system's file selection box. This step is crucial for user interaction; the system filters the selectable file types based on the parameters, ensuring the user's selection meets the needs of the mobile application. The file selection box provides a graphical interface, allowing users to intuitively browse and select files stored on the PC.
[0180] File copying and path transfer: After the user selects a file in the file selection box, the host will automatically perform a file copy operation, copying the file from its original location to a preset shared directory between the Android emulator and the PC. This shared directory is a storage location accessible to both parties, ensuring file availability.
[0181] After the file is copied, the host will generate a new path for the file in the shared directory and send this path information back to the mobile launcher via a message communication channel.
[0182] The technical solution provided in this application greatly simplifies the data file access process by directly intercepting file open requests within the Android emulator and achieving seamless connection with the PC client. Users can quickly select, access, and import files without leaving the emulator interface, thus providing a smoother and more intuitive operating experience.
[0183] It enables direct file access between PCs and Android emulators, breaking down data isolation previously caused by operating system and environment limitations. This cross-platform file access capability makes file processing more flexible and improves work adaptability.
[0184] By leveraging built-in file processing mechanisms, reliance on third-party tools or external storage devices is reduced, lowering the risk of data leakage or corruption. Simultaneously, the more centralized and internalized operation ensures more rigorous and secure data management and control.
[0185] Simplified operating procedures and improved efficiency directly lead to increased user satisfaction.
[0186] Furthermore, the technical solutions provided in this application are not only applicable to Android emulators, but also have the potential to be applied to other types of virtual environments or system emulators, demonstrating excellent adaptability and scalability.
[0187] Regarding the possible application scenarios of the technical solutions provided in the embodiments of this application, exemplary embodiments are also provided.
[0188] 1. The first operating environment is a PC-based operating environment, and the second operating environment is a mobile operating environment.
[0189] In some embodiments, the first runtime environment is a PC runtime environment, and the second runtime environment is a mobile runtime environment. For example, the first runtime environment is a Windows runtime environment, and the second runtime environment is an Android runtime environment. For example, as... Figure 10 As shown, the method includes at least one of the following steps 1010 to 1050.
[0190] Step 1010: The file manager receives a file access request sent by the Android application. The file access request is used to request access to the data file stored in the first storage space. The first storage space allows access by applications running in the Windows environment, but does not allow access by applications running in the Android environment.
[0191] In some embodiments, the file manager intercepts file access requests sent by an Android application. In some embodiments, the file manager obtains first information sent by the Android 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. For example, the first information carries first indication information, indicating that the first information is used to access a data file, and is a file access request. For example, the first information does not carry first indication information, indicating that the first information is not used to access a data file, and is not a file access request.
[0192] In some embodiments, a file access request may be triggered by an Android application or by user interaction with the Android application. For example, a file access request may be actively triggered by the Android application during runtime. For example, a file access request may be triggered by a user through controls displayed in the user interface of the Android application.
[0193] Step 1020: The file manager sends a file access request to the Android emulator.
[0194] In some embodiments, a second application also runs in the Android runtime environment, which manages the applications running in the Android runtime environment.
[0195] In some embodiments, the file manager sends file access requests to a second application through a cross-process communication mechanism implemented in a first interface language, which is compatible with the Android runtime environment; the second application sends file access requests to the Android emulator through a first communication channel, which 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 runtime environment and the Android emulator runs in the Windows runtime environment, information exchange between the two requires a second application to forward the information.
[0197] In some embodiments, the first interface language is used to implement cross-process communication within the same runtime environment. In the following embodiments, the first communication channel is used to implement communication between applications in different runtime environments.
[0198] Step 1030: Based on the file access request, the Android emulator adds the first data file to the second storage space. The second storage space is accessible to applications in both the Windows and Android runtime environments. The first data file is the data file selected in the first storage space.
[0199] In some embodiments, the Android emulator determines the 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] For example, step 1030 may include at least one of steps 1 to 3 below.
[0201] Step 1: The Android emulator determines the first storage address of the first data file based on the file access request. The first storage address is the storage address of the first data file in the first storage space.
[0202] In some embodiments, after receiving a file access request, the Android emulator determines the defined storage address of the first data file. In some embodiments, the first storage address is determined based on parameters carried in the file access request. Exemplarily, the parameters include at least one of the following: a first file type and a file size limit. The first file type indicates the file type of the first data file, and the file size limit indicates the required size of the first data file. The Android emulator determines a data file with the same file type as the first file type, and then determines the first data file from among the aforementioned data files based on the file size limit, thus determining the storage address of the first data file in the first storage space as the first storage address. In some embodiments, since the first storage space may store a large number of data files, the above parameters may not be able to uniquely determine the first data file in the first storage space. In this case, user operation can be considered, allowing the user to select a suitable data file as the first data file.
[0203] In some embodiments, the first data file is selected and determined by the user in a first storage space. Exemplarily, the method includes at least one of steps a to b.
[0204] Step a: Based on the file access request, the Android emulator displays a file selection interface, which shows at least one data file stored in the first storage space.
[0205] In some embodiments, the above-mentioned at least one data file may be all the data files in the first storage space, or it may be a portion of the data files in the first storage space; this application does not limit this.
[0206] In some embodiments, the file selection interface displays at least one data file categorized by directory. In some embodiments, the file selection interface may display the interface containing the root directory, or it may display the interface containing any subdirectory; this application does not limit this.
[0207] In some embodiments, the storage address corresponding to the file selection interface can be a default storage address. In some embodiments, the default storage address can be set by the Android emulator, by the first device, or by the type of Android application; this application does not limit this.
[0208] For example, the Android emulator filters out 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. The third storage address is the default storage address corresponding to the file access request in the first storage space. The Android emulator displays a file selection interface, which shows at least one candidate data file.
[0209] In some embodiments, the parameters include at least one of the following: a first file type and a file size limit.
[0210] In some embodiments, the Android emulator, based on a first file type and a file size limit, filters data files stored at a third storage address to obtain at least one candidate data file. The at least one candidate data file has the same file type as the first file type, and its size meets the file size limit. For example, if the first file type is PDF, then all candidate data files will be PDF. For example, if the file size limit is less than 1GB, then all candidate data files will be less than 1GB in size.
[0211] In step b, in response to the selection operation for the first data file among at least one data file, the Android emulator determines the first storage address of the first data file.
[0212] In some embodiments, in response to a path switching operation on the 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 from which the candidate data files displayed in the file selection interface originate. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0213] Step 2: The Android emulator retrieves 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 a first data file from a first storage address and adds it to a second storage space.
[0216] In some embodiments, if there are multiple first data files, and 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. If the multiple first data files correspond to different first storage addresses, the Android emulator performs the operation of copying the first data file and adding it to the second storage space for each first storage address.
[0217] Step 1040: The Android emulator sends 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.
[0218] In some embodiments, a second application also runs in the Android runtime environment.
[0219] In some embodiments, the Android emulator sends a second storage address to the second application through a first communication channel; the second application sends the second storage address to the file manager through a cross-process communication mechanism implemented in a first interface language.
[0220] In step 1050, the file manager provides the second storage address to the Android application.
[0221] In some embodiments, due to adjustments made to the file manager, in order to reduce the learning curve for users, the file manager may also provide prompts to assist users in performing file access operations.
[0222] In some embodiments, the file manager displays a first prompt message, which indicates the operation corresponding to accessing a data file stored in the first storage space. For example, the file manager displays a first user interface, which shows the first prompt message.
[0223] In some embodiments, the file manager displays a first prompt message before receiving a file access request. In some embodiments, the first prompt message is displayed only when the user triggers a file access request. The first prompt message is not displayed when the Android application triggers a file access request itself. Exemplarily, the first prompt message is displayed in response to the user's triggering action for a file access request, and a file selection interface is displayed in response to the completion of reading the first prompt message.
[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 runtime environment is a first PC-side runtime environment, and the second runtime environment is a second PC-side runtime environment, wherein the first PC-side runtime environment and the second PC-side runtime environment are different. For example, the first runtime environment is a Windows runtime environment, and the second runtime environment is a Linux runtime environment. For example, as... Figure 11 As shown, the method includes at least one of the following steps 1110 to 1150.
[0226] Step 1110: The file manager receives a file access request sent by a Linux application. The file access request is used to request access to a data file stored in the first storage space. The first storage space allows access from applications running in the Windows environment, but does not allow access from applications running in the Linux environment.
[0227] In some embodiments, the file manager intercepts file access requests sent by Linux applications. In some embodiments, the file manager obtains first information sent by the Linux 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. For example, the first information carries first indication information, indicating that the first information is used to access a data file, and is a file access request. For example, the first information does not carry first indication information, indicating that the first information is not used to access a data file, and is not a file access request.
[0228] In some embodiments, a file access request can be triggered by a Linux application or by a user interacting with the Linux application. For example, a file access request can be triggered actively by the Linux application during runtime. For example, a file access request can be triggered by a user through controls displayed in the user interface of the Linux application.
[0229] Step 1120: The file manager sends the file access request to the Linux emulator.
[0230] In some embodiments, a second application also runs in the Linux runtime environment, which manages the applications running in the Linux runtime environment.
[0231] In some embodiments, the file manager sends file access requests to a second application through a cross-process communication mechanism implemented in a first interface language, which is compatible with the Linux runtime environment; the second application sends file access requests to a Linux emulator through a first communication channel, which is used for data transmission between the second application and the Linux emulator.
[0232] In some embodiments, since the file manager runs in a Linux runtime environment and the Linux emulator runs in a Windows runtime environment, a second application is needed to forward information when the two interact.
[0233] In some embodiments, the first interface language is used to implement cross-process communication within the same runtime environment. In the following embodiments, the first communication channel is used to implement communication between applications in different runtime environments.
[0234] Step 1130: Based on the file access request, the Linux emulator adds the first data file to the second storage space. The second storage space is accessible to applications in both the Windows and Linux runtime environments. The first data file is the data file selected in the first storage space.
[0235] In some embodiments, the Linux emulator determines the 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] For example, step 1130 may include at least one of steps 1 to 3 below.
[0237] Step 1: The Linux emulator determines the first storage address of the first data file based on the file access request. The first storage address is the storage address of the first data file in the first storage space.
[0238] In some embodiments, after receiving a file access request, the Linux emulator determines the defined storage address of a first data file. In some embodiments, the first storage address is determined based on parameters carried in the file access request. Exemplarily, the parameters include at least one of the following: a first file type and a file size limit. The first file type indicates the file type of the first data file, and the file size limit indicates the required size of the first data file. The Linux emulator determines a data file with the same file type as the first file type, and then determines the first data file from among these data files based on the file size limit, thus determining the storage address of the first data file in the first storage space as the first storage address. In some embodiments, since the first storage space may store a large number of data files, the above parameters may not be able to uniquely determine the first data file in the first storage space. In this case, user operation can be introduced, allowing the user to select a suitable data file as the first data file.
[0239] In some embodiments, the first data file is selected and determined by the user in a first storage space. Exemplarily, the method includes at least one of steps a to b.
[0240] Step a: Based on the file access request, the Linux emulator displays a file selection interface, which shows at least one data file stored in the first storage space.
[0241] In some embodiments, the above-mentioned at least one data file may be all the data files in the first storage space, or it may be a portion of the data files in the first storage space; this application does not limit this.
[0242] In some embodiments, the file selection interface displays at least one data file categorized by directory. In some embodiments, the file selection interface may display the interface containing the root directory, or it may display the interface containing any subdirectory; this application does not limit this.
[0243] In some embodiments, the storage address corresponding to the file selection interface can be a default storage address. In some embodiments, the default storage address can be set by the Linux emulator, the first device, or based on the type of Linux application; this application does not limit this.
[0244] For example, the Linux emulator filters out 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. The third storage address is the default storage address corresponding to the file access request in the first storage space. The Linux emulator displays a file selection interface, which shows at least one candidate data file.
[0245] In some embodiments, the parameters include at least one of the following: a first file type and a file size limit.
[0246] In some embodiments, the Linux emulator, based on a first file type and file size limit, filters data files stored at a third storage address to obtain at least one candidate data file. The at least one candidate data file has the same file type as the first file type, and its size meets the file size limit. For example, if the first file type is PDF, then all candidate data files will be PDF. For example, if the file size limit is less than 1GB, then all candidate data files will be less than 1GB.
[0247] In step b, in response to the selection operation for the first data file among at least one data file, the Linux emulator determines the first storage address of the first data file.
[0248] In some embodiments, in response to a path switching operation on the 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 from which the candidate data files displayed in the file selection interface originate. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0249] Step 2: The Linux emulator retrieves the first data file from the first storage address.
[0250] Step 3: The Linux emulator adds the first data file to the second storage space.
[0251] In some embodiments, the Linux emulator copies a first data file from a first storage address and adds it to a second storage space.
[0252] In some embodiments, if there are multiple first data files, and these multiple first data files correspond to the same first storage address, the Linux emulator simultaneously copies the multiple first data files and adds them to the second storage space. If the multiple first data files correspond to different first storage addresses, the Linux emulator performs the operation of copying the first data file and adding it to the second storage space for each first storage address.
[0253] Step 1140: The Linux emulator sends 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.
[0254] In some embodiments, a second application also runs in the Linux runtime environment.
[0255] In some embodiments, the Linux emulator sends a second storage address to a second application through a first communication channel; the second application sends the second storage address to the file manager through a cross-process communication mechanism implemented in a first interface language.
[0256] In step 1150, the file manager provides the second storage address to the Linux application.
[0257] In some embodiments, due to adjustments made to the file manager, in order to reduce the learning curve for users, the file manager may also provide prompts to assist users in performing file access operations.
[0258] In some embodiments, the file manager displays a first prompt message, which indicates the operation corresponding to accessing a data file stored in the first storage space. For example, the file manager displays a first user interface, which shows the first prompt message.
[0259] In some embodiments, the file manager displays a first prompt message before receiving a file access request. In some embodiments, the first prompt message is displayed only when the user triggers a file access request. The first prompt message is not displayed when the Linux application triggers a file access request itself. For example, the first prompt message is displayed in response to the user's triggering of a file access request, and a file selection interface is displayed in response to the completion of reading the first prompt message.
[0260] In some embodiments, the technical solutions provided in this application can also be applied to other operating environments. For example, they can be applied to the operating environment of VR and MR devices, and this application does not limit them.
[0261] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0262] Please refer to Figure 12 This diagram illustrates a block diagram of a file access device according to an embodiment of this application. This device can be installed in a file manager. Figure 12 As shown, the device 1200 includes: an acquisition module 1210, a first transmission module 1220, a first receiving module 1230, and a providing module 1240.
[0263] The acquisition module 1210 is used to acquire 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 running environment but does not allow access by applications in a second running environment. The first running environment has an emulator running, which is used to create and manage the second running environment. The second running environment has the first application and a file manager running. The first application supports running in the second running environment but does not support running in the first running environment. The second running environment is different from the first running environment.
[0264] The first sending module 1220 is used 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. The first data file is added to the second storage space by the simulator based on the file access request.
[0266] The module 1240 is provided to provide the second storage address to the first application.
[0267] In some embodiments, a second application also runs in the second runtime environment, and the second application is used to manage applications running in the second runtime 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 in a first interface language, the first interface language being adapted to the second runtime environment. The second application is used to send the file access request to the emulator through a first communication channel, the first communication channel being used for data transmission between the second application and the emulator.
[0268] In some embodiments, the device 1200 further includes a display module (not shown).
[0269] The display module is used to display a first prompt message, which indicates the operation corresponding to accessing the data file stored in the first storage space.
[0270] The technical solution provided in this application embodiment allows the file manager to forward a file access request to the emulator after receiving it. The emulator then interacts with the first runtime environment to obtain a first data file stored in the first storage space. The emulator adds the first data file from the first storage space to a 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 enables the first application to access the first data file based on the second storage address. The user does not need to manually copy the first data file to the second storage space, simplifying the file access process and improving operational efficiency.
[0271] Please refer to Figure 13 This illustrates a block diagram of a file access device according to another embodiment of this application. This device can be installed in a simulator. Figure 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. 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage the second runtime environment. The second runtime environment runs the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment.
[0273] The addition module 1320 is used to add a first data file to a second storage space based on the file access request. The second storage space allows access from applications in the first runtime environment and applications in the second runtime environment. 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. 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 to the first application by the file manager.
[0275] In some embodiments, the adding module 1320 is configured to determine a first storage address of the first data file based on the file access request, wherein the first storage address is the 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, module 1320 is configured 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 for 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, the addition module 1320 is used to filter 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, wherein the third storage address is the default storage address corresponding to the file access request in the first storage space; and to display the file selection interface, wherein the file selection interface displays the at least one candidate data file.
[0278] In some embodiments, the addition module 1320 is further configured to, in response to a path switching operation for the file selection interface, switch the file selection interface from displaying at least one candidate data file at the third storage address to displaying at least one candidate data file at a fourth storage address, wherein the path switching operation is used to switch the storage address from which the candidate data files displayed in the file selection interface originate, and the fourth storage address is a storage address in the first storage space selected by the path switching operation.
[0279] In some embodiments, a second application also runs in the second runtime environment, and the second application is used to manage applications running in the second runtime environment. The second sending module 1330 is used to send the second storage address to the second application through a first communication channel. The first communication channel is used for data transmission between the second application and the emulator, and the second application sends the second storage address to the file manager through a cross-process communication mechanism implemented in a first interface language, which is adapted to the second runtime environment.
[0280] The technical solution provided in this application embodiment allows the file manager to forward a file access request to the emulator after receiving it. The emulator then interacts with the first runtime environment to obtain a first data file stored in the first storage space. The emulator adds the first data file from the first storage space to a 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 enables the first application to access the first data file based on the second storage address. The user does not need to manually copy the first data file to the second storage space, simplifying the file access process and improving operational efficiency.
[0281] Please refer to Figure 14 This diagram illustrates a structural block diagram of a terminal device 1400 provided in one embodiment of this application. The terminal device 1400 can be any electronic device capable of data calculation, processing, and storage. The terminal device 1400 can be used to implement the file access method provided in the above embodiments. Exemplarily, the terminal device can be implemented as the first device described above.
[0282] Typically, terminal device 1400 includes a processor 1401 and a memory 1402.
[0283] Processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational 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 high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 are used to store a computer program configured to be executed by one or more processors to implement the file access method described above.
[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 using 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 technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Those skilled in the art will understand that... Figure 14 The structure shown does not constitute a limitation on the terminal device 1400, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0286] The memory also includes a computer program stored in the memory and configured to be executed by one or more processors to implement the above-described file access method.
[0287] In an exemplary embodiment, a computer program product is also provided, the computer program including a computer program 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, causing the terminal device to perform the file access method described above.
[0288] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user data. These prompt interfaces, pop-ups, or voice prompts are used to inform users that their data is being collected. This ensures that the application only begins the steps of collecting user data after receiving confirmation from the user regarding the prompt interface or pop-up. Otherwise (i.e., without receiving confirmation from the user), the steps of collecting user data are terminated, and user data is not collected. In other words, all user data collected by this application (including the first storage space, first storage address, second storage space, second storage address, etc.) is processed strictly in accordance with the requirements of relevant national laws and regulations. The informed consent or separate consent of the personal information subject is obtained only with the user's consent and authorization. Subsequent data use and processing are conducted within the scope of laws and regulations and the authorization of the personal information subject. The collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0289] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0290] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A file access method, characterized in that, The method includes: The file manager receives 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 from applications in a first runtime environment but does not allow access from applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage the second runtime environment. The second runtime environment is different from the first runtime environment. The second runtime environment runs the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The file manager sends the file access request to the emulator; The simulator determines the first storage address of the first data file based on the file access request. The first storage address is the 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, which is accessible to applications in the first and second runtime environments. The first data file is a data file selected in the first storage space. 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; The file manager provides the second storage address to the first application.
2. The method according to claim 1, characterized in that, The simulator determines the first storage address of the first data file based on the file access request, including: Based on the file access request, the simulator displays a file selection interface, which displays at least one data file stored in the first storage space. In response to a selection operation for the first data file among the at least one data file, the simulator determines the first storage address of the first data file.
3. The method according to claim 2, characterized in that, The simulator displays a file selection interface based on the file access request, including: Based on the parameters carried in the file access request, the simulator filters out at least one candidate data file from the data files stored at the third storage address, where the third storage address is the default storage address corresponding to the file access request in the first storage space. The simulator displays the file selection interface, which shows at least one candidate data file.
4. The method according to claim 3, characterized in that, The parameters include at least one of the following: a first file type, a file size limit; Based on the parameters carried in the file access request, the simulator filters out at least one candidate data file from the data files stored at the third storage address, including: Based on the first file type and the file size limit, the simulator filters the data files stored at the third storage address to obtain at least one candidate data file. 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.
5. The method according to claim 3, characterized in that, The method further includes: 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 at the third storage address to displaying at least one candidate data file at the fourth storage address. The path switching operation is used to switch the storage address from which the candidate data files displayed in the file selection interface originate. The fourth storage address is a storage address in the first storage space selected by the path switching operation.
6. The method according to any one of claims 1 to 5, characterized in that, A second application also runs in the second runtime environment, and the second application is used to manage the applications running in the second runtime environment; The file manager sends the file access request to the emulator, including: The file manager sends the file access request to the second application through a cross-process communication mechanism implemented in a first interface language, wherein the first interface language is adapted to the second runtime environment; The second application sends the file access request to the emulator through the first communication channel, which is used for data transmission between the second application and the emulator.
7. The method according to claim 6, 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 the cross-process communication mechanism implemented in the first interface language.
8. The method according to any one of claims 1 to 5, characterized in that, Before the file manager receives the file access request sent by the first application, it also includes: The file manager displays a first prompt message, which indicates the operation corresponding to accessing the data file stored in the first storage space.
9. The method according to any one of claims 1 to 5, characterized in that, The first operating environment is a personal computer (PC) operating environment, and the second operating environment is a mobile operating environment; or, The first operating environment is a first PC operating environment, and the second operating environment is a second PC operating environment. The first PC operating environment is different from the second PC operating environment.
10. A file access method, characterized in that, The method includes: A file access request sent by a first application is obtained. 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment has an emulator running. The emulator is used to create and manage the second runtime environment. The second runtime environment has the first application and a file manager running. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment. Send the file access request to the simulator; The simulator receives 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. The first data file is added to the second storage space by the simulator based on the file access request. The file access request is used to determine the first storage address of the first data file. The first storage address is the storage address of the first data file in the first storage space. The first storage address is used to obtain the first data file. Provide the second storage address to the first application.
11. The method according to claim 10, characterized in that, A second application also runs in the second runtime environment, and the second application is used to manage the applications running in the second runtime environment; Sending the file access request to the emulator includes: The file access request is sent to the second application through a cross-process communication mechanism implemented by a first interface language, wherein the first interface language is adapted to the second runtime environment; The second application is used to send the file access request to the emulator through a first communication channel, and the first communication channel is used for data transmission between the second application and the emulator.
12. A file access method, characterized in that, The method includes: The system receives a file access request sent by a file manager. The file access request is sent by a first application to the file manager and is used to request access to a data file stored in a first storage space. The first storage space allows access from applications in a first runtime environment but does not allow access from applications in a second runtime environment. The first runtime environment contains an emulator used to create and manage a second runtime environment. The second runtime environment contains the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment. Based on the file access request, a first storage address of the first data file is determined, wherein the first storage address is the storage address of the first data file in the first storage space; Retrieve the first data file from the first storage address; The first data file is added to the second storage space, which is accessible to applications in both the first and second runtime environments. The first data file is a data file selected in the first storage space. The second storage address of the first data file is sent to the file manager. 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 to the first application by the file manager.
13. The method according to claim 12, characterized in that, A second application also runs in the second runtime environment, and the second application is used to manage the applications running in the second runtime environment; Sending the second storage address of the first data file to the file manager includes: The second storage address is sent to the second application through the first communication channel; The first communication channel is used for data transmission between the second application and the emulator. The second application sends the second storage address to the file manager through a cross-process communication mechanism implemented by a first interface language. The first interface language is adapted to the second runtime environment.
14. A file access device, characterized in that, The device includes: The acquisition module is used to acquire 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage a second runtime environment. The second runtime environment runs the first application and a file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment. The first sending module is used to send the file access request to the simulator; The first receiving module 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. The first data file is added to the second storage space by the simulator based on the file access request. The file access request is used to determine the first storage address of the first data file. The first storage address is the storage address of the first data file in the first storage space. The first storage address is used to obtain the first data file. A module is provided for providing the second storage address to the first application.
15. A file access device, characterized in that, The device includes: The second receiving module is used to receive a file access request sent by the file manager. The file access request is sent by the 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 runtime environment but does not allow access by applications in a second runtime environment. The first runtime environment runs an emulator, which is used to create and manage the second runtime environment. The second runtime environment runs the first application and the file manager. The first application supports running in the second runtime environment but does not support running in the first runtime environment. The second runtime environment is different from the first runtime environment. An add module is used to determine a first storage address of a first data file based on the file access request, wherein the first storage address is the storage address of the first data file in the first storage space; retrieve the first data file from the first storage address; and add the first data file to a second storage space, wherein the second storage space allows access from applications in the first runtime environment and applications in the second runtime environment, 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. 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 to the first application by the file manager.
16. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the file access method as described in any one of claims 1 to 9, or the file access method as described in any one of claims 10 to 11, or the file access method as described in any one of claims 12 to 13.
17. 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 9, or the file access method as described in any one of claims 10 to 11, or the file access method as described in any one of claims 12 to 13.
18. A computer program product, characterized in that, The computer program product includes a computer program that is loaded and executed by a processor to implement the file access method as described in any one of claims 1 to 9, or the file access method as described in any one of claims 10 to 11, or the file access method as described in any one of claims 12 to 13.