Inter-application data sharing method and electronic device

By creating a shared sandbox in electronic devices and establishing a mapping relationship between application sandbox and shared sandbox, the problem of low data synchronization efficiency between multiple applications is solved, efficient data sharing and security is achieved, and users are enhanced Experience.

WO2025001409A1PCT designated stage expired Publication Date: 2025-01-02HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/086860
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-30
Filing Date
2024-04-09
Publication Date
2025-01-02

AI Technical Summary

Technical Problem

When the prior art realizes data synchronization between multiple applications, data redundancy and resource waste are present, and efficiency and performance are poor, resulting in poor user experience.

Method used

By creating a shared sandbox in electronic devices, establishing a mapping relationship between the application sandbox and the shared sandbox, allowing different applications to write and read data under the isolation mechanism, reducing resource waste, improving data sharing efficiency, and sharing Identification ensures data security.

Benefits of technology

Data sharing between different application sandboxes is realized, resource waste is reduced, data sharing efficiency and user experience is improved, data security is enhanced, and user operation redundancy is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024086860_02012025_PF_FP_ABST
    Figure CN2024086860_02012025_PF_FP_ABST
Patent Text Reader

Abstract

An inter-application data sharing method and an electronic device, for use in reducing the waste of resources and improving the efficiency of data sharing between multiple applications. The method is applied to an electronic device, and comprises: in response to a first operation of a user, running a first application; determining a shared sandbox corresponding to the first application; writing first data of the first application into the shared sandbox, wherein the first data is used for being shared with a second application; in response to a second operation of the user, running a second application; and reading the first data from the shared sandbox. The first application and the second application can write data into and read data from the shared sandbox, respectively, so that the redundancy of stored resources and the waste of resources caused by the presence of some overlapped data between applications can be reduced, and the efficiency of data sharing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data sharing method between applications and electronic device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 30, 2023, with application number 202310799094.2 and application name “A method for sharing data between applications and an electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of terminal technology, and in particular to a method for sharing data between applications and an electronic device. Background Art

[0004] An operating system (OS) is a set of interrelated system software programs that manage and control computer operations, utilize and run hardware and software resources, and provide public services to organize user interactions. Operating systems include mobile phone operating systems. Applications running on mobile phone operating systems are called applications (APPs, hereinafter referred to as applications). For each application, the system will create a dedicated application sandbox directory in the storage space. The application can save and process its own data in the application sandbox directory. In this dedicated application sandbox directory, the application can only see the data of the current application. Correspondingly, the files under the dedicated application sandbox directory are not visible to other applications. In this way, different applications run in different application sandboxes, so the data between different applications is completely isolated, which can ensure the data security of the application, but also limits the data sharing between applications.

[0005] In some real-world scenarios, multiple apps need to synchronize data. For example, the step count information in App A and App B must be consistent, and App A, App B, and App C should all conform to the same display state (for example, night mode). To achieve this, apps must synchronize data through the cloud or local inter-process communication, which results in data redundancy and resource waste, resulting in poor synchronization efficiency and performance.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a method and electronic device for sharing data between applications, which are used to reduce resource waste and improve the efficiency of data sharing between multiple applications.

[0008] In a first aspect, an embodiment of the present application provides a method for sharing data between applications, which is applied to an electronic device and can be executed by the electronic device or by a component such as a chip, processor, or chip system within the device, and the embodiment of the present application does not limit the method. The following is an example of an electronic device executing the method, and the method includes: the electronic device runs a first application in response to a first operation of a user; the electronic device determines a shared sandbox corresponding to the first application; the electronic device writes first data of the first application into the shared sandbox; wherein the first data is used to be shared with a second application; the electronic device runs the second application in response to a second operation of the user; and the electronic device reads the first data from the shared sandbox.

[0009] Using this method, the first application and the second application in the electronic device can write and read data in the shared sandbox respectively. Therefore, when there is an isolation mechanism between the application sandboxes of different applications, data sharing between the first application and the second application can be achieved, thereby reducing resource waste and improving the efficiency of data sharing, thereby improving the user experience.

[0010] In one possible design, before the electronic device writes the first data, the method also includes: the electronic device creates a shared sandbox based on the first application and the second application; the electronic device establishes a first mapping relationship, the first mapping relationship being a mapping relationship between a directory of the first application sandbox and a directory of the shared sandbox; the first application sandbox is a data storage space corresponding to the first application.

[0011] With this design, the electronic device can create a shared sandbox and establish a mapping relationship between the directory of the first application sandbox and the directory of the shared sandbox, so that the first application can determine the shared sandbox through the directory of the first application sandbox, thereby improving the efficiency of data sharing.

[0012] In a possible design, the electronic device establishes a second mapping relationship, where the second mapping relationship is a mapping relationship between a directory of the second application sandbox and a directory of the shared sandbox; the second application sandbox is a data storage space corresponding to the second application.

[0013] With this design, the electronic device can establish a mapping relationship between the directory of the second application sandbox and the directory of the shared sandbox, so that when there is an isolation mechanism for the second application, the shared sandbox can be determined through the directory of the second application sandbox, thereby improving the efficiency of data sharing.

[0014] In one possible design, the signing certificate of the first application includes a first shared identifier, and the signing certificate of the second application includes a second shared identifier; the first shared identifier and the second shared identifier are the same; the aforementioned electronic device creates a shared sandbox, including: the electronic device creates a shared sandbox based on the first shared identifier or the second shared identifier.

[0015] With this design, a shared identifier is configured in the application, so that the identity of the application accessing the shared sandbox can be confirmed based on the shared identifier of the shared sandbox and the shared identifiers of different applications. This can reduce the probability of data in the shared sandbox being maliciously tampered with or stolen, and improve data security.

[0016] In one possible design, the aforementioned electronic device determines the shared sandbox corresponding to the first application, including: the electronic device determines the shared sandbox based on the directory of the first application sandbox and the first mapping relationship; the aforementioned electronic device reads the first data from the shared sandbox, including: the electronic device determines the shared sandbox based on the directory of the second application sandbox and the second mapping relationship; the electronic device reads the first data from the shared sandbox.

[0017] With this design, based on the first mapping relationship and the second mapping relationship, the first application and the second application can determine the shared sandbox through the directories of their respective application sandboxes, thereby writing and reading data in the shared sandbox.

[0018] In one possible design, the aforementioned electronic device runs the second application in response to the user's second operation, including: the electronic device detects an interface jump instruction in the user interface of the first application; the electronic device switches the first application from foreground operation to background operation in response to the interface jump instruction; the electronic device runs the second application and displays the user interface of the second application.

[0019] With such a design, the electronic device can directly jump to the user interface of different applications when it detects an interface jump instruction; compared with the traditional method in which the user authorizes and confirms whether to jump, when it is known that data can be shared between multiple applications, this design can reduce user operation redundancy and thus improve the user experience.

[0020] In one possible design, the user interface of the first application is a first login interface, the user interface of the second application is a second login interface, and the first data includes account data and password data.

[0021] In one possible design, the first application has the same business function as at least one target application; the second application is one of the at least one target application; before the electronic device determines the shared sandbox corresponding to the first application, the method also includes: the electronic device determines that the first data is data of the aforementioned same business function.

[0022] With this design, the first application can determine that the shared sandbox for writing the first data is the shared sandbox for the first application and the second application based on the business function to which the first data belongs, thereby preventing the first data from being read by other applications. This design can improve data security.

[0023] In one possible design, the first data is configuration information, and the method further includes: the electronic device can update a configuration file of the second application according to the configuration information when running the second application.

[0024] With this design, the first application and the second application can update the configuration file based on the aforementioned data sharing method between applications, thereby reducing user operations and improving user experience.

[0025] In the second aspect, an embodiment of the present application provides a data sharing device between applications, which includes modules / units for executing the above-mentioned first aspect or any possible design method of the first aspect; these modules / units can be implemented by hardware, or corresponding software implementations can be executed by hardware.

[0026] In a third aspect, the present application further provides an electronic device comprising a processor, a microcontroller unit, and a memory. The memory is configured to store one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor and the microcontroller unit, the electronic device executes the method for sharing data between applications described in the first aspect or any possible design of the first aspect.

[0027] In a fourth aspect, the present application further provides an electronic device comprising a microcontroller unit and a memory. The memory is configured to store one or more computer programs; when the microcontroller unit executes the one or more computer programs stored in the memory, the electronic device executes the method for sharing data between applications according to the first aspect or any possible design of the first aspect.

[0028] In the fifth aspect, the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are run on an electronic device, the electronic device executes the data sharing method between applications of the above-mentioned first aspect or any possible design of the first aspect.

[0029] In a sixth aspect, the present application also provides a computer program product, which, when running on an electronic device, enables the electronic device to execute the method of the above-mentioned first aspect or any possible design of the first aspect.

[0030] In the seventh aspect, an embodiment of the present application also provides a chip, which includes a processor and a microcontroller unit; the processor sends accessory management information to the microcontroller unit, and the microcontroller unit implements the data sharing method between applications of the above-mentioned first aspect or any possible design of the first aspect based on the accessory management information.

[0031] In an eighth aspect, an embodiment of the present application further provides a chip system, comprising a processor for supporting a computer device in implementing the data sharing method between applications of the first aspect or any one of the possible designs of the first aspect. In one possible design, the chip system further comprises a memory for storing the necessary programs and data for the computer device. The chip system may be composed of a chip, or may include a chip and other discrete devices.

[0032] The technical effects that can be achieved in any of the second to eighth aspects mentioned above can refer to the description of the technical effects that can be achieved by any possible design in the first aspect mentioned above, and the repetitions will not be discussed. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0034] FIG2 is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0035] FIG3a is a diagram of a display interface of an electronic device provided in an embodiment of the present application;

[0036] FIG3 b is a diagram of a display interface of another electronic device provided in an embodiment of the present application;

[0037] FIG3c is an example diagram of a process of putting an application on a shelf according to an embodiment of the present application;

[0038] FIG3 d is a diagram of a display interface of another electronic device provided in an embodiment of the present application;

[0039] FIG4 is a flow chart of a method for sharing data between applications according to an embodiment of the present application;

[0040] FIG5a is an example diagram of a directory mapping method provided in an embodiment of the present application;

[0041] FIG5 b is an example diagram of another directory mapping method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and beneficial effects of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0043] In the description of the embodiments of the present application, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The multiple involved in this application refers to two or more. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0044] Below, some terms in this application are explained to facilitate understanding by those skilled in the art.

[0045] (1) Application: referred to as application, is a software program that can realize one or more specific functions. Generally, multiple applications can be installed in an electronic device. For example, camera application, SMS application, email application, video application, music application, etc. The applications mentioned below can be applications installed on the electronic device when it leaves the factory, or they can be applications downloaded from the Internet or obtained from other electronic devices by the user during the use of the electronic device.

[0046] The application can be an instant app (IAPP), which does not require explicit installation or uninstallation. An IAPP does not require explicit installation and is installed by the system framework backend, allowing it to be used immediately. The system framework backend can manage the uninstallation of the IAPP. In some examples, IAPPs include quick apps, mini-programs, and service cards.

[0047] (2) Application sandbox: It isolates system resources through access control mechanisms such as discretionary access control (DAC) and mandatory access control (MAC) to protect the application itself and the system from attacks by malicious applications.

[0048] It should be noted that the application sandbox is an isolation mechanism for security purposes, preventing data from being accessed through malicious paths. Therefore, under this sandbox protection mechanism, the data visible to the application can be limited to the data stored in the application sandbox. For an application that uses an isolation mechanism, the electronic device's operating system will map a dedicated application sandbox in the internal storage space, that is, the attributes of files under the application sandbox are private. The application sandbox corresponds to the cacheDir interface for obtaining the cache directory and the filesDir interface for obtaining the file directory.

[0049] In some examples, the directory of the application sandbox includes an application file directory. The application file directory is a directory added by the electronic device in the internal storage space for the application after the application is installed. The directory can be, for example, data / data / com.xxx.xx.

[0050] In other examples, the directory of the application sandbox may also include a directory where some system files (eg, a small number of system files necessary for running the application) are located.

[0051] It should be understood that for the directories of an application's application sandbox, other applications cannot access the files in these directories. Accordingly, when an application is uninstalled, all files in the directory of the application sandbox will be removed.

[0052] (3) Listing: Upload the developed APP application to the application market. The listed application can be downloaded and used by users.

[0053] In some scenarios, users install an increasing number of apps on electronic devices, such as mobile phones. These apps generate a large amount of data during use. The data generated by different apps overlaps, so the app data takes up a large amount of storage space. As the phone's storage space decreases over time, the phone's storage space becomes less and less.

[0054] In view of this, the present application provides a method for sharing data between applications, in which overlapping data between multiple applications can be shared to save the storage space occupied by the applications, improve storage space utilization, and enhance user experience.

[0055] It should be noted that the data sharing method between applications provided in the embodiments of the present application can be applied to electronic devices, which can also be referred to as user equipment (UE), mobile station (MS), mobile terminal (MT), etc., which are devices that provide voice or data connectivity to users, and can also be Internet of Things devices. For example, electronic devices include handheld devices with wireless connection capabilities, vehicle-mounted devices, etc. Currently, electronic devices can include: mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), wearable devices (such as smart watches, smart bracelets, pedometers, etc.), in-vehicle devices (such as cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed trains, etc.), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, smart home devices (such as refrigerators, televisions, air conditioners, electricity meters, etc.), intelligent robots, workshop equipment, wireless terminals in self-driving cars, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, and flying devices (such as intelligent robots, hot air balloons, drones, airplanes). Electronic devices can also be devices that function as terminals in device-to-device (D2D) communication. The electronic device involved in the embodiment of the present application may be a foldable electronic device, such as a foldable mobile phone, a foldable tablet computer, etc., and the present application does not limit this. In addition, exemplary embodiments of electronic devices include but are not limited to devices equipped with Hongmeng Or other electronic devices with operating systems.

[0056] The following uses a mobile phone as an example to introduce the structure of an electronic device.

[0057] As shown in Figure 1, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0058] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the mobile phone 100. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. The processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. This memory may store instructions or data that have just been used or are being recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces the processor 110's waiting time, and thus improves system efficiency.

[0059] The USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transfer data between the mobile phone 100 and peripheral devices. The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[0060] The wireless communication functions of mobile phone 100 are implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, and a baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.

[0061] Display screen 194 is used to display the application interface, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, mobile phone 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0062] The camera 193 is used to capture still images or videos. The camera 193 may include a front camera and a rear camera.

[0063] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, and software code of at least one application (such as iQiyi application, WeChat application, etc.). The data storage area can store data (such as images, videos, etc.) generated during the use of the mobile phone 100. In addition, the internal memory 121 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, a universal flash storage (UFS), etc.

[0064] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as pictures and videos can be saved in the external memory card.

[0065] The mobile phone 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0066] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the mobile phone 100, in a location different from that of the display screen 194.

[0067] The buttons 190 include a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The mobile phone 100 can receive button input and generate key signal input related to the user settings and function control of the mobile phone 100. The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the mobile phone 100.

[0068] It is understandable that the components shown in FIG1 do not constitute a specific limitation on the mobile phone. The mobile phone may also include more or fewer components than shown in the figure, or combine or split some components, or arrange the components differently.

[0069] The software system of the mobile phone 100 can adopt a layered architecture, including an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the mobile phone 100. It should be understood that the system in the embodiment of the present application can also be This application does not limit this.

[0070] The following introduces the software structure of electronic devices in combination with different scenarios. Figure 2 is a block diagram of the software structure of the mobile phone 100 in an embodiment of the present application. 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 is divided into five layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime (Android runtime, ART) and the native C / C++ library, the hardware abstract layer (hardware abstract layer, HAL) and the kernel layer.

[0071] The application layer can include a series of application packages. As shown in Figure 2, the application package can include applications such as desktop, settings, gallery, calendar, call, map, navigation, music, video, short message, etc.

[0072] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 2, the application framework layer may include a space compression manager, a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, and so on.

[0073] The Android runtime consists of the core libraries and the Android runtime. The Android runtime is responsible for converting source code into machine code. It primarily utilizes ahead-of-time (AOT) and just-in-time (JIT) compilation technologies.

[0074] The core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks, etc. The core library provides an API for users to develop Android applications.

[0075] Native C / C++ libraries can include multiple functional modules, such as surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.

[0076] The hardware abstraction layer runs in user space, encapsulates kernel layer drivers, and provides a calling interface to the upper layer.

[0077] The kernel layer is the layer between hardware and software. It includes at least the file system, display driver, Bluetooth driver, camera driver, audio driver, and sensor driver. The file system provides file compression capabilities.

[0078] In some embodiments of the present application, an electronic device supports multiple applications, such as one or more of the following applications: Application A, Application B, Application C, Installation-Free Application a1, Installation-Free Application a2, and Installation-Free Application b1. Installation-Free Applications are not limited to running on an application host (desktop, service center, etc.) in the form of card-type desktop elements such as service cards and desktop widgets. For ease of understanding, the present application provides a simple example of the interface of the electronic device.

[0079] For example, when the electronic device is a mobile phone, as shown in Figure 3a, the main interface of the mobile phone can display application icons and service cards of free-installation applications, that is, the icons of application A, application B and application C can be displayed on the interface of the mobile phone, and service cards of free-installation application a1, free-installation application a2 and free-installation application b1 can also be displayed.

[0080] For another example, when the electronic device is a tablet computer, as shown in FIG3b , the main interface of the tablet computer can display application icons and service cards for installation-free applications, and the interface of the tablet computer can display icons for application A, application B, and application C, and can also display service cards for installation-free application a1, installation-free application a2, and installation-free application b1.

[0081] In some scenarios of actual operation, there may be overlapping data between multiple applications. In one possible design, for application developers, applications can be developed through developers. For example, as shown in Figure 3c, the business functions corresponding to the integrated development environment (IDE) that developers can develop include: navigation, shared bicycles and taxis; accordingly, developers can put the three business functions of navigation, shared bicycles and taxis on the application market as a complete application A, and put the shared bicycle business function and taxi business function on the application market as free installation applications a1 and free installation applications a2 respectively; it should be understood that the applications (including free installation applications) put on the application market are available for users to download and use. For example, application B includes a store recommendation business function and a store navigation business function; the function of application C includes a text message sending business function and a text message receiving business function. It should be understood that the developers of application B and application C can be the same as or different from the developer of application A, and this embodiment of the application does not limit this.

[0082] Based on the business functions described in the aforementioned scenario examples, the overlapping data between Application A and Application B includes commonly used location information for implementing navigation functions; the overlapping data between Application A, Application B, and Application C includes application mode settings (for example, whether to enable night mode), which can keep the status information of multiple applications consistent; the overlapping data between Application A and the free-to-install application a1 includes shared bicycle riding route records; and the overlapping data between Application A and the free-to-install application a2 includes commonly used taxi destinations. Based on this, in order to save the storage space occupied by applications, it is necessary to improve storage space utilization by sharing data between different applications.

[0083] However, in some operating systems, the organization method for putting applications on the application market can be: a single application is packaged into an independent application package (APP Pack) and installed separately. In an APP Pack, one or more harmony ability packages (HAPs) are included. The APP Pack has a ".app" suffix. A HAP file contains the application's code, resources, third-party libraries, and application configuration files, and has a ".hap" suffix. Because the HAP packages in the APP Packs corresponding to different applications may have different names, the lifecycles of different applications may be completely independent when the applications are running, and different applications may run in different application sandboxes. Consequently, the data of different applications may be completely isolated, making data sharing difficult.

[0084] The embodiment of the present application provides a method for sharing data between applications, so as to realize data sharing between different applications, reduce resource waste, and improve the efficiency of data sharing between multiple applications.

[0085] FIG4 is a flow chart of a method for sharing data between applications according to an embodiment of the present application. This method is applicable to an electronic device, such as the mobile phone 100 shown in FIG1 . The user interface of the electronic device in this method includes, but is not limited to, FIG3 a and FIG3 b . The method according to the embodiment of the present application will be described below with reference to FIG4 .

[0086] S401: The electronic device runs a first application in response to a first operation of the user. For example, the first operation is an opening operation of the first application by the user.

[0087] It should be understood that the first application can be any one of application A, application B, application C, installation-free application a1, installation-free application a2 and installation-free application b1 as shown in Figure 3a or Figure 3b, and this embodiment of the application does not limit this.

[0088] In one possible design, the first application and at least one target application may have the same business function. It should be understood that the same business function may have overlapping data in different applications.

[0089] For example, in the scenario shown in Figure 3c, the applications supported by the electronic device include application A, free-installation application a1 and free-installation application a2. Application A and free-installation application a1 both have the shared bicycle business function, and application A and free-installation application a2 both have the taxi business function; in the embodiment of the present application, it is assumed that the first application is application A, then at least one target application includes free-installation application a1 and free-installation application a2.

[0090] In one possible design, app developers can develop apps through developers, who can then apply for one or more shared identifiers through the app market. Developers can configure these shared identifiers in the app's signature certificate. After completing the app's development, testing, and certification, the app developer formally submits the app listing application and the app's signature certificate to the app market. Once the app market's reviewers confirm that the signature certificate has passed review, they configure the app's status to "listed," completing the listing process.

[0091] Accordingly, users can download and use the application through their electronic devices. The aforementioned review includes confirming that the shared identifier in the signing certificate is the shared identifier of the developer. This correspondence between the shared identifier and the application developer prevents other developers from impersonating their identities and stealing data, thereby improving data security.

[0092] Based on this design, the signature certificate of the first application includes the first shared identifier. It should be understood that the signature certificate of the first application may include multiple first shared identifiers, which is not limited in this embodiment of the application.

[0093] For example, when the first application is launched, the electronic device can determine the first shared identifier configured in the signature certificate of the first application. The configuration method of the first shared identifier includes but is not limited to the following configuration method 1 and configuration method 2:

[0094] Configuration Method 1: The electronic device may determine that the first shared identifier is the shared identifier of the developer or manufacturer of the first application. In this way, the signature certificate of the first application includes a first shared identifier. It should be understood that the same developer or manufacturer may correspond to multiple applications and / or multiple installation-free applications, and this embodiment of the application does not limit this.

[0095] Still taking the scenario shown in FIG. 3 c as an example, it is assumed that the developer of application A is D1, and the signing certificate of application A includes the shared identifier of D1.

[0096] Configuration method 2: The first application and at least one target application have at least two identical service functions, specifically service function 1 and service function 2. Accordingly, the electronic device can determine the first shared identifier as the shared identifier corresponding to service function 1 or the shared identifier corresponding to service function 2. In this way, the first application is configured with at least two first shared identifiers.

[0097] Still taking the scenario shown in Figure 3c as an example, application A and the installation-free application a1 have the same business function (shared bicycle business function), and application A and the installation-free application a2 have the same business function (taxi business function); the electronic device can determine that the first shared identifier is the shared identifier corresponding to the shared bicycle business function or the shared identifier corresponding to the taxi business function.

[0098] In a possible design, before executing the action shown in step S401, the electronic device may further create a shared sandbox. In some examples, the electronic device may create a shared sandbox based on the first shared identifier.

[0099] Optionally, the electronic device may trigger the aforementioned action of creating a shared sandbox when detecting a creation instruction; or, the electronic device may trigger the aforementioned action of creating a shared sandbox when the first application and at least one target application with the same shared identifier are both installed on the electronic device.

[0100] In some examples, when an electronic device receives a creation instruction (i.e., detects a creation instruction), the electronic device may trigger the aforementioned action of creating a shared sandbox; accordingly, after triggering the action of creating a shared sandbox, the electronic device may create a shared sandbox based on multiple applications corresponding to the creation instruction. For example, assuming that the signature certificates of multiple applications corresponding to the creation instruction all include the shared identifier of the developer D2, the electronic device may create a shared sandbox based on the shared identifier corresponding to D2. Wherein, D2 may be the same as or different from the aforementioned D1, and this is not limited in the embodiments of the present application.

[0101] In other examples, when at least two applications installed on an electronic device have the same shared identifier, the electronic device triggers the aforementioned action of creating a shared sandbox for data sharing between the at least two applications. The shared identifier is the shared identifier of the shared sandbox.

[0102] When the shared identifier of the application adopts the aforementioned configuration mode 1, the shared identifier of the shared sandbox may be the shared identifier corresponding to the developers or manufacturers of at least two applications (eg, the shared identifier corresponding to D1).

[0103] When the shared identifier of the application adopts the aforementioned configuration mode 2, the shared identifier of the shared sandbox may be a shared identifier corresponding to the same business function of at least two applications (eg, a shared identifier corresponding to business function 1).

[0104] Taking the scenario shown in Figure 3c as an example, when application A and the installation-free application a1 are both installed on the electronic device, and application A and the installation-free application a1 have the same shared identifier, the action of creating a shared sandbox is triggered; the electronic device can determine that application A and the installation-free application a1 have the same business function (shared bicycle business function), that is, application A and the installation-free application a1 have the same shared identifier (the shared identifier corresponding to the shared bicycle business function); the electronic device can also determine that the shared identifier of the shared sandbox is the shared identifier corresponding to the shared bicycle business function; accordingly, the electronic device can create a shared sandbox based on the shared identifier corresponding to the shared bicycle business function.

[0105] In the embodiments of the present application, the application sandbox of the first application is the first application sandbox, which is the data storage space corresponding to the first application. Therefore, the first application can access the data corresponding to the first application sandbox. In addition, as illustrated in the methods of each embodiment, the first application can also access the corresponding shared sandbox.

[0106] Based on the above design, before executing the action shown in step S401, the electronic device can also determine that the shared identifier of the first application is the same as the shared identifier of the shared sandbox; the electronic device can also establish a first mapping relationship, which is a mapping relationship between the directory of the first application sandbox and the directory of the shared sandbox.

[0107] For example, the electronic device can also determine that the shared identifier of application A (the shared identifier of D1) is the same as the shared identifier of the shared sandbox (the shared identifier corresponding to D2); or, the electronic device can determine that the shared identifier of application A and the shared identifier of the shared sandbox are both shared identifiers corresponding to the shared bicycle business function.

[0108] Optionally, the directory of the first application sandbox includes at least one module directory, and the electronic device establishes a mapping relationship between the module directory and the directory of the shared sandbox, that is, establishes a first mapping relationship.

[0109] For example, the directory of the first application sandbox includes one or more HAP directories, which can be used as module directories. As shown in Figure 5a, the directory of the first application sandbox includes module directory 1, and the first mapping relationship is the mapping relationship between module directory 1 and the directory of the shared sandbox.

[0110] For another example, as shown in Figure 5b, the directory of the first application sandbox includes module directory 2 and module directory 3. The electronic device includes two shared sandboxes, corresponding to shared sandbox directory 1 and shared sandbox directory 2, respectively. The first mapping relationship is the mapping relationship between module directory 2 and shared sandbox directory 1, or the first mapping relationship is the mapping relationship between module directory 3 and shared sandbox directory 2. It should be understood that the electronic device can establish mapping relationships between multiple module directories and directories of one or more shared sandboxes, respectively, and this embodiment of the application is not limited to this.

[0111] Optionally, the data storage space corresponding to the application in this application can be internal storage space or external storage space, which is not limited in the embodiments of this application. The internal storage space can be a storage space that the user needs to be rooted to access, and the external storage space can be a storage space that the user can access through a file manager or other means. It should be understood that users generally cannot access data in the internal storage space.

[0112] S402: The electronic device determines a shared sandbox corresponding to the first application, and writes first data into the shared sandbox, wherein the first data is shared with the second application.

[0113] It should be understood that the second application can be any one of application A, application B, application C, installation-free application a1, installation-free application a2 and installation-free application b1 as shown in Figure 3a or Figure 3b, and this embodiment of the application does not limit this.

[0114] In some examples, the electronic device may determine the shared sandbox based on the directory of the first application sandbox and the first mapping relationship, thereby writing the first data into the shared sandbox.

[0115] For example, as shown in Figure 5b, assuming that the first mapping relationship is a mapping relationship between module directory 2 and shared sandbox directory 1, the electronic device can find module directory 2 in the directory of the first application sandbox based on the first mapping relationship and determine the shared sandbox (for example, determine the interface for accessing the shared sandbox).

[0116] Optionally, assuming that the first application and the second application have the same business function, before the electronic device executes the action shown in step S402, the electronic device may also determine that the first data is data of the same business function.

[0117] Still taking the scenario shown in FIG3c as an example, the electronic device may determine that the first data is data of the aforementioned shared bicycle service function, or the electronic device may determine that the first data is data of the aforementioned taxi service function.

[0118] S403: In response to a second operation by the user, the second application is run; the electronic device reads the first data from the shared sandbox. For example, the second operation is an opening operation of the second application by the user.

[0119] Optionally, before reading the first data from the shared sandbox, the electronic device may detect a third operation of the user. For example, the third operation is a user generating an access request for the first data through the electronic device.

[0120] In one possible design, the second application is one of the at least one target application mentioned above.

[0121] Still taking the scenario shown in Figure 3c as an example, application A and the free-installation application a1 both have the shared bicycle business function, and application A and the free-installation application a2 both have the taxi business function; assuming that the first application is application A, the second application can be the free-installation application a1 or the free-installation application a2.

[0122] In one possible design, the signature certificate of the second application includes the second shared identifier. It should be understood that the signature certificate of the second application may include multiple second shared identifiers, which is not limited in this embodiment of the present application.

[0123] For example, the electronic device may determine the second shared identifier configured in the signature certificate of the second application. Configuration methods of the second shared identifier include but are not limited to configuration method 1 and configuration method 2 adopted by the aforementioned first application, which will not be repeated here.

[0124] For example, when using configuration method 1, assuming that the second application is the installation-free application a1, and the developer of the installation-free application a1 is D3, the electronic device can determine that the second shared identifier corresponding to the installation-free application a1 is the shared identifier of D3. Wherein, D3 can be the same as or different from the aforementioned D1 and D2, and this embodiment of the application does not limit this.

[0125] For example, when configuration method two is adopted, assuming that the second application is the installation-free application a1, and the installation-free application a1 has the same business function as application A (shared bicycle business function); the electronic device can determine that the second shared identifier corresponding to the installation-free application a1 is the shared identifier corresponding to the shared bicycle business function.

[0126] In some examples, the second shared identifier is the same as the first shared identifier. Before executing the action shown in step S401, the electronic device may create a shared sandbox according to the second shared identifier.

[0127] In one possible design, before executing the action shown in step S403, the electronic device may determine that the sharing identifier of the second application is the same as the sharing identifier of the shared sandbox.

[0128] For example, the electronic device can also determine that the shared identifier of the installation-free application a1 (the shared identifier of D3) is the same as the shared identifier of the shared sandbox (the shared identifier corresponding to D2); or, the electronic device can determine that the shared identifier of the installation-free application a1 and the shared identifier of the shared sandbox are both shared identifiers corresponding to the shared bicycle business function.

[0129] In the embodiment of the present application, the data storage space corresponding to the second application is the second application sandbox. The second application sandbox is the data storage space corresponding to the second application. The second application can access the data corresponding to the directory of the second application sandbox. In addition, as illustrated in the methods of each embodiment, the second application can also access the corresponding shared sandbox.

[0130] Based on the above design, before executing the action shown in step S403, the electronic device can also determine that the shared identifier of the second application is the same as the shared identifier of the shared sandbox; the electronic device can also establish a second mapping relationship, where the second mapping relationship is a mapping relationship between the directory of the second application sandbox and the directory of the shared sandbox. Accordingly, when executing the action shown in step S403, the electronic device can determine the shared sandbox (for example, determine the interface for accessing the shared sandbox) based on the directory of the second application sandbox and the second mapping relationship.

[0131] The directory of the second application sandbox may include at least one module directory, and the electronic device establishes a mapping relationship between the module directory and the directory of the shared sandbox, that is, establishes a second mapping relationship. In the embodiment of the present application, the method for the electronic device to establish the second mapping relationship may be the same as or different from the method for establishing the first mapping relationship, and the embodiment of the present application does not limit this.

[0132] For example, as shown in FIG5 a , the directory of the second application sandbox includes the module directory 4 , and the second mapping relationship is a mapping relationship between the module directory 4 and the directory of the shared sandbox.

[0133] For another example, as shown in Figure 5b, the directory of the second application sandbox includes module directory 5, and the second mapping relationship is the mapping relationship between module directory 5 and shared sandbox directory 1. If the applications supported by the electronic device may also include a third device, and the data storage space corresponding to the third application is a third application sandbox, the electronic device may further establish a third mapping relationship, which is the mapping relationship between the directory of the third application sandbox and the directory of the shared sandbox. If the directory of the third application sandbox includes module directory 6, the third mapping relationship may be the mapping relationship between module directory 6 and shared sandbox directory 2.

[0134] In the example shown in Figure 5b, the first application sandbox directory can be the data storage space corresponding to the application A shown in Figure 3c, the second application sandbox directory can be the data storage space corresponding to the installation-free application a1 shown in Figure 3c, and the third application sandbox directory can be the data storage space corresponding to the installation-free application a2 shown in Figure 3c.

[0135] Optionally, when the data storage space corresponding to the second application is a shared sandbox, or in other words, when the second application sandbox is the shared sandbox, the second application can directly access the data in the shared sandbox.

[0136] For example, if application A includes navigation, bike-sharing, and taxi-hailing services, while free-to-install application a1 only includes bike-sharing, then the services of application A completely overwrite those of free-to-install application a1. In this case, the electronic device can use the data storage space (e.g., application sandbox) of free-to-install application a1 as a shared sandbox.

[0137] In one possible design, when running a first application, the electronic device detects an interface jump instruction in the user interface of the first application; in response to the interface jump instruction, the electronic device switches the user interface from the first application running from the foreground to the background; runs a second application, and displays the user interface of the second application. In other words, when the target jump application corresponding to the interface jump instruction is the second application, and the shared identifier of the second application is the same as the shared identifier of the first application, the electronic device can directly jump the user interface from the interface of the first application to the interface of the second application without user authorization; otherwise, the electronic device needs to jump the user interface from the interface of the first application to the interface of the second application after obtaining user authorization.

[0138] In this way, when the shared identifiers of different applications are the same, the electronic device can directly jump the interface when it detects the interface jump instruction; compared with the traditional method in which the user authorizes and confirms whether to jump, when multiple applications have the same business functions, the user's required operation steps can be reduced, thereby improving the user experience.

[0139] Optionally, the user interface of the first application may be a first login interface, the user interface of the second application may be a second login interface, and the first data may include account data and password data. Accordingly, after displaying the second login interface of the second application, the electronic device may read the account data and password data from the shared sandbox, thereby enabling user login.

[0140] Based on the scenario shown in the aforementioned FIG3c, the account and password used to log in to the installation-free application a1 may be the same as those used to log in to application A. The embodiment of the present application provides an example diagram of an interface for logging in / registering a second application, as shown in FIG3d. It can be seen that the data to be entered in the login interface includes an account and a password. Assuming that the first application is application A and the second application is the installation-free application a1, when running the installation-free application a1, the electronic device can read the account and password by accessing the shared sandbox of application A and the installation-free application a1, thereby completing the login. Based on this, the user does not need to enter the account and password again when running the installation-free application a1, which can reduce user operation redundancy and thus improve the user experience.

[0141] In one possible design, when the first data is configuration information, the electronic device runs the second application and updates a configuration file of the second application based on the configuration information.

[0142] In some examples, the first application is application A, and the second application is installation-free application a1 or installation-free application a2. For example, when running application A, the first data written by the electronic device to the shared sandbox is: the theme style selects "Theme One", and the installation-free application a1 or installation-free application a2 can read the first data from the shared sandbox: the theme style selects "Theme One". Assuming that the first data is configuration information, the electronic device can also configure the corresponding theme style of the installation-free application a1 or installation-free application a2 to "Theme One" based on the configuration information. Conversely, the installation-free application a1 or installation-free application a2 can also write configuration information to enable application A to update the configuration file, which is not limited in this embodiment of the present application.

[0143] For example, as shown in the display interface diagram shown in FIG3a or FIG3b, the installation-free application appears in the form of a service card, and the electronic device can realize the refresh of the service card through the above-mentioned design. Among them, the service card is a service form that can provide a more intuitive and concise visual component than the application (APP), and directly presents the services or content that the user cares about most to the user in the form of an interactive service card. In addition, the service card can also track the changes of services or content over time and display the latest services or content. For example, the service card corresponding to the weather APP displays more timely weather information. Service cards can be embedded in various APPs or interactive scenarios to better meet user needs.

[0144] In some examples, the scenarios in which service cards are applicable may also be applicable to small components, widgets, or the like.

[0145] Taking the first application as application A and the second application as the installation-free application a1 as an example, assuming that initially, the background color (BackgroundColor) of application A and the installation-free application a1 is blue, the configuration data of the service card corresponding to the installation-free application a1 includes: {"BackgroundColor":"blue"}; if the user needs to change the background color of application A and the installation-free application a1 to red, when application A is running, the electronic device can write the first data for indicating that the background color is changed to red to the shared sandbox through the method shown in the aforementioned step S402, and the first data includes: {"BackgroundColor":"red"}; accordingly, when the installation-free application a1 is running, the electronic device can read the first data from the shared sandbox through the method shown in the aforementioned step S403; further, the electronic device can also update the background color of the service card of the installation-free application a1 to red based on the first data, thereby refreshing the service card.

[0146] By using the inter-application data sharing method provided in the embodiments of the present application, an electronic device can enable a first application and a second application to write and read data in a shared sandbox. Thus, data sharing between the first application and the second application can be achieved even when an isolation mechanism exists in the first application sandbox, thereby reducing resource waste, improving data sharing efficiency, and thus enhancing the user experience. Furthermore, this method does not require explicit cloud communication or local inter-process communication to achieve data synchronization, which improves the convenience of use for developers and manufacturers, saves electronic device resources, and reduces the system power consumption of the electronic device.

[0147] Based on the method provided in the embodiment shown in FIG4 , this application also provides an example of data sharing. In this example, the applications supported by the electronic device include: APP1, IAPP1, IAPP2, and IAPP3. Among them, APP1 has overlapping data with IAPP1, IAPP2, and IAPP3. Based on this, the data sharing method between applications APP1, IAPP1, IAPP2, and IAPP3 includes but is not limited to the following steps:

[0148] Step 1: When developing an application, the application developer or developer can apply for three shared identifiers through the application market, namely identifier (mark) 1, mark 2 and mark 3; the developer or developer configures mark 1, mark 2 and mark 3 in APP1 through an electronic device, configures mark 1 in IAPP1, configures mark 2 in IAPP2, and configures mark 3 in IAPP3.

[0149] Step 2: After APP1, IAPP1, IAPP2 and IAPP3 complete the listing process, the electronic device creates three shared sandboxes according to the shared identifiers configured in APP1, IAPP1, IAPP2 and IAPP3. The shared identifiers of the three shared sandboxes are mark 1, mark 2 and mark 3 respectively.

[0150] Step 3: The electronic device verifies the consistency between the shared identifiers of the three shared sandboxes and the shared identifier of APP1, the shared identifier of IAPP1, the shared identifier of IAPP2 and the shared identifier of IAPP3 respectively. If the verification results are consistent, a mapping relationship is established between the three shared sandboxes and the four application sandboxes respectively.

[0151] In some examples, the electronic device can create interfaces for accessing the aforementioned three shared sandboxes respectively through the mapping relationship between any shared sandbox directory and the sandbox directory of APP1, the sandbox directory of IAPP1, the sandbox directory of IAPP2, and the sandbox directory of IAPP3.

[0152] Step 4: When running APP1, the electronic device determines that data 1 is the overlapping data of APP1 and IAPP1; the electronic device determines the interface for accessing the shared sandbox based on the mapping relationship between the sandbox directory of APP1 and the directory of the shared sandbox with the sharing identifier mark 1; the electronic device writes data 1 to the shared sandbox with the sharing identifier mark 1 through the interface.

[0153] Step 5: When running IAPP1, the electronic device determines the interface for accessing the shared sandbox based on the mapping relationship between the sandbox directory of IAPP1 and the directory of the shared sandbox; the electronic device reads data 1 from the shared sandbox with the shared identifier mark 1 through the interface.

[0154] Step 6: Assuming that the content of data 1 is configuration information, for example, data 1 is used to configure the night mode, when running IAPP1, the electronic device can also update the configuration of IAPP1 to the night mode according to data 1.

[0155] Step 7: When running APP1, the electronic device detects an interface jump instruction, and the target jump application corresponding to the interface jump instruction is IAPP1; since the shared identifier of APP1 and the shared identifier of IAPP1 both include mark 1, the electronic device responds to the interface jump instruction and jumps the user interface from the interface of APP1 to the interface of IAPP1.

[0156] Conversely, IAPP1 can also write data so that APP1 can read the data. The specific solution can be understood by analogy with the above embodiments and will not be repeated here.

[0157] It should be understood that step 6 and step 7 are optional steps, and the electronic device may determine whether to perform them according to the specific embodiment.

[0158] In the embodiments provided in the present application above, the methods provided in the embodiments of the present application are introduced from the perspective of an electronic device as an execution subject. In order to implement the various functions in the methods provided in the embodiments of the present application above, the electronic device may include a hardware structure and / or a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0159] An embodiment of the present application provides an inter-application data sharing device, comprising modules / units for executing any of the aforementioned methods for writing first data or any of the aforementioned methods for reading first data; these modules / units may be implemented in hardware, or may be implemented in software through hardware. The relevant features of the specific implementation of the inter-application data sharing device can be found in the method section of the embodiment provided above and will not be further elaborated here.

[0160] Based on the same technical concept, the present application also provides an electronic device, which includes at least one processor, at least one memory, and a microcontroller unit. The at least one memory unit stores computer program instructions. When the electronic device is running, the microcontroller unit performs the functions performed by the electronic device in the method for sharing data between applications described in the embodiments of the present application. For example, steps S401 to S403 performed by the electronic device in the embodiment shown in FIG. 4 are performed.

[0161] Based on the above embodiments, the present application further provides an electronic device, comprising at least one memory and a microcontroller unit, wherein the at least one memory unit stores computer program instructions, and when the electronic device is running, the microcontroller unit executes the functions performed by the electronic device in the method for sharing data between applications described in the embodiments of the present application, such as executing S401 to S403 performed by the electronic device in the embodiment shown in FIG.

[0162] Based on the same technical concept, an embodiment of the present application also provides a computer storage medium, wherein the computer-readable storage medium includes a computer program. When the computer program runs on an electronic device, the electronic device executes the method provided in the above embodiment.

[0163] The storage medium may be any available medium that can be accessed by a computer. By way of example and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.

[0164] Based on the same technical concept, an embodiment of the present application further provides a computer program product, which includes instructions. When the instructions are executed, the computer executes the method provided in the above embodiment.

[0165] Based on the same technical concept, the present application also provides a chip. The chip includes a processor and a microcontroller unit. The processor sends accessory management information to the microcontroller unit, and the microcontroller unit implements the method provided in the above embodiment according to the accessory management information.

[0166] Based on the above embodiments, embodiments of the present application further provide a chip configured to read a computer program stored in a memory to implement the methods provided in the above embodiments. Optionally, the chip may include a processor and a memory, wherein the processor is coupled to the memory to read the computer program stored in the memory to implement the methods provided in the above embodiments.

[0167] Based on the above embodiments, embodiments of the present application provide a chip system, which includes a processor for supporting a computer device to implement the functions involved in the electronic device in the above embodiments. In one possible design, the chip system also includes a memory for storing the necessary programs and data for the computer device. The chip system can be composed of a chip or can include a chip and other discrete devices.

[0168] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can 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 can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0169] 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 flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart 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 produce a device for implementing the functions specified in one or more flow charts and / or one or more boxes in the block diagram.

[0170] These computer program instructions may also be stored in a computer-readable memory that can direct 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 a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0171] 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, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

Claims

1. A data sharing method between applications, applied to an electronic device, characterized in that: The method comprises: In response to a first operation by a user, running a first application; Determine a shared sandbox corresponding to the first application; write first data of the first application into the shared sandbox; wherein the first data is used to be shared with the second application; In response to a second operation of the user, the second application is run; and the first data is read from the shared sandbox.

2. The method according to claim 1, characterized in that The method further comprises: Creating the shared sandbox based on the first application and the second application; Establishing a first mapping relationship, where the first mapping relationship is a mapping relationship between a directory of the first application sandbox and a directory of the shared sandbox; the first application sandbox is a data storage space corresponding to the first application; A second mapping relationship is established, where the second mapping relationship is a mapping relationship between a directory of the second application sandbox and a directory of the shared sandbox; the second application sandbox is a data storage space corresponding to the second application.

3. The method according to claim 2, characterized in that The signing certificate of the first application includes a first shared identifier, and the signing certificate of the second application includes a second shared identifier; The first shared identifier is the same as the second shared identifier; The creating the shared sandbox includes: The shared sandbox is created according to the first shared identifier or the second shared identifier.

4. The method according to claim 2 or 3, characterized in that The determining a shared sandbox corresponding to the first application includes: Determining the shared sandbox according to the directory of the first application sandbox and the first mapping relationship; The reading the first data from the shared sandbox includes: Determining the shared sandbox according to the directory of the second application sandbox and the second mapping relationship; The first data is read from the shared sandbox.

5. The method according to any one of claims 1 to 4, characterized in that: The step of running the second application in response to a second operation of the user includes: An interface jump instruction is detected in the user interface of the first application; In response to the interface jump instruction, switching the first application from foreground operation to background operation; The second application is run, and a user interface of the second application is displayed.

6. The method according to claim 5, characterized in that The user interface of the first application is a first login interface, the user interface of the second application is a second login interface, and the first data includes account data and password data.

7. The method according to any one of claims 1 to 6, characterized in that: The first application and at least one target application have the same business function; The second application is one of the at least one target application; Before determining the shared sandbox corresponding to the first application, the method further includes: Determine that the first data is data of the same business function.

8. The method according to any one of claims 1 to 7, characterized in that: The first data is configuration information, and the method further includes: When the second application is run, a configuration file of the second application is updated according to the configuration information.

9. An electronic device, characterized in that: including a processor, a microcontroller unit and a memory; The memory stores one or more computer programs; When one or more computer programs stored in the memory are executed by the processor and the micro control unit, the electronic device is enabled to perform the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.

11. A chip, characterized in that: The chip includes a processor and a micro control unit. The processor sends accessory management information to the micro control unit. The micro control unit implements the method according to any one of claims 1 to 8 according to the accessory management information.

12. A computer program product, characterized in that When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 8.

13. A data sharing device between applications, characterized in that: Comprising modules for executing the method as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Cross-application data sharing method and webpage browser

    CN106919634A

  • Data transmission method between hosting applications

    CN110083465A

  • Data sharing method and device, equipment and storage medium

    CN111190748A

  • Content Sharing Between Sandboxed Apps

    US20160085602A1