WO2021104259A1 - Method and terminal for data sharing between fast application and native application - Google Patents

Method and terminal for data sharing between fast application and native application Download PDF

Info

Publication number
WO2021104259A1
WO2021104259A1 PCT/CN2020/131133 CN2020131133W WO2021104259A1 WO 2021104259 A1 WO2021104259 A1 WO 2021104259A1 CN 2020131133 W CN2020131133 W CN 2020131133W WO 2021104259 A1 WO2021104259 A1 WO 2021104259A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
quick
fast
native
access agent
Prior art date
Application number
PCT/CN2020/131133
Other languages
French (fr)
Chinese (zh)
Inventor
舒玉华
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021104259A1 publication Critical patent/WO2021104259A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5681Pre-fetching or pre-delivering data based on network characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements

Definitions

  • the embodiments of the present application relate to the field of terminal technology, and in particular, to a method and terminal for data sharing between a fast application and a native application.
  • a native application is a software program for a specific platform or device that can run directly on the operating system of the terminal. Generally speaking, native applications need to be installed on the terminal before they can be used by users.
  • Kuaiapp is a new application ecosystem jointly launched by several major Android mobile phone manufacturers in China based on the hardware platform. It does not need to be downloaded and installed, just click and use.
  • Quick apps are developed using front-end technology stacks, native rendering, and have the dual advantages of H5 pages and native apps, with no installation, no storage, one-key direct access, and direct update push.
  • the fast application framework program is deeply integrated into the terminal software system of various manufacturers. The fast application runs inside the fast application framework program, and cannot be directly controlled by the terminal's operating system like a native application.
  • the embodiment of the present application provides a method and terminal for data sharing between a fast application and a native application, which can efficiently and securely share data between the fast application and the native application.
  • the embodiments of the present application provide a method for sharing data between a fast application and a native application, which is applied to a terminal.
  • the terminal includes a fast application engine, a fast application access agent, an operating system, a first fast application, and a first native application.
  • Application the method can include:
  • the fast application engine registers the first fast application to the fast application access agent; the fast application access agent registers the first fast application to the operating system to form the first fast application access agent instance; the first fast application access agent instance and the first native application
  • the data sharing mechanism between native applications is adopted for data sharing, and the shared data of the first native application is obtained; the first fast application obtains the shared data of the first native application from the first fast application access agent instance through the fast application access agent.
  • the first fast application access proxy instance and the first native application adopt the data sharing mechanism between native applications for data sharing, which can reduce the speed
  • the risk of unauthorized access to the data of the native application by the application enables efficient and safe data sharing between the fast application and the native application.
  • the fast application engine registering the first fast application to the fast application access agent includes: the fast application engine registers the authorized access information between the first fast application and the first native application to Quick application access agent; among them, the authorized access information between the first quick application and the first native application includes: the identification of the first quick application resource installation package, the certificate fingerprint of the first quick application resource installation package, and the identification of the first native application , And the requested data.
  • the identifier of the first fast application resource installation package may be the package name of the first fast application resource installation package
  • the identifier of the first native application may be the package name of the first native application.
  • the fast application access agent registers the first fast application to the operating system to form the first fast application access agent instance, and the fast application access agent combines the first fast application with the first fast application.
  • the authorized access information between native applications is saved to the first fast application access proxy instance. In this way, the first fast application access proxy instance can obtain the corresponding relationship between the first fast application and the first native application according to the authorized access information.
  • the identification of the first fast application access agent instance corresponds to the identification of the first fast application resource installation package
  • the certificate fingerprint of the first fast application access agent instance corresponds to the first fast application resource installation package.
  • the quick application engine registering the first quick application to the quick application access agent further includes: the quick application access agent returns the first quick application to the first quick application for data access Encryption key.
  • the encryption key can be used to encrypt the data requested to be shared.
  • the data sharing mechanism between native applications includes: Content Provider, or shared preferences sharedPreferences.
  • the data sharing between native applications is provided with data access permissions, and the data access permissions are controlled by the operating system.
  • the fast application access agent belongs to the operating system or belongs to the fast application engine.
  • an embodiment of the present application provides a terminal, which includes a fast application engine, a fast application access agent, an operating system, a first fast application, and a first native application.
  • the fast application engine is used to register the first fast application to the fast application access agent;
  • the fast application access agent is used to register the first fast application to the operating system to form an instance of the first fast application access agent;
  • the first fast application Access proxy instance used to share data with the first native application using the data sharing mechanism between native applications, and obtain the shared data of the first native application;
  • the first fast application used to access the proxy from the first fast application through the fast application access proxy The instance obtains the shared data of the first native application.
  • the fast application engine is specifically used to register the authorized access information between the first fast application and the first native application to the fast application access agent; the first fast application and the first native application
  • the authorized access information between native applications includes: the identification of the first quick application resource installation package, the certificate fingerprint of the first quick application resource installation package, the identification of the first native application, and the data requested for access.
  • the fast application access agent is also used to save the authorized access information between the first fast application and the first native application to the first fast application access agent instance.
  • the identifier of the first fast application access agent instance corresponds to the identifier of the first fast application resource installation package
  • the certificate fingerprint of the first fast application access agent instance corresponds to the first fast application resource installation package.
  • the fast application access agent is also used to return to the first fast application the encryption key of the first fast application for data access.
  • the operating system is used to control data access permissions for data sharing between native applications.
  • the fast application access agent belongs to the operating system or belongs to the fast application engine.
  • embodiments of the present application provide a terminal, which can implement the method of data sharing between a fast application and a native application described in the first aspect, which can be implemented by software, hardware, or by hardware executing corresponding software.
  • the terminal may include a processor and a memory.
  • the processor is configured to support the terminal to perform the corresponding function in the method of the first aspect described above.
  • the memory is used for coupling with the processor, and it stores the necessary program instructions and data of the terminal.
  • inventions of the present application provide a computer-readable storage medium.
  • the computer-readable storage medium includes computer instructions.
  • the terminal executes any of the above-mentioned aspects and possible The method of data sharing between the fast application and the native application described in the design method.
  • the embodiments of the present application provide a computer program product.
  • the computer program product runs on a computer
  • the computer executes the fast applications and native applications described in any of the above aspects and possible design methods.
  • FIG. 1 is a schematic diagram of the hardware structure of an electronic device to which a method for data sharing between a fast application and a native application provided by an embodiment of the application is applicable;
  • FIG. 2 is a schematic diagram of the software architecture of an electronic device to which a method for data sharing between a fast application and a native application provided by an embodiment of the application is applicable;
  • Figure 3 is a schematic diagram of a fast application running process
  • Figure 4 is a schematic diagram of the architecture of a terminal running a fast application
  • FIG. 5A is a schematic diagram of an example of a native application scenario
  • Figure 5B is a schematic diagram of an example of a fast application scenario
  • Figure 6A is a schematic diagram 1 of a data sharing method between a fast application and a native application
  • Fig. 6B is a second schematic diagram of a data sharing method between a fast application and a native application
  • FIG. 7 is a first schematic flowchart of a method for data sharing between a fast application and a native application according to an embodiment of the application
  • FIG. 8 is a second schematic flowchart of a method for data sharing between a fast application and a native application according to an embodiment of the application
  • FIG. 9 is a third flowchart of a method for data sharing between a fast application and a native application provided by an embodiment of the application.
  • the method for sharing data between a fast application and a native application can be applied to a terminal.
  • the terminal can be a portable computer (such as a mobile phone), a tablet computer, a notebook computer, a personal computer (PC), a wearable electronic device (such as a smart watch), augmented reality (AR) ⁇ virtual reality (virtual reality) , VR) equipment, on-board computer, etc.
  • AR augmented reality
  • VR virtual reality
  • FIG. 1 shows a schematic structural diagram of an electronic device 100.
  • the electronic device 100 may be the terminal described in this embodiment.
  • the electronic device 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, and a battery 142 , Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193 , Display screen 194, subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • 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, and a battery 142 , Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor
  • the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter/receiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may be coupled to the touch sensor, the charger, the flash, the camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor through an I2C interface, so that the processor 110 and the touch sensor communicate through the I2C bus interface, so as to realize the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • 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 supplies 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.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), and the quasi-zenith satellite system (quasi). -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and transforms it into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • 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 magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the button 190 includes a power button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations applied to different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to 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 electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 may also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • surface manager surface manager
  • media library media libraries
  • 3D graphics processing library for example: OpenGL ES
  • 2D graphics engine for example: SGL
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the method for sharing data between a fast application and a native application provided in the embodiment of the present application can be applied to the above-mentioned terminal.
  • Native applications are installed on the terminal; for example, the aforementioned camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, SMS and other applications.
  • native applications include applications pre-installed on the terminal and third-party applications installed on the terminal.
  • Quick app is free of installation and can be accessed through entrances such as notification bar, negative one screen, voice assistant, global search, browser, and application market.
  • the server 32 includes a developer platform 321 and an application warehouse 322, and the terminal 31 includes a scene entry 311, a quick application 312, and a quick application engine 313.
  • the quick application 312 is used in the form of a resource package (RPK).
  • the warehouse 322 is released, and the quick application engine 313 runs on the terminal 31 instead of the operating system 314 running on the terminal 31 directly like native applications.
  • the user can invoke the quick application engine 313 by clicking on the scene entry 311.
  • the fast application engine 313 downloads the data of the fast application from the server 32 and caches it in the fast application engine 313 to improve the efficiency of subsequent data acquisition.
  • the fast application 312 runs on the fast application engine platform 313 and is displayed to users. Please continue to refer to FIG. 4, on the terminal side, the user enters the quick application through the scene entry 311, and the quick application runs on the quick application engine 313.
  • the fast application engine 313 is an application program that runs on the application layer of the operating system 314.
  • a native smart home application is installed on the terminal. Users can enter the native smart home application by clicking on the icon "Smart Life” on the desktop.
  • the main interface of "Smart Life” includes "My Device", which can display a list of smart devices registered in the smart home system. Take the entry of a negative one-screen entry into the smart home fast application as an example.
  • the user can enter the negative screen by sliding the screen from left to right on the desktop of the terminal.
  • One negative screen includes quick search 501, sports health 502, quick application 503, situational intelligence 504, news 505 and other parts.
  • the quick search 501 is used to search for local or online content according to user input;
  • the sports health 502 is used to display sports-related information, such as the number of steps taken, energy consumed, walking distance, etc.;
  • the quick application 503 is used to recommend or self Define the shortcut function entry;
  • the contextual intelligence 504 is used to recommend contextual cards according to the user's usage habits.
  • the contextual intelligence 504 includes the smart home quick application display interface 506, and the smart home quick application display interface 506 can display the smart devices registered in the smart home system The list;
  • News 505 is used to recommend news content according to the user’s usage habits. Since both the smart home fast application and the smart home native application need to display the list of smart devices registered in the smart home system, the smart home fast application and the smart home native application need to share the information of the smart devices registered in the smart home system.
  • data sharing is implemented between the fast application and the native application through a server.
  • Native applications synchronize static data or dynamic data to the server.
  • the fast app obtains static data or dynamic data from the server.
  • the data sharing between the fast application and the corresponding native application needs to pass through the server, which depends on the network connection between the terminal and the server; the efficiency of data synchronization may cause the fast application interface to render slowly and the user experience is poor; and it also consumes users bandwidth.
  • the fast application and the native application realize data sharing through the data sharing mechanism between the fast application engine and the native application (for example, the content provider mechanism of Android).
  • the access relationship between the fast application and the native application is determined by the fast application engine.
  • the fast application runs on the fast application engine, and the operating system does not recognize the application type of the fast application, and cannot perform targeted system authorization authorization for the fast application, and authorization processing for data sharing with the native application;
  • the application engine controls the permission of the fast application and the authorization control of data sharing with the native application. Due to the lack of an operating system-level access authorization mechanism, there is a risk that other fast apps may gain unauthorized access to native application data.
  • the embodiment of the present application provides a method for data sharing between a fast application and a native application.
  • the operating system performs authorization and control of data sharing between the fast application and the native application, which can efficiently and securely exchange data between the fast application and the native application. Data sharing between.
  • fast applications can be run on the terminal, and multiple native applications can be installed.
  • fast application A corresponds to native application A
  • fast application B corresponds to native application B
  • Quick apps and corresponding native apps can be apps developed by the same manufacturer and provide the same functions.
  • a negative one-screen smart home quick application corresponds to a native smart home application
  • a negative one-screen express query quick application corresponds to a native express query application.
  • Only the corresponding fast apps and native apps can share data, otherwise there will be the problem of unauthorized access to data.
  • a negative one-screen smart home fast application needs to display information such as the name, icon, and device connection status of the smart device on the interface, and needs to obtain the data of this information.
  • the corresponding smart home native application may have obtained and saved the data from the server. .
  • the native smart home application can share these data with the smart home fast application.
  • the data saved in the native application of smart home cannot be shared by the express application, otherwise there will be a data leakage problem.
  • the operating system of the terminal saves and manages the corresponding relationship between the fast application and the native application, and performs access permission control on the data sharing between the fast application and the native application. In this way, data can be shared between fast apps and native apps efficiently and securely.
  • fast application A3121 corresponds to native application A318, and fast application B3122 corresponds to native application B3182.
  • the quick application A3121 and the quick application B3122 run on the quick application engine 313 of the terminal 31 respectively.
  • the native application A3181 and the native application B3182 run on the operating system 314 respectively.
  • the terminal 31 also includes a quick application access agent 315, which can generate two quick application access agent instances (such as the quick application access agent instance A316 and the quick application access agent instance B317 in FIG. 7) correspondingly.
  • the quick application access agent 315 may be located in the operating system 314 or the quick application engine 313, for example, The fast application access agent 315 may be located at the application framework layer of the operating system 314.
  • the quick application access agent instance registration can be performed in the operating system 314 through the quick application access agent 315.
  • fast application A3121 registers fast application access agent instance in operating system 314 through fast application access agent 315
  • fast application B3122 registers fast application access agent instance in operating system 314 through fast application access agent 315
  • the fast application access proxy instance B317 is formed.
  • the operating system 314 can perform application management on the quick application access agent instance A316 and the quick application access agent instance B317; that is, the operating system 314 can equate the quick application access agent instance A316 and the quick application access agent instance B317 to the native application for application Management, data access authority control for quick application access agent instance A316 and quick application access agent instance B317.
  • the operating system 314 controls the quick application access proxy instance A316 and the native application A3181 corresponding to the quick application A3121 to share data through the native inter-application data sharing mechanism, and controls the quick application access proxy instance B317 to the native application B3182 corresponding to the quick application B3122 through the native application. Data sharing mechanism for data sharing.
  • the quick application access agent instance A316 can send or receive shared data to or from the quick application A3121 through the quick application access agent 315, thereby completing the data sharing between the quick application A3121 and the native application A3181; the quick application access agent instance B317 can The quick application access agent 315 sends or receives shared data to or from the quick application B3122, thereby completing data sharing between the quick application B3122 and the native application B3182.
  • the operating system 314 manages the correspondence between the fast application A3121 and the native application A3181, and the correspondence between the fast application B3122 and the native application B3182, to ensure that the data sharing process between the fast application and the native application is carried out safely and efficiently. Avoid unauthorized access to data by apps.
  • the smart home fast application and the smart home native application share data through the fast application access agent, and the smart home fast application needs to be registered in the operating system of the terminal first.
  • the process of registering the smart home application in the operating system of the terminal may include:
  • the smart home fast application downloads the fast application resource installation package from the fast application platform through the fast application engine.
  • the fast app resource installation package is downloaded from the fast app platform through the fast app engine.
  • the fast application platform may be an application warehouse on a server.
  • the quick application engine obtains the identification, certificate fingerprint and other information of the smart home quick application resource installation package.
  • the quick application engine loads the smart home quick application resource installation package.
  • the quick application engine registers the smart home quick application with the quick application access agent.
  • the quick application engine after the quick application engine loads the smart home quick application resource installation package, it can immediately register the smart home quick application with the quick application access agent. In other examples, after the quick application engine loads the smart home quick application resource installation package, when needed (for example, when it receives a request from the smart home quick application to access the shared data of the native application), it registers the smart home with the quick application access agent Quickly apply.
  • the quick application engine registers the authorized access information between the smart home quick application and the corresponding smart home native application to the quick application access agent.
  • the authorized access information between the smart home app and the corresponding smart home native application may include: the identification of the smart home app resource installation package, the certificate fingerprint of the smart home app resource installation package, and the smart home corresponding to the smart home app The identity of the native application, and the data requested to be accessed, etc.
  • the identifier of the smart home application resource installation package may be the package name of the smart home application resource installation package
  • the identifier of the smart home native application may be the package name of the smart home native application.
  • the registration interface is as follows:
  • fastappPackageName represents the package name of the fast app resource installation package
  • fastappFingerPrint represents the certificate fingerprint of the fast app resource installation package
  • nativeappPackageName represents the package name of the native application
  • shareData represents the data requested to be accessed.
  • the fast application access agent generates and returns the encryption key for data access of the smart home fast application.
  • the smart home fast application obtains the encryption key.
  • the fast application access agent performs registration of the fast application access agent instance in the operating system.
  • the fast application access agent dynamically applies to the operating system (for example, the application management module of the operating system) for the fast application access agent instance corresponding to the smart home fast application to form the corresponding fast application access agent instance A.
  • the quick application access agent instance A is registered in the operating system, and the operating system saves the information of the quick application access agent instance A, and then the application management of the quick application access agent instance A can be performed.
  • the identification of the quick application access agent instance A is the same as the identification of the smart home quick application resource installation package
  • the certificate fingerprint of the quick application access agent instance A is the same as the certificate fingerprint of the smart home quick application resource installation package .
  • there is a one-to-one mapping between the identification of the quick application access agent instance A and the identification of the smart home quick application resource installation package, and the certificate fingerprint of the quick application access agent instance A and the smart home quick application resource installation There is a one-to-one mapping between the package certificate fingerprints.
  • the package name of the smart home quick application resource installation package is different from the APK package name of other native applications in the operating system.
  • the fast application access agent can also log off the fast application access agent instance in the operating system. After the quick application access agent instance A corresponding to the smart home quick application logs out of the operating system, the operating system no longer controls and manages the data access authority of the quick application access agent instance A (ie, the smart home quick application).
  • the quick application access agent saves the authorized access information between the smart home quick application and the corresponding smart home native application to the quick application access agent instance A.
  • the quick application access agent instance A obtains the authorized access information between the smart home quick application and the corresponding smart home native application.
  • the authorized access information between the smart home app and the corresponding smart home native application includes: the identification of the smart home app resource installation package, the certificate fingerprint of the smart home app resource installation package, and the smart home native app corresponding to the smart home app The identity of the application, and the requested data, etc.
  • the smart home fast application After the smart home fast application registers with the operating system through the fast application access agent, and the corresponding fast application access agent instance is formed, the smart home fast application can share data with the native smart home application under the control and management of the operating system.
  • the process of the smart home fast application accessing the shared data of the smart home native application can include:
  • the smart home fast application calls the inter-application data access interface of the fast application engine to request access to the shared data of the corresponding native application.
  • the smart home fast application needs to access the shared data of the smart home native application, it calls the inter-application data access interface of the fast application engine to request access to the shared data of the native application.
  • the data that the smart home fast application requests to access is encrypted by the encryption key for the smart home fast application data access obtained in S803.
  • the fast application engine sends a request message for the smart home fast application to call the inter-application data access interface to the fast application access agent.
  • a transparent access tunnel is established between the fast application engine and the fast application access agent, and a request message for the smart home fast application to call the inter-application data access interface is sent.
  • a transparent access tunnel can be established based on message communication methods such as Android interface definition language (AIDL) and Messager.
  • the fast application access agent sends a request message for the smart home fast application to call the inter-application data access interface to the fast application access agent instance A.
  • the quick application access agent receives the request message of the smart home quick application to call the inter-application data access interface, decrypts the data requested by the smart home quick application, and sends the smart home to the quick application access agent instance A
  • the fast application calls the request message of the inter-application data access interface.
  • the fast application access agent instance A accesses the shared data of the native application of the smart home through the data sharing mechanism between the native applications.
  • the quick application access agent instance A accesses the shared data of the smart home native application according to the data requested by the smart home quick application in the request message of the smart home quick application to call the inter-application data access interface through the native inter-application data sharing mechanism.
  • the data sharing mechanism between native applications can adopt the data sharing mechanism between the native applications of the Android operating system in general technology, such as Content Provider, shared preferences, etc.; details are not described here.
  • the operating system controls access to data between applications. For example, the operating system saves the correspondence between the quick application access agent instance A and the smart home native application during the quick application registration process, and allows the quick application access agent instance A to access the shared data of the smart home native application.
  • the quick application access agent instance A obtains the authorized access information between the smart home quick application and the corresponding smart home native application, including: the smart home quick application resource installation package Identification, the certificate fingerprint of the smart home application resource installation package, the identification of the smart home native application corresponding to the smart home application, and the data requested to be accessed, etc.
  • the quick application access proxy instance A determines the corresponding smart home native application through the identification of the smart home native application, and requests the smart home native application to access its shared data.
  • the native smart home application verifies the authorization information such as the identification of the quick application access agent instance A according to the data access authority control mechanism of the operating system. If the verification is passed, the data requested to be accessed by the smart home fast application is sent to the fast application access agent instance A.
  • the quick application access agent instance A After the quick application access agent instance A obtains the shared data, it can use the quick application access agent to send the obtained shared data to the smart home quick application. In this way, the smart home fast application obtains the shared data of the smart home native application.
  • process for the native smart home application to access the shared data of the smart home fast application is similar to the process for the smart home fast app to access the shared data of the smart home native application.
  • the operating system performs permission control on the data access request of the native smart home application. For example, during the quick application registration process, the operating system saves the correspondence between the quick application access agent instance A and the smart home native application, and allows the smart home native application to access the shared data of the quick application access agent instance A.
  • the native smart home application needs to access the shared data of the corresponding smart home fast application, it sends a data sharing request message to the fast application access agent instance A.
  • the quick application access agent instance A obtains the authorized access information between the smart home quick application and the corresponding smart home native application, including: the identification of the smart home quick application resource installation package, and the smart home quick application resource The certificate fingerprint of the installation package, the identification of the smart home native application corresponding to the smart home fast application, and the data requested to be accessed, etc.
  • the fast application access agent instance A After the fast application access agent instance A receives the data sharing request message of the smart home native application, it verifies the identity of the smart home native application. If the verification is passed, it is determined that the native smart home application is allowed to access the shared data of the smart home fast application.
  • the quick application access proxy instance A sends the received data sharing request message to the quick application engine through the quick application access agent, and the quick application engine uses the corresponding relationship between the quick application access agent instance A and the smart home quick application to share the data sharing request message Send to the smart home app.
  • the smart home fast application After receiving the data sharing request message, the smart home fast application sends the shared data to the fast application access agent through the fast application engine.
  • the quick application access agent sends the shared data of the smart home quick application to the quick application access agent instance A according to the corresponding relationship between the quick application access agent instance A and the smart home quick application.
  • the smart home native application accesses the shared data of the quick application access agent instance A through the data sharing mechanism between the native applications, that is, accesses the shared data of the smart home quick application.
  • the fast application running on the fast application engine registers with the operating system through the fast application access agent to form a corresponding fast application access agent instance.
  • the fast application access proxy instance can share data with the native application using the native inter-application data sharing mechanism of the operating system.
  • the fast application access agent instance and the native application use the native inter-application data sharing mechanism of the operating system in the conventional technology for data sharing, without the need to modify the operating system's native inter-application data sharing mechanism, and the scalability is good.
  • the above-mentioned terminal includes hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the embodiments of the present application.
  • the embodiment of the present application also provides a computer storage medium in which computer program code is stored.
  • the processor of the electronic device executes the computer program code
  • the electronic device executes the terminal execution in FIG. 7 or FIG. 8 or FIG. 9
  • the relevant method steps implement the method in the above-mentioned embodiment.
  • the embodiment of the present application also provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the relevant method steps executed by the terminal in FIG. 7 or FIG. 8 or FIG. 9 to implement the method in the foregoing embodiment.
  • the computer storage media or computer program products provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above. The effect will not be repeated here.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the functional units in the various embodiments of the present application may be integrated into one processor, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, ROM, magnetic disk, or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiments of the present application relate to the technical field of terminals. Disclosed are a method and terminal for data sharing between a fast application and a native application. The terminal comprises a fast application engine, a fast application access proxy, an operating system, a first fast application, and a first native application. The method comprises: the fast application engine registers the first fast application to the fast application access proxy; the fast application access proxy registers the first fast application to the operating system to form a first fast application access proxy instance; the first fast application access proxy instance and the first native application share data by using a data sharing mechanism between native applications to obtain shared data of the first native application; and the first fast application obtains, from the first fast application access proxy instance by means of the fast application access proxy, the shared data of the first native application. The risk of unauthorized access of the fast application can be reduced, and data sharing between the fast application and the native application is efficiently and securely achieved.

Description

一种快应用与原生应用间数据共享的方法及终端Method and terminal for data sharing between fast application and native application
本申请要求于2019年11月27日提交国家知识产权局、申请号201911183286.0、申请名称为“一种快应用与原生应用间数据共享的方法及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office, application number 201911183286.0, and application titled "A method and terminal for data sharing between fast applications and native applications" on November 27, 2019, and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请实施例涉及终端技术领域,尤其涉及一种快应用与原生应用间数据共享的方法及终端。The embodiments of the present application relate to the field of terminal technology, and in particular, to a method and terminal for data sharing between a fast application and a native application.
背景技术Background technique
原生应用是一种用于特定平台或设备的软件程序,能直接运行于终端的操作系统。一般来说,原生应用需要在终端上安装,才可以供用户使用。A native application is a software program for a specific platform or device that can run directly on the operating system of the terminal. Generally speaking, native applications need to be installed on the terminal before they can be used by users.
快应用是中国几大安卓手机厂商基于硬件平台共同推出的新型应用生态,无需下载安装,即点即用。快应用使用前端技术栈开发,原生渲染,同时具备H5页面和原生应用的双重优点,免安装、免存储、一键直达、更新直接推送。快应用框架程序深度集成进各厂商终端软件系统中。快应用运行在快应用框架程序内部,不能像原生应用一样,直接由终端的操作系统进行权限控制。Kuaiapp is a new application ecosystem jointly launched by several major Android mobile phone manufacturers in China based on the hardware platform. It does not need to be downloaded and installed, just click and use. Quick apps are developed using front-end technology stacks, native rendering, and have the dual advantages of H5 pages and native apps, with no installation, no storage, one-key direct access, and direct update push. The fast application framework program is deeply integrated into the terminal software system of various manufacturers. The fast application runs inside the fast application framework program, and cannot be directly controlled by the terminal's operating system like a native application.
快应用与原生应用之间存在数据共享的场景。然而,由于终端的操作系统无法对快应用的数据访问权限进行有效管理,可能发生快应用越权访问的问题。如何高效、安全地在快应用与原生应用之间进行数据共享,是一个需要解决的问题。There are scenarios for data sharing between fast apps and native apps. However, since the operating system of the terminal cannot effectively manage the data access permissions of the fast application, the problem of unauthorized access to the fast application may occur. How to efficiently and securely share data between fast apps and native apps is a problem that needs to be solved.
发明内容Summary of the invention
本申请实施例提供了一种快应用与原生应用间数据共享的方法及终端,可以高效、安全地在快应用与原生应用之间进行数据共享。The embodiment of the present application provides a method and terminal for data sharing between a fast application and a native application, which can efficiently and securely share data between the fast application and the native application.
第一方面,本申请实施例提供一种快应用与原生应用间数据共享的方法,应用于终端,该终端包括快应用引擎,快应用访问代理,操作系统,第一快应用,以及第一原生应用,该方法可以包括:In the first aspect, the embodiments of the present application provide a method for sharing data between a fast application and a native application, which is applied to a terminal. The terminal includes a fast application engine, a fast application access agent, an operating system, a first fast application, and a first native application. Application, the method can include:
快应用引擎将第一快应用注册至快应用访问代理;快应用访问代理将第一快应用注册至操作系统,形成第一快应用访问代理实例;第一快应用访问代理实例与第一原生应用采用原生应用间数据共享机制进行数据共享,获取第一原生应用的共享数据;第一快应用通过快应用访问代理从第一快应用访问代理实例获取第一原生应用的共享数据。The fast application engine registers the first fast application to the fast application access agent; the fast application access agent registers the first fast application to the operating system to form the first fast application access agent instance; the first fast application access agent instance and the first native application The data sharing mechanism between native applications is adopted for data sharing, and the shared data of the first native application is obtained; the first fast application obtains the shared data of the first native application from the first fast application access agent instance through the fast application access agent.
由于第一快应用通过第一快应用访问代理实例获取第一原生应用的共享数据,第一快应用访问代理实例与第一原生应用间采用原生应用间数据共享机制进行数据共享,从而可以降低快应用越权访问原生应用的数据的风险,实现高效、安全地在快应用与原生应用之间进行数据共享。Since the first fast application obtains the shared data of the first native application through the first fast application access proxy instance, the first fast application access proxy instance and the first native application adopt the data sharing mechanism between native applications for data sharing, which can reduce the speed The risk of unauthorized access to the data of the native application by the application enables efficient and safe data sharing between the fast application and the native application.
结合第一方面,在一种可能的设计方式中,快应用引擎将第一快应用注册至快应用访问代理包括:快应用引擎将第一快应用与第一原生应用间的授权访问信息注册至快应用访问代理;其中,第一快应用与第一原生应用间的授权访问信息包括:第一快 应用资源安装包的标识,第一快应用资源安装包的证书指纹,第一原生应用的标识,以及请求访问的数据。比如,第一快应用资源安装包的标识可以为第一快应用资源安装包的包名,第一原生应用的标识可以为第一原生应用的包名。In combination with the first aspect, in a possible design method, the fast application engine registering the first fast application to the fast application access agent includes: the fast application engine registers the authorized access information between the first fast application and the first native application to Quick application access agent; among them, the authorized access information between the first quick application and the first native application includes: the identification of the first quick application resource installation package, the certificate fingerprint of the first quick application resource installation package, and the identification of the first native application , And the requested data. For example, the identifier of the first fast application resource installation package may be the package name of the first fast application resource installation package, and the identifier of the first native application may be the package name of the first native application.
结合第一方面,在一种可能的设计方式中,快应用访问代理将第一快应用注册至操作系统,形成第一快应用访问代理实例之后,快应用访问代理将第一快应用与第一原生应用间的授权访问信息保存至第一快应用访问代理实例。这样,第一快应用访问代理实例可以根据授权访问信息获取第一快应用与第一原生应用的对应关系。In combination with the first aspect, in a possible design method, the fast application access agent registers the first fast application to the operating system to form the first fast application access agent instance, and the fast application access agent combines the first fast application with the first fast application. The authorized access information between native applications is saved to the first fast application access proxy instance. In this way, the first fast application access proxy instance can obtain the corresponding relationship between the first fast application and the first native application according to the authorized access information.
结合第一方面,在一种可能的设计方式中,第一快应用访问代理实例的标识与第一快应用资源安装包的标识一一对应,第一快应用访问代理实例的证书指纹与第一快应用资源安装包的证书指纹一一对应。With reference to the first aspect, in a possible design manner, the identification of the first fast application access agent instance corresponds to the identification of the first fast application resource installation package, and the certificate fingerprint of the first fast application access agent instance corresponds to the first fast application resource installation package. There is a one-to-one correspondence between the certificate fingerprints of the quick application resource installation package.
结合第一方面,在一种可能的设计方式中,快应用引擎将所述第一快应用注册至快应用访问代理还包括:快应用访问代理向第一快应用返回第一快应用进行数据访问的加密密钥。这样,第一快应用请求访问第一原生应用的共享数据时,可以使用该加密密钥对请求共享的数据进行加密。With reference to the first aspect, in a possible design manner, the quick application engine registering the first quick application to the quick application access agent further includes: the quick application access agent returns the first quick application to the first quick application for data access Encryption key. In this way, when the first fast application requests to access the shared data of the first native application, the encryption key can be used to encrypt the data requested to be shared.
结合第一方面,在一种可能的设计方式中,原生应用间数据共享机制包括:内容提供者Content Provider,或者,共享偏好sharedPreferences。In combination with the first aspect, in a possible design approach, the data sharing mechanism between native applications includes: Content Provider, or shared preferences sharedPreferences.
结合第一方面,在一种可能的设计方式中,所述原生应用间数据共享设置有数据访问权限,所述数据访问权限由所述操作系统控制。With reference to the first aspect, in a possible design manner, the data sharing between native applications is provided with data access permissions, and the data access permissions are controlled by the operating system.
结合第一方面,在一种可能的设计方式中,快应用访问代理属于操作系统,或者属于快应用引擎。In combination with the first aspect, in a possible design approach, the fast application access agent belongs to the operating system or belongs to the fast application engine.
第二方面,本申请实施例提供一种终端,该终端包括快应用引擎,快应用访问代理,操作系统,第一快应用,以及第一原生应用。其中,快应用引擎,用于将第一快应用注册至快应用访问代理;快应用访问代理,用于将第一快应用注册至操作系统,形成第一快应用访问代理实例;第一快应用访问代理实例,用于与第一原生应用采用原生应用间数据共享机制进行数据共享,获取第一原生应用的共享数据;第一快应用,用于通过快应用访问代理从第一快应用访问代理实例获取第一原生应用的共享数据。In a second aspect, an embodiment of the present application provides a terminal, which includes a fast application engine, a fast application access agent, an operating system, a first fast application, and a first native application. Among them, the fast application engine is used to register the first fast application to the fast application access agent; the fast application access agent is used to register the first fast application to the operating system to form an instance of the first fast application access agent; the first fast application Access proxy instance, used to share data with the first native application using the data sharing mechanism between native applications, and obtain the shared data of the first native application; the first fast application, used to access the proxy from the first fast application through the fast application access proxy The instance obtains the shared data of the first native application.
结合第二方面,在一种可能的设计方式中,快应用引擎,具体用于将第一快应用与第一原生应用间的授权访问信息注册至快应用访问代理;第一快应用与第一原生应用间的授权访问信息包括:第一快应用资源安装包的标识,第一快应用资源安装包的证书指纹,第一原生应用的标识,以及请求访问的数据。In combination with the second aspect, in a possible design method, the fast application engine is specifically used to register the authorized access information between the first fast application and the first native application to the fast application access agent; the first fast application and the first native application The authorized access information between native applications includes: the identification of the first quick application resource installation package, the certificate fingerprint of the first quick application resource installation package, the identification of the first native application, and the data requested for access.
结合第二方面,在一种可能的设计方式中,快应用访问代理,还用于将第一快应用与第一原生应用间的授权访问信息保存至第一快应用访问代理实例。With reference to the second aspect, in a possible design manner, the fast application access agent is also used to save the authorized access information between the first fast application and the first native application to the first fast application access agent instance.
结合第二方面,在一种可能的设计方式中,第一快应用访问代理实例的标识与第一快应用资源安装包的标识一一对应,第一快应用访问代理实例的证书指纹与第一快应用资源安装包的证书指纹一一对应。With reference to the second aspect, in a possible design manner, the identifier of the first fast application access agent instance corresponds to the identifier of the first fast application resource installation package, and the certificate fingerprint of the first fast application access agent instance corresponds to the first fast application resource installation package. There is a one-to-one correspondence between the certificate fingerprints of the quick application resource installation package.
结合第二方面,在一种可能的设计方式中,快应用访问代理,还用于向第一快应用返回第一快应用进行数据访问的加密密钥。With reference to the second aspect, in a possible design manner, the fast application access agent is also used to return to the first fast application the encryption key of the first fast application for data access.
结合第二方面,在一种可能的设计方式中,操作系统,用于对原生应用间数据共享进行数据访问权限控制。In combination with the second aspect, in a possible design method, the operating system is used to control data access permissions for data sharing between native applications.
结合第二方面,在一种可能的设计方式中,快应用访问代理属于操作系统,或者属于快应用引擎。In combination with the second aspect, in a possible design approach, the fast application access agent belongs to the operating system or belongs to the fast application engine.
第三方面,本申请实施例提供一种终端,该终端可以实现第一方面所述的快应用与原生应用间数据共享的方法,其可以通过软件、硬件、或者通过硬件执行相应的软件实现上述方法。在一种可能的设计中,该终端可以包括处理器和存储器。该处理器被配置为支持该终端执行上述第一方面方法中相应的功能。存储器用于与处理器耦合,其保存该终端必要的程序指令和数据。In a third aspect, embodiments of the present application provide a terminal, which can implement the method of data sharing between a fast application and a native application described in the first aspect, which can be implemented by software, hardware, or by hardware executing corresponding software. method. In one possible design, the terminal may include a processor and a memory. The processor is configured to support the terminal to perform the corresponding function in the method of the first aspect described above. The memory is used for coupling with the processor, and it stores the necessary program instructions and data of the terminal.
第四方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在终端上运行时,使得终端执行如上述任一方面及其可能的设计方式所述的快应用与原生应用间数据共享的方法。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions run on a terminal, the terminal executes any of the above-mentioned aspects and possible The method of data sharing between the fast application and the native application described in the design method.
第五方面,本申请实施例提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如上述任一方面及其可能的设计方式所述的快应用与原生应用间数据共享的方法。In the fifth aspect, the embodiments of the present application provide a computer program product. When the computer program product runs on a computer, the computer executes the fast applications and native applications described in any of the above aspects and possible design methods. The method of data sharing between applications.
第二方面所述的终端,第三方面所述的终端,第四方面所述的计算机可读存储介质以及第五方面所述的计算机程序产品所带来的技术效果可参见上述第一方面及其不同设计方式所带来的技术效果,此处不再赘述。For the technical effects brought by the terminal described in the second aspect, the terminal described in the third aspect, the computer-readable storage medium described in the fourth aspect, and the computer program product described in the fifth aspect, please refer to the first aspect and The technical effects brought about by its different design methods will not be repeated here.
附图说明Description of the drawings
图1为本申请实施例提供的一种快应用与原生应用间数据共享的方法所适用的电子设备的硬件结构的组成示意图;FIG. 1 is a schematic diagram of the hardware structure of an electronic device to which a method for data sharing between a fast application and a native application provided by an embodiment of the application is applicable;
图2为本申请实施例提供的一种快应用与原生应用间数据共享的方法所适用的电子设备的软件架构示意图;2 is a schematic diagram of the software architecture of an electronic device to which a method for data sharing between a fast application and a native application provided by an embodiment of the application is applicable;
图3为一种快应用运行流程示意图;Figure 3 is a schematic diagram of a fast application running process;
图4为一种运行快应用的终端的架构示意图;Figure 4 is a schematic diagram of the architecture of a terminal running a fast application;
图5A为一种原生应用的场景实例示意图;FIG. 5A is a schematic diagram of an example of a native application scenario;
图5B为一种快应用的场景实例示意图;Figure 5B is a schematic diagram of an example of a fast application scenario;
图6A为一种快应用与原生应用间数据共享方法的示意图一;Figure 6A is a schematic diagram 1 of a data sharing method between a fast application and a native application;
图6B为一种快应用与原生应用间数据共享方法的示意图二;Fig. 6B is a second schematic diagram of a data sharing method between a fast application and a native application;
图7为本申请实施例提供的一种快应用与原生应用间数据共享的方法的流程示意图一;FIG. 7 is a first schematic flowchart of a method for data sharing between a fast application and a native application according to an embodiment of the application;
图8为本申请实施例提供的一种快应用与原生应用间数据共享的方法的流程示意图二;FIG. 8 is a second schematic flowchart of a method for data sharing between a fast application and a native application according to an embodiment of the application;
图9为本申请实施例提供的一种快应用与原生应用间数据共享的方法的流程示意图三。FIG. 9 is a third flowchart of a method for data sharing between a fast application and a native application provided by an embodiment of the application.
具体实施方式Detailed ways
本申请实施例提供的一种快应用与原生应用间数据共享的方法可以应用于终端。该终端可以为便携式计算机(如手机)、平板电脑、笔记本电脑、个人计算机(personal computer,PC)、可穿戴电子设备(如智能手表)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、车载电脑等,以下实施例对该终端的具体形式不做特殊限制。The method for sharing data between a fast application and a native application provided in an embodiment of the present application can be applied to a terminal. The terminal can be a portable computer (such as a mobile phone), a tablet computer, a notebook computer, a personal computer (PC), a wearable electronic device (such as a smart watch), augmented reality (AR)\virtual reality (virtual reality) , VR) equipment, on-board computer, etc. The following embodiments do not specifically limit the specific form of the terminal.
请参考图1,其示出了一种电子设备100的结构示意图。该电子设备100可以是本实施例中所述的终端。Please refer to FIG. 1, which shows a schematic structural diagram of an electronic device 100. The electronic device 100 may be the terminal described in this embodiment.
如图1所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。As shown in FIG. 1, the electronic device 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, and a battery 142 , Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193 , Display screen 194, subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。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), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Among them, the different processing units may be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器,使处理器110与触摸传感器通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor, the charger, the flash, the camera 193, etc., respectively through different I2C bus interfaces. For example, the processor 110 may couple the touch sensor through an I2C interface, so that the processor 110 and the touch sensor communicate through the I2C bus interface, so as to realize the touch function of the electronic device 100.
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on. In some embodiments, the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on. The GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在 其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。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 supplies 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. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system, GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc. The GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), and the quasi-zenith satellite system (quasi). -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and transforms it into an image visible to the naked eye. ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, for example, the transfer mode between human brain neurons, it can quickly process input information, and it can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子 设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 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 magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone", "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The button 190 includes a power button, a volume button, and so on. The button 190 may be a mechanical button. It can also be a touch button. The electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback. For example, touch operations applied to different applications (such as photographing, audio playback, etc.) can correspond to different vibration feedback effects. Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminding, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示 消息,未接来电,通知等。The indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect to 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 electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the electronic device 100 adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
图2是本发明实施例的电子设备100的软件结构框图。FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图2所示,应用程序包可以包括相机,图库,日历,电话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 2, the application package can include applications such as camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 2, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。The content provider is used to store and retrieve data and make these data accessible to applications. The data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, and so on. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, and so on. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。The system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
2D图形引擎是2D绘图的绘图引擎。The 2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
本申请实施例提供的快应用与原生应用间数据共享的方法,可以应用于上述终端。原生应用是安装在终端上的;比如,上述相机,图库,日历,电话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用。本申请实施例中,原生应用包括预安装在终端的应用,和安装在终端的第三方应用。快应用是免安装的,可以通过通知栏、负一屏、语音助手、全局搜索、浏览器、应用市场等入口进入。请参考图3,服务器32包括开发者平台321和应用仓库322,终端31包括场景入口311、快应用312和快应用引擎313,快应用312以资源安装包(resource package,RPK)的形式在应用仓库322进行发布,运行于终端31上的快应用引擎313,而不是与原生应用一样直接运行于终端31的操作系统314。用户可以通过点击场景入口311,唤起快应用引擎313。快应用引擎313从服务器32下载该快应用的数据,缓存在快应用引擎313中,以提高后续数据获取效率。该快应用312在快应用引擎平台313运行,展示给用户。请继续参考图4,在终端侧,用户通过场景入口311进入快应用,快应用运行在快应用引擎313。快应用引擎313是一种应用程序,运行于操作系统314的应用层。The method for sharing data between a fast application and a native application provided in the embodiment of the present application can be applied to the above-mentioned terminal. Native applications are installed on the terminal; for example, the aforementioned camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, SMS and other applications. In the embodiments of the present application, native applications include applications pre-installed on the terminal and third-party applications installed on the terminal. Quick app is free of installation and can be accessed through entrances such as notification bar, negative one screen, voice assistant, global search, browser, and application market. 3, the server 32 includes a developer platform 321 and an application warehouse 322, and the terminal 31 includes a scene entry 311, a quick application 312, and a quick application engine 313. The quick application 312 is used in the form of a resource package (RPK). The warehouse 322 is released, and the quick application engine 313 runs on the terminal 31 instead of the operating system 314 running on the terminal 31 directly like native applications. The user can invoke the quick application engine 313 by clicking on the scene entry 311. The fast application engine 313 downloads the data of the fast application from the server 32 and caches it in the fast application engine 313 to improve the efficiency of subsequent data acquisition. The fast application 312 runs on the fast application engine platform 313 and is displayed to users. Please continue to refer to FIG. 4, on the terminal side, the user enters the quick application through the scene entry 311, and the quick application runs on the quick application engine 313. The fast application engine 313 is an application program that runs on the application layer of the operating system 314.
快应用与对应原生应用间存在数据共享的场景。例如,智能家居快应用与智能家居原生应用间存在共享设备列表的需求场景。There are scenarios for data sharing between fast apps and corresponding native apps. For example, there is a demand scenario for sharing the device list between the smart home fast application and the smart home native application.
示例性的,如图5A,终端上安装了智能家居原生应用。用户可以通过点击桌面上的图标“智慧生活”,进入智能家居原生应用。“智慧生活”的主界面包括“我的设备”,可以显示在智能家居系统中注册的智能设备的列表。以从负一屏入口进入智能家居快应用为例。如图5B,用户可以通过在终端桌面上,从左向右滑动屏幕,进入负一屏。负一屏包括快捷搜索501、运动健康502、快捷应用503、情景智能504、新闻505等部分。其中,快捷搜索501用于根据用户输入搜索本地或在线内容;运动健康 502用于显示运动相关的信息,比如,走路的步数,消耗的能量,行走距离等;快捷应用503用于推荐或自定义快捷功能入口;情景智能504用于根据用户使用习惯推荐情景卡片,比如,情景智能504包括智能家居快应用显示界面506,智能家居快应用显示界面506可以显示在智能家居系统中注册的智能设备的列表;新闻505用于根据用户的使用习惯推荐新闻内容。由于智能家居快应用和智能家居原生应用都需要显示在智能家居系统中注册的智能设备的列表,所以智能家居快应用和智能家居原生应用需要共享在智能家居系统中注册的智能设备的信息。Exemplarily, as shown in Figure 5A, a native smart home application is installed on the terminal. Users can enter the native smart home application by clicking on the icon "Smart Life" on the desktop. The main interface of "Smart Life" includes "My Device", which can display a list of smart devices registered in the smart home system. Take the entry of a negative one-screen entry into the smart home fast application as an example. As shown in Figure 5B, the user can enter the negative screen by sliding the screen from left to right on the desktop of the terminal. One negative screen includes quick search 501, sports health 502, quick application 503, situational intelligence 504, news 505 and other parts. Among them, the quick search 501 is used to search for local or online content according to user input; the sports health 502 is used to display sports-related information, such as the number of steps taken, energy consumed, walking distance, etc.; the quick application 503 is used to recommend or self Define the shortcut function entry; the contextual intelligence 504 is used to recommend contextual cards according to the user's usage habits. For example, the contextual intelligence 504 includes the smart home quick application display interface 506, and the smart home quick application display interface 506 can display the smart devices registered in the smart home system The list; News 505 is used to recommend news content according to the user’s usage habits. Since both the smart home fast application and the smart home native application need to display the list of smart devices registered in the smart home system, the smart home fast application and the smart home native application need to share the information of the smart devices registered in the smart home system.
在现有技术的一种实现方式中,请参考图6A,快应用和原生应用间通过服务器实现数据共享。原生应用将静态数据或动态数据同步到服务器。当用户点击使用原生应用对应的快应用时,快应用从服务器获取静态数据或动态数据。在该方式中,快应用与对应原生应用间的数据共享需要通过服务器,依赖终端与服务器间的网络连接;数据的同步效率可能导致快应用界面渲染慢,用户体验差的问题;并且还消耗用户带宽。In an implementation manner of the prior art, please refer to FIG. 6A, data sharing is implemented between the fast application and the native application through a server. Native applications synchronize static data or dynamic data to the server. When the user clicks to use the fast app corresponding to the native application, the fast app obtains static data or dynamic data from the server. In this method, the data sharing between the fast application and the corresponding native application needs to pass through the server, which depends on the network connection between the terminal and the server; the efficiency of data synchronization may cause the fast application interface to render slowly and the user experience is poor; and it also consumes users bandwidth.
在现有技术的另一种实现方式中,请参考图6B,快应用和原生应用间通过快应用引擎与原生应用间的数据共享机制(例如安卓的内容提供者Content Provider机制)实现数据共享。快应用与原生应用间的访问关系由快应用引擎决定。在该方式中,快应用运行于快应用引擎,操作系统并不识别快应用这种应用类型,无法针对快应用进行针对性系统权限授权,以及与原生应用间数据共享授权处理;只能由快应用引擎对快应用进行权限控制,以及与原生应用间数据共享授权控制。由于缺少操作系统级访问授权机制,存在其他快应用越权访问原生应用数据的风险。In another implementation manner of the prior art, please refer to FIG. 6B, the fast application and the native application realize data sharing through the data sharing mechanism between the fast application engine and the native application (for example, the content provider mechanism of Android). The access relationship between the fast application and the native application is determined by the fast application engine. In this method, the fast application runs on the fast application engine, and the operating system does not recognize the application type of the fast application, and cannot perform targeted system authorization authorization for the fast application, and authorization processing for data sharing with the native application; The application engine controls the permission of the fast application and the authorization control of data sharing with the native application. Due to the lack of an operating system-level access authorization mechanism, there is a risk that other fast apps may gain unauthorized access to native application data.
本申请实施例提供一种快应用与原生应用间数据共享的方法,在终端内部,由操作系统对快应用和原生应用间数据共享进行授权控制,可以高效、安全地在快应用与原生应用之间进行数据共享。The embodiment of the present application provides a method for data sharing between a fast application and a native application. In the terminal, the operating system performs authorization and control of data sharing between the fast application and the native application, which can efficiently and securely exchange data between the fast application and the native application. Data sharing between.
终端上可以运行多个快应用,以及安装多个原生应用。一些快应用与原生应用间存在对应关系。比如,快应用A对应原生应用A,快应用B对应原生应用B。快应用和对应的原生应用可以是同一个厂商开发的,提供相同功能的应用。示例性的,负一屏智能家居快应用对应智能家居原生应用;负一屏快递查询快应用对应快递查询原生应用。只有存在对应关系的快应用与原生应用间可以共享数据,否则就会存在越权访问数据的问题。比如,负一屏智能家居快应用需要在界面显示智能设备的名称、图标、设备连网状态等信息,需要获取这些信息的数据,对应的智能家居原生应用可能已经从服务器获取并保存了这些数据。智能家居原生应用可以向智能家居快应用共享这些数据。然而,智能家居原生应用保存的数据不能向快递查询快应用共享,否则就会存在数据泄露的问题。本申请实施例提供的快应用与原生应用间数据共享的方法,由终端的操作系统保存和管理快应用与原生应用间的对应关系,对快应用与原生应用间的数据共享进行访问权限控制,这样,可以高效、安全地在快应用与原生应用之间进行数据共享。Multiple fast applications can be run on the terminal, and multiple native applications can be installed. There is a correspondence between some fast apps and native apps. For example, fast application A corresponds to native application A, and fast application B corresponds to native application B. Quick apps and corresponding native apps can be apps developed by the same manufacturer and provide the same functions. Exemplarily, a negative one-screen smart home quick application corresponds to a native smart home application; a negative one-screen express query quick application corresponds to a native express query application. Only the corresponding fast apps and native apps can share data, otherwise there will be the problem of unauthorized access to data. For example, a negative one-screen smart home fast application needs to display information such as the name, icon, and device connection status of the smart device on the interface, and needs to obtain the data of this information. The corresponding smart home native application may have obtained and saved the data from the server. . The native smart home application can share these data with the smart home fast application. However, the data saved in the native application of smart home cannot be shared by the express application, otherwise there will be a data leakage problem. In the method for data sharing between a fast application and a native application provided by the embodiment of the present application, the operating system of the terminal saves and manages the corresponding relationship between the fast application and the native application, and performs access permission control on the data sharing between the fast application and the native application. In this way, data can be shared between fast apps and native apps efficiently and securely.
请参考图7,快应用A3121对应原生应用A318,快应用B3122对应原生应用B3182。快应用A3121和快应用B3122分别运行于终端31的快应用引擎313上。原生应用A3181和原生应用B3182分别运行于操作系统314上。终端31还包括快应用访问代理315,该快应用访问代理315可以对应生成两个快应用访问代理实例(如图7中快应用 访问代理实例A316和快应用访问代理实例B317),当然,也可以包含两个快应用访问代理,一个快应用访问代理分别对应生成一个快应用访问代理实例(图中未示出),该快应用访问代理315可以位于操作系统314或快应用引擎313内部,比如,快应用访问代理315可以位于操作系统314的应用程序框架层。Please refer to Figure 7, fast application A3121 corresponds to native application A318, and fast application B3122 corresponds to native application B3182. The quick application A3121 and the quick application B3122 run on the quick application engine 313 of the terminal 31 respectively. The native application A3181 and the native application B3182 run on the operating system 314 respectively. The terminal 31 also includes a quick application access agent 315, which can generate two quick application access agent instances (such as the quick application access agent instance A316 and the quick application access agent instance B317 in FIG. 7) correspondingly. Of course, it can also be Contains two quick application access agents, one quick application access agent generates one quick application access agent instance (not shown in the figure) respectively, and the quick application access agent 315 may be located in the operating system 314 or the quick application engine 313, for example, The fast application access agent 315 may be located at the application framework layer of the operating system 314.
当快应用A3121或快应用B3122首次运行,或用户首次订阅快应用A3121或快应用B3122时,可以通过快应用访问代理315在操作系统314进行快应用访问代理实例注册。快应用A3121通过快应用访问代理315在操作系统314进行快应用访问代理实例注册后,形成快应用访问代理实例A316;快应用B3122通过快应用访问代理315在操作系统314进行快应用访问代理实例注册后,形成快应用访问代理实例B317。操作系统314可以对快应用访问代理实例A316和快应用访问代理实例B317进行应用管理;也就是说,操作系统314可以将快应用访问代理实例A316和快应用访问代理实例B317等同于原生应用进行应用管理,对快应用访问代理实例A316和快应用访问代理实例B317进行数据访问权限控制。操作系统314控制快应用访问代理实例A316与快应用A3121对应的原生应用A3181通过原生应用间数据共享机制进行数据共享,控制快应用访问代理实例B317与快应用B3122对应的原生应用B3182通过原生应用间数据共享机制进行数据共享。进一步的,快应用访问代理实例A316可以通过快应用访问代理315向快应用A3121发送或从快应用A3121接收共享数据,从而完成快应用A3121与原生应用A3181的数据共享;快应用访问代理实例B317可以通过快应用访问代理315向快应用B3122发送或从快应用B2122接收共享数据,从而完成快应用B3122与原生应用B3182的数据共享。When the quick application A3121 or the quick application B3122 runs for the first time, or the user subscribes to the quick application A3121 or the quick application B3122 for the first time, the quick application access agent instance registration can be performed in the operating system 314 through the quick application access agent 315. After fast application A3121 registers fast application access agent instance in operating system 314 through fast application access agent 315, it forms fast application access agent instance A316; fast application B3122 registers fast application access agent instance in operating system 314 through fast application access agent 315 Then, the fast application access proxy instance B317 is formed. The operating system 314 can perform application management on the quick application access agent instance A316 and the quick application access agent instance B317; that is, the operating system 314 can equate the quick application access agent instance A316 and the quick application access agent instance B317 to the native application for application Management, data access authority control for quick application access agent instance A316 and quick application access agent instance B317. The operating system 314 controls the quick application access proxy instance A316 and the native application A3181 corresponding to the quick application A3121 to share data through the native inter-application data sharing mechanism, and controls the quick application access proxy instance B317 to the native application B3182 corresponding to the quick application B3122 through the native application. Data sharing mechanism for data sharing. Further, the quick application access agent instance A316 can send or receive shared data to or from the quick application A3121 through the quick application access agent 315, thereby completing the data sharing between the quick application A3121 and the native application A3181; the quick application access agent instance B317 can The quick application access agent 315 sends or receives shared data to or from the quick application B3122, thereby completing data sharing between the quick application B3122 and the native application B3182.
这样,由操作系统314管理快应用A3121与原生应用A3181之间的对应关系,快应用B3122与原生应用B3182之间的对应关系,保证快应用与原生应用间的数据共享过程安全、高效的进行,避免应用越权访问数据。In this way, the operating system 314 manages the correspondence between the fast application A3121 and the native application A3181, and the correspondence between the fast application B3122 and the native application B3182, to ensure that the data sharing process between the fast application and the native application is carried out safely and efficiently. Avoid unauthorized access to data by apps.
下面以智能家居快应用与智能家居原生应用间数据共享为例,对本申请实施例提供的快应用与原生应用间数据共享的方法进行详细介绍。In the following, taking data sharing between the smart home quick application and the smart home native application as an example, the method for data sharing between the quick application and the native application provided in the embodiment of the present application will be introduced in detail.
智能家居快应用与智能家居原生应用间通过快应用访问代理进行数据共享,智能家居快应用需要先在终端的操作系统进行注册。The smart home fast application and the smart home native application share data through the fast application access agent, and the smart home fast application needs to be registered in the operating system of the terminal first.
请参考图8,智能家居快应用在终端的操作系统进行注册的过程可以包括:Please refer to Figure 8, the process of registering the smart home application in the operating system of the terminal may include:
S801、智能家居快应用通过快应用引擎从快应用平台下载快应用资源安装包。S801. The smart home fast application downloads the fast application resource installation package from the fast application platform through the fast application engine.
在智能家居快应用首次使用时,通过快应用引擎从快应用平台下载快应用资源安装包。该快应用平台可以是服务器上的应用仓库。下载快应用资源安装包后,快应用引擎获取到智能家居快应用资源安装包的标识、证书指纹等信息。When the smart home fast app is used for the first time, the fast app resource installation package is downloaded from the fast app platform through the fast app engine. The fast application platform may be an application warehouse on a server. After downloading the quick application resource installation package, the quick application engine obtains the identification, certificate fingerprint and other information of the smart home quick application resource installation package.
S802、快应用引擎加载智能家居快应用资源安装包。S802. The quick application engine loads the smart home quick application resource installation package.
S803、快应用引擎向快应用访问代理注册智能家居快应用。S803. The quick application engine registers the smart home quick application with the quick application access agent.
在一些示例中,快应用引擎加载智能家居快应用资源安装包后,可以立即向快应用访问代理注册智能家居快应用。在另一些示例中,快应用引擎加载智能家居快应用资源安装包后,在需要时(比如,收到智能家居快应用访问原生应用的共享数据的请求时),向快应用访问代理注册智能家居快应用。In some examples, after the quick application engine loads the smart home quick application resource installation package, it can immediately register the smart home quick application with the quick application access agent. In other examples, after the quick application engine loads the smart home quick application resource installation package, when needed (for example, when it receives a request from the smart home quick application to access the shared data of the native application), it registers the smart home with the quick application access agent Quickly apply.
在一种实现方式中,快应用引擎将智能家居快应用与对应的智能家居原生应用间 的授权访问信息注册至快应用访问代理。其中,智能家居快应用与对应的智能家居原生应用间的授权访问信息可以包括:智能家居快应用资源安装包的标识,智能家居快应用资源安装包的证书指纹,智能家居快应用对应的智能家居原生应用的标识,以及请求访问的数据等。示例性的,智能家居快应用资源安装包的标识可以为智能家居快应用资源安装包的包名,智能家居原生应用的标识可以为智能家居原生应用的包名。In one implementation, the quick application engine registers the authorized access information between the smart home quick application and the corresponding smart home native application to the quick application access agent. Among them, the authorized access information between the smart home app and the corresponding smart home native application may include: the identification of the smart home app resource installation package, the certificate fingerprint of the smart home app resource installation package, and the smart home corresponding to the smart home app The identity of the native application, and the data requested to be accessed, etc. Exemplarily, the identifier of the smart home application resource installation package may be the package name of the smart home application resource installation package, and the identifier of the smart home native application may be the package name of the smart home native application.
示例性的,注册接口如下:Exemplarily, the registration interface is as follows:
public bool fastappRegister(String fastappPackageName,String fastappFingerPrint,String nativeappPackageName,OBJECT shareData)。public bool fastappRegister(String fastappPackageName, String fastappFingerPrint, String nativeappPackageName, OBJECT shareData).
其中,fastappPackageName表示快应用资源安装包的包名,fastappFingerPrint表示快应用资源安装包的证书指纹,nativeappPackageName表示原生应用的包名,shareData表示请求访问的数据。Among them, fastappPackageName represents the package name of the fast app resource installation package, fastappFingerPrint represents the certificate fingerprint of the fast app resource installation package, nativeappPackageName represents the package name of the native application, and shareData represents the data requested to be accessed.
快应用访问代理生成并返回智能家居快应用数据访问的加密密钥。智能家居快应用获取到该加密密钥。The fast application access agent generates and returns the encryption key for data access of the smart home fast application. The smart home fast application obtains the encryption key.
S804、快应用访问代理在操作系统进行快应用访问代理实例注册。S804. The fast application access agent performs registration of the fast application access agent instance in the operating system.
快应用访问代理向操作系统(比如,操作系统的应用管理模块)动态申请智能家居快应用对应的快应用访问代理实例,形成对应的快应用访问代理实例A。快应用访问代理实例A在操作系统进行登记,操作系统保存快应用访问代理实例A的信息,之后就可以对快应用访问代理实例A进行应用管理。The fast application access agent dynamically applies to the operating system (for example, the application management module of the operating system) for the fast application access agent instance corresponding to the smart home fast application to form the corresponding fast application access agent instance A. The quick application access agent instance A is registered in the operating system, and the operating system saves the information of the quick application access agent instance A, and then the application management of the quick application access agent instance A can be performed.
其中,在一种实现方式中,快应用访问代理实例A的标识与智能家居快应用资源安装包的标识相同,快应用访问代理实例A的证书指纹与智能家居快应用资源安装包的证书指纹相同。在另一种实现方式中,快应用访问代理实例A的标识与智能家居快应用资源安装包的标识存在一一对应的映射关系,快应用访问代理实例A的证书指纹与智能家居快应用资源安装包的证书指纹存在一一对应的映射关系。Among them, in one implementation, the identification of the quick application access agent instance A is the same as the identification of the smart home quick application resource installation package, and the certificate fingerprint of the quick application access agent instance A is the same as the certificate fingerprint of the smart home quick application resource installation package . In another implementation, there is a one-to-one mapping between the identification of the quick application access agent instance A and the identification of the smart home quick application resource installation package, and the certificate fingerprint of the quick application access agent instance A and the smart home quick application resource installation There is a one-to-one mapping between the package certificate fingerprints.
需要说明的是,智能家居快应用资源安装包的包名与操作系统中其他原生应用的APK包名都不相同。It should be noted that the package name of the smart home quick application resource installation package is different from the APK package name of other native applications in the operating system.
在一种实现方式中,快应用访问代理还可以在操作系统注销快应用访问代理实例。智能家居快应用对应的快应用访问代理实例A在操作系统注销后,操作系统不再对快应用访问代理实例A(即智能家居快应用)的数据访问权限进行控制管理。In an implementation manner, the fast application access agent can also log off the fast application access agent instance in the operating system. After the quick application access agent instance A corresponding to the smart home quick application logs out of the operating system, the operating system no longer controls and manages the data access authority of the quick application access agent instance A (ie, the smart home quick application).
S805、快应用访问代理将智能家居快应用与对应的智能家居原生应用间的授权访问信息保存至快应用访问代理实例A。S805. The quick application access agent saves the authorized access information between the smart home quick application and the corresponding smart home native application to the quick application access agent instance A.
这样,快应用访问代理实例A获取到智能家居快应用与对应的智能家居原生应用间的授权访问信息。其中,智能家居快应用与对应的智能家居原生应用间的授权访问信息包括:智能家居快应用资源安装包的标识,智能家居快应用资源安装包的证书指纹,智能家居快应用对应的智能家居原生应用的标识,以及请求访问的数据等。In this way, the quick application access agent instance A obtains the authorized access information between the smart home quick application and the corresponding smart home native application. Among them, the authorized access information between the smart home app and the corresponding smart home native application includes: the identification of the smart home app resource installation package, the certificate fingerprint of the smart home app resource installation package, and the smart home native app corresponding to the smart home app The identity of the application, and the requested data, etc.
智能家居快应用通过快应用访问代理在操作系统注册,形成对应的快应用访问代理实例后,智能家居快应用就可以与智能家居原生应用间在操作系统的控制管理下进行数据共享。After the smart home fast application registers with the operating system through the fast application access agent, and the corresponding fast application access agent instance is formed, the smart home fast application can share data with the native smart home application under the control and management of the operating system.
请参考图9,智能家居快应用访问智能家居原生应用的共享数据的流程可以包括:Please refer to Figure 9, the process of the smart home fast application accessing the shared data of the smart home native application can include:
S901、智能家居快应用调用快应用引擎的应用间数据访问接口,请求访问对应的 原生应用的共享数据。S901. The smart home fast application calls the inter-application data access interface of the fast application engine to request access to the shared data of the corresponding native application.
智能家居快应用在需要访问智能家居原生应用的共享数据时,调用快应用引擎的应用间数据访问接口,请求访问原生应用的共享数据。When the smart home fast application needs to access the shared data of the smart home native application, it calls the inter-application data access interface of the fast application engine to request access to the shared data of the native application.
在一种实现方式中,调用应用间数据访问接口时,智能家居快应用请求访问的数据通过S803中获取的智能家居快应用数据访问的加密密钥进行加密。In an implementation manner, when the inter-application data access interface is called, the data that the smart home fast application requests to access is encrypted by the encryption key for the smart home fast application data access obtained in S803.
S902、快应用引擎将智能家居快应用调用应用间数据访问接口的请求消息发送至快应用访问代理。S902. The fast application engine sends a request message for the smart home fast application to call the inter-application data access interface to the fast application access agent.
在一种实现方式中,快应用引擎与快应用访问代理间建立透明访问隧道,发送智能家居快应用调用应用间数据访问接口的请求消息。例如,可以基于Android接口定义语言(android interface definition language,AIDL)、Messager等消息通信方式建立透明访问隧道。In one implementation, a transparent access tunnel is established between the fast application engine and the fast application access agent, and a request message for the smart home fast application to call the inter-application data access interface is sent. For example, a transparent access tunnel can be established based on message communication methods such as Android interface definition language (AIDL) and Messager.
S903、快应用访问代理向快应用访问代理实例A发送智能家居快应用调用应用间数据访问接口的请求消息。S903. The fast application access agent sends a request message for the smart home fast application to call the inter-application data access interface to the fast application access agent instance A.
在一种实现方式中,快应用访问代理接收到智能家居快应用调用应用间数据访问接口的请求消息,对智能家居快应用请求访问的数据进行解密,并向快应用访问代理实例A发送智能家居快应用调用应用间数据访问接口的请求消息。In one implementation, the quick application access agent receives the request message of the smart home quick application to call the inter-application data access interface, decrypts the data requested by the smart home quick application, and sends the smart home to the quick application access agent instance A The fast application calls the request message of the inter-application data access interface.
S904、快应用访问代理实例A通过原生应用间数据共享机制访问智能家居原生应用的共享数据。S904. The fast application access agent instance A accesses the shared data of the native application of the smart home through the data sharing mechanism between the native applications.
快应用访问代理实例A根据智能家居快应用调用应用间数据访问接口的请求消息中智能家居快应用请求访问的数据,通过原生应用间数据共享机制,访问智能家居原生应用的共享数据。其中,原生应用间数据共享机制可以采用一般技术中安卓操作系统的原生应用间数据共享机制,比如内容提供者Content Provider、共享偏好sharedPreferences等;此处不再赘述。The quick application access agent instance A accesses the shared data of the smart home native application according to the data requested by the smart home quick application in the request message of the smart home quick application to call the inter-application data access interface through the native inter-application data sharing mechanism. Among them, the data sharing mechanism between native applications can adopt the data sharing mechanism between the native applications of the Android operating system in general technology, such as Content Provider, shared preferences, etc.; details are not described here.
原生应用间数据共享机制中,操作系统对应用间数据访问进行权限控制。比如,操作系统在快应用注册过程保存了快应用访问代理实例A与智能家居原生应用间的对应关系,则允许快应用访问代理实例A访问智能家居原生应用的共享数据。In the native data sharing mechanism between applications, the operating system controls access to data between applications. For example, the operating system saves the correspondence between the quick application access agent instance A and the smart home native application during the quick application registration process, and allows the quick application access agent instance A to access the shared data of the smart home native application.
在一种实现方式中,在快应用注册过程的S805,快应用访问代理实例A获取到智能家居快应用与对应的智能家居原生应用间的授权访问信息,包括:智能家居快应用资源安装包的标识,智能家居快应用资源安装包的证书指纹,智能家居快应用对应的智能家居原生应用的标识,以及请求访问的数据等。快应用访问代理实例A通过智能家居原生应用的标识,确定对应的智能家居原生应用,并向智能家居原生应用请求访问其共享数据。智能家居原生应用根据操作系统的数据访问权限控制机制,校验快应用访问代理实例A的标识等授权信息。如果校验通过,则将智能家居快应用请求访问的数据发送给快应用访问代理实例A。In one implementation, in S805 of the quick application registration process, the quick application access agent instance A obtains the authorized access information between the smart home quick application and the corresponding smart home native application, including: the smart home quick application resource installation package Identification, the certificate fingerprint of the smart home application resource installation package, the identification of the smart home native application corresponding to the smart home application, and the data requested to be accessed, etc. The quick application access proxy instance A determines the corresponding smart home native application through the identification of the smart home native application, and requests the smart home native application to access its shared data. The native smart home application verifies the authorization information such as the identification of the quick application access agent instance A according to the data access authority control mechanism of the operating system. If the verification is passed, the data requested to be accessed by the smart home fast application is sent to the fast application access agent instance A.
快应用访问代理实例A获取到共享数据后,可以通过快应用访问代理,将获取到的共享数据发送至智能家居快应用。这样,智能家居快应用获取到智能家居原生应用的共享数据。After the quick application access agent instance A obtains the shared data, it can use the quick application access agent to send the obtained shared data to the smart home quick application. In this way, the smart home fast application obtains the shared data of the smart home native application.
需要说明的是,智能家居原生应用访问智能家居快应用的共享数据的流程,与智能家居快应用访问智能家居原生应用的共享数据的流程类似。It should be noted that the process for the native smart home application to access the shared data of the smart home fast application is similar to the process for the smart home fast app to access the shared data of the smart home native application.
在一种示例中,由操作系统对智能家居原生应用的数据访问请求进行权限控制。比如,在快应用注册过程,操作系统保存了快应用访问代理实例A与智能家居原生应用间的对应关系,则允许智能家居原生应用访问快应用访问代理实例A的共享数据。智能家居原生应用需要访问对应的智能家居快应用的共享数据时,向快应用访问代理实例A发送数据共享请求消息。In an example, the operating system performs permission control on the data access request of the native smart home application. For example, during the quick application registration process, the operating system saves the correspondence between the quick application access agent instance A and the smart home native application, and allows the smart home native application to access the shared data of the quick application access agent instance A. When the native smart home application needs to access the shared data of the corresponding smart home fast application, it sends a data sharing request message to the fast application access agent instance A.
在快应用注册过程的S805,快应用访问代理实例A获取到智能家居快应用与对应的智能家居原生应用间的授权访问信息,包括:智能家居快应用资源安装包的标识,智能家居快应用资源安装包的证书指纹,智能家居快应用对应的智能家居原生应用的标识,以及请求访问的数据等。快应用访问代理实例A接收到智能家居原生应用的数据共享请求消息后,对智能家居原生应用的标识进行验证。如果验证通过,则确定允许智能家居原生应用访问智能家居快应用的共享数据。In S805 of the quick application registration process, the quick application access agent instance A obtains the authorized access information between the smart home quick application and the corresponding smart home native application, including: the identification of the smart home quick application resource installation package, and the smart home quick application resource The certificate fingerprint of the installation package, the identification of the smart home native application corresponding to the smart home fast application, and the data requested to be accessed, etc. After the fast application access agent instance A receives the data sharing request message of the smart home native application, it verifies the identity of the smart home native application. If the verification is passed, it is determined that the native smart home application is allowed to access the shared data of the smart home fast application.
快应用访问代理实例A将接收到的数据共享请求消息通过快应用访问代理发送至快应用引擎,快应用引擎根据快应用访问代理实例A与智能家居快应用的对应关系,将该数据共享请求消息发送给智能家居快应用。The quick application access proxy instance A sends the received data sharing request message to the quick application engine through the quick application access agent, and the quick application engine uses the corresponding relationship between the quick application access agent instance A and the smart home quick application to share the data sharing request message Send to the smart home app.
智能家居快应用接收到数据共享请求消息后,将共享数据通过快应用引擎发送至快应用访问代理。快应用访问代理根据快应用访问代理实例A与智能家居快应用的对应关系,将智能家居快应用的共享数据发送至快应用访问代理实例A。After receiving the data sharing request message, the smart home fast application sends the shared data to the fast application access agent through the fast application engine. The quick application access agent sends the shared data of the smart home quick application to the quick application access agent instance A according to the corresponding relationship between the quick application access agent instance A and the smart home quick application.
智能家居原生应用通过原生应用间数据共享机制,访问快应用访问代理实例A的共享数据,即访问智能家居快应用的共享数据。The smart home native application accesses the shared data of the quick application access agent instance A through the data sharing mechanism between the native applications, that is, accesses the shared data of the smart home quick application.
本申请实施例提供的快应用与原生应用间数据共享的方法,运行于快应用引擎的快应用通过快应用访问代理在操作系统进行注册,形成对应的快应用访问代理实例。快应用访问代理实例可以与原生应用间采用操作系统的原生应用间数据共享机制进行数据共享。这样,可以在终端内部实现快应用与原生应用间的数据共享,且由操作系统进行数据访问权限控制,数据共享过程既安全又高效。并且,快应用访问代理实例与原生应用间采用常规技术中操作系统的原生应用间数据共享机制进行数据共享,不需要修改操作系统的原生应用间数据共享机制,可扩展性好。In the method for data sharing between a fast application and a native application provided by the embodiments of the present application, the fast application running on the fast application engine registers with the operating system through the fast application access agent to form a corresponding fast application access agent instance. The fast application access proxy instance can share data with the native application using the native inter-application data sharing mechanism of the operating system. In this way, the data sharing between the fast application and the native application can be realized within the terminal, and the data access authority is controlled by the operating system, and the data sharing process is safe and efficient. In addition, the fast application access agent instance and the native application use the native inter-application data sharing mechanism of the operating system in the conventional technology for data sharing, without the need to modify the operating system's native inter-application data sharing mechanism, and the scalability is good.
可以理解的是,上述终端为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。It can be understood that, in order to implement the above-mentioned functions, the above-mentioned terminal includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the embodiments of the present application.
本申请实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机程序代码,当电子设备的处理器执行该计算机程序代码时,电子设备执行图7或图8或图9中终端执行的相关方法步骤实现上述实施例中的方法。The embodiment of the present application also provides a computer storage medium in which computer program code is stored. When the processor of the electronic device executes the computer program code, the electronic device executes the terminal execution in FIG. 7 or FIG. 8 or FIG. 9 The relevant method steps implement the method in the above-mentioned embodiment.
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行图7或图8或图9中终端执行的相关方法步骤实现上述实施例中的方法。The embodiment of the present application also provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the relevant method steps executed by the terminal in FIG. 7 or FIG. 8 or FIG. 9 to implement the method in the foregoing embodiment.
其中,本申请实施例提供的计算机存储介质或者计算机程序产品均用于执行上文 所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the computer storage media or computer program products provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above. The effect will not be repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example. In practical applications, the above-mentioned functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理器中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以使用硬件的形式实现,也可以使用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processor, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, ROM, magnetic disk, or optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any change or replacement within the technical scope disclosed in this application shall be covered by the protection scope of this application. . Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (18)

  1. 一种快应用与原生应用间数据共享的方法,应用于终端,所述终端包括快应用引擎,快应用访问代理,操作系统,第一快应用,以及第一原生应用,其特征在于,所述方法包括:A method for data sharing between a quick application and a native application is applied to a terminal, the terminal includes a quick application engine, a quick application access agent, an operating system, a first quick application, and a first native application, wherein the Methods include:
    所述快应用引擎将所述第一快应用注册至所述快应用访问代理;The quick application engine registers the first quick application to the quick application access agent;
    所述快应用访问代理将所述第一快应用注册至所述操作系统,形成第一快应用访问代理实例;The fast application access agent registers the first fast application to the operating system to form a first fast application access agent instance;
    所述第一快应用访问代理实例与所述第一原生应用采用原生应用间数据共享机制进行数据共享,获取所述第一原生应用的共享数据;The first fast application access agent instance and the first native application use a data sharing mechanism between native applications to share data, and obtain shared data of the first native application;
    所述第一快应用通过所述快应用访问代理从所述第一快应用访问代理实例获取所述第一原生应用的共享数据。The first fast application obtains the shared data of the first native application from the first fast application access proxy instance through the fast application access proxy.
  2. 根据权利要求1所述的方法,其特征在于,所述快应用引擎将所述第一快应用注册至所述快应用访问代理包括:The method according to claim 1, wherein the quick application engine registering the first quick application to the quick application access agent comprises:
    所述快应用引擎将所述第一快应用与所述第一原生应用间的授权访问信息注册至所述快应用访问代理;所述第一快应用与所述第一原生应用间的授权访问信息包括:所述第一快应用资源安装包的标识,所述第一快应用资源安装包的证书指纹,所述第一原生应用的标识,以及请求访问的数据。The quick application engine registers the authorized access information between the first quick application and the first native application to the quick application access agent; the authorized access between the first quick application and the first native application The information includes: the identification of the first quick application resource installation package, the certificate fingerprint of the first quick application resource installation package, the identification of the first native application, and the data requested to be accessed.
  3. 根据权利要求2所述的方法,其特征在于,所述快应用访问代理将所述第一快应用注册至所述操作系统,形成第一快应用访问代理实例之后,所述方法还包括:The method according to claim 2, wherein after the quick application access agent registers the first quick application to the operating system to form a first quick application access agent instance, the method further comprises:
    所述快应用访问代理将所述第一快应用与所述第一原生应用间的授权访问信息保存至所述第一快应用访问代理实例。The quick application access agent saves the authorized access information between the first quick application and the first native application to the first quick application access agent instance.
  4. 根据权利要求2或3所述的方法,其特征在于,The method according to claim 2 or 3, wherein:
    所述第一快应用访问代理实例的标识与所述第一快应用资源安装包的标识一一对应,所述第一快应用访问代理实例的证书指纹与所述第一快应用资源安装包的证书指纹一一对应。The identification of the first quick application access agent instance corresponds to the identification of the first quick application resource installation package, and the certificate fingerprint of the first quick application access agent instance corresponds to the identification of the first quick application resource installation package. There is a one-to-one correspondence between certificate fingerprints.
  5. 根据权利要求2-4任一项所述的方法,其特征在于,所述快应用引擎将所述第一快应用注册至所述快应用访问代理还包括:The method according to any one of claims 2-4, wherein the quick application engine registering the first quick application to the quick application access agent further comprises:
    所述快应用访问代理向所述第一快应用返回所述第一快应用进行数据访问的加密密钥。The fast application access agent returns to the first fast application an encryption key for the first fast application for data access.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述原生应用间数据共享机制包括:内容提供者Content Provider,或者,共享偏好sharedPreferences。The method according to any one of claims 1 to 5, wherein the data sharing mechanism between native applications includes: Content Provider, or shared preferences sharedPreferences.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述原生应用间数据共享设置有数据访问权限,所述数据访问权限由所述操作系统控制。The method according to any one of claims 1 to 6, wherein the data sharing between native applications is provided with data access permissions, and the data access permissions are controlled by the operating system.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述快应用访问代理属于所述操作系统,或者属于所述快应用引擎。The method according to any one of claims 1-7, wherein the fast application access agent belongs to the operating system or belongs to the fast application engine.
  9. 一种终端,其特征在于,包括:快应用引擎,快应用访问代理,操作系统,第一快应用,以及第一原生应用,A terminal, which is characterized by comprising: a fast application engine, a fast application access agent, an operating system, a first fast application, and a first native application,
    所述快应用引擎,用于将所述第一快应用注册至所述快应用访问代理;The quick application engine is used to register the first quick application to the quick application access agent;
    所述快应用访问代理,用于将所述第一快应用注册至所述操作系统,形成第一快应用访问代理实例;The quick application access agent is used to register the first quick application to the operating system to form an instance of the first quick application access agent;
    所述第一快应用访问代理实例,用于与所述第一原生应用采用原生应用间数据共享机制进行数据共享,获取所述第一原生应用的共享数据;The first fast application access agent instance is used to share data with the first native application using a data sharing mechanism between native applications, and obtain shared data of the first native application;
    所述第一快应用,用于通过所述快应用访问代理从所述第一快应用访问代理实例获取所述第一原生应用的共享数据。The first fast application is configured to obtain shared data of the first native application from the first fast application access proxy instance through the fast application access proxy.
  10. 根据权利要求9所述的终端,其特征在于,The terminal according to claim 9, wherein:
    所述快应用引擎,具体用于将所述第一快应用与所述第一原生应用间的授权访问信息注册至所述快应用访问代理;所述第一快应用与所述第一原生应用间的授权访问信息包括:所述第一快应用资源安装包的标识,所述第一快应用资源安装包的证书指纹,所述第一原生应用的标识,以及请求访问的数据。The quick application engine is specifically configured to register authorized access information between the first quick application and the first native application to the quick application access agent; the first quick application and the first native application The authorized access information includes: the identification of the first quick application resource installation package, the certificate fingerprint of the first quick application resource installation package, the identification of the first native application, and the data requested for access.
  11. 根据权利要求10所述的终端,其特征在于,The terminal according to claim 10, wherein:
    所述快应用访问代理,还用于将所述第一快应用与所述第一原生应用间的授权访问信息保存至所述第一快应用访问代理实例。The quick application access agent is further configured to save the authorized access information between the first quick application and the first native application to the first quick application access agent instance.
  12. 根据权利要求10或11所述的终端,其特征在于,The terminal according to claim 10 or 11, wherein:
    所述第一快应用访问代理实例的标识与所述第一快应用资源安装包的标识一一对应,所述第一快应用访问代理实例的证书指纹与所述第一快应用资源安装包的证书指纹一一对应。The identification of the first quick application access agent instance corresponds to the identification of the first quick application resource installation package, and the certificate fingerprint of the first quick application access agent instance corresponds to the identification of the first quick application resource installation package. There is a one-to-one correspondence between certificate fingerprints.
  13. 根据权利要求10-12任一项所述的终端,其特征在于,The terminal according to any one of claims 10-12, wherein:
    所述快应用访问代理,还用于向所述第一快应用返回所述第一快应用进行数据访问的加密密钥。The fast application access agent is further configured to return to the first fast application an encryption key for the first fast application for data access.
  14. 根据权利要求9-13任一项所述的终端,其特征在于,The terminal according to any one of claims 9-13, wherein:
    所述操作系统,用于对所述原生应用间数据共享进行数据访问权限控制。The operating system is used to perform data access permission control on data sharing between the native applications.
  15. 根据权利要求9-14任一项所述的终端,其特征在于,The terminal according to any one of claims 9-14, wherein:
    所述快应用访问代理属于所述操作系统,或者属于所述快应用引擎。The fast application access agent belongs to the operating system or belongs to the fast application engine.
  16. 一种终端,其特征在于,所述终端包括:处理器和存储器;所述存储器与所述处理器耦合;所述存储器用于存储计算机程序代码;所述计算机程序代码包括计算机指令,当所述处理器执行上述计算机指令时,使得所述终端执行如权利要求1-8任一项所述的方法。A terminal, characterized in that the terminal includes: a processor and a memory; the memory is coupled with the processor; the memory is used to store computer program code; the computer program code includes computer instructions, when the When the processor executes the above computer instructions, it causes the terminal to execute the method according to any one of claims 1-8.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机指令,当所述计算机指令在终端上运行时,使得所述终端执行如权利要求1-8任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium includes computer instructions, which when the computer instructions are run on a terminal, cause the terminal to execute any one of claims 1-8 Methods.
  18. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-8任一项所述的方法。A computer program product, characterized in that, when the computer program product runs on a computer, the computer is caused to execute the method according to any one of claims 1-8.
PCT/CN2020/131133 2019-11-27 2020-11-24 Method and terminal for data sharing between fast application and native application WO2021104259A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911183286.0 2019-11-27
CN201911183286.0A CN112860445B (en) 2019-11-27 2019-11-27 Method and terminal for sharing data between fast application and native application

Publications (1)

Publication Number Publication Date
WO2021104259A1 true WO2021104259A1 (en) 2021-06-03

Family

ID=75984850

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/131133 WO2021104259A1 (en) 2019-11-27 2020-11-24 Method and terminal for data sharing between fast application and native application

Country Status (2)

Country Link
CN (1) CN112860445B (en)
WO (1) WO2021104259A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805797A (en) * 2021-06-17 2021-12-17 荣耀终端有限公司 Network resource processing method, electronic device and computer readable storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667434A (en) * 2022-08-23 2024-03-08 华为技术有限公司 Method for accessing data and electronic equipment
CN116737405B (en) * 2022-10-24 2024-03-05 荣耀终端有限公司 Method for data communication of quick application card and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100153667A1 (en) * 2008-12-15 2010-06-17 Sony Ericsson Mobile Communications Ab Method, computer program and electronic device
CN106201610A (en) * 2016-07-06 2016-12-07 青岛海信移动通信技术股份有限公司 Web application accesses the method and device of the primary function of terminal
CN110008668A (en) * 2019-03-21 2019-07-12 北京小米移动软件有限公司 A kind of data processing method, device and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110179477A1 (en) * 2005-12-09 2011-07-21 Harris Corporation System including property-based weighted trust score application tokens for access control and related methods
CN110096375B (en) * 2019-03-29 2023-07-25 努比亚技术有限公司 Method and device for sharing data by application programs and computer readable storage medium
CN110457944B (en) * 2019-08-02 2023-08-25 爱友智信息科技(苏州)有限公司 Data sharing method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100153667A1 (en) * 2008-12-15 2010-06-17 Sony Ericsson Mobile Communications Ab Method, computer program and electronic device
CN106201610A (en) * 2016-07-06 2016-12-07 青岛海信移动通信技术股份有限公司 Web application accesses the method and device of the primary function of terminal
CN110008668A (en) * 2019-03-21 2019-07-12 北京小米移动软件有限公司 A kind of data processing method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805797A (en) * 2021-06-17 2021-12-17 荣耀终端有限公司 Network resource processing method, electronic device and computer readable storage medium
CN113805797B (en) * 2021-06-17 2023-04-28 荣耀终端有限公司 Processing method of network resource, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN112860445A (en) 2021-05-28
CN112860445B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
WO2021023220A1 (en) Content continuation method and system, and electronic device
WO2020192714A1 (en) Device control page display method, related apparatus and system
WO2020108356A1 (en) Application display method and electronic device
WO2021000807A1 (en) Processing method and apparatus for waiting scenario in application
WO2021023163A1 (en) Method for displaying screen-on information of application, and electronic device
WO2021104259A1 (en) Method and terminal for data sharing between fast application and native application
WO2021258809A1 (en) Data synchronization method, electronic device, and computer readable storage medium
WO2021253975A1 (en) Permission management method and apparatus for application, and electronic device
WO2020150917A1 (en) Application permission management method and electronic device
WO2021159746A1 (en) File sharing method and system, and related device
WO2021052204A1 (en) Address book-based device discovery method, audio and video communication method, and electronic device
WO2022089121A1 (en) Method and apparatus for processing push message
WO2022127632A1 (en) Resource management and control method, and device
WO2021073337A1 (en) Method and apparatus for installing plug-in, and storage medium
WO2022253158A1 (en) User privacy protection method and apparatus
CN115333941A (en) Method for acquiring application running condition and related equipment
WO2023051094A1 (en) Memory recovery method and apparatus, electronic device, and readable storage medium
WO2023284555A1 (en) Method for securely calling service, and method and apparatus for securely registering service
CN115309431A (en) Parameter updating method, readable medium and electronic equipment
WO2021238376A1 (en) Function pack loading method and apparatus, and server and electronic device
CN116982042A (en) Flexible authorized access control method, related device and system
CN115203716A (en) Permission synchronization method, related device and system
CN115238299A (en) Access control method based on security level, related device and system
CN116795435A (en) Compatibility management and control method and related equipment
CN115599565A (en) Method and device for sending clipboard data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20894115

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20894115

Country of ref document: EP

Kind code of ref document: A1