Data reading and writing method and device, electronic equipment and storage medium

By generating the mapping storage space of applications in the external storage space of the terminal device, the data chaos caused by multiple applications is solved, data isolation between applications and user data protection is realized, and user privacy control capabilities are improved.

CN119179430APending Publication Date: 2024-12-24BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311599750.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-27
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

In terminal devices, multiple applications obtain read and write external storage permissions and cause data confusion in external storage space, user data files are leaked, and the existing partition storage adaptation rate is low, so data isolation and user data protection cannot be effectively realized between applications. .

Method used

By generating the mapped storage space of the application in the external storage space, the file system module is used to determine the mapped storage space of data read and write instructions, and perform data read and write instructions based on the mapped storage space, data isolation and access control between applications are realized.

Benefits of technology

Effectively prevent data leakage between applications, improve users' ability to control personal security and privacy, keep external storage space neat and orderly, and realize data isolation between applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179430A_ABST
    Figure CN119179430A_ABST
Patent Text Reader

Abstract

The invention relates to a data reading and writing method and device, electronic equipment and a storage medium, and the method comprises the steps: responding to loading completion of an application program, generating a mapping storage space of the application program in a preset external storage space, and responding to a data reading and writing instruction based on the preset external storage space received in the application program, and determining a mapping storage space of the data read-write instruction through a file system FS module of a preset external storage space, and executing the data read-write instruction based on the mapping storage space. Therefore, the mapping storage space of the application is established in the external storage space to perform access control on data reading and writing of the application, data isolation between the applications is realized, and the control capability of a user on personal security privacy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data reading and writing, and in particular to a data reading and writing method, device, electronic device and storage medium. Background Art

[0002] In the related art, in the operating system of the terminal device, for applications that are not adapted to partitioned storage, after obtaining the permission to read and write terminal storage, the application can arbitrarily read and write data files in the storage space. When there are multiple applications in the terminal, and multiple applications have obtained the permission to read and write terminal storage, each application can arbitrarily read and write data files in the external storage space, causing data confusion in the external storage directory. In addition, most application APPs will create hidden files in the terminal's external storage space SD card (secure digital card, flash memory card), and the application places electronic fingerprints to track user behavior across applications, resulting in the leakage of user data files. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a data reading and writing method, device, electronic device and storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a data reading and writing method is provided, comprising:

[0005] In response to completion of loading of the application, generating a mapping storage space of the application in a preset external storage space;

[0006] In response to receiving a data read / write instruction based on the preset external storage space in the application, determining the mapped storage space of the data read / write instruction through a file system FS module of the preset external storage space;

[0007] Based on the mapped storage space, the data read and write instructions are executed.

[0008] Optionally, determining the mapped storage space of the data read and write instruction by means of a file system FS module of the preset external storage space includes:

[0009] Obtaining an application program identifier of the data read and write instruction;

[0010] The mapped storage space is determined by the FS module according to the application identifier, and the FS module includes a mapping relationship between a plurality of mapped storage spaces and a plurality of application identifiers.

[0011] Optionally, determining the mapped storage space of the data read and write instruction by means of a file system FS module of the preset external storage space includes:

[0012] The data read and write instructions are sent to the user space file system Fuse module through the virtual file system VFS module;

[0013] The Fuse module sends the data read and write instructions to the file system FS module through the VFS module;

[0014] The mapped storage space of the data read and write instructions is determined based on the FS module.

[0015] Optionally, the Fuse module includes a Fuse driver module and a Fuse daemon module, and the Fuse module sends the data read and write instruction to the file system FS module through the VFS module, including:

[0016] Sending the data read and write instructions to the Fuse daemon module through the Fuse driver module;

[0017] Based on the Fuse daemon module, the data read and write instructions are sent to the FS module through the VFS module.

[0018] Optionally, determining the mapped storage space of the data read and write instruction based on the FS module includes:

[0019] Determine the access permission information of the data read and write instruction by the FS module;

[0020] The mapped storage space is determined according to the access permission information.

[0021] Optionally, the method further comprises:

[0022] Determining, by the file system module, that the read and write storage space of the data read and write instructions is a shared storage space;

[0023] Based on the shared storage space, the data read and write instructions are executed.

[0024] Optionally, executing the data read and write instruction based on the mapped storage space includes:

[0025] Determine the read / write file type of the data read / write instruction;

[0026] Determine a target storage space matching the read-write file type from the mapped storage space;

[0027] Based on the target storage space, the data read and write instructions are executed.

[0028] According to a second aspect of an embodiment of the present disclosure, a data reading and writing device is provided, including:

[0029] A generating module, configured to generate a mapping storage space of the application in a preset external storage space in response to completion of loading of the application;

[0030] a determination module configured to, in response to receiving a data read / write instruction based on the preset external storage space in the application program, determine the mapped storage space of the data read / write instruction through a file system FS module of the preset external storage space;

[0031] The execution module is configured to execute the data read and write instructions based on the mapped storage space.

[0032] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0033] processor;

[0034] a memory for storing processor-executable instructions;

[0035] Among them, the processor is configured to execute the executable instructions to implement the steps of any data reading and writing method described in the first aspect of the present disclosure.

[0036] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data reading and writing method provided in the first aspect of the present disclosure are implemented.

[0037] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0038] In the above manner, in response to the completion of loading of the application, a mapped storage space of the application is generated in the preset external storage space, and in response to receiving a data read and write instruction based on the preset external storage space in the application, the mapped storage space of the data read and write instruction is determined through the file system FS module of the preset external storage space, and the data read and write instruction is executed based on the mapped storage space. Thus, by establishing the mapped storage space of the application in the external storage space, access control is performed on the data read and write of the application, data isolation between applications is achieved, and the user's control over personal security and privacy is improved.

[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0041] Figure 1It is a schematic diagram showing a data reading and writing method according to an exemplary embodiment.

[0042] Figure 2 The figure is a schematic diagram showing a method for managing SD card read and write permissions according to an exemplary embodiment.

[0043] Figure 3 The figure is a flow chart of a data reading and writing method according to an exemplary embodiment.

[0044] Figure 4 The figure is a flowchart of a method for determining a mapping storage space according to an exemplary embodiment.

[0045] Figure 5 It is a flowchart of a data reading and writing method according to an exemplary embodiment.

[0046] Figure 6 The figure is a block diagram of a data reading and writing device according to an exemplary embodiment.

[0047] Figure 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. DETAILED DESCRIPTION

[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0049] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0050] In the related art, the terminal operating system adopts a partitioned storage method. In the partitioned storage, the current application can only access the media files of other applications. However, the terminal's native partitioned storage requires application upgrades to adapt. Usually, the application adaptation rate is only 20%, and the adaptation rate of long-tail applications is much lower than this value. For example, Figure 1 is a schematic diagram of a data reading and writing method according to an exemplary embodiment. Figure 1As shown, the method is applied to a terminal, and multiple applications are configured in the terminal. Each application has a corresponding private storage space in the internal storage space of the terminal, for example, APP1-APP5, corresponding to the private internal storage space of the terminal: / data / data / com.app1-5. At the same time, the terminal is also provided with an SD to provide a shared external storage space to each APP. In the external storage space, different storage folders are provided based on different file types, for example: DCIM (Digital Camera Images) folder, Pictures folder, Download folder, Movies folder, etc. Among the various APPs in the terminal, the APPs holding READ_EXTERANAL_STORAGE and WRITE_EXTERNAL_STORAGE can read and write data files in the external storage space at will.

[0051] The storage system of the terminal is generally divided into internal storage and external storage for applications. Internal storage refers to the private directory of the application. The application can access its own private directory without permission, and the applications are completely isolated and cannot access each other. External storage generally refers to the terminal-based SD card, which is used to save various user files such as photos, videos, and various documents. When the user allows the application's external read permission READ_EXTERANAL_STORAGE and external write permission WRITE_EXTERNAL_STORAGE, the application has full read, write, and delete capabilities for the external storage in the SD card on the terminal. The various storage behaviors and storage methods of the APP in the terminal are based on the different read and write logic of each APP, which can easily lead to the storage space of the SD card being read and written based on different APPs, making the external storage space disordered, and many application software will also track the user's terminal application behavior by placing hidden files as electronic fingerprints.

[0052] For example, Figure 2 is a schematic diagram showing a method for managing SD card read and write permissions according to an exemplary embodiment. Figure 2As shown, when the APP in the terminal needs to read and write data files in the external storage space SD card, it needs to send a read and write permission application to the user. The user controls the APP's SD card read and write permissions based on the needs of the current APP, and sets the read and write permissions of "deny", "always allow" and "allow only when in use" for the APP. The read and write permissions can also be for specific data files in the SD card, such as: "album", "social application files", etc. Relevant data shows that about 98% of applications will apply for external storage permissions, and at the same time, 92% of users will choose to allow. Based on this, the governance of external storage space is urgent. How to solve the storage chaos on external storage, protect user data files from being leaked, and take into account the user experience has become a technical problem that needs to be solved urgently.

[0053] In view of this, this application proposes a data reading and writing method. Figure 3 is a flow chart of a data reading and writing method according to an exemplary embodiment. Figure 3 As shown, the method is used in a terminal and includes the following steps.

[0054] In step S11 , in response to the completion of loading of the application, a mapping storage space of the application is generated in a preset external storage space.

[0055] For example, this embodiment is applied to a terminal, which is configured with a preset external storage space, which is used to provide additional storage space for the terminal. Users can store photos, music, videos and other files in the SD card, thereby expanding the storage capacity of the terminal. Multiple applications can be loaded in the terminal. When the terminal downloads an application from an application store and completes the loading of the application, a mapping storage space of the application is generated in the preset external storage space based on the identity ID information of the application. After the application obtains the read and write permission of the preset external storage space from the terminal, the data read and write operation of the application is performed in the mapped storage space based on the read and write instructions of the application to the preset external storage space.

[0056] For example, in some embodiments, after the loading of the application is completed in the terminal, a folder corresponding to the identity ID information can be established in the preset external storage space based on the identity ID information of the application, and a corresponding relationship between the folder and the external file storage path of the application can be established, thereby realizing the directional mounting between the application and the folder. It is understandable that multiple APPs can be loaded in the terminal, and each APP's access to the external storage is directional mounted to the corresponding mapped storage space of the preset external storage space, so that all APP's access to the external storage space will be in the folder directory corresponding to the preset external storage space, and the mapped storage space corresponding to each APP will be determined from the folder directory, thereby achieving the purpose of application storage isolation.

[0057] In step S12, in response to receiving a data read / write instruction based on a preset external storage space in an application, a mapping storage space of the data read / write instruction is determined by a file system FS module of the preset external storage space.

[0058] For example, the data storage and modification of the application in the terminal includes reading, modifying and deleting data files in the private internal storage space of the application in the terminal, and also includes the application reading, modifying and deleting data files stored in the preset external storage space. After determining that the application currently operated by the terminal has the editing permission for the preset external storage space, during the use of the application, the data read and write instructions of the application based on the preset external storage space are monitored. When the data read and write instruction is detected, the mapped storage space of the application corresponding to the data read and write instruction in the preset external storage space is determined through the file system FS module of the preset external storage space. Among them, the mapping relationship between different applications and different mapped storage spaces is loaded in the file system FS module, and the FS module can determine the mapped storage space for executing the data read and write instruction by identifying the identity ID information of the application corresponding to the data read and write instruction.

[0059] Optionally, in some implementations, the above step S12 includes:

[0060] Get the application ID of the data read and write instructions;

[0061] According to the application identifier, the mapping storage space is determined through the FS module, and the FS module includes a mapping relationship between a plurality of mapping storage spaces and a plurality of application identifiers.

[0062] For example, in this embodiment, the data read and write instructions of the application include application identification information, which is used to indicate which application the data read and write instructions come from. The application identification is identified by the FS module, and the mapping relationship between multiple mapping storage spaces and multiple application identifications in the FS module is compared to determine the mapping storage space corresponding to the current application identification.

[0063] For example, in some embodiments, the FS module can also determine the application corresponding to the data read and write instruction based on the transmission path of the data read and write instruction, and determine the mapped storage space for executing the data read and write instruction based on the correspondence between the application in the FS module and the mapped storage space in the preset external storage space.

[0064] In step S13, data read and write instructions are executed based on the mapped storage space.

[0065] For example, in this embodiment, the mapped storage space of the application in the preset external storage space is determined, and the data read and write instructions are executed based on the mapped storage space. The mapped storage space may include data files previously stored and written by the application, and the data files may be read or deleted based on the data read and write instructions; at the same time, data files may also be written to the mapped storage space based on the data read and write instructions.

[0066] Optionally, in some embodiments, the method further comprises:

[0067] Determine, through the file system FS module, that the read and write storage space of the data read and write instructions is a shared storage space;

[0068] Execute data read and write instructions based on shared storage space.

[0069] For example, in this embodiment, the preset external storage space also has a shared storage space corresponding to each application, but in order to avoid leakage of user data, the data file format stored in the shared storage space will be limited. For example, image data files, video data files, and audio data files of the terminal can be stored based on the shared storage space. Through the file system FS module configured in the terminal, it is determined whether the data read and write instructions sent by the current application are based on the mapped storage space or the shared storage space. When it is determined that the data read and write instructions sent by the current application are data read and write based on the shared storage space, the data read and write instructions of the application are executed in the shared storage space.

[0070] Optionally, in some implementations, the above step S13 includes:

[0071] Determine the read and write file type of the data read and write instructions;

[0072] Determine a target storage space matching the read / write file type from the mapped storage space;

[0073] Execute data read and write instructions based on the target storage space.

[0074] For example, in this embodiment, multiple data folders are created in the mapped storage space for storing different types of data files corresponding to the application. For example, the mapped storage space may include: DCIM (Digital Camera Images) folder, Pictures folder, Download folder, Movies folder, etc. When executing the data read and write instruction in the mapped storage space, the read and write file type of the data read and write instruction is determined, and the target storage space matching the read and write file type is determined from the multiple folders in the mapped storage space. In the target storage space, the data read and write instruction is executed. Thus, data read and write operations are performed based on different types of data files in the mapped data space, and the data files in the mapped data space are isolated from each other, which is more convenient for the classification management of each data file in the preset external storage space.

[0075] In the above manner, in response to the completion of loading of the application, a mapped storage space of the application is generated in the preset external storage space. In response to receiving a data read and write instruction based on the preset external storage space in the application, the mapped storage space of the data read and write instruction is determined through the file system FS module of the preset external storage space, and the data read and write instruction is executed based on the mapped storage space. Thus, by establishing the mapped storage space of the application in the external storage space, access control is performed on the data read and write of the application, data isolation between applications is achieved, and the user's control over personal security and privacy is improved. By isolating the storage access of the application in the mapped storage space, the application's access to the external storage can be fully controlled. In this way, the user's control over personal security and privacy is improved, and applications are effectively prevented from tracking the user's behavior through shared files, while preventing the files in the external storage space on the device from being cluttered and becoming more neat and orderly.

[0076] Figure 4 is a flowchart of a method for determining a mapping storage space according to an exemplary embodiment, which is executed by a terminal. Figure 4 As shown, the above step S12 includes the following steps.

[0077] In step S121, the data read and write instructions are sent to the user space file system Fuse module through the virtual file system VFS module.

[0078] For example, the terminal of this embodiment is loaded with a VFS (Virtual File System) module and a Fuse (Filesystem in Userspace) module. The VFS module is a component used to manage files in the operating system of the terminal. It can abstract different physical file systems (such as FAT32, NTFS, etc.) into a unified file management interface, so that users can easily access and manage different types of files. The VFS module can hide the details of the file system and provide a simple and consistent file operation interface to users and applications. The application can implement data read and write operations based on the VFS module. The Fuse module is a file system service tool running in user space, allowing users to create and manage file systems with ordinary user permissions rather than super user permissions. The Fuse module can be used to write the file system and mount it in the operating system without modifying the kernel, which enables the terminal to develop and maintain the file system more flexibly. The application sends the data read and write instructions to the Fuse module through the VFS module, thereby avoiding the incompatibility of the application program, resulting in the inability to execute the data read and write instructions.

[0079] In step S122, the Fuse module sends the data read and write instructions to the file system FS module through the VFS module.

[0080] In step S123, a mapping storage space for the data read and write instructions is determined based on the FS module.

[0081] For example, in this embodiment, after the Fuse module receives the data read and write instructions of the application, it also sends the data read and write instructions to the file system FS module through the VFS module, and the data read and write instructions are identified by the FS module to determine the mapping storage space of the data read and write instructions.

[0082] Optionally, in some implementations, the Fuse module includes a Fuse driver module and a Fuse daemon module, and the Fuse module sends the data read and write instructions to the file system FS module through the VFS module, including:

[0083] Send data read and write instructions to the Fuse daemon module through the Fuse driver module;

[0084] Based on the Fuse daemon module, the data read and write instructions are sent to the FS module through the VFS module.

[0085] For example, in this embodiment, the Fuse module includes a Fuse driver module and a Fuse daemon module. The Fuse driver module receives the data read and write instructions sent by the VFS module, and then the Fuse driver module sends the data read and write instructions to the Fuse daemon module, and the Fuse daemon module sends the data read and write instructions to the FS module through the VFS module. Among them, the Fuse driver module is used to create and manage the file system in the user space. Traditional file systems usually need to run in the kernel space, and privileged access is required to manage and operate. Fuse allows the terminal to develop and run file systems in the user space without modifying the kernel, and drives the Fuse daemon module to manage and operate the file system through the Fuse driver module. The Fuse daemon module acts as an intermediary, responsible for communicating with the kernel and forwarding the file system request of the user space to the actual file system. It allows the user space program and the file system code to run in the user space, and can also communicate with the kernel, so that the user can simulate his own file system without having to deeply understand kernel programming. The Fuse daemon allows other programs to access file system operations through standard file I / O interfaces, such as reading, writing, creating, deleting files, etc. This will enable userspace programs to create and manage filesystems without system administrator privileges.

[0086] For example, Figure 5 is a flowchart of a data reading and writing method according to an exemplary embodiment. Figure 5As shown, the method is applied in a terminal, which is configured with a VFS module, a Fuse driver module, a Fuse daemon module, a file system FS module and an SD card. The SD card is configured with multiple isolation spaces, and each isolation space includes a shared directory and an isolation directory, which are respectively used to store shared data files and isolated data files in each application. After the terminal configures the data read and write permissions of the SD card for the application, the application sends a data read and write instruction based on the SD card, and sends the data read and write instruction to the Fuse driver module through the VFS module. The Fuse driver module drives the Fuse daemon module based on the data read and write instruction, and the Fuse daemon module sends the data read and write instruction to the FS module through the VFS module. The FS module is used to manage and record the corresponding relationship between the application and the isolated mapped storage space in the SD card, determine the isolated storage space of the application in the SD card based on the corresponding relationship, and execute the data read and write instruction of the application in the isolated storage space. Among them, when executing the data read and write instruction, it is determined whether the data read and write instruction is for the shared storage directory or the isolated storage directory of the isolation space terminal. When it is determined that the data read and write instruction is for the data reading and writing of the shared storage directory, the data read and write instruction is executed in the shared storage directory; when it is determined that the data read and write instruction is for the isolated storage directory, the data read and write instruction is executed in the isolated storage directory.

[0087] Optionally, in some implementations, the above step S123 includes:

[0088] Determine the access permission information of data read and write instructions through the FS module;

[0089] The mapped storage space is determined according to the access permission information.

[0090] For example, in this embodiment, the FS module is used to manage the access rights of the application to the mapped storage space in the SD card. After the FS module determines the access rights information of the data read and write instructions, the mapped storage space of the data read and write instructions in the SD card is determined according to the access rights information, and the data read and write instructions are executed in the mapped storage space.

[0091] Through the above method, by managing the access rights of each application in the external storage space, the applications cannot access each other, thereby achieving the purpose of application isolation, avoiding the problem of disordered data storage in the external storage space, and effectively protecting the user's data security.

[0092] Figure 6 is a block diagram of a data reading and writing device according to an exemplary embodiment. Figure 6 As shown, the device is applied to a terminal, and the device 100 includes: a generating module 110 , a determining module 120 and an executing module 130 .

[0093] The generating module 110 is configured to generate a mapping storage space of the application in a preset external storage space in response to completion of loading of the application;

[0094] The determination module 120 is configured to determine the mapping storage space of the data read / write instruction through the file system FS module of the preset external storage space in response to receiving a data read / write instruction based on the preset external storage space in the application program;

[0095] The execution module 130 is configured to execute data read and write instructions based on the mapped storage space.

[0096] Optionally, the determination module 120 is configured to:

[0097] Get the application ID of the data read and write instructions;

[0098] According to the application identifier, the mapping storage space is determined through the FS module, and the FS module includes a mapping relationship between a plurality of mapping storage spaces and a plurality of application identifiers.

[0099] Optionally, the determination module 120 includes:

[0100] A first sending submodule is configured to send the data read and write instructions to the user space file system Fuse module through the virtual file system VFS module;

[0101] The second sending submodule is configured as a Fuse module that sends the data read and write instructions to the file system FS module through the VFS module;

[0102] The determination submodule is configured to determine a mapping storage space of a data read and write instruction based on the FS module.

[0103] Optionally, the second sending submodule is configured as follows:

[0104] Send data read and write instructions to the Fuse daemon module through the Fuse driver module;

[0105] Based on the Fuse daemon module, the data read and write instructions are sent to the FS module through the VFS module.

[0106] Optionally, a submodule is determined, configured as:

[0107] Determine the access permission information of data read and write instructions through the FS module;

[0108] The mapped storage space is determined according to the access permission information.

[0109] Optionally, the apparatus 100 further includes a processing module, and the processing module is configured to:

[0110] Determine, through the file system FS module, that the read and write storage space of the data read and write instructions is a shared storage space;

[0111] Execute data read and write instructions based on shared storage space.

[0112] Optionally, the execution module 130 is configured to:

[0113] Determine the read and write file type of the data read and write instructions;

[0114] Determine a target storage space matching the read / write file type from the mapped storage space;

[0115] Execute data read and write instructions based on the target storage space.

[0116] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0117] The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data reading and writing method provided by the present disclosure are implemented.

[0118] Figure 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0119] Reference Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 707 , an audio component 710 , an input / output interface 712 , a sensor component 714 , and a communication component 716 .

[0120] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned data reading and writing method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 707 and the processing component 702.

[0121] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0122] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0123] The multimedia component 707 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 707 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0124] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0125] The input / output interface 712 provides an interface between the processing component 702 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0126] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0127] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0128] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned data reading and writing methods.

[0129] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to complete the above data reading and writing method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0130] In addition to being an independent electronic device, the above-mentioned device can also be a part of an independent electronic device. For example, in one embodiment, the device can be an integrated circuit (IC) or a chip, wherein the integrated circuit can be an IC or a collection of multiple ICs; the chip can include but is not limited to the following types: GPU (Graphics Processing Unit), CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), SOC (System on Chip, SoC, system on chip or system-level chip), etc. The above-mentioned integrated circuit or chip can be used to execute executable instructions (or codes) to implement the above-mentioned data reading and writing method. The executable instructions can be stored in the integrated circuit or chip, or can be obtained from other devices or equipment, such as the integrated circuit or chip includes a processor, a memory, and an interface for communicating with other devices. The executable instruction can be stored in the memory, and when the executable instruction is executed by the processor, the above-mentioned data reading and writing method is implemented; alternatively, the integrated circuit or chip can receive the executable instruction through the interface and transmit it to the processor for execution, so as to implement the above-mentioned data reading and writing method.

[0131] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device. The computer program has a code portion for executing the above data reading and writing method when executed by the programmable device.

[0132] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0133] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data reading and writing method, characterized in that: include: In response to completion of loading of the application, generating a mapping storage space of the application in a preset external storage space; In response to receiving a data read / write instruction based on the preset external storage space in the application, determining the mapped storage space of the data read / write instruction through a file system FS module of the preset external storage space; Based on the mapped storage space, the data read and write instructions are executed.

2. The method according to claim 1, characterized in that The determining the mapped storage space of the data read and write instruction through the file system FS module of the preset external storage space includes: Obtaining an application program identifier of the data read and write instruction; The mapped storage space is determined by the FS module according to the application identifier, and the FS module includes a mapping relationship between a plurality of mapped storage spaces and a plurality of application identifiers.

3. The method according to claim 1, characterized in that The determining the mapped storage space of the data read and write instruction through the file system FS module of the preset external storage space includes: The data read and write instructions are sent to the user space file system Fuse module through the virtual file system VFS module; The Fuse module sends the data read and write instructions to the file system FS module through the VFS module; The mapped storage space of the data read and write instructions is determined based on the FS module.

4. The method according to claim 3, characterized in that The Fuse module includes a Fuse driver module and a Fuse daemon module. The Fuse module sends the data read and write instructions to the file system FS module through the VFS module, including: Sending the data read and write instructions to the Fuse daemon module through the Fuse driver module; Based on the Fuse daemon module, the data read and write instructions are sent to the FS module through the VFS module.

5. The method according to claim 3, characterized in that: The determining the mapped storage space of the data read and write instruction based on the FS module includes: Determine the access permission information of the data read and write instruction by the FS module; The mapped storage space is determined according to the access permission information.

6. The method according to claim 1, characterized in that The method further comprises: Determining, by the file system FS module, that the read and write storage space of the data read and write instruction is a shared storage space; Based on the shared storage space, the data read and write instructions are executed.

7. The method according to any one of claims 1 to 6, characterized in that The executing the data read and write instruction based on the mapped storage space includes: Determine the read / write file type of the data read / write instruction; Determine a target storage space matching the read-write file type from the mapped storage space; Based on the target storage space, the data read and write instructions are executed.

8. A data reading and writing device, characterized in that: The device comprises: A generating module, configured to generate a mapping storage space of the application in a preset external storage space in response to completion of loading of the application; a determination module configured to, in response to receiving a data read / write instruction based on the preset external storage space in the application program, determine the mapped storage space of the data read / write instruction through a file system FS module of the preset external storage space; The execution module is configured to execute the data read and write instructions based on the mapped storage space.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the steps of the data reading and writing method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the data reading and writing method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • File read-write permission control method and device, terminal and storage medium

    CN109977040A

  • Application data isolation method and device in internal and external storage, terminal and storage medium

    CN110457925A

  • Data access device and method, readable medium and electronic equipment

    CN114637703A

  • Storage data access method and device, electronic equipment and storage medium

    CN115687714A

  • Data processing method and device, terminal equipment and medium

    CN116305227A