Data sharing method between applications and electronic equipment

By creating a shared sandbox in electronic devices and establishing a mapping relationship between application sandbox and shared sandbox, the problem of inefficient data synchronization between multiple applications is solved, efficient data sharing and security is achieved, and the User experience.

CN119227055APending Publication Date: 2024-12-31HUAWEI TECH CO LTD

Patent Information

Application Number
CN202310799094.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The prior art has problems of resource waste and inefficiency in the data synchronization process between multiple applications, resulting in poor data redundancy and poor performance.

Method used

By creating a shared sandbox in electronic devices, a mapping relationship between the application sandbox and the shared sandbox is established, allowing different applications to write and read data under the isolation mechanism, data sharing between applications is realized, and shared identification is ensured Data security.

Benefits of technology

Reduces resource waste, improves data sharing efficiency between multiple applications, improves user experience, and reduces the probability of data being maliciously tampered with.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227055A_ABST
    Figure CN119227055A_ABST
Patent Text Reader

Abstract

A data sharing method among applications and an electronic device are applied to the electronic device and are used for reducing resource waste and improving the efficiency of data sharing among multiple applications. The method comprises the steps of running a first application in response to a first operation of a user; determining a shared sandbox corresponding to the first application; writing first data of the first application into a 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 and read the data in the shared sandbox respectively, so that storage resource and resource waste caused by partial data overlapping between the applications can be reduced, and the data sharing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] An operating system (OS) is a set of interrelated system software programs that manage and control computer operations, apply and run hardware and software resources, and provide public services to organize user interactions. Operating systems include mobile operating systems. Applications running on mobile operating systems are called applications (APPs, hereinafter referred to as applications). For each application, the system will create an exclusive application sandbox directory in the storage space, and the application can save and process its own data in the application sandbox directory; in this exclusive application sandbox directory, the application can only see the data of the current application; accordingly, the files under the exclusive 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.

[0003] In some actual operation scenarios, there is a need for data synchronization between multiple applications. For example, the step count information in application A and application B needs to be consistent; application A, application B, and application C should all conform to the same display state (such as night mode). Based on this, applications need to synchronize data through cloud communication or local inter-process communication, which will cause data redundancy and resource waste, and the efficiency and performance of data synchronization are poor. Summary of the invention

[0004] 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.

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

[0006] By adopting 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.

[0007] 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.

[0008] With such a 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.

[0009] 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.

[0010] With such a 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 an isolation mechanism exists 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.

[0011] 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.

[0012] 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.

[0013] In one possible design, the electronic device determines a 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 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.

[0014] With such a 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.

[0015] 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.

[0016] With such a design, the electronic device can directly jump to the user interfaces of different applications when an interface jump instruction is detected; 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 user experience.

[0017] 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.

[0018] 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.

[0019] 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 according to 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.

[0020] 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.

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

[0022] 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 can be implemented by hardware.

[0023] In a third aspect, the present application further provides an electronic device, including a processor, a microcontroller unit, and a memory. The memory is used 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 data sharing method between applications of the first aspect or any possible design of the first aspect.

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

[0025] In a fifth aspect, the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed 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.

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

[0027] In the seventh aspect, an embodiment of the present application also provides a chip, the chip including 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.

[0028] In an eighth aspect, an embodiment of the present application further provides a chip system, the chip system including a processor for supporting a computer device to implement the data sharing method between applications of the first aspect or any possible design of the first aspect. In one possible design, the chip system also includes a memory, the memory is used to store the necessary programs and data of the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0029] 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 here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0031] Figure 2 A software structure block diagram of an electronic device provided in an embodiment of the present application;

[0032] Figure 3a A display interface diagram of an electronic device provided in an embodiment of the present application;

[0033] Figure 3b A display interface diagram of another electronic device provided in an embodiment of the present application;

[0034] Figure 3c An example diagram of the process of putting an application on the shelf provided in an embodiment of the present application;

[0035] Figure 3d A display interface diagram of another electronic device provided in an embodiment of the present application;

[0036] Figure 4 A flowchart of a method for sharing data between applications provided in an embodiment of the present application;

[0037] Figure 5a An example diagram of a directory mapping method provided in an embodiment of the present application;

[0038] Figure 5b An example diagram of another directory mapping method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and beneficial effects of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0040] 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 may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The multiple involved in the present application refers to two or more. In addition, it should be understood that in the description of the present 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.

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

[0042] (1) Application: referred to as application, which 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 application mentioned below can be an application installed on the electronic device when it leaves the factory, or an application downloaded from the Internet or obtained from other electronic devices by the user when using the electronic device.

[0043] Among them, the application can be an instant APP (IAPP), which does not require explicit installation or uninstallation. An instant APP does not need to be explicitly installed and can be used after being installed by the system program framework background. The uninstallation of the instant APP can be controlled by the system program framework background. In some examples, the instant APP includes quick applications, mini-programs, service cards, etc.

[0044] (2) Application sandbox: Through access control mechanisms such as discretionary access control (DAC) and mandatory access control (MAC), system resources are isolated to protect the application itself and the system from attacks by malicious applications.

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

[0046] 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 may be, for example, data / data / com.xxx.xx.

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

[0048] It should be understood that for the directories of an 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.

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

[0050] In some scenarios, users install more and more applications on electronic devices, such as mobile phones. These applications will generate a large amount of data during use. There is some overlap between the data generated by different applications, so the application data will occupy a large amount of storage space. As the usage time increases, the storage space of the mobile phone will become smaller and smaller.

[0051] 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 the storage space utilization rate, and enhance the user experience.

[0052] It should be noted that the data sharing method between applications provided in the embodiments of the present application can be applicable to electronic devices, which can also be called user equipment (UE), mobile station (MS), mobile terminal (MT), etc., which is a device that provides voice or data connectivity to users, and can also be an Internet of Things device. For example, electronic devices include handheld devices with wireless connection functions, vehicle-mounted devices, etc. At present, electronic devices can be: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices (such as smart watches, smart bracelets, pedometers, etc.), vehicle-mounted 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, TVs, air conditioners, electric meters, etc.), smart robots, workshop equipment, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes, flying devices (such as smart robots, hot air balloons, drones, airplanes), etc. Electronic devices can also be devices that function as terminals in device-to-device (D2D) communication. The electronic device involved in the embodiments 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 Or other electronic devices with operating systems.

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

[0054] like Figure 1As shown, 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.

[0055] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the mobile phone 100. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The memory can save instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.

[0056] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit 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 screen 194, the camera 193, and the wireless communication module 160.

[0057] The wireless communication function of the mobile phone 100 can be realized by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization rate of the antenna.

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

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

[0060] 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.

[0061] 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 a data storage function. For example, files such as pictures and videos are stored in the external memory card.

[0062] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.

[0063] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and 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 acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the mobile phone 100, which is different from the position of the display screen 194.

[0064] The button 190 includes 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 the button input and generate a key signal input related to the user settings and function control of the mobile phone 100. The motor 191 can generate a vibration prompt. 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.

[0065] Understandably, Figure 1 The components shown do not constitute a specific limitation on the mobile phone. The mobile phone may also include more or fewer components than those shown in the figure, or combine or separate some components, or arrange the components differently.

[0066] The software system of the mobile phone 100 can adopt a layered architecture, including an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The present application embodiment 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 present application embodiment can also be This application does not limit this.

[0067] The following introduces the software structure of electronic devices in combination with different scenarios. Figure 2 1 is a software structure diagram of the mobile phone 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has 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.

[0068] The application layer can include a series of application packages. Figure 2 As shown, the application package may include desktop, settings, gallery, calendar, call, map, navigation, music, video, short message and other applications.

[0069] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, 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 the like.

[0070] The Android runtime includes the core library and the Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly uses the ahead of time (AOT) compilation technology and the just in time (JIT) compilation technology.

[0071] 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.

[0072] The native C / C++ library can include multiple functional modules, such as surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.

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

[0074] The kernel layer is the layer between hardware and software. The kernel layer includes at least the file system, display driver, Bluetooth driver, camera driver, audio driver, and sensor driver. Among them, the file system can provide file compression capabilities.

[0075] In some embodiments of the present application, the 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. The installation-free application is not limited to running on the 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 embodiments of the present application provide a simple example of the interface of the electronic device.

[0076] For example, when the electronic device is a mobile phone, Figure 3a As shown, 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 the service cards of free installation application a1, free installation application a2 and free installation application b1 can also be displayed.

[0077] For example, when the electronic device is a tablet computer, Figure 3b As shown, the main interface of the tablet computer can display application icons and service cards of free installation applications. The interface of the tablet computer can display icons of application A, application B and application C, and can also display service cards of free installation application a1, free installation application a2 and free installation application b1.

[0078] In some actual operation scenarios, there may be overlapping data between multiple applications. In a possible design, for application developers, applications can be developed by developers. For example, Figure 3c As shown, the business functions corresponding to the integrated development environment (IDE) that developers can develop include: navigation, shared bicycles and taxi-hailing; accordingly, developers can put the three business functions of navigation, shared bicycles and taxi-hailing as a complete application A on the application market, and put the shared bicycle business function and taxi-hailing business function on the application market as free installation application a1 and free installation application 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 store recommendation business functions and store navigation business functions; the functions of application C include sending short message business functions and receiving short message business functions. 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.

[0079] Based on the business functions described in the above scenario examples, the overlapping data between application A and application B includes common location information used to implement navigation functions; the overlapping data between application A, application B and application C includes application mode settings (such as whether to turn on night mode), which can keep the status information of multiple applications consistent; the overlapping data between application A and free installation application a1 includes the riding route records of shared bicycles; the overlapping data between application A and free installation application a2 includes common destinations for taxis. Based on this, in order to save the storage space occupied by applications, it is necessary to improve the storage space utilization rate by sharing data between different applications.

[0080] 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 the APP Pack, there are one or more harmony ability packages (HAP) packages. The suffix of the APP Pack is ".app". A HAP file contains the application code, resources, third-party libraries and application configuration files, and its file suffix is ​​".hap". Since the package names of the HAP packages of the APP Pack corresponding to different applications may be different, the life cycles of different applications may be completely independent when the applications are running, and different applications may run in different application sandboxes. Accordingly, the data of different applications may be completely isolated, making it difficult to achieve data sharing.

[0081] 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.

[0082] Figure 4 A flow chart of a method for sharing data between applications provided in an embodiment of the present application, the method is applicable to electronic devices, such as Figure 1 The mobile phone 100 shown in the figure, the user interface of the electronic device in the method includes but is not limited to the aforementioned Figure 3a and Figure 3b See below Figure 4 The method provided in the application example is described.

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

[0084] It should be understood that the first application may be Figure 3a or Figure 3b Any one of the application A, application B, application C, free-installation application a1, free-installation application a2 and free-installation application b1 shown is not limited in the embodiment of the present application.

[0085] In a 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.

[0086] For example, in Figure 3c In the scenario shown, the applications supported by the electronic device include application A, free-installation application a1 and free-installation application a2. Both application A and free-installation application a1 have the function of sharing bicycle business, and both application A and free-installation application a2 have the function of hailing taxi business. 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.

[0087] In one possible design, application developers can develop applications through developers, who can apply for one or more shared identifiers through the application market; developers can configure the aforementioned one or more shared identifiers in the application's signature certificate. After completing the application's development, testing and certification, the application developer formally submits the application listing application and the application's signature certificate to the application market. After the reviewer of the application market confirms that the signature certificate has passed the review, the status of the application is configured as "listed", which means that the application listing process has been completed.

[0088] Accordingly, users can download and use the application through electronic devices. The aforementioned review includes confirming that the shared identifier in the signature certificate is the shared identifier under the name of the developer. In this way, through the correspondence between the shared identifier and the developer of the application, it is prevented that other developers use the identity to steal data, thereby improving data security.

[0089] 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 present application.

[0090] 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:

[0091] Configuration method 1: The electronic device can determine that the first shared identifier is the shared identifier of the developer or developer 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 developer can correspond to multiple applications and / or multiple free installation applications, and this embodiment of the application does not limit this.

[0092] Still Figure 3c In the scenario shown, it is assumed that the developer of application A is D1, and the signing certificate of application A includes the shared identifier of D1.

[0093] Configuration mode 2: The first application and at least one target application have at least two identical business functions, specifically: business function 1 and business function 2; accordingly, the electronic device can determine that the first shared identifier is the shared identifier corresponding to business function 1 or the shared identifier corresponding to business function 2. In this way, the first application is configured with at least two first shared identifiers.

[0094] Still Figure 3cTaking the scenario shown 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.

[0095] In a possible design, before executing the action shown in step S401, the electronic device may also create a shared sandbox. In some examples, the electronic device may create a shared sandbox according to the first shared identifier.

[0096] 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 installed on the electronic device.

[0097] 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 a shared identifier of the developer D2, the electronic device may create a shared sandbox based on the shared identifier corresponding to D2. Among them, D2 may be the same as or different from the aforementioned D1, and this is not limited in the embodiments of the present application.

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

[0099] 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 developers of at least two applications (eg, the shared identifier corresponding to D1).

[0100] 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).

[0101] by Figure 3cTaking the scenario shown 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.

[0102] In the embodiment of the present application, the application sandbox of the first application is the first application sandbox, and the first application sandbox is the data storage space corresponding to the first application, so the first application can access the data corresponding to the first application sandbox. In addition, as the method illustrated in each embodiment, the first application can also access the corresponding shared sandbox.

[0103] Based on the foregoing 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.

[0104] 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.

[0105] 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.

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

[0107] For example, Figure 5bAs shown, the directory of the first application sandbox includes module directory 2 and module directory 3, and 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 respectively establish mapping relationships between multiple module directories and directories of one or more shared sandboxes, and the embodiments of the present application are not limited to this.

[0108] Optionally, the data storage space corresponding to the application in this application may be an internal storage space or an external storage space, which is not limited in the embodiments of this application. Among them, the internal storage space may be a storage space that the user needs to access through root or other methods, and the external storage space may be a storage space that the user can access through a file manager or other methods; it should be understood that the user generally cannot access the data in the internal storage space.

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

[0110] It should be understood that the second application can be Figure 3a or Figure 3b Any one of the application A, application B, application C, free-installation application a1, free-installation application a2 and free-installation application b1 shown is not limited in the embodiment of the present application.

[0111] 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.

[0112] For example, Figure 5b As shown, 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 according to the first mapping relationship and determine the shared sandbox (for example, determine the interface for accessing the shared sandbox).

[0113] 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 aforementioned same business function.

[0114] Still Figure 3c Taking the scenario shown 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.

[0115] S403: In response to a second operation of 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 operation of opening the second application by the user.

[0116] 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 that the user generates an access request for the first data through the electronic device.

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

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

[0119] In a 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 the embodiment of the present application.

[0120] For example, the electronic device may determine the second shared identifier configured in the signature certificate of the second application. The configuration method of the second shared identifier includes but is not limited to the configuration method 1 and configuration method 2 adopted by the first application, which will not be described in detail here.

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

[0122] 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 (shared bicycle business function) as application A; 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.

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

[0124] In a 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.

[0125] 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.

[0126] 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, and the second application can access the data corresponding to the directory of the second application sandbox. In addition, as the method illustrated in each embodiment, the second application can also access the corresponding shared sandbox.

[0127] 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, and 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.

[0128] Among them, 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.

[0129] For example, Figure 5a As shown, the directory of the second application sandbox includes the module directory 4, and the second mapping relationship is the mapping relationship between the module directory 4 and the directory of the shared sandbox.

[0130] For example, Figure 5b As shown, 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. The application 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. Then the electronic device may also establish a third mapping relationship, which is a mapping relationship between the directory of the third application sandbox and the directory of the shared sandbox; when the directory of the third application sandbox includes module directory 6, the third mapping relationship may be a mapping relationship between module directory 6 and shared sandbox directory 2.

[0131] exist Figure 5b In the example shown, the first application sandbox directory can be Figure 3cThe data storage space corresponding to the application A shown in FIG. 1 , the second application sandbox directory may be Figure 3c The data storage space corresponding to the free installation application a1 shown in , the third application sandbox directory can be Figure 3c The data storage space corresponding to the free installation application a2 shown in FIG.

[0132] 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.

[0133] For example, if application A includes three business functions, namely, navigation, bike-sharing, and taxi-hailing, while free-installation application a1 only includes one business function, namely, bike-sharing, then the business functions of application A completely cover the business functions of free-installation application a1. At this time, the electronic device can use the data storage space (eg, application sandbox) of free-installation application a1 as a shared sandbox.

[0134] 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 from the foreground to the background; runs the 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 sharing identifier of the second application is the same as the sharing 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.

[0135] In this way, when the shared identifiers of different applications are the same, the electronic device can directly implement the interface jump when an interface jump instruction is detected; 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.

[0136] 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 to implement user login.

[0137] Based on the aforementioned Figure 3c In the scenario shown, the account and password used to log in to the free installation application a1 may be the same as the account and password used to log in to application A. The present application embodiment provides an example of an interface for logging in / registering a second application, such as Figure 3dAs shown, it can be seen that the data to be input in the login interface includes an account number and a password. Assuming that the first application is application A and the second application is a free installation application a1, when running the free installation application a1, the electronic device can access the shared sandbox of application A and the free installation application a1 to read the account number and password, thereby completing the login. Based on this, the user does not need to enter the account number and password again when running the free installation application a1, which can reduce user operation redundancy and improve user experience.

[0138] 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 according to the configuration information.

[0139] 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 the 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 the installation-free application a2 to "Theme One" according to the configuration information. Conversely, the installation-free application a1 or the installation-free application a2 can also write configuration information to enable application A to update the configuration file, which is not limited in the embodiments of the present application.

[0140] For example, Figure 3a or Figure 3b As shown in the display interface diagram, the installation-free application appears in the form of a service card, and the electronic device can refresh 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 display 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.

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

[0142] Taking the first application as application A and the second application as free-installation application a1 as an example, assuming that initially, the background color (BackgroundColor) of application A and free-installation application a1 is blue (blue), the configuration data of the service card corresponding to free-installation application a1 includes: {"BackgroundColor":"blue"}; if the user needs to change the background color of application A and free-installation 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 free-installation 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 free-installation application a1 to red according to the first data, thereby refreshing the service card.

[0143] By adopting the data sharing method between applications provided in the embodiment of the present application, the electronic device can allow the first application and the second application to write and read data in the shared sandbox, so that the data sharing between the first application and the second application can be realized when there is an isolation mechanism in the first application sandbox, which reduces resource waste, improves the efficiency of data sharing, and thus improves the user experience. At the same time, the method does not need to achieve data synchronization through explicit cloud communication or local inter-process communication, improves the convenience of use for developers or developers, saves resources of the electronic device, and reduces the system power consumption of the electronic device.

[0144] based on Figure 4 The method provided by the embodiment shown in the figure, the present 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, there are overlapping data between APP1 and IAPP1, IAPP2 and IAPP3 respectively. Based on this, the data sharing method between applications APP1, IAPP1, IAPP2 and IAPP3 includes but is not limited to the following steps:

[0145] Step 1: When developing an application, the application developer or developer can apply for three shared identifiers through the application market, namely, 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.

[0146] 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.

[0147] 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.

[0148] 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.

[0149] 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 data1 to the shared sandbox with the sharing identifier mark 1 through the interface.

[0150] Step 5: When running IAPP1, the electronic device determines the interface for accessing the shared sandbox according to 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 sharing identifier mark 1 through the interface.

[0151] 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.

[0152] 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.

[0153] 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 described in detail here.

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

[0155] In the embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of the electronic device as the execution subject. In order to implement the functions in the methods provided by the embodiments of the present application, 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.

[0156] The embodiment of the present application provides a data sharing device between applications, which includes a module / unit for executing any possible design method of writing the first data or any possible design method of reading the first data; these modules / units can be implemented by hardware, or by executing corresponding software implementations through hardware. The relevant features of the specific implementation method of the data sharing device between applications can refer to the method part of the embodiment provided by the present application above, and will not be repeated here.

[0157] 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, wherein at least one memory stores computer program instructions, and when the electronic device is running, the microcontroller unit executes the functions executed by the electronic device in the data sharing method between applications described in the embodiment of the present application. Figure 4 S401 to S403 are executed by the electronic device in the illustrated embodiment.

[0158] Based on the above embodiments, the present application further provides an electronic device, which includes at least one memory and a microcontroller unit. The at least one memory stores computer program instructions. When the electronic device is running, the microcontroller unit executes the functions executed by the electronic device in the data sharing method between applications described in the embodiments of the present application. Figure 4 S401 to S403 are executed by the electronic device in the illustrated embodiment.

[0159] 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.

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

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

[0162] Based on the same technical concept, the embodiment of the present application further provides a chip. The chip includes a processor and a micro control unit; the processor sends accessory management information to the micro control unit, and the micro control unit implements the method provided in the above embodiment according to the accessory management information.

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

[0164] Based on the above embodiments, the 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 a possible design, the chip system also includes a memory, which is used to store the necessary programs and data for the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0165] 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.

[0166] 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.

[0167] 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 comprising 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.

[0168] 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.

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.

Citation Information

Patent Citations

  • Data sharing method and device, equipment and storage medium

    CN111190748A

  • Methods and apparatus for control of a jointly shared memory-mapped region

    CN112639741A

  • Task processing request processing method and device and block chain node equipment

    CN112789596A

  • File access method, communication system and electronic equipment

    CN115114235A

  • Multiple containers assigned to an application

    US20140366157A1

Cited By

  • Inter-application data sharing method and electronic device

    EP4650998A1