File sharing method and electronic device
By integrating a dual-system virtual device agent into the terminal device, the problem of file isolation between operating systems is solved, file sharing is realized, and user experience and device functionality consistency are improved.
Patent Information
- Application Number
- PCT/CN2025/098856
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-06
- Filing Date
- 2025-06-03
- Publication Date
- 2025-12-11
AI Technical Summary
In terminal devices with multiple operating systems, file sharing cannot be achieved between the different operating systems due to file system isolation, resulting in a decline in user experience.
By integrating a dual-system virtual device agent into the terminal device, monitoring directory unlock broadcasts and performing mount mapping, file sharing between different operating systems can be achieved.
It improves the user experience, enabling files to be accessed between different operating systems, facilitating file editing and display, and enhancing device functionality consistency and user interactivity.
Smart Images

Figure CN2025098856_11122025_PF_FP_ABST
Abstract
Description
Method for sharing file and electronic device
[0001] The present application claims priority to the Chinese patent application No. 202410733723.6, filed on June 6, 2024, and entitled "Method for sharing file and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the field of terminals, and in particular, to a method for sharing file and an electronic device. BACKGROUND
[0003] For some terminals carrying multiple operating systems, there is an ecological isolation between the multiple operating systems, and the files cannot be accessed by each other. Taking a terminal carrying a Hongmeng system and an Android system as an example, some applications run on the Android side, such as WeChat and Meitu Xiu Xiu, and some applications run on the Hongmeng side, such as Gallery and Camera. Due to file system isolation, the files (such as pictures, videos, etc.) generated by WeChat on the Android side cannot be displayed on the Gallery on the Hongmeng side, or the photos taken by the Camera on the Hongmeng side can only be displayed on the Gallery on the Hongmeng side, and cannot be displayed on the Meitu Xiu Xiu and other applications on the Android side, which will affect the user experience.
[0004] Therefore, it is urgent to provide a method to realize file sharing between multiple operating systems. SUMMARY
[0005] The present application provides a method for sharing file and an electronic device, which is beneficial to realize file sharing between multiple operating systems.
[0006] In a first aspect, a method for sharing file is provided, which can be executed by an electronic device, a component (such as a processor, a chip, or a chip system, etc.) configured in the electronic device, or a logic module or software capable of realizing all or part of the functions of the electronic device, and the present application does not make any limitation in this regard.
[0007] The method comprises: in response to a user's operation of opening a picture display interface of a first application, displaying the picture display interface of the first application, the first application being an application in a first operating system, the picture display interface of the first application displaying a first picture, the first picture being stored in a path of a first node directory of the first operating system. In response to a user's operation of opening a picture display interface of a second application, the first picture is obtained by accessing a second node directory, and the first picture is displayed in the picture display interface of the second application. The second application is an application in a second operating system, the first node directory is mounted on the second node directory, and the second node directory is used for the second operating system to access the files of the first operating system.
[0008] In the present application, the electronic device mounts the first node directory on the second node directory, so that the electronic device can access the files under the path of the first node directory through the second node directory, so as to achieve the purpose of sharing files by the first operating system and the second operating system, which is beneficial to improve the user experience.
[0009] With reference to the first aspect, in some implementations of the first aspect, the method further includes: in response to an editing operation of the first picture in the second application by the user, generating a second picture; in response to a storage operation of the second picture by the user, storing the second picture; and in response to an operation of the user opening the picture display interface of the first application, displaying the picture display interface of the first application, and the picture display interface of the first application further displays the second picture.
[0010] In the present application, the user can edit the first picture in the second application of the electronic device, which is beneficial to improve the user experience.
[0011] With reference to the first aspect, in some implementations of the first aspect, the electronic device includes a first virtual device agent and a second virtual device agent. Before the first picture is obtained by accessing the second node directory, the method further includes: monitoring, by the first virtual device agent, a lock broadcast of the first operating system; and after the first virtual device agent monitors the lock broadcast of the first operating system, creating the second node directory; and mounting the first node directory on the second node directory.
[0012] With reference to the first aspect, in some implementations of the first aspect, the type of the second node directory includes one or more of the following: picture, audio, video, document, or download.
[0013] With reference to the first aspect, in some implementations of the first aspect, before the lock broadcast of the first operating system is monitored by the first virtual device agent, the method further includes: in response to an operation of the user initially starting the electronic device, detecting whether the electronic device supports dual systems; in the case that the electronic device supports dual systems, starting the first operating system and the second operating system; and associating the first operating system and the second operating system.
[0014] With reference to the first aspect, in some implementations of the first aspect, the first operating system and the second operating system are associated, including: associating a user identifier (UID) of the first operating system and a UID of the second operating system; and transferring a mount node, a mount mode, and a device node between the first operating system and the second operating system.
[0015] With reference to the first aspect, in some implementations of the first aspect, the method further includes: fixing a user group of the second operating system; and registering the user group at the first operating system.
[0016] For example, the second operating system is Android, and the first operating system is Harmony. In order to avoid randomness caused by changes in the user group of the Android side, the user group of the Android side can be fixed by remapping, and the user group is registered at the Harmony side. In this way, users belonging to the same user group have the same access rights, and Android can access the public files on the Harmony side, and Harmony can also access the public files on the Android side.
[0017] The second aspect provides an electronic device, which includes one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and are configured to store computer program codes including computer instructions. When the one or more processors execute the computer instructions, the electronic device is caused to perform the method in any possible implementation of the first aspect.
[0018] The third aspect provides a computer program product, which includes a computer program (also referred to as code or instructions). When the computer program is executed, the computer program causes a computer to perform the method in any possible implementation of the first aspect.
[0019] The fourth aspect provides a computer-readable storage medium, which stores a computer program (also referred to as code or instructions). When the computer program is executed on a computer, the computer program causes the computer to perform the method in any possible implementation of the first aspect.
[0020] The fifth aspect provides a chip system, which includes at least one processor configured to support functions involved in any possible implementation of the first aspect, such as receiving or processing data involved in the method.
[0021] In a possible design, the chip system further includes a memory configured to store program instructions and data. The memory is located in the processor or outside the processor.
[0022] Optionally, the chip system can be composed of a chip, or can include a chip and other discrete devices. BRIEF DESCRIPTION OF DRAWINGS
[0023] FIG. 1 is a schematic diagram of cross-system file sharing through end-cloud collaboration;
[0024] FIG. 2 is a schematic diagram of cross-system file sharing through a third-party application;
[0025] FIG. 3 is a schematic diagram of cross-system file sharing through a virtual IP access;
[0026] FIG. 4 is a schematic diagram of the structure of an electronic device to which embodiments of the present application are applied;
[0027] FIG. 5 is a schematic flowchart of a method of sharing files according to an embodiment of the present application;
[0028] FIG. 6 is a schematic diagram of a scenario in which Android accesses Harmony according to an embodiment of the present application;
[0029] FIG. 7 is a schematic diagram of a scenario in which Harmony accesses Android according to an embodiment of the present application;
[0030] FIG. 8 is a schematic diagram of a system architecture for sharing files between two systems according to an embodiment of the present application;
[0031] FIG. 9 is a schematic diagram of a software architecture of an electronic device according to an embodiment of the present application;
[0032] FIG. 10 is a schematic diagram of a boot-up process of an electronic device according to an embodiment of the present application;
[0033] FIG. 11 is a schematic diagram of a mounting process of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the present application will be described below with reference to the accompanying drawings.
[0035] Before introducing the method of sharing files and the electronic device according to embodiments of the present application, the following points will be explained.
[0036] First, in the embodiments shown below, each term and English abbreviation, such as mounting mapping, is an example for facilitating description and should not be considered as limiting the present application. The present application does not exclude the possibility of defining other terms capable of achieving the same or similar functions in existing or future protocols.
[0037] Second, in the embodiments shown below, the first, second, and various numbers are only used for distinguishing and should not be considered as limiting the scope of the embodiments of the present application.
[0038] Third, "at least one" means one or more, "multiple" means two or more. "And / or" describes the association between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, and c can mean a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0039] In other words, sending and receiving can be between devices, such as between a terminal and a base station, or within a device, such as between components, modules, chips, software modules or hardware modules within a device through a bus, wire or interface.
[0040] The related technologies and concepts involved in the present application are introduced below.
[0041] Currently, there are electronic devices with different operating systems on the market, for example, electronic device A with operating system 1, electronic device B with operating system 2, and cross-system file sharing of electronic devices generally includes the following three ways:
[0042] The first way is to realize cross-system file sharing through end-cloud collaboration, as shown in FIG. 1, electronic device A backs up the files of operating system 1 to the cloud, and electronic device B downloads the files of operating system 1 from the cloud. Alternatively, electronic device B backs up the files of operating system 2 to the cloud, and electronic device A downloads the files of operating system 2 from the cloud. However, this method has high power consumption when synchronizing data, and takes a long time to upload and download each time, and cannot achieve dynamic updating.
[0043] The second way is to realize cross-system file sharing through a third-party application, as shown in FIG. 2, the third-party application is, for example, Baidu cloud, backup coffee, etc. For example, electronic device A and electronic device B share the account of Baidu cloud or the account of backup coffee, electronic device A backs up the files of operating system 1 to Baidu cloud or backup coffee, and electronic device B logs in the account of Baidu cloud or the account of backup coffee to download the files of operating system 1 from Baidu cloud or backup coffee. However, this method has poor privacy security of the third-party application, which can easily lead to leakage of private information, in addition, most third-party applications have slow download speed, and need to open a membership to speed up, which increases unnecessary expenses for users, and this method cannot achieve dynamic updating.
[0044] The third mode is to realize cross-system file sharing through virtual internet protocol (IP) access, as shown in FIG. 3. Generally, a virtual IP is used on a docker container to realize file sharing between the container and the outside of the container through socker communication. However, this mode cannot realize dynamic updating, and the speed is slow when transmitting large files, which is easy to cause lag.
[0045] There are also some electronic devices on the market that are equipped with multiple operating systems. For example, in the transition version of the operating system completely Hongmeng, the Android system runs on the Hongmeng system at the same time, that is, the electronic device is installed with the Hongmeng operating system and the Android operating system. However, the third-party application does not timely put on the version that can run on the Hongmeng operating system, only the version that can run on the Android operating system, therefore, the Hongmeng operating system needs to be compatible with the application running in the Android system.
[0046] Taking the electronic device equipped with the Hongmeng operating system and the Android operating system as an example, the electronic device is installed with multiple applications, some of which run on the Android side, such as WeChat and Meitu, and some of which run on the Hongmeng side, such as Gallery and Camera. However, due to file system isolation, the two operating systems cannot share files, for example, the files (such as pictures, videos, etc.) generated by WeChat on the Android side cannot be displayed on Gallery on the Hongmeng side, or the photos taken by the camera on the Hongmeng side can only be displayed on Gallery on the Hongmeng side, and cannot be displayed on the Meitu and other applications on the Android side, which will affect the user's experience.
[0047] Therefore, the present application provides a method for sharing files and an electronic device, which integrates dual systems, and devices virtual device agents on the dual system sides, which are used for broadcast monitoring and broadcast delivery. At the same time, by monitoring the directory unlocking broadcast to pull up the mounting mapping, the ecological isolation of the dual systems is broken through, so as to realize the sharing of the public files on the dual system sides.
[0048] The dual systems in the present application include a first operating system and a second operating system, and the underlying architectures of the first operating system and the second operating system are different, so that even if all data of the electronic device exists on a disk, the data of the other party cannot be accessed due to the isolation of the file operating system.
[0049] The first operating system and the second operating system in the present application are any one of the following operating systems: Hongmeng operating system, Android operating system or windows operating system.
[0050] The method for sharing a file provided in the present application can be applied to an electronic device such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), and the like. The specific type and form of the electronic device is not limited in the embodiments of the present application.
[0051] FIG. 4 is a structural schematic diagram of an electronic device to which an embodiment of the present application is applied. As shown in FIG. 4, the electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.
[0052] It can be understood that the structure shown in the embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than those shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0053] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a display processing unit (DPU), a neural-network processing unit (NPU), and / or the like. Different processing units can be independent devices or integrated in one or more processors. In some embodiments, the electronic device 100 can also include one or more processors 110. Among them, the processor can be the nerve center and command center of the electronic device 100. The processor can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions. The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the electronic device 100.
[0054] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc. The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset.
[0055] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is illustrative and does not limit the structure of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0056] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc. The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0057] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier, etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transfer the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify signals modulated by the modem processor, and radiate the signals as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.
[0058] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrated with at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, perform frequency modulation and amplification on the signals, and radiate the signals as electromagnetic waves through the antenna 2.
[0059] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The above-mentioned GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Bei Dou satellite navigation system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).
[0060] The electronic device 100 can implement a display function through a GPU, a display screen 194, and an application processor, etc. The application processor can include an NPU and / or a DPU. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute instructions to generate or change display information. The NPU is a neural-network (NN) computing processor that quickly processes input information by drawing on the structure of a biological neural network, such as the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, intelligent cognition applications of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc. The DPU is also called a display sub-system (DSS). The DPU is used to adjust the color of the display screen 194. The DPU can adjust the color of the display screen through a color 3D look up table (3D LUT). The DPU can also perform scaling, noise reduction, contrast enhancement, backlight brightness management, hdr processing, display parameter Gamma adjustment, etc. on the picture.
[0061] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, or a quantum dot light emitting diodes (QLED). In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.
[0062] The electronic device 100 can implement a photographing function through an ISP, one or more cameras 193, a video codec, a GPU, one or more display screens 194, and an application processor, and the like.
[0063] The external memory interface 120 can be configured to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, music, photo, video, and the like data files are saved in the external memory card.
[0064] The internal memory 121 can be configured to store one or more computer programs including instructions. The processor 110 can cause the electronic device 100 to perform various functional applications and data processing by running the above-mentioned instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, and can also store one or more application programs (such as a gallery, contacts, and the like). The data storage area can store data created during use of the electronic device 100 (such as photos, contacts, and the like). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. In some embodiments, the processor 110 can cause the electronic device 100 to perform various functional applications and data processing by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory disposed in the processor 110.
[0065] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music play, recording, etc.
[0066] The sensor 180 can include a pressure sensor 180A, a gyro sensor 180B, a barometric sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0067] The electronic device in the embodiments of the present application can also be referred to as a terminal, a terminal device, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device can be a mobile phone, a personal computer (PC), a smart television, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0068] As an example but not limitation, in the embodiments of the present application, the electronic device can also be a wearable device. The wearable device can also be referred to as a wearable smart device, which is a general term for devices that are designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes. The wearable device is a portable device that can be directly worn on the body or integrated into the user's clothes or accessories. The wearable device is not only a hardware device, but also a powerful function achieved through software support and data interaction, cloud interaction. The general wearable smart device includes a full function, large size, and can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, and focuses on a certain application function, and needs to cooperate with other devices such as a smart phone, such as various smart wristbands, smart jewelry, and the like.
[0069] In addition, the electronic device can also be an electronic device in an Internet of Things (IoT) system. The IoT is an important part of the future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection. The specific form of the electronic device is not limited in the present application.
[0070] It should be understood that in the embodiments of the present application, the electronic device can be a device for realizing the function of the electronic device, or a device capable of supporting the electronic device to realize the function, such as a chip system, which can be installed in the electronic device. In the embodiments of the present application, the chip system can be composed of a chip, or can include a chip and other discrete devices.
[0071] The electronic device in the embodiments of the present application can have an architecture as shown in FIG. 4, but is not limited thereto.
[0072] FIG. 5 is a schematic flowchart of a method 500 for sharing a file according to an embodiment of the present application. The steps of the method 500 can be performed by an electronic device, which can have a structure as shown in FIG. 4, but the present application is not limited thereto.
[0073] The electronic device of the present application is installed with a first operating system and a second operating system, and the first operating system and the second operating system are two different operating systems, and the underlying architectures of the two operating systems are different.
[0074] The method 500 includes S501 to S502, and the specific steps are as follows:
[0075] S501, in response to the operation of the user opening the picture display interface of the first application, display the picture display interface of the first application, the first application is an application in the first operating system, the picture display interface of the first application displays a first picture, and the first picture is stored in the path of the first node directory of the first operating system.
[0076] In this step, the first application is an application in the first operating system, and the first picture taken in the first operating system can be displayed in the first application of the first operating system.
[0077] Example one: the first operating system is HarmonyOS, the first application is Gallery, and the user can use the camera on the HarmonyOS side to take the first picture, that is, the Gallery on the HarmonyOS side displays the first picture taken by the camera on the HarmonyOS side.
[0078] Example two: the first operating system is Android, the first application is a third-party Android application (such as Meitu, Xiaohongshu, etc.) with a shooting function and the ability to edit pictures, and the user can take the first picture in the third-party Android application, that is, the third-party Android application displays the first picture taken by the third-party Android application.
[0079] S502, in response to the operation of the user opening the picture display interface of the second application, access the second node directory to obtain the first picture, and display the first picture in the picture display interface of the second application. Wherein, the second application is an application in the second operating system, the first node directory is mounted on the second node directory, and the second node directory is used for the second operating system to access the file of the first operating system.
[0080] After the first operating system and the second operating system can access each other, the electronic device can display the first picture in the picture display interface of the second application, that is, the second application in the second operating system can access the file of the first application in the first operating system.
[0081] Based on example one in S501, the second operating system is, for example, Android, and the second application is, for example, Meitu, Xiaohongshu, etc.
[0082] Based on example two in S501, the second operating system is, for example, HarmonyOS, and the second application is, for example, Gallery.
[0083] In the embodiments of the present application, the electronic device mounts the first node directory on the second node directory, so that the electronic device can access the file in the path of the first node directory through the second node directory, so as to achieve the purpose of sharing the file between the first operating system and the second operating system, which is beneficial to improve the user experience.
[0084] FIG. 6 is a schematic diagram of a scenario of Android accessing Harmony provided by an embodiment of the present application. In an example scenario, a user can take a picture A by using a camera on the Harmony side of the electronic device, as shown in a of FIG. 6, and the electronic device can display the picture A on a photo display interface of a gallery on the Harmony side. Before the file systems of Harmony and Android can be shared, as shown in b of FIG. 6, a picture display interface of a third-party Android application A (for example, an application that can edit pictures such as Meitu, Xiaohongshu, etc.) does not display the picture A, that is, the third-party Android application A cannot access the picture in the gallery on the Harmony side. After the file systems of Harmony and Android can be shared, as shown in c of FIG. 6, the picture display interface of the third-party Android application displays the picture A, that is, the third-party Android application can access the picture in the gallery on the Harmony side, or in other words, the picture A taken by the camera on the Harmony side can be scanned by the third-party Android application.
[0085] Further, the user can perform editing operations on the picture A in the third-party Android application A, for example, cropping the size of the picture A, adding filters to the picture A, etc. It should be noted that the electronic device cannot directly save the picture after the editing operation on the picture A, that is, the edited picture cannot overwrite the original picture, and the electronic device can save the edited picture A as a picture B, and then the picture display interface of the gallery on the Harmony side can also display the picture B.
[0086] Further, the user can delete the picture A in the gallery on the Harmony side, but cannot delete the picture A in the third-party Android application A,
[0087] In another example, in response to the user inserting the picture A in a third-party Android application B (for example, an application that can insert pictures such as WPS), the electronic device displays a picture selection interface, and the picture selection interface includes the picture A, that is, the picture A taken by the camera on the Harmony side can be scanned by the third-party Android application B.
[0088] FIG. 7 is a schematic diagram of a scenario of Harmony accessing Android provided by an embodiment of the present application. In an example scenario, a user downloads a picture C in a third-party Android application C (for example, a browser in Android), and the electronic device can save the picture C under a file directory of the third-party Android application C, as shown in a of FIG. 7, in response to the user selecting the file directory (referred to as “new file” in the figure), the electronic device displays the interface b of FIG. 7, and the electronic device can display the picture C on a file display interface of the third-party Android application C. After the file systems of Harmony and Android can be shared, as shown in c of FIG. 7, a picture display interface of a gallery on the Harmony side displays the picture C, that is, the picture saved in the third-party Android application C can be scanned by the gallery on the Harmony side.
[0089] In another example, in response to a user opening a third-party Android application D (e.g., an application capable of creating a document such as WPS), the electronic device creates a document A; in response to a user save operation, the electronic device can save the document A under the file directory of the third-party Android application D. After the file systems of Harmony and Android can be shared, in response to a user opening the file management on the Harmony side, the files in the file management on the Harmony side include the document A, that is, the document in the third-party Android application D can be scanned by the file management on the Harmony side.
[0090] In another possible scenario, the electronic device A is installed with the Harmony operating system and the Android operating system, and the electronic device B is installed with the Harmony operating system and the Android operating system. In the case that the electronic device A opens the sharing function to share pictures with the electronic device B, the electronic device A can send the pictures taken or saved by the applications in the Harmony and the pictures taken or saved by the applications in the Android to the electronic device B together.
[0091] The above describes the scenario of file sharing of the present application, and the following describes the specific implementation manner of the electronic device.
[0092] FIG. 8 is a system architecture for sharing files of two systems according to an embodiment of the present application. Referring to FIG. 8, the gallery and the file management on the upper layer of the Harmony side can view the files such as pictures taken by the camera and screenshots, and the path thereof can be to scan various types of public directories from the user file management and then to obtain public files (pictures, videos, audios, etc.). Among them, the various types of public directories are, for example, the public directory of pictures, the public directory of audios, the public directory of videos, the public directory of documents, and the public directory of downloads. Similarly, the third-party applications on the upper layer of the Android side can scan various types of public directories through the media library and then obtain public files. In the embodiment of the present application, the electronic device connects the data on the Harmony side and the data on the Android side through the bindfs system and associates the user identifier UID on the Harmony side and the UID on the Android side. In addition, the electronic device allows the Harmony to access the Android with read and write permissions, and the Android can only access the Harmony with read-only permission, so as to improve the management and control of file security on the premise of file sharing.
[0093] The embodiment of the present application designs a set of user systems through the selection of bindfs, and vertically integrates the boot startup and mounting mapping between the Harmony and the Android. Referring to the software architecture diagram of the electronic device as shown in FIG. 9, the software architecture of the Harmony includes an application program layer, an application framework layer, and a kernel layer, and the software architecture of the Android includes an application layer, a framework layer, a hardware abstraction layer, and a kernel layer.
[0094] The application program layer on the Harmony side can include a plurality of application programs, such as the camera, the gallery, the calendar, the music, the navigation, and the like.
[0095] The application framework layer on the Android side includes a startup subsystem, a package management subsystem, a container subsystem, a multimedia subsystem, and a file management subsystem. The startup subsystem is used for broadcast monitoring, startup mounting mapping, and ensuring the timing dependence of the startup of the system on the Android side and the system on the Hongmeng side. The package management subsystem is used for fixing the user group of the public directory of the media library on the Android side. The container subsystem is used for cross-system delivery of a filesystem in userspace (FUSE) node, cross-system delivery in master-slave mode, cross-system delivery of a device node, and the like. The multimedia subsystem is used for dynamically subscribing to files in the underlying filesystem. The file management subsystem connects the data on the Hongmeng side and the data on the Android side through a bindfs system, opens up the underlying filesystem for mounting mapping, ensures that the dual systems can use the data on the shared disk, and ensures privacy isolation.
[0096] The application program layer on the Android side can include applications such as a camera, a calendar, a map, a telephone, music, Bluetooth, a video, social networking, a gallery, navigation, and a short message.
[0097] The application framework layer on the Android side provides application program interfaces (APIs) and programming frameworks for the application programs of the application program layer. The application framework layer includes some predefined functions, for example, including a package manager service (PMS), an activity manager service (AMS), a backup manager service (BMS), and the like.
[0098] The application framework layer can also include a window manager, a content provider, a resource manager, a notification manager, a view system, a telephone manager, and the like, which are not limited in the embodiments of the present application.
[0099] The system library can include a plurality of functional modules. For example, a surface manager, media libraries, a three-dimensional graphics processing library (for example, OpenGL ES), a two-dimensional (2dimension, 2D) graphics engine, and the like.
[0100] The surface manager is used for managing a display subsystem and provides fusion of 2D and 3dimension (3D) layers for a plurality of application programs. The media libraries support playback and recording of a plurality of commonly used audio, video formats, and static image files. The media libraries can support a plurality of audio and video coding formats. The three-dimensional graphics processing library is used for implementing three-dimensional graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0101] The kernel layer is a layer between hardware and software. The kernel layer includes a virtual file system (VFS) and a file system (FS). The VFS is a distributed file system for a network environment, and is an interface that allows and operates different file system implementations with an operating system. The file system is a mechanism that provides a user with underlying data access, such as a flash friendly file system (F2FS) designed for a flash.
[0102] The kernel layer is used to drive hardware, so that the hardware works. The kernel layer at least contains a display driver, an audio driver, a camera driver, a Bluetooth driver, and the like, which are not limited by embodiments of the present application.
[0103] Before the method 500, the electronic device performs a first boot process and a mounting process. First, the boot process of the embodiments of the present application is introduced in combination with FIG. 10. Referring to FIG. 10, the steps of the method 1000 are performed by the electronic device, and the method 1000 includes S1001 to S1006, and the specific steps are as follows:
[0104] S1001, in the case that the user presses the power key of the mobile phone to start the electronic device, detecting whether the electronic device supports dual systems. For example, the electronic device parses a first field, and the first field is used to indicate whether the electronic device supports dual systems. For example, the first field is set to "0" or "false", indicating that dual systems are not supported, and is set to "1" or "true", indicating that dual systems are supported. The embodiments of the present application are described by taking the dual systems as including Hongmeng and Android.
[0105] S1002, in the case that the electronic device supports dual systems, starting the Hongmeng operating system and starting the Android operating system.
[0106] For example, the electronic device starts the mounting mapping of each of the two operating systems, and creates a basic directory. In addition, the electronic device can set Hongmeng as a system base, and the access permission of Hongmeng is higher than that of Android. For example, Hongmeng can access the files of Android with read-write permission, while Android can only access the files of Hongmeng with read-only permission.
[0107] S1003, associating the UID on the Hongmeng side with the UID on the Android side.
[0108] For example, for the same user, the UID on the Harmony side is 0, and the UID on the Android side is 100. The electronic device needs to associate UID 0 and UID 100, so that UID 0 and UID 100 have the same access right to access the files in the systems on both sides. In this way, the isolation of private data in the multi-user scenario can be ensured, and after the mobile phone is restarted, UID 0 and UID 100 will also be associated according to the mapping relationship this time.
[0109] The UID on the Android side is a non-system-level UID. In other words, each third-party Android application has a corresponding UID, and the UIDs of different third-party Android applications are different. In this way, the same UID of the third-party Android application can be prevented from tampering with the public file resources.
[0110] S1004, configuring a dependent parameter of the dual system.
[0111] S1005, transferring the mounting node, mounting mode and device node between the dual systems.
[0112] The Harmony side transfers the mounting relationship of the file directory from the Harmony side to the Android side. For example, the picture type file directory of the Harmony is mounted under the user file management directory. Similarly, the Android side transfers the mounting relationship of the file directory from the Android side to the Harmony side. In this way, the mounting relationships of each other can be made to avoid the problem that the mounting relationships of the two sets of operating systems are independent of each other and cannot access each other. The mounting mode is selected as a master-slave mode, which means that there is one master node and multiple slave nodes, and the master node is responsible for reading and writing, and the slave node can only read.
[0113] In the Harmony system, the device node is similar to other unix-link operating systems, and is usually located under the “ / dev” directory. The device node is an interface for the kernel and the user space to interact with hardware devices. The device node is usually dynamically generated by the device management daemon (for example, “udev”) when the system starts. Application programs can usually interact with the device node through the API provided by the operating system to index to the storage location of the file through the device node. That is, in order to access the file, the device node of the file needs to be known, and therefore, the device nodes of the files on the dual system sides need to be transferred between the dual systems in the boot process, so as to ensure the file access between the dual systems.
[0114] S1006, fixing the user group on the Android side and registering the user group on the Harmony side.
[0115] Since the user group on the Android side changes dynamically and has randomness, the electronic device can fix the user group on the Android side in a remap manner, so as to eliminate the influence of the randomness of the user group of the public directory of the media library on the Android side.
[0116] After that, the electronic device is started up. The user can swipe up the screen to enter the main interface of the electronic device. In the case of setting up the Hongmeng as the system base, the electronic device enters the interface of the Hongmeng operating system after starting up.
[0117] In the method 1000, the electronic device can start up the dual system at the same time without the user's awareness when starting up for the first time after leaving the factory, complete the configuration of the dependent parameters of the dual system, and realize the bidirectional integration of the public files without the user's secondary operation.
[0118] After the above start-up entry configuration is completed, the electronic device starts to execute the mounting process shown in FIG. 11. Referring to the method 1100 shown in FIG. 11, the steps of the method 1100 are executed by the electronic device, and the method 1100 includes S1101 to S1107, and the specific steps are as follows:
[0119] S1101, monitoring the unlocking broadcast of the Hongmeng side by the first virtual device agent.
[0120] The first virtual device agent is set on the Hongmeng side, used for monitoring and callback of the unlocking broadcast of the Hongmeng side, and starting up the mounting mapping. When the user unlocks the Hongmeng to enter the interface of the Hongmeng, the first virtual device agent monitors the unlocking broadcast.
[0121] The first virtual device agent receiving the unlocking broadcast of the Hongmeng side means that the public directory of the Hongmeng side is decrypted.
[0122] For example, the user inputs a password to enter the main interface of the electronic device, or the user swipes up the screen to enter the main interface of the electronic device.
[0123] S1102, after the first virtual device agent monitors the unlocking broadcast of the Hongmeng side, creating the node directory of the Android in the Hongmeng (referred to as node directory 1), and mounting the node directory 2 on the node directory 1.
[0124] The node directory 1 is used for the Hongmeng to access the files of the Android, therefore, the node directory of the Android in the Hongmeng can also be referred to as the node directory of the Hongmeng accessing the Android. The node directory 2 is the root node directory of the Android, which can be regarded as a channel for accessing the Android. By mounting the node directory 2 on the node directory 1, the application on the Hongmeng side can access the files under the node directory 2 by accessing the node directory 1, that is, can access the files of the Android.
[0125] When mounting the node directory 2 on the node directory 1, the node directory 1 and the node directory 2 can be specified to have the same user group and the same access permission.
[0126] S1103, passing the unlocking broadcast of the Hongmeng side to the second virtual device agent by the first virtual device agent.
[0127] The second virtual device agent is arranged on the Android side and is configured to monitor and call back the unlock broadcast on the Android side. After receiving the unlock broadcast, the second virtual device agent can perform encryption and decryption operations on the root directory.
[0128] S1104, after the second virtual device agent receives the unlock broadcast on the Harmony side, the Android side performs a decryption operation on the public directory.
[0129] S1105, after the second virtual device agent monitors the decryption of the public directory on the Android side, a node directory of the Harmony on the Android (referred to as node directory 3) is created, and the node directory 4 is mounted on the node directory 3.
[0130] The node directory 3 is used for the Android to access the files of the Harmony, and therefore, the node directory of the Harmony on the Android can also be referred to as the node directory of the Android accessing the Harmony. The node directory 3 can include one or more types of node directories, for example, one or more types including: pictures, audio, video, documents, or downloads. In other words, the electronic device can create one or more types of node directories, and each type of directory can only store files of the corresponding type, in other words, entering a node directory can only access a type of files. For example, if the node directory 3 is a picture type node directory, it can only store picture files and cannot store other types of files. For the gallery directory, a bucket sorting method can be used to classify files according to file size, which can prevent large file access from being stuck.
[0131] The node directory 4 is a node directory of the Harmony, and the path thereof stores files of the Harmony. By mounting the node directory 4 on the node directory 3, the application on the Android side can access the files under the path of the node directory 4 by accessing the node directory 3, that is, the files of the Harmony can be accessed.
[0132] Referring to the above description of S1105, the mounting in this step is according to the type of the node directory, for example, the picture type node directory in the node directory 4 is mounted on the picture type node directory in the node directory 3, and for example, the video type node directory in the node directory 4 is mounted on the video type node directory in the node directory 3.
[0133] S1106, classify files according to directories.
[0134] Referring to the above description of S1105, the node directory 3 can include one or more types of node directories, and the electronic device can classify files into corresponding node directories. For example, classify picture files into a picture type node directory, and classify video files into a video type node directory. In this way, the problem of access lag caused by storing all types of files in the same directory can be avoided.
[0135] S1107, dynamically scanning the file to display the file at the application layer.
[0136] For example, the gallery application dynamically scans the local disk, scans all picture format files at a time, obtains the full path of the picture, and displays the picture on the picture display interface of the gallery application.
[0137] In the embodiments of the present application, after the first boot, the electronic device monitors the unlock broadcast through the first virtual device agent and the second virtual device agent, integrates the mounting mapping, permission control and other processes into the boot startup item, and realizes mounting at boot through broadcast transmission. The timing dependence of the dual system can be guaranteed, and the dynamic update of the directory level public file on the dual system side can be realized.
[0138] It should be understood that the size of the serial number of the above processes does not mean the order of execution, and the execution order of the processes should be determined according to their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0139] The present application also provides an electronic device which can execute the method described in the above embodiments.
[0140] The present application also provides a computer readable storage medium for storing a computer program, which, when executed on a computer, causes an electronic device to perform the method described in the above embodiments.
[0141] The present application also provides a computer program product, which includes a computer program or instructions, which, when executed, causes an electronic device to perform the method described in the above embodiments.
[0142] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to be limiting to the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an" and "the" are intended to include plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or" as used herein refers to and includes any or all possible combinations of one or more of the listed items.
[0143] In the above embodiments, the term "when" or "in the case of" can be interpreted as "if" or "after" or "in response to" or "in response to determining" or "in response to detecting" according to the context. Similarly, the phrase "upon determining" or "if detecting (the stated condition or event)" can be interpreted as "if determining" or "in response to determining" or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)" according to the context.
[0144] Those skilled in the art can understand that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0145] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and module can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0146] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be realized by other ways. For example, the above-described device embodiments are only schematic, for example, the division of the modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed ones can be indirect coupling or communication connection through some interfaces, devices or modules, and can be electrical, mechanical or other forms.
[0147] The modules described as separate components can or can not be physically separated, and the components shown as modules can or can not be physical modules, i.e. can be located in one place or can be distributed to a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.
[0148] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically, or two or more modules can be integrated into one module.
[0149] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0150] The above is only a specific implementation of the present application, but the protection scope of the embodiments of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.
Claims
1. A method of sharing a file, characterized by, The method is applied to an electronic device, the electronic device is installed with a first operating system and a second operating system, and the method comprises the following steps: In response to a user's operation of opening a picture display interface of a first application, displaying the picture display interface of the first application, the first application is an application in the first operating system, and the picture display interface of the first application displays a first picture, the first picture is stored in a path of a first node directory of the first operating system; In response to a user's operation of opening a picture display interface of a second application, obtaining the first picture by accessing a second node directory, and displaying the first picture in the picture display interface of the second application, the second application is an application in the second operating system, the first node directory is mounted on the second node directory, and the second node directory is used for the second operating system to access files of the first operating system.
2. The method of claim 1, wherein, The method further comprises: In response to a user's editing operation on the first picture in the second application, generating a second picture; In response to a user's storage operation on the second picture, storing the second picture; In response to a user's operation of opening a picture display interface of the first application, displaying the picture display interface of the first application, and the picture display interface of the first application also displays the second picture.
3. The method according to claim 1 or 2, characterized in that, The electronic device comprises a first virtual device agent and a second virtual device agent; before the step of obtaining the first picture by accessing the second node directory, the method further comprises the following steps: Monitoring, by the first virtual device agent, a lock broadcast of the first operating system; After the first virtual device agent monitors the lock broadcast of the first operating system, creating the second node directory; Mounting the first node directory on the second node directory.
4. The method of claim 3, wherein, The type of the second node directory comprises one or more of the following: Pictures, audio, video, documents, or downloads.
5. The method according to claim 3 or 4, characterized in that, Before the step of monitoring, by the first virtual device agent, the lock broadcast of the first operating system, the method further comprises the following steps: In response to a user's operation of starting the electronic device for the first time, detecting whether the electronic device supports dual systems; In the case that the electronic device supports dual systems, starting the first operating system and the second operating system; Associating the first operating system and the second operating system.
6. The method of claim 5, wherein, The step of associating the first operating system and the second operating system comprises the following steps: Associating a user identification (UID) of the first operating system and a UID of the second operating system; Transferring a mounting node, a mounting mode, and a device node between the first operating system and the second operating system.
7. The method of claim 6, wherein, The method further comprises the following steps: Fixing a user group of the second operating system; Registering the user group in the first operating system.
8. An electronic device, comprising: The electronic device comprises at least one processor and a memory, the memory is used for storing programs or instructions, and when the programs or instructions are executed by the at least one processor, the method in any one of claims 1 to 7 is executed.
9. A computer-readable storage medium, characterized in that, A computer program product for storing a computer program which, when run on a computer, causes the method of any one of claims 1 to 7 to be performed.
10. A computer program product, characterised in that, comprising: A computer program or instructions which, when run, cause the method of any one of claims 1 to 7 to be performed.
Citation Information
Patent Citations
File sharing method, folding screen terminal, computing equipment and computer storage medium
CN110119261A
File sharing method, communication system and electronic equipment
CN114374690A
File sharing method, communication system and electronic equipment
CN117938830A
Window implementation method under multiple systems and electronic equipment
CN117992189A
Binding local device folders to a content management system for synchronization
US20210200720A1