CN114595203A - File synchronization method based on dual systems, terminal device and storage medium - Google Patents

File synchronization method based on dual systems, terminal device and storage medium Download PDF

Info

Publication number
CN114595203A
CN114595203A CN202210186678.8A CN202210186678A CN114595203A CN 114595203 A CN114595203 A CN 114595203A CN 202210186678 A CN202210186678 A CN 202210186678A CN 114595203 A CN114595203 A CN 114595203A
Authority
CN
China
Prior art keywords
file
synchronized
path
synchronization
dual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210186678.8A
Other languages
Chinese (zh)
Inventor
孙哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN202210186678.8A priority Critical patent/CN114595203A/en
Publication of CN114595203A publication Critical patent/CN114595203A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Abstract

The application discloses a file synchronization method based on dual systems, terminal equipment and a storage medium, which are used for solving the problems that in the related technology, the process of dual systems for sharing data is complex and inefficient, the characteristic of dual system data isolation is damaged, and the use experience of a user is greatly reduced. In the method, a communication interface of a sharing service is called to transmit a synchronization request by responding to the synchronization request of a foreground system to at least one file to be synchronized, and a storage path of the at least one file to be synchronized in the foreground system and a backup path of a background system are determined based on path parameters in the synchronization request; and copying at least one file to be synchronized from the storage path of the foreground system to the backup path of the background system, and sending the copying result to the file manager. Therefore, parameters are transferred by calling a communication interface of the sharing service of the double systems, the file to be synchronized is synchronized to the other system on the basis of not damaging data isolation, and data interaction and data sharing in the double systems are realized.

Description

File synchronization method based on dual systems, terminal device and storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a file synchronization method based on dual systems, a terminal device, and a storage medium.
Background
With the increasing popularization of terminal devices, the application scenarios of the dual system are increasing. The data isolation characteristic of the dual system enables the data security of the terminal device to be further improved, but the operation convenience is reduced.
In the related art, when one system in the dual system needs to use data in the other system, the data in the one system needs to be copied by means of another device and then copied into the other system, or data of the two systems can be intercommunicated, for example, storage locations of the data are set to be the same storage area, but the data of the two systems cannot be isolated, the advantage of data isolation of the dual system is completely abandoned, mutual influence of the data is generated, the process of sharing the data is complex and inefficient, the performance of the dual system is damaged, and the use experience of a user on the dual system is greatly reduced.
Disclosure of Invention
The application aims to provide a file synchronization method based on dual systems, terminal equipment and a storage medium, and the file synchronization method, the terminal equipment and the storage medium are used for solving the problems that in the related technology, the process of dual system data sharing is complex and inefficient, the characteristic of dual system data isolation is damaged, and the use experience of a user is greatly reduced.
In a first aspect, the present application provides a file synchronization method based on dual systems, where the method includes:
responding to a synchronization request of a foreground system to at least one file to be synchronized, and calling a communication interface of a sharing service to transmit the synchronization request, wherein the synchronization request comprises a path parameter of the at least one file to be synchronized; the shared service is a service shared by two systems;
if the caller of the communication interface is the file manager of the foreground system, determining a storage path of the at least one file to be synchronized in the foreground system and a backup path of the background system based on the path parameters;
and copying the at least one file to be synchronized to a backup path of the background system based on the storage path of the at least one file to be synchronized in the foreground system, and sending a copying result to the file manager.
In one possible embodiment, the method further comprises:
and after the terminal equipment is started and before the dual-system is started, starting the shared service in the bottom service class.
In one possible embodiment, the communication interface invoking the sharing service passing the synchronization request includes:
acquiring a list consisting of a path position and a file name corresponding to the at least one file to be synchronized;
and calling the communication interface, and transmitting the path parameter indicating the list carried in the synchronous request to the sharing service.
In a possible embodiment, the determining, based on the path parameter, a storage path of the at least one file to be synchronized at the foreground system and a backup path of the background system includes:
determining a system identification of the foreground system;
if the system identifier indicates that the foreground system is the first system of the dual systems, determining that the storage path of the foreground system of the at least one file to be synchronized is the path position of the file in the first system, and determining that the backup path of the background system of the at least one file to be synchronized is the path position of the file in the second system of the dual systems.
In a possible implementation manner, before the copying the at least one file to be synchronized to the backup path of the backend system, the method further includes:
if the backup path of the background system does not exist in the background system, creating the backup path of the background system according to a file path creation rule of the background system;
and copying the at least one file to be synchronized to the created backup path of the background system.
In a possible implementation, the synchronization request further includes a password parameter, and the method further includes:
if the caller is the file manager of the foreground system, judging whether the password parameters in the synchronous request are correct;
if the password parameters are correct, the step of determining the storage path of the at least one file to be synchronized in the foreground system and the backup path of the background system based on the path parameters is executed;
and if the password parameters are wrong, executing exit operation.
In one possible embodiment, the method further comprises:
displaying a synchronous guide interface for selecting files to be synchronized, wherein the synchronous guide interface comprises at least one file;
responding to the file selection operation of the user on the at least one file, and determining the at least one file to be synchronized;
and responding to a synchronization instruction for executing synchronization operation on the at least one file to be synchronized, and generating the synchronization request.
In a second aspect, the present application provides a terminal device, comprising:
a display, a processor, and a memory;
the display is used for displaying a screen display area;
the memory to store the processor-executable instructions;
the processor is configured to execute the instructions to implement the dual system based file synchronization method of any of the first aspects described above.
In a third aspect, the present application provides a computer-readable storage medium, wherein instructions, when executed by a terminal device, enable the terminal device to perform the dual-system based file synchronization method according to any one of the first aspect.
In a fourth aspect, the present application provides a computer program product comprising a computer program:
the computer program when executed by a processor implements the dual system based file synchronization method as described in any of the first aspects above.
The technical scheme provided by the embodiment of the application at least has the following beneficial effects:
in the embodiment of the application, a communication interface of a sharing service is called to transmit a synchronization request by responding to the synchronization request of a foreground system to at least one file to be synchronized, wherein the synchronization request comprises a path parameter of the at least one file to be synchronized; the shared service is a service shared by two systems; if the caller of the communication interface is a file manager of the foreground system, determining a storage path of at least one file to be synchronized in the foreground system and a backup path of the background system based on the path parameters; and copying at least one file to be synchronized to a backup path of the background system based on a storage path of the at least one file to be synchronized in the foreground system, and sending a copying result to the file manager. Therefore, by transferring parameters through a communication interface of the sharing service of the dual systems, a convenient and efficient method for sharing data in the dual systems can be realized for a user, files to be synchronized are synchronized to the other system on the basis of not damaging the data isolation of the dual systems, data interaction and data sharing in the dual systems are realized, and the use experience of the user is improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 2 is a block diagram of a software structure of a terminal device according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a file synchronization method based on dual systems according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating that a first system and a second system respectively access hardware through respective underlying services according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating that a first system and a second system both access hardware through a shared service according to an embodiment of the present application;
fig. 6 is a schematic effect diagram of a synchronous guidance interface provided in an embodiment of the present application;
FIG. 7 is a schematic diagram illustrating an effect of a confirmation file synchronization interface according to an embodiment of the present application;
fig. 8 is a schematic effect diagram of a background system after synchronization is completed according to an embodiment of the present application;
fig. 9 is a schematic view of a complete flow of a file synchronization method based on a dual system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. The embodiments described are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Also, in the description of the embodiments of the present application, "/" indicates an inclusive meaning unless otherwise specified, for example, a/B may indicate a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the features, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
Hereinafter, the foreground system is a system of the terminal device currently used by the user; the background system is a system of the terminal equipment which can not be directly used by the user at present.
With the increasing popularization of terminal devices, the application scenarios of the dual system are increasing. The data isolation characteristic of the dual system enables the data security of the terminal device to be further improved, but the operation convenience is reduced.
When one system in the dual system needs to use the data in the other system, the data in the one system needs to be copied out by the aid of another device and then copied into the other system. For example, when a user takes several photos on a first system and later finds that the photos are also needed on a second system, the following two methods can be used:
the first method comprises the following steps: firstly, finding a computer, opening mtp (mul t i-path transmission), copying the photos or files to be transferred from the first system to the computer, then switching to the second system, opening mtp again, and copying the files copied to the computer to the second system.
The second method comprises the following steps: firstly, the photo or the file in the first system is sent to the mobile phone of another user by means of the network through WeChat, Bluetooth and the like, and then the system is switched to the second system, so that the other user borrows the file from the network.
In either method, the process of sharing data by two systems is complex and inefficient, and if no second terminal device is available or the network does not allow, the user cannot use data in one system under the other system.
In the related art, to solve this problem, data of two systems may be communicated, for example, storage locations of data are set as the same storage location. However, once the storage location is changed into the same storage area, the private data of the application can be also stored in the same directory, when the two systems have the same application, the data of the application can interfere and affect each other, which can completely give up the advantage of data isolation of the two systems, and can generate the mutual influence of the data, so that the process of sharing the data is complex and inefficient, the performance of the two systems is damaged, and the use experience of the user on the two systems is greatly reduced.
In view of this, the present application provides a file synchronization method based on dual systems, a terminal device and a storage medium, so as to solve the problems that in the related art, the process of sharing data by the dual systems is complex and inefficient, the characteristic of data isolation of the dual systems is damaged, and the use experience of a user is greatly reduced.
The inventive concept of the present application can be summarized as follows: in the embodiment of the application, a communication interface of a sharing service is called to transmit a synchronization request by responding to the synchronization request of a foreground system to at least one file to be synchronized, wherein the synchronization request comprises a path parameter of the at least one file to be synchronized; the shared service is a service shared by two systems; if the caller of the communication interface is a file manager of the foreground system, determining a storage path of at least one file to be synchronized in the foreground system and a backup path of the background system based on the path parameters; and copying at least one file to be synchronized to a backup path of the background system based on the storage path of the at least one file to be synchronized in the foreground system, and sending the copying result to the file manager. Therefore, by transferring parameters through a communication interface of the sharing service of the dual systems, a convenient and efficient method for sharing data in the dual systems can be realized for a user, files to be synchronized are synchronized to the other system on the basis of not damaging the data isolation performance of the dual systems, data interaction and data sharing in the dual systems are realized, and the use experience of the user is improved.
After the inventive concept of the present application is introduced, the terminal device provided in the present application will be described below.
Fig. 1 shows a schematic structural diagram of a terminal device 100. It should be understood that the terminal device 100 shown in fig. 1 is only an example, and the terminal device 100 may have more or less components than those shown in fig. 1, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
A block diagram of a hardware configuration of a terminal device 100 according to an exemplary embodiment is exemplarily shown in fig. 1. As shown in fig. 1, the terminal device 100 includes: a Radio Frequency (RF) circuit 110, a memory 120, a display unit 130, a camera 140, a sensor 150, an audio circuit 160, a Wireless Fidelity (Wi-Fi) module 170, a processor 180, a bluetooth module 181, and a power supply 190.
The RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and may receive downlink data of a base station and then send the downlink data to the processor 180 for processing; the uplink data may be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
The memory 120 may be used to store software programs and data. The processor 180 performs various functions of the terminal device 100 and data processing by executing software programs or data stored in the memory 120. The memory 120 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The memory 120 stores an operating system that enables the terminal device 100 to operate. The memory 120 may store an operating system and various application programs, and may also store program codes for executing the dual system based file synchronization method according to the embodiment of the present application.
The display unit 130 may be used to receive input numeric or character information and generate signal input related to user settings and function control of the terminal device 100, and specifically, the display unit 130 may include a touch screen 131 disposed on the front surface of the terminal device 100 and capable of collecting touch operations, such as button clicking, by the user thereon or nearby.
The display unit 130 may also be used to display a Graphical User Interface (GUI) of information input by or provided to the user and various menus of the terminal apparatus 100. Specifically, the display unit 130 may include a display screen 132 disposed on the front surface of the terminal device 100. The display screen 132 may be configured in the form of a liquid crystal display, a light emitting diode, or the like. The display unit 130 may be used to display a screen display area of the terminal device in the present application.
The touch screen 131 may cover the display screen 132, or the touch screen 131 and the display screen 132 may be integrated to implement the input and output functions of the terminal device 100, and after the integration, the touch screen may be referred to as a touch display screen for short. In the present application, the display unit 130 may display the application programs and the corresponding operation steps.
The camera 140 may be used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing elements convert the light signals into electrical signals which are then passed to the processor 180 for conversion into digital image signals.
The terminal device 100 may further comprise at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, a temperature sensor 154. The terminal device 100 may also be configured with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, motion sensor, and the like.
The audio circuitry 160, speaker 161, microphone 162 may provide an audio interface between a user and the terminal device 100. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161. The terminal device 100 may further be configured with a volume button for adjusting the volume of the sound signal, and may be configured to combine other buttons to adjust the closed area. On the other hand, the microphone 162 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by the audio circuit 160, and outputs the audio data to the RF circuit 110 to be transmitted to, for example, another terminal device, or outputs the audio data to the memory 120 for further processing.
Wi-Fi belongs to a short-distance wireless transmission technology, and the terminal device 100 can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the Wi-Fi module 170, and provides wireless broadband internet access for the user.
The processor 180 is a control center of the terminal device 100, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device 100 and processes data by running or executing software programs stored in the memory 120 and calling data stored in the memory 120. In some embodiments, processor 180 may include one or more processing units; the processor 180 may also integrate an application processor, which mainly handles operating systems, user interfaces, applications, etc., and a baseband processor, which mainly handles wireless communications. It will be appreciated that the baseband processor described above may not be integrated into the processor 180. In the present application, the processor 180 may run an operating system, an application program, a user interface display, and a touch response, and the file synchronization method based on the dual system according to the embodiment of the present application. Further, the processor 180 is coupled with the display unit 130.
And the bluetooth module 181 is configured to perform information interaction with other bluetooth devices having bluetooth modules through a bluetooth protocol. For example, the terminal device 100 may establish a bluetooth connection with a wearable electronic device (e.g., a smart watch) having a bluetooth module via the bluetooth module 181, so as to perform data interaction.
The terminal device 100 also includes a power supply 190 (such as a battery) for powering the various components. The power supply may be logically connected to the processor 180 through a power management system to manage charging, discharging, power consumption, etc. through the power management system. The terminal device 100 may further be configured with a power button for powering on and off the terminal device, and locking the screen.
Fig. 2 is a block diagram of a software configuration of the terminal device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system may be divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer, from top to bottom, respectively. As shown in fig. 2, in the present application, each system of the dual systems respectively has the application layer and the application framework layer corresponding to each other, and the dual systems share the same system library and share the same kernel layer.
The application layer may include a series of application packages.
As shown in FIG. 2, the application package may include applications such as a file manager, application marketplace, settings, WeChat, information, alarm clock, gallery, calendar, WLAN, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and answered, browsing history and bookmarks, phone books, short messages, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying a picture.
The phone manager is used to provide the communication function of the terminal device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources, such as localized strings, icons, pictures, layout files, video files, etc., to the application.
The notification manager allows the application to display notification information (e.g., the message content of a short message) in the status bar, can be used to convey notification-type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the terminal device vibrates, an indicator light flickers, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc., and the system Libraries further include the shared services of the dual systems provided by the embodiments of the present application.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
A 2D (an animation mode) graphics engine is a drawing engine for 2D drawing.
In the embodiment of the application, the shared service and the surface manager in the system library are commonly used by the dual systems, and the media library, the three-dimensional graphics processing library and the 2D graphics engine are respectively used by the two systems in the dual systems.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The terminal 100 in the embodiment of the present application may be an electronic device including, but not limited to, a smart phone, a tablet computer, a wearable electronic device (e.g., a smart watch), a notebook computer, and the like.
In order to facilitate understanding of the file synchronization method based on dual systems provided in the embodiments of the present application, the following description is further provided with reference to the accompanying drawings.
It should be noted that, in order to ensure the characteristic of dual-system data isolation, in the embodiment of the present application, the synchronization operation of the present application is only performed on files in the system file manager, and an entry for performing the synchronization operation of the present application is only the system file manager, so that it is convenient to perform authority management control, and no additional security risk is added to the dual-system data isolation. The system file manager is already existed in an application program layer of the terminal device when the terminal device leaves a factory, and is an application which can not be installed and uninstalled by the terminal device.
The file manager in the embodiment of the application is a system file manager which is preset for leaving a factory, and cannot be unloaded and replaced, so that the data security is guaranteed to be system-controlled and cannot be interfered by other applications; meanwhile, the user operation files in the terminal equipment are mainly operated by using the file manager, and the user habit is met, so that the synchronous operation of the application is only executed aiming at the files in the system file manager in the embodiment of the application.
Fig. 3 is a schematic flowchart of a file synchronization method based on dual systems according to an embodiment of the present application. As shown in fig. 3, the method comprises the steps of:
in step 301, in response to a synchronization request of the foreground system for at least one file to be synchronized, a communication interface of a sharing service is invoked to transmit the synchronization request, where the synchronization request includes a path parameter of the at least one file to be synchronized, and the sharing service is a dual-system shared service.
In a possible implementation manner, in order to ensure the data isolation characteristic of the dual system and avoid access conflict, in this embodiment of the application, after the terminal device is powered on and before the dual system is powered on, the shared service in the underlying service class is started.
The level of the shared service and the level of the management service of the dual systems belong to the same level, the space which can be accessed by only the shared service is used for synchronizing the file data between the two systems, the safety of the data is ensured, and because the space which can be accessed by only the shared service can be accessed by the shared service and the file storage space of the two systems can not be accessed by the two systems, the two systems can still not access the file system of the other side, the data is still in an isolated state for the two systems, and the data isolation of the dual systems is ensured.
Specifically, after the terminal device is powered on and before the dual system is powered on, a high-privilege-level bottom service is started first, and the high-privilege-level bottom service is set as a shared service of the dual system, for example, a data switch service.
Some bottom layer services are only used by one system, and some bottom layer services can be used by both systems, so that the bottom layer services used by both systems have higher authority levels compared with the bottom layer services used by only one system. The shared service refers to a bottom layer service which is used by both systems and has a relatively large association with bottom layer hardware, because only one piece of bottom layer hardware is provided, logic for switching with the systems or processing messages can only be executed by the same bottom layer service, otherwise, a hardware access conflict may occur, as shown in fig. 4, a first system and a second system respectively access the hardware through respective bottom layer services, and an access conflict may be caused, so that a type of shared service is provided on the two systems, as shown in fig. 5, the first system and the second system can both access the shared service, and the access conflict of the logic or the hardware can be avoided by accessing the hardware through the shared service.
In a possible implementation manner, in order to facilitate a user to perform file synchronization, a synchronization guidance interface for selecting a file to be synchronized is displayed in the embodiment of the present application, where the synchronization guidance interface includes at least one file; responding to the file selection operation of a user on at least one file, and determining at least one file to be synchronized; and generating a synchronization request in response to a synchronization instruction for executing a synchronization operation on at least one file to be synchronized. For example, as shown in fig. 6, for the synchronization guidance interface provided in the embodiment of the present application, the synchronization guidance interface includes 7 files, and in response to a file selection operation of a user on a file 1 and a file 5, the file to be synchronized is determined to be the file 1 and the file 5, and then in response to a click operation on a synchronization button in fig. 6, a synchronization request for synchronizing the file 1 and the file 5 is generated. Therefore, convenience of user operation is improved through display of the synchronous guide interface.
In a possible implementation manner, in order to increase the security of data and avoid file synchronization caused by a user error operation, in this embodiment of the application, after responding to a synchronization instruction for performing a synchronization operation on at least one file to be synchronized, a confirmation file synchronization interface may also be displayed, as shown in fig. 7. For example, after the user clicks the synchronization button shown in fig. 6, a confirmation file synchronization interface shown in fig. 7 pops up, and prompts the user to confirm the operation of performing file synchronization. It should be noted that the file synchronization interface may be displayed according to a requirement, and may not be displayed, or may display an input password confirmation interface, and the like, which is not limited in the embodiment of the present application.
In a possible implementation manner, in order to ensure communication between the dual system and the shared service, in this embodiment of the present application, a communication interface, such as a copy file, needs to be added between the shared service and the upper foreground system.
In a possible implementation manner, after the synchronization request is generated, a communication interface that needs to invoke the sharing service transfers the synchronization request, which may be specifically implemented in this embodiment as follows: firstly, acquiring a list consisting of a path position and a file name corresponding to at least one file to be synchronized; and then calling a communication interface, and carrying the path parameters of the indication list in the synchronization request to be transmitted to the sharing service.
Illustratively, after the user clicks the synchronization button shown in fig. 6, the file manager first combines the file name of the file to be synchronized and the corresponding path position selected in fig. 6 to form a list, and then calls the communication interface copyFile to carry the path parameter indicating the list in the synchronization request to be transmitted to the sharing service, for example, if the list formed by the file name of the file to be synchronized and the corresponding path position is pathnamelilist (file name path string list), then the path parameter is pathnamelilist.
In step 302, if the caller of the communication interface is the file manager of the foreground system, the storage path of at least one file to be synchronized in the foreground system and the backup path of the background system are determined based on the path parameters.
In a possible implementation manner, in order to ensure the security performance of the terminal device and the data, in the embodiment of the present application, the synchronization request further includes a password parameter, such as a password, and if the caller is a file manager of a foreground system, it is determined whether the password parameter in the synchronization request is correct; if the password parameters are correct, the step of determining at least one storage path of the file to be synchronized in the foreground system and the backup path of the background system based on the path parameters is executed; and if the password parameters are wrong, executing exit operation.
The password parameters may be set according to actual needs, which is not limited in this application.
In a possible implementation manner, in the embodiment of the present application, after receiving the call of the communication interface, the shared service needs to check the caller of the communication interface, which may specifically be implemented as: firstly, acquiring Uid (User Identification, User account) of a caller through getCallingUid (service for acquiring caller package name), judging whether the Uid of the caller is the Uid of a file manager, and if so, executing a step of determining a storage path of at least one file to be synchronized in a foreground system and a backup path of a background system based on path parameters; if not, the sharing service returns a copy result to the file manager, wherein the copy result is a copy failure.
Wherein, Uid is the unique identification of each application under the system. After the terminal device performs factory setting, the Uid of each application in the system is fixed, and the Uid of each application is not changed as long as the factory setting is not restored again.
In a possible implementation manner, because in the dual system, each system can only see the path positions of the respective internal storage files, but the sharing service can see the path positions of the complete storage files of all the systems, the path positions of the storage files corresponding to the foreground system and the background system seen by the sharing service are different from the path positions of the respective internal storage files seen by each system. Therefore, after determining that the caller of the communication interface is the file manager of the foreground system, in the embodiment of the present application, it is required to determine, based on the path parameter, a storage path of at least one file to be synchronized in the foreground system and a backup path of the background system, which may specifically be implemented as: determining a system identifier of a foreground system; and if the system identifier indicates that the foreground system is a first system of the dual systems, determining that the storage path of the foreground system of at least one file to be synchronized is the path position of the file in the first system, and determining that the backup path of the background system of the at least one file to be synchronized is the path position of the file in the second system of the dual systems.
Illustratively, taking file 1 as a file to be synchronized as an example, the storage path of the foreground system seen by the sharing service is/data/host/data/media/0/file 1, and the storage path of the background system is/data/child/data/media/0/file 1. For the foreground system and the background system, only the path directory hierarchy seen is/data/media/0/file 1, so the path directory hierarchy in the path parameters transmitted by the communication interface is/data/media/0/file 1.
If the system identification indicates that the foreground system is the first system of the dual systems, after receiving the path parameter/data/media/0/file 1 transmitted by the communication interface, determining that the storage path of the foreground system of the file to be synchronized is/data/host/data/media/0/file 1, and determining that the backup path of the background system of the file to be synchronized is/data/child/data/media/0/synchronous file 1.
If the system identification indicates that the foreground system is a second system of the dual system, after receiving the path parameter/data/media/0/file 1 transmitted by the communication interface, determining that the storage path of the foreground system of the file to be synchronized is/data/child/data/media/0/file 1, and determining that the backup path of the background system of the file to be synchronized is/data/host/data/media/0/synchronous file 1.
Therefore, the storage path of the file to be synchronized in the foreground system and the backup path of the file to be synchronized in the background system can be determined.
In step 303, based on the storage path of the at least one file to be synchronized in the foreground system, the at least one file to be synchronized is copied to the backup path of the background system, and the copy result is sent to the file manager.
The sharing service belongs to a service with a high authority level and is a sharing service of double systems, so the sharing service can directly operate files in the two systems, directly copy files to be synchronized in a storage path of a foreground system to a backup path of a background system, and return a copying result to the file manager.
Exemplarily, if the system identifier indicates that the foreground system is the first system of the dual system, after receiving the path parameter/data/media/0/file 1 transmitted by the communication interface, determining that the storage path of the foreground system of the file to be synchronized is/data/host/data/media/0/file 1, and determining that the backup path of the file to be synchronized in the background system is/data/child/data/media/0/synchronization file 1, copying the file to be synchronized in/data/media/0/file 1 into/data/child/data/media/0/synchronization file 1, popping up a floating window according to needs after the copying is completed to notify the user that the synchronization is completed, and returning the copying result to the file manager after the copying is completed, when the user switches to the background system, the user can see a synchronization file with a prefix name of "synchronization xxx", such as synchronization file 1 shown in fig. 8, under the same directory of the file manager.
In a possible implementation manner, if a backup path of a background system does not exist in the background system, in the embodiment of the present application, before copying at least one file to be synchronized to the backup path of the background system, a backup path of the background system may be created according to a file path creation rule of the background system; at least one file to be synchronized is copied to the backup path of the established background system, so that the consistency of directory hierarchies of the two systems can be realized, the file synchronization of the two systems can be realized, the two systems can share the file to be synchronized, and the complex copying and mutual transmission operation of the file to be synchronized between the two systems is not needed.
For ease of understanding, the dual system-based file synchronization method provided in the embodiment of the present application is further described below with reference to fig. 9. As shown in fig. 9, the method includes the steps of:
in step 901, at least one file to be synchronized is determined in response to a file selection operation of a user on the at least one file; and generating a synchronization request in response to a synchronization instruction for executing a synchronization operation on at least one file to be synchronized.
In step 902, in response to a synchronization request of the foreground system for at least one file to be synchronized, a communication interface of the sharing service is invoked to deliver the synchronization request.
In step 903, after the sharing service receives the call of the communication interface, it checks whether the caller is a file manager; if the caller is not the file manager, then in step 904, the shared service returns a check failure to the caller, followed by execution of step 909; if the caller is a file manager, in step 905, the storage path of the at least one file to be synchronized in the foreground system and the backup path of the background system are determined based on the path parameters.
If the synchronization request carries the password parameter, in step 903, the shared service further needs to verify whether the password carried in the password parameter is correct; if the password is incorrect, go to step 904, if the password is correct and the caller is verified to be the filer, go to step 905. Of course, the order of checking caller identity and checking password is not limited.
In step 906, the sharing service copies the at least one file to be synchronized to the backup path of the backend system based on the storage path of the at least one file to be synchronized at the backend system.
In step 907, the sharing service returns the results of the copy to the file manager.
Wherein the replication result is divided into successful replication and failed replication; if the copy is successful, the sharing service returns the copy success to the file manager, and if the copy is failed, the sharing service returns the copy failure to the file manager.
In step 908, the file manager displays the results of the copy.
In step 909, the synchronization flow ends.
Therefore, through the steps described in fig. 9, the file to be synchronized can be synchronized to another system without destroying the data isolation performance of the dual systems, and the interaction of data in the dual systems and the sharing of data are realized.
Based on the foregoing description, in the embodiment of the present application, a communication interface of a sharing service is invoked to transmit a synchronization request by responding to a synchronization request of a foreground system for at least one file to be synchronized, where the synchronization request includes a path parameter of the at least one file to be synchronized; the shared service is a service shared by two systems; if the caller of the communication interface is a file manager of the foreground system, determining a storage path of at least one file to be synchronized in the foreground system and a backup path of the background system based on the path parameters; and copying at least one file to be synchronized to a backup path of the background system based on a storage path of the at least one file to be synchronized in the foreground system, and sending a copying result to the file manager. Therefore, by transferring parameters through a communication interface of the sharing service of the dual systems, a convenient and efficient method for sharing data in the dual systems can be realized for a user, files to be synchronized are synchronized to the other system on the basis of not damaging the data isolation performance of the dual systems, data interaction and data sharing in the dual systems are realized, and the use experience of the user is improved.
In an exemplary embodiment, the present application also provides a computer readable storage medium comprising instructions, such as the memory 120 comprising instructions, which are executable by the processor 180 of the terminal device 100 to perform the dual system based file synchronization method described above. Alternatively, the computer readable storage medium may be a non-transitory computer readable storage medium, for example, which may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program which, when executed by the processor 180, implements the dual system based file synchronization method as provided herein.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A file synchronization method based on dual systems is characterized by comprising the following steps:
responding to a synchronization request of a foreground system to at least one file to be synchronized, and calling a communication interface of a sharing service to transmit the synchronization request, wherein the synchronization request comprises a path parameter of the at least one file to be synchronized; the shared service is a service shared by two systems;
if the caller of the communication interface is the file manager of the foreground system, determining a storage path of the at least one file to be synchronized in the foreground system and a backup path of the background system based on the path parameters;
and copying the at least one file to be synchronized to a backup path of the background system based on the storage path of the at least one file to be synchronized in the foreground system, and sending a copying result to the file manager.
2. The method of claim 1, further comprising:
and after the terminal equipment is started and before the dual-system is started, starting the shared service in the bottom service class.
3. The method of claim 1, wherein the communication interface invoking the shared service passing the synchronization request comprises:
acquiring a list consisting of a path position and a file name corresponding to the at least one file to be synchronized;
and calling the communication interface, and carrying the path parameter indicating the list in the synchronous request to transmit to the sharing service.
4. The method of claim 1, wherein the determining the storage path of the at least one file to be synchronized at the foreground system and the backup path of the background system based on the path parameters comprises:
determining a system identification of the foreground system;
if the system identifier indicates that the foreground system is the first system of the dual systems, determining that the storage path of the foreground system of the at least one file to be synchronized is the path position of the file in the first system, and determining that the backup path of the background system of the at least one file to be synchronized is the path position of the file in the second system of the dual systems.
5. The method of claim 1, wherein prior to copying the at least one file to be synchronized to the backup path of the backend system, the method further comprises:
if the backup path of the background system does not exist in the background system, the backup path of the background system is created according to the file path creation rule of the background system;
and copying the at least one file to be synchronized to the created backup path of the background system.
6. The method of claim 1, wherein the synchronization request further includes a cryptographic parameter, the method further comprising:
if the caller is the file manager of the foreground system, judging whether the password parameters in the synchronous request are correct;
if the password parameters are correct, the step of determining the storage path of the at least one file to be synchronized in the foreground system and the backup path of the background system based on the path parameters is executed;
and if the password parameters are wrong, executing exit operation.
7. The method of claim 1, further comprising:
displaying a synchronous guide interface for selecting files to be synchronized, wherein the synchronous guide interface comprises at least one file;
responding to the file selection operation of the user on the at least one file, and determining the at least one file to be synchronized;
and responding to a synchronization instruction for executing synchronization operation on the at least one file to be synchronized, and generating the synchronization request.
8. A terminal device, comprising:
a display, a processor, and a memory;
the display is used for displaying a screen display area;
the memory to store the processor-executable instructions;
the processor is configured to execute the instructions to implement the dual system based file synchronization method of any of claims 1-7.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a terminal device, enable the terminal device to perform the dual system-based file synchronization method of any one of claims 1-7.
10. A computer program product, comprising a computer program to:
the computer program when executed by a processor implements the dual system based file synchronization method of any of claims 1-7.
CN202210186678.8A 2022-02-28 2022-02-28 File synchronization method based on dual systems, terminal device and storage medium Pending CN114595203A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210186678.8A CN114595203A (en) 2022-02-28 2022-02-28 File synchronization method based on dual systems, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210186678.8A CN114595203A (en) 2022-02-28 2022-02-28 File synchronization method based on dual systems, terminal device and storage medium

Publications (1)

Publication Number Publication Date
CN114595203A true CN114595203A (en) 2022-06-07

Family

ID=81815122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210186678.8A Pending CN114595203A (en) 2022-02-28 2022-02-28 File synchronization method based on dual systems, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN114595203A (en)

Similar Documents

Publication Publication Date Title
CN112114733B (en) Screen capturing and recording method, mobile terminal and computer storage medium
CN111274564A (en) Communication terminal and application unlocking method in split screen mode
CN110865837A (en) Method and terminal for upgrading system
CN113835569A (en) Terminal device, quick start method for internal function of application and storage medium
CN113835928A (en) Application backup and recovery method, device, storage medium, and program product
CN111158735B (en) Hot patch file processing method and communication terminal
CN113055585B (en) Thumbnail display method of shooting interface and mobile terminal
CN111600862B (en) User account management method and device
CN114675786A (en) Large-capacity storage mounting method, device, terminal and medium
CN111163220B (en) Display method, communication terminal and computer storage medium
CN112954622A (en) Mobile terminal and short message sending method thereof
CN114020379A (en) Terminal device, information feedback method and storage medium
CN114595203A (en) File synchronization method based on dual systems, terminal device and storage medium
CN114035870A (en) Terminal device, application resource control method and storage medium
CN111159734A (en) Communication terminal and multi-application data inter-access processing method
CN113642010B (en) Method for acquiring data of extended storage device and mobile terminal
CN115297467A (en) Data domain switching method, device, terminal equipment and medium
CN113642010A (en) Method for acquiring data of extended storage device and mobile terminal
CN114661310A (en) Application installation method based on dual systems, terminal device and storage medium
CN111913772A (en) Terminal and desktop display method
CN115150265A (en) Method, equipment and device for processing dual-system data
CN113014792A (en) Terminal equipment and camera resource sharing method
CN111273849A (en) Communication terminal and screen unlocking method
CN112312509A (en) Mobile terminal and network access method thereof
CN112114885A (en) Terminal, control equipment and service processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination