File synchronization method, terminal device and storage medium based on dual systems
By using the communication interface of shared services on dual-system devices for file synchronization, the problem of complex and inefficient data sharing of dual-system devices is solved, and convenient and efficient data interaction and sharing is achieved, improving user experience, while maintaining data isolation. .
Patent Information
- Application Number
- CN202210186678.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-02-28
AI Technical Summary
The process of dual-system devices is complex and inefficient when sharing data, destroying the data isolation characteristics and reducing the user experience.
By implementing a dual-system-based file synchronization method on the terminal device, the synchronization request is passed using the communication interface of the shared service, the storage path and backup path of the files to be synchronized are determined, and file copying and synchronization is performed without destroying data isolation.
It realizes convenient and efficient data sharing and interaction, improves user experience, and maintains the data isolation performance of dual systems.
Smart Images

Figure CN114595203B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a dual-system based file synchronization method, terminal equipment and storage medium. Background Art
[0002] As terminal devices become more and more popular, the application scenarios of dual systems are also increasing. The data isolation characteristics of the dual system itself have further improved the security of the data of the terminal device, but relatively speaking, it has reduced the convenience of operation.
[0003] In the related art, when one system in a dual system needs to use data from another system, it is necessary to use another device to copy the data from one system and then copy it to the other system, or the data of the two systems can be interoperable, such as setting the storage location of the data to the same storage area, but this will make it impossible to isolate the data of the two systems, completely abandoning the advantage of dual system data isolation, causing mutual influence of data, making the process of sharing data complicated and inefficient, destroying the performance of the dual system, and greatly reducing the user experience of the dual system. Summary of the invention
[0004] The purpose of this application is to provide a dual-system based file synchronization method, terminal device and storage medium to solve the problem that the process of dual-system data sharing in the related technology is complex and inefficient, which destroys the dual-system data isolation characteristics and greatly reduces the user experience.
[0005] In a first aspect, the present application provides a dual-system based file synchronization method, the method comprising:
[0006] In response to a synchronization request of the foreground system for at least one file to be synchronized, calling a communication interface of a shared service to transmit the synchronization request, wherein 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;
[0007] If the caller of the communication interface is the file manager of the foreground system, determining the storage path of the at least one file to be synchronized in the foreground system and the backup path of the backend system based on the path parameter;
[0008] 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.
[0009] In a possible implementation, the method further includes:
[0010] After the terminal device is turned on and before the dual systems are turned on, the shared service in the underlying service class is started.
[0011] In a possible implementation manner, the calling of the communication interface of the shared service to transmit the synchronization request includes:
[0012] Obtain a list consisting of the path location and file name corresponding to the at least one file to be synchronized;
[0013] The communication interface is called, and a path parameter indicating the list is carried in the synchronization request and passed to the sharing service.
[0014] In a possible implementation, 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 parameter includes:
[0015] Determine the system identification of the foreground system;
[0016] If the system identifier indicates that the foreground system is the first system of the dual system, the storage path of the foreground system of the at least one file to be synchronized is determined to be the path location of the file in the first system, and the backup path of the at least one file to be synchronized in the background system is determined to be the path location of the file in the second system of the dual system.
[0017] In a possible implementation manner, before copying the at least one to-be-synchronized file to a backup path of the background system, the method further includes:
[0018] If the backup path of the backend system does not exist in the backend system, creating the backup path of the backend system according to the file path creation rule of the backend system;
[0019] The at least one file to be synchronized is copied to the created backup path of the background system.
[0020] In a possible implementation manner, the synchronization request further includes a password parameter, and the method further includes:
[0021] If the caller is the file manager of the foreground system, determining whether the password parameter in the synchronization request is correct;
[0022] If the password parameter is 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 backend system based on the path parameter is performed;
[0023] If the password parameter is incorrect, the exit operation is executed.
[0024] In a possible implementation, the method further includes:
[0025] Displaying a synchronization guide interface for selecting a file to be synchronized, wherein the synchronization guide interface includes at least one file;
[0026] In response to a user's file selection operation on the at least one file, determining the at least one file to be synchronized;
[0027] The synchronization request is generated in response to a synchronization instruction to perform a synchronization operation on the at least one file to be synchronized.
[0028] In a second aspect, the present application provides a terminal device, including:
[0029] Display, processor and memory;
[0030] The display is used to display the screen display area;
[0031] The memory is used to store the processor executable instructions;
[0032] The processor is configured to execute the instructions to implement the dual-system based file synchronization method as described in any one of the first aspects above.
[0033] In a third aspect, the present application provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a terminal device, the terminal device can execute the dual-system-based file synchronization method as described in any one of the first aspects above.
[0034] In a fourth aspect, the present application provides a computer program product, including a computer program:
[0035] When the computer program is executed by a processor, the dual-system-based file synchronization method as described in any one of the first aspects above is implemented.
[0036] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0037] In the embodiment of the present application, by responding to the synchronization request of the foreground system for at least one file to be synchronized, the communication interface of the sharing service is called to transmit the synchronization request, and the synchronization request includes at least one path parameter of the file to be synchronized; the sharing service is a service shared by the two systems; 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; based on the storage path of at least one file to be synchronized in the foreground system, 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. Thus, by calling the communication interface of the sharing service of the two systems to transmit parameters, a convenient and efficient method for sharing data in the two systems can be realized for users, and the files to be synchronized can be synchronized to another system without destroying the data isolation of the two systems, so as to realize the interaction and sharing of data in the two systems, and improve the user experience.
[0038] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0041] Figure 2 A software structure diagram of a terminal device provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of a dual-system file synchronization method according to an embodiment of the present application;
[0043] Figure 4 A schematic diagram of a first system and a second system provided in an embodiment of the present application accessing hardware through their respective underlying services;
[0044] Figure 5 A schematic diagram of a first system and a second system provided in an embodiment of the present application both accessing hardware through a shared service;
[0045] Figure 6A schematic diagram of the effect of the synchronization guidance interface provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the effect of the confirmation file synchronization interface provided in an embodiment of the present application;
[0047] Figure 8 A schematic diagram of the effect of the background system after the synchronization is completed according to the embodiment of the present application;
[0048] Fig. 9 A complete flowchart of a dual-system based file synchronization method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Among them, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0050] Furthermore, in the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0051] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.
[0052] In the following text, the foreground system refers to the system of the terminal device that the user is currently using; the backend system refers to the system of the terminal device that the user cannot currently use directly.
[0053] As terminal devices become more and more popular, the application scenarios of dual systems are also increasing. The data isolation characteristics of the dual system itself have further improved the security of the data of the terminal device, but relatively speaking, it has reduced the convenience of operation.
[0054] When one system in a dual system needs to use data from another system, it is necessary to use another device to copy the data from one system and then copy it to the other system. For example, when a user takes a few photos on the first system and later finds that they also need these photos on the second system, the following two methods can be used:
[0055] The first method: First find a computer, open mtp (multi-path transfer), copy the photos or files to be transferred from the first system to the computer, then switch to the second system, open mtp again, and copy the files previously copied to the computer to the second system.
[0056] The second method: first use the Internet to send photos or files in the first system to another user's mobile phone through WeChat, Bluetooth, etc., then switch to the second system and let the other user use the Internet to send the files.
[0057] Regardless of the method used, the process of dual-system data sharing is relatively complicated and inefficient. If there is no second terminal device or the network does not allow it, the user cannot use the data in one system under another system.
[0058] In related technologies, in order to solve this problem, the data of the two systems can be interoperable, for example, the data storage location can be set to the same storage area. However, once the storage location becomes the same storage area, the private data of the application will also be placed in the same directory. When the two systems have the same application, the application data will definitely interfere with and affect each other, which will completely abandon the advantage of data isolation in the two systems, will cause mutual influence of data, will make the process of sharing data complex and inefficient, destroy the performance of the two systems, and greatly reduce the user experience of the two systems.
[0059] In view of this, the present application provides a dual-system based file synchronization method, terminal device and storage medium to solve the problem that the process of dual-system data sharing in the related technology is complex and inefficient, which destroys the dual-system data isolation characteristics and greatly reduces the user experience.
[0060] The inventive concept of the present application can be summarized as follows: in the embodiment of the present application, by responding to the synchronization request of the foreground system for at least one file to be synchronized, the communication interface of the sharing service is called to transmit the synchronization request, and the synchronization request includes at least one path parameter of the file to be synchronized; the sharing service is a service shared by the two systems; 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; based on the storage path of at least one file to be synchronized in the foreground system, 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. Thus, by calling the communication interface of the sharing service of the two systems to transmit parameters, a convenient and efficient method for sharing data in the two systems can be realized for users, and the files to be synchronized can be synchronized to another system without destroying the data isolation performance of the two systems, so as to realize the interaction and sharing of data in the two systems, and improve the user experience.
[0061] After introducing the inventive concept of the present application, the terminal device provided by the present application will be described below.
[0062] Figure 1 FIG. 1 shows a schematic diagram of the structure of a terminal device 100. It should be understood that Figure 1 The terminal device 100 shown is only an example, and the terminal device 100 may have more Figure 1 The more or less components shown in the figure can be combined with two or more components, or can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0063] Figure 1 FIG. 1 is a block diagram showing a hardware configuration of a terminal device 100 according to an exemplary embodiment. Figure 1 As shown, 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 and other components.
[0064] The RF circuit 110 can be used to receive and send signals during the process of sending and receiving information or making calls. It can receive downlink data from the base station and hand it over to the processor 180 for processing; it can send uplink data to the base station. Generally, the RF circuit includes but is not limited to antennas, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer and other devices.
[0065] The memory 120 can be used to store software programs and data. The processor 180 executes various functions and data processing of the terminal device 100 by running the software programs or data stored in the memory 120. The memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 120 stores an operating system that enables the terminal device 100 to run. In the present application, the memory 120 can store an operating system and various application programs, and can also store program codes for executing the file synchronization method based on the dual system described in the embodiment of the present application.
[0066] The display unit 130 may be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal device 100. Specifically, the display unit 130 may include a touch screen 131 disposed on the front of the terminal device 100, which may collect user touch operations thereon or near the touch screen, such as clicking a button.
[0067] The display unit 130 can also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal device 100. Specifically, the display unit 130 may include a display screen 132 disposed on the front of the terminal device 100. The display screen 132 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 130 may be used to display the screen display area of the terminal device in the present application.
[0068] The touch screen 131 may be covered on the display screen 132, or the touch screen 131 and the display screen 132 may be integrated to realize the input and output functions of the terminal device 100, and the integrated touch screen may be referred to as a touch display screen. In the present application, the display unit 130 may display the application and the corresponding operation steps.
[0069] The camera 140 can be used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then passed to the processor 180 for conversion into a digital image signal.
[0070] The terminal device 100 may further include at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, and a temperature sensor 154. The terminal device 100 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0071] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the terminal device 100. The audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, which is converted into a sound signal for output. The terminal device 100 can also be configured with a volume button for adjusting the volume of the sound signal, and can also be used 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, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the RF circuit 110 to be sent to, for example, another terminal device, or the audio data is output to the memory 120 for further processing.
[0072] Wi-Fi is a short-range wireless transmission technology. The terminal device 100 can help users send and receive emails, browse web pages, and access streaming media through the Wi-Fi module 170, which provides users with wireless broadband Internet access.
[0073] The processor 180 is the control center of the terminal device 100. It uses various interfaces and lines to connect various parts of the entire terminal device. It executes 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, the processor 180 may include one or more processing units; the processor 180 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 180. In the present application, the processor 180 can run the operating system, application programs, user interface display and touch response, as well as the file synchronization method based on the dual system described in the embodiment of the present application. In addition, the processor 180 is coupled to the display unit 130.
[0074] The Bluetooth module 181 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device 100 can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 181 to exchange data.
[0075] The terminal device 100 also includes a power supply 190 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption. The terminal device 100 can also be configured with a power button for powering on and off the terminal device, as well as locking the screen and other functions.
[0076] Figure 2 It is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.
[0077] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer. Figure 2 As shown, in the present application, each system of the dual system has its own corresponding application layer and application framework layer, and the dual systems share the same system library and the same kernel layer.
[0078] The application layer can include a series of application packages.
[0079] like Figure 2 As shown, the application package may include file manager, application market, settings, WeChat, information, alarm clock, gallery, calendar, WLAN and other applications.
[0080] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0081] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0082] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0083] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, short messages, etc.
[0084] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying images.
[0085] The phone manager is used to provide communication functions of the terminal device 100, such as management of call status (including connection, disconnection, etc.).
[0086] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc.
[0087] The notification manager enables applications to display notification information (such as the content of short messages) in the status bar. It can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.
[0088] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0089] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0090] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0091] The system library may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc. The system library also includes a dual-system sharing service provided in the embodiment of the present application.
[0092] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0093] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0094] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0095] A 2D (animation mode) graphics engine is a drawing engine for 2D drawing.
[0096] In the embodiment of the present application, the shared services and surface manager in the system library are used by both systems, while the media library, 3D graphics processing library, and 2D graphics engine are used by each of the two systems in the dual system.
[0097] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0098] 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 (such as a smart watch), a laptop computer, etc.
[0099] In order to facilitate understanding of the dual-system based file synchronization method provided in the embodiment of the present application, it is further described below with reference to the accompanying drawings.
[0100] It should be noted that, in order to ensure the dual-system data isolation feature, in the embodiment of the present application, the synchronization operation of the present application is only performed on the files in the system file manager, and the entry for performing the synchronization operation of the present application is only the system file manager, which can facilitate the authority management control, and does not increase the data isolation of the dual systems. The system file manager already exists in the application layer of the terminal device when the terminal device leaves the factory, and is an application that cannot be installed or uninstalled by the terminal device.
[0101] The file manager in the embodiment of the present application is a system file manager, which is factory preset, cannot be uninstalled or replaced, and thus ensures that the data security is controlled by the system and will not be interfered with by other applications; at the same time, users in the terminal device mainly operate files using the file manager, which is in line with user habits, and therefore, in the embodiment of the present application, only the synchronization operation of the present application is performed on the files in the system file manager.
[0102] Figure 3 The following is a flowchart of a dual-system file synchronization method provided in an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:
[0103] In step 301, in response to a synchronization request of the foreground system for at least one file to be synchronized, the communication interface of the shared service is called to transmit the synchronization request, the synchronization request includes a path parameter of at least one file to be synchronized, and the shared service is a service shared by two systems.
[0104] In a possible implementation, in order to ensure the data isolation characteristics of the dual systems and avoid access conflicts, in the embodiment of the present application, after the terminal device is turned on and before the dual systems are turned on, the shared service in the underlying service class is started.
[0105] Among them, the level of sharing service is the same as the level of management service of dual systems. File data is synchronized between the two systems using space that only sharing service can access, which ensures data security. Moreover, because only sharing service can access the file storage space of the two systems, the two systems still cannot access each other's file system, so the data is still isolated for the two systems, ensuring the data isolation of the dual systems.
[0106] The specific implementation is that after the terminal device is turned on and before the dual systems are turned on, a high-privilege-level underlying service is first started, and the high-privilege-level underlying service is set as a shared service of the dual systems, such as dataswitch (data switch service).
[0107] Some underlying services are used by only one system, and some are used by both systems. Therefore, compared with the underlying services used by only one system, the underlying services used by both systems have a higher level of permissions. Shared services refer to the underlying services used by both systems and are closely related to the underlying hardware. Because there is only one copy of the underlying hardware, the logic related to system switching or message processing can only be executed by the same underlying service, otherwise hardware access conflicts may occur, such as Figure 4 As shown in the figure, the first system and the second system access the hardware through their own underlying services, which will cause access conflicts. Therefore, a type of shared service is provided on the dual systems, such as Figure 5 As shown, both the first system and the second system can access the shared service, and access hardware through the shared service to avoid logical or hardware access conflicts.
[0108] In a possible implementation, in order to facilitate the user to perform file synchronization operations, in the embodiment of the present application, a synchronization guide interface for selecting files to be synchronized is displayed, and the synchronization guide interface includes at least one file; in response to the user's file selection operation on the at least one file, at least one file to be synchronized is determined; in response to the synchronization instruction for performing a synchronization operation on the at least one file to be synchronized, a synchronization request is generated. For example, Figure 6As shown, the synchronization guide interface provided by the embodiment of the present application includes 7 files. In response to the user's file selection operation on file 1 and file 5, it is determined that the files to be synchronized are file 1 and file 5, and then in response to the Figure 6 The click operation of the synchronization button generates a synchronization request for synchronizing file 1 and file 5. Thus, the convenience of user operation is increased by displaying the synchronization guide interface.
[0109] In a possible implementation, in order to increase data security and avoid file synchronization caused by user error operations, in the embodiment of the present application, after responding to the synchronization instruction to perform a synchronization operation on at least one file to be synchronized, a file synchronization confirmation interface may also be displayed, such as Figure 7 For example, when a user clicks Figure 6 After clicking the Sync button shown in Figure 7 The confirmation file synchronization interface shown prompts the user to confirm the operation of executing file synchronization. It should be noted that the file synchronization interface can be displayed according to demand, or it can be not displayed if not needed, or a password input confirmation interface can be displayed, etc., which is not limited in the embodiment of the present application.
[0110] In a possible implementation, in order to ensure communication between the dual systems and the shared service, it is necessary to add a communication interface, such as copyFile (copy file), between the shared service and the upper-level foreground system in the embodiment of the present application.
[0111] In one possible implementation, after generating a synchronization request, it is necessary to call the communication interface of the sharing service to transmit the synchronization request. In the embodiment of the present application, it can be specifically implemented as follows: first obtain a list consisting of the path location and file name corresponding to at least one file to be synchronized; then call the communication interface, and carry the path parameter indicating the list in the synchronization request to pass it to the sharing service.
[0112] For example, when a user clicks Figure 6 After clicking the Sync button shown in Figure 6 The file names and corresponding path locations of the files to be synchronized are selected to form a list, and then the communication interface copyFile is called to carry the path parameter indicating the list in the synchronization request and pass it to the sharing service. For example, the list composed of the file names and corresponding path locations of the files to be synchronized is pathNameLlist (file name path string list), and the path parameter is pathNameLlist.
[0113] In step 302, if the caller of the communication interface is a file manager of the foreground system, a storage path of at least one file to be synchronized in the foreground system and a backup path in the background system are determined based on the path parameters.
[0114] In a possible implementation, in order to ensure the security performance of terminal devices and data, the synchronization request in the embodiment of the present application also includes a password parameter, such as password. If the caller is the file manager of the foreground system, it is determined whether the password parameter in the synchronization request is correct; if the password parameter is correct, the step of determining the storage path of at least one file to be synchronized in the foreground system and the backup path of the background system based on the path parameter is executed; if the password parameter is incorrect, an exit operation is executed.
[0115] Among them, the password parameters can be set according to actual needs, and this application does not impose any restrictions on this.
[0116] In one possible implementation, after receiving the call of the communication interface, the sharing service in the embodiment of the present application needs to verify the caller of the communication interface, which can be implemented specifically as follows: first, obtain the caller's Uid (User Identification, user account) through getCallingUid (service for obtaining the caller's package name), and determine whether the caller's Uid is the file manager's Uid. If so, execute the step of determining the storage path of at least one file to be synchronized in the foreground system and the backup path of the background system based on the path parameters; if not, the sharing service returns the copy result to the file manager, where the copy result is a copy failure.
[0117] Among them, Uid is the unique identifier of each application in the system. After the terminal device is factory reset, the Uid of each application in the system will be fixed, and the Uid of each application will not change unless the factory settings are restored again.
[0118] In one possible implementation, because each system in a dual system can only see the path location of its own internal storage files, while the sharing service can see the path location of the complete storage files of all systems, the path location of the storage files corresponding to the foreground system and the backend system seen by the sharing service is different from the path location of each system's own internal storage files. Therefore, after determining that the caller of the communication interface is the file manager of the foreground system, in an embodiment of the present application, it is necessary to determine the storage path of at least one file to be synchronized in the foreground system and the backup path of the backend system based on the path parameters, which can be specifically implemented as follows: determining the system identifier of the foreground system; if the system identifier indicates that the foreground system is the first system of the dual system, then determining the storage path of the foreground system of at least one file to be synchronized is the path location of the file in the first system, and determining the backup path of at least one file to be synchronized in the backend system is the path location of the file in the second system of the dual system.
[0119] For example, taking file 1 as the file to be synchronized, the storage path of the front-end system seen by the sharing service is / data / host / data / media / 0 / file 1, and the storage path of the back-end system is / data / child / data / media / 0 / file 1. For the front-end system and the back-end system themselves, they can only see the path directory level of / data / media / 0 / file 1, so the path directory level in the path parameter transmitted by the communication interface is / data / media / 0 / file 1.
[0120] 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 / file1 transmitted by the communication interface, the storage path of the foreground system of the file to be synchronized is determined to be / data / host / data / media / 0 / file1, and the backup path of the file to be synchronized in the background system is determined to be / data / child / data / media / 0 / synchronization file 1.
[0121] If the system identifier indicates that the foreground system is the second system of the dual system, after receiving the path parameter / data / media / 0 / file1 transmitted by the communication interface, the storage path of the foreground system of the file to be synchronized is determined to be / data / child / data / media / 0 / file1, and the backup path of the file to be synchronized in the background system is determined to be / data / host / data / media / 0 / synchronization file 1.
[0122] Thus, 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.
[0123] 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.
[0124] Among them, the sharing service is a service with a high authority level and is a sharing service for dual systems. Therefore, the sharing service can directly operate files in the two systems, and can directly copy the files to be synchronized in the storage path of the foreground system to the backup path of the background system, and return the copy result to the file manager.
[0125] Exemplarily, if the system identifier indicates that the foreground system is the first system of a dual-system, after receiving the path parameter / data / media / 0 / file1 passed by the communication interface, determine that the storage path of the foreground system for the file to be synchronized is / data / host / data / media / 0 / file1, and determine that the backup path of the file to be synchronized in the background system is / data / child / data / media / 0 / synchronized_file1. Then, copy the file to be synchronized in / data / media / 0 / file1 to / data / child / data / media / 0 / synchronized_file1. After the copying is completed, a floating window can be popped up to notify the user that the synchronization is completed as needed. At the same time, after the copying is completed, return the copying result to the file manager, so that when the user switches to the background system, the user can see the synchronized file with the prefix "synchronized xxx" in the same directory of the file manager, such as Figure 8 the synchronized file1 shown.
[0126] In a possible implementation manner, if the backup path of the background system does not exist in the background system, in the embodiments of the present application, before copying at least one file to be synchronized to the backup path of the background system, the backup path of the background system can be created according to the file path creation rule of the background system; copy at least one file to be synchronized to the created backup path of the background system, thereby realizing the consistency of the directory levels of the dual-system and the file synchronization of the dual-system, enabling the dual-system to share the file to be synchronized, and no longer requiring complex copying and mutual transfer operations of the file to be synchronized between the dual-systems.
[0127] For the sake of easy understanding, the following combines Fig. 9 to further illustrate the file synchronization method based on a dual-system provided in the embodiments of the present application. As Fig. 9 shown, the method includes the following steps:
[0128] In step 901, in response to the user's file selection operation on at least one file, determine at least one file to be synchronized; in response to the synchronization instruction for performing the synchronization operation on at least one file to be synchronized, generate a synchronization request.
[0129] In step 902, in response to the synchronization request of the foreground system for at least one file to be synchronized, call the communication interface of the sharing service to transfer the synchronization request.
[0130] In step 903, after receiving the call of the communication interface, the sharing service verifies whether the caller is a file manager; if the caller is not a file manager, then in step 904, the sharing service returns the verification failure to the caller, and then executes step 909; if the caller is a file manager, then in step 905, based on the path parameters, 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.
[0131] If the synchronization request carries a password parameter, then in step 903, the sharing service also needs to verify whether the password carried in the password parameter is correct; if the password is incorrect, step 904 is executed; if the password is correct and it is verified that the caller is a file manager, step 905 is executed. Of course, there is no restriction on the order of verifying the identity of the caller and verifying the password.
[0132] In step 906, the sharing service copies 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 front-end system.
[0133] In step 907, the sharing service returns the copy result to the file manager.
[0134] The copy results are divided into copy success and copy failure. If the copy is successful, the sharing service returns a copy success to the file manager. If the copy fails, the sharing service returns a copy failure to the file manager.
[0135] In step 908, the file manager displays the copy result.
[0136] In step 909, the synchronization process ends.
[0137] Thus, through Fig. 9 The steps described in the above can synchronize the files to be synchronized to another system without destroying the data isolation performance of the two systems, thereby realizing data interaction and data sharing in the two systems.
[0138] Based on the foregoing description, in the embodiment of the present application, by responding to the synchronization request of the foreground system for at least one file to be synchronized, the communication interface of the sharing service is called to transmit the synchronization request, and the synchronization request includes at least one path parameter of the file to be synchronized; the sharing service is a service shared by the two systems; 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; based on the storage path of at least one file to be synchronized in the foreground system, 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. Thus, by calling the communication interface of the sharing service of the two systems to transmit parameters, a convenient and efficient method for sharing data in the two systems can be realized for the user, and the files to be synchronized can be synchronized to another system without destroying the data isolation performance of the two systems, so as to realize the interaction and sharing of data in the two systems, and improve the user experience.
[0139] In an exemplary embodiment, the present application further provides a computer-readable storage medium including instructions, such as a memory 120 including instructions, and the instructions can be executed by a processor 180 of a terminal device 100 to complete the above-mentioned dual-system-based file synchronization method. Optionally, the computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0140] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by the processor 180, the dual-system-based file synchronization method provided in the present application is implemented.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these 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 also intended to include these modifications and variations.
Claims
1. A file synchronization method based on dual systems, characterized in that: The method comprises: In response to a synchronization request of the foreground system for at least one file to be synchronized, the communication interface of the sharing service is called to transmit the synchronization request, wherein the synchronization request includes the path parameter of the at least one file to be synchronized; the sharing service is a service shared by the two systems; the level of the sharing service is the same as the level of the management service of the two systems, and the file data is synchronized between the two systems using a file storage space that only the sharing service can access; the sharing service can access the file storage space of the two systems; If the caller of the communication interface is the file manager of the foreground system, 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; the determination of 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 includes: determining the system identifier of the foreground system; if the system identifier indicates that the foreground system is the first system of the dual system, determining the storage path of the foreground system of the at least one file to be synchronized is the path location of the file in the first system, and determining the backup path of the at least one file to be synchronized in the background system is the path location of the file in the second system of the dual system; 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.
2. The method according to claim 1, characterized in that: The method further comprises: After the terminal device is turned on and before the dual systems are turned on, the shared service in the underlying service class is started.
3. The method according to claim 1, characterized in that: The calling of the communication interface of the shared service to transmit the synchronization request comprises: Obtain a list consisting of the path location and file name corresponding to the at least one file to be synchronized; The communication interface is called, and a path parameter indicating the list is carried in the synchronization request and passed to the sharing service.
4. The method according to claim 1, characterized in that: Before copying the at least one to-be-synchronized file to a backup path of the background system, the method further includes: If the backup path of the backend system does not exist in the backend system, creating the backup path of the backend system according to the file path creation rule of the backend system; The at least one file to be synchronized is copied to the created backup path of the background system.
5. The method according to claim 1, characterized in that The synchronization request also includes a password parameter, and the method further includes: If the caller is the file manager of the foreground system, determining whether the password parameter in the synchronization request is correct; If the password parameter is 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 backend system based on the path parameter is performed; If the password parameter is incorrect, the exit operation is executed.
6. The method according to claim 1, characterized in that The method further comprises: Displaying a synchronization guide interface for selecting a file to be synchronized, wherein the synchronization guide interface includes at least one file; In response to a user's file selection operation on the at least one file, determining the at least one file to be synchronized; The synchronization request is generated in response to a synchronization instruction to perform a synchronization operation on the at least one file to be synchronized.
7. A terminal device, characterized in that: include: Display, processor and memory; The display is used to display the screen display area; The memory is used to store the processor executable instructions; The processor is configured to execute the instructions to implement the dual-system based file synchronization method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a terminal device, the terminal device is enabled to execute the dual-system-based file synchronization method as described in any one of claims 1 to 6.
9. A computer program product, characterized in that Computer programs include: When the computer program is executed by a processor, the dual-system-based file synchronization method according to any one of claims 1 to 6 is implemented.
