WO2022111469A1 - Procédé et appareil de partage de fichier et dispositif électronique - Google Patents

Procédé et appareil de partage de fichier et dispositif électronique Download PDF

Info

Publication number
WO2022111469A1
WO2022111469A1 PCT/CN2021/132422 CN2021132422W WO2022111469A1 WO 2022111469 A1 WO2022111469 A1 WO 2022111469A1 CN 2021132422 W CN2021132422 W CN 2021132422W WO 2022111469 A1 WO2022111469 A1 WO 2022111469A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
file
identifier
electronic device
installation package
Prior art date
Application number
PCT/CN2021/132422
Other languages
English (en)
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 WO2022111469A1 publication Critical patent/WO2022111469A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a file sharing method, apparatus, and electronic device.
  • Electronic devices such as personal computers and smartphones have become an indispensable part of people's lives. These electronic devices often have multiple applications installed on them. Multiple applications can provide users with various services such as weather information, shopping, instant messaging, and photography.
  • Each application typically stores data related to the operation of the application in a directory of the electronic device's file system. The application can access the stored related data according to the running requirements.
  • the operating system of a general electronic device provides an application sandbox mechanism for each application in the electronic device.
  • Sandboxing is a security mechanism that provides an isolated environment for running programs. That is, each application can only access that application's data, not other applications' data. Adopting this security mechanism can prevent some applications from maliciously accessing other applications' data.
  • some applications need to share data, for example, application B needs to share data of application A (for example, a file of application A stored in the file system of the electronic device).
  • application A for example, a file of application A stored in the file system of the electronic device.
  • due to the security mechanism of the operating system in the electronic device it is difficult to share data between applications.
  • the present application provides a file sharing method, device and electronic device.
  • a specified file can be shared with a specified application program, and malicious access of the shared file by other application programs can be avoided. This enables safe and convenient data sharing between applications.
  • the present application provides a file sharing method, the method may include: acquiring an installation package of a first application, wherein the installation package of the first application includes a first file and a first identifier, and the first identifier Indicates that the shared object of the first file includes the second application; and according to the first identification, the second application is provided with the access right of the first file.
  • a specified file can be shared with a specified application.
  • the electronic device only needs to establish a sharing relationship according to the first identifier in the installation package of the first application, and provide the access right of the first file.
  • no additional operation is required to set the sharing permission of the first file. If other application programs of the electronic device are not the sharing objects of the first file indicated by the first identifier, they do not have permission to access the first file. In this way, malicious access to the first file by other applications can be avoided. In this way, data sharing between applications can be achieved in a safe and convenient manner.
  • providing the second application with the access authority of the first file according to the first identifier includes: when the electronic device installs the first application according to the installation package of the first application, reading the first application an identifier; according to the first identifier, provide the second application with the access right of the first file.
  • providing the second application with the access right of the first file according to the first identification includes: according to the first identification, adding the second application to the sharing group of the first file, wherein the sharing A group is used to indicate an application that has permission to access the first file.
  • adding the identifier of the second application program to the sharing group of the first file according to the first identifier includes: when it is determined that the identifier of the second application program is included in the first identifier, adding the identifier of the second application program to the first identifier.
  • the program is added to the sharing group of the first file; the identifier of the second application program includes the identifier carried in the installation package of the second application program.
  • the identifier of the second application program may be the public key of the second application program, and when it is determined that the identifier of the second application program is included in the first identifier, the second application program is added to the sharing group of the first file, which may be specifically : when it is determined that the first identifier contains the public key of the second application, add the public key of the second application to the sharing group of the first file.
  • adding the second application program to the sharing group of the first file according to the first identification includes: adding the identification of the second application program to the sharing group of the first file according to the first identification;
  • the identifier of the second application program includes the identifier assigned to the second application program when the electronic device installs the second application program.
  • the identifier of the second application may be a UID assigned to the second application by the electronic device.
  • the UID of each application is unique in the electronic device.
  • the UIDs of the same application in different electronic devices may be different. In this way, the identification of other application programs can be effectively prevented from being tampered with the identification of the second application program. Thus, malicious access of the first file by other applications can be effectively reduced. In this way, the security of data sharing between applications can be provided.
  • adding the identifier of the second application program to the sharing group of the first file according to the first identifier includes: when the second application program is installed, assigning the first application program the identifier of the second application program identification; according to the first identification, add the identification of the second application program to the sharing group of the first file.
  • the method before adding the identifier of the second application program to the sharing group of the first file according to the first identifier, the method further includes: when the first application program is installed, indicating in the establishment of the first identifier the sharing relationship; the sharing relationship indicates that the shared object of the first file includes the second application.
  • the method further includes: receiving an access request for the first file by the second application; confirming the second application The program has access rights to the first file; the data of the first file is provided to the second application program.
  • a file sharing apparatus may include:
  • an obtaining module which can be used to: obtain an installation package of the first application, wherein the installation package of the first application includes a first file and a first identifier, and the first identifier indicates that the shared object of the first file includes the second application ;
  • the permission setting module may be configured to: provide the second application with the access permission of the first file according to the first identifier.
  • the permission setting module can be used to:
  • the second application is added to the sharing group of the first file, wherein the sharing group is used to indicate the application having the permission to access the first file.
  • the permission setting module can be used to:
  • the second application is added to the sharing group of the first file; the identification of the second application includes the identification carried in the installation package of the second application. For example, the public key of the second application.
  • the permission setting module can be used to:
  • the identification of the second application is added to the sharing group of the first file, where the identification of the second application includes the identification assigned to the second application when the second application is installed, such as the UID of the second application .
  • the permission setting module can be used to:
  • the identification of the second application is added to the sharing group of the first file.
  • the permission setting module can be used to:
  • the sharing relationship indicated in the first identifier is established; the sharing relationship describes that the shared object of the first file includes the second application.
  • the obtaining module may also be used to: receive an access request to the first file by the second application; the permission setting module may also be used to: confirm that the second application has access permission to the first file;
  • the file sharing apparatus may further include: a providing module for: providing the data of the first file to the second application.
  • the file sharing apparatus provided in the second aspect can add the second application to the sharing group of the first file in the installation package of the first application according to the first identifier in the installation package of the first application.
  • the second application has permission to access the first file.
  • the first file can not only be shared with the designated application.
  • the second application can only access the first file in the first application, not all files of the first application. In this way, the normal operation of the first application program can be avoided.
  • the present application provides an electronic device, including: a processor and a memory; the memory is used for storing program codes, and the processor is used for calling the program codes to make the electronic device execute any possible implementation manner of any one of the above aspects file sharing methods in .
  • a computer program product containing instructions, when the instructions are executed on an electronic device, so that the electronic device executes the file sharing method in any of the possible implementations of any one of the above aspects.
  • a computer-readable storage medium comprising instructions, when the instructions are executed on an electronic device, so that the electronic device executes the file sharing method in any of the possible implementations of any of the foregoing aspects.
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 2 is a software block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of an application development and installation process provided by an embodiment of the present application.
  • FIG. 4 is a logical implementation block diagram of a file sharing method provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a file sharing method provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a file sharing method provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a file sharing method provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a file sharing apparatus provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be understood as implying or implying relative importance or implying the number of indicated technical features. Therefore, the features defined with “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, the “multiple” The meaning is two or more.
  • a developer when developing application A, a developer can add a UIFileSharingEnabled(Application supports iTunes file sharing) key to the file info.Plist in application A, and The key value is set as the first identifier, and the first identifier may be "yes". Then, the developer puts the file A that can be shared in the application A into the documents directory in the electronic device. In this way, other applications can access the data in file A of application A.
  • the file A of the application A can be shared.
  • any application program that enables the file sharing function in the electronic device can share the file A. In this way, the applications that can share file A are not single enough.
  • the developer in order to implement data sharing between application A and application B.
  • the developer can set the shareduserID in the manifest.xml file in the application A's installation package to be the same.
  • the application with the same shareduserID will be assigned the same user ID, that is, the UID.
  • application A and application B can mutually access data.
  • Application B can access all data of application A.
  • application B can access all data of application A. If improper operation is received with application B, the normal operation of application A may be affected.
  • the present application provides a file sharing method and electronic device, which can enable a specified application (eg, application B) to share a file specified in application A.
  • a specified application eg, application B
  • application A e.g., application B
  • data sharing between applications can be realized, and sharable files of one application can be avoided to be shared by all applications, and all data of one application can be avoided to be shared by other applications.
  • the exemplary electronic device 100 provided by the embodiment of the present application is introduced.
  • FIG. 1 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 100 may have more or fewer components than those shown in the figures, may combine two or more components, or may have different component configurations.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • 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, a battery 142, an antenna 1, an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194 and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • application processor application processor, AP
  • modem processor graphics processor
  • graphics processor graphics processor
  • 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
  • different processing units can be independent devices, and can also be 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 an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold 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 called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • 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, a universal asynchronous transceiver (universal asynchronous transmitter) 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 (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • 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 that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other 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 contain 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 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can 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 may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through a CSI interface, so as to realize the photographing function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may 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 the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the SIM interface can be used to communicate with the SIM card interface 195 to realize the function of transferring data to the SIM card or reading data in the SIM card.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the 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 only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the power management module 141 is used for connecting 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 wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through 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 may be provided in the same device as at least part of the modules of the processor 110 .
  • 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. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may 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), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • 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 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation 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 technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband 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 a global positioning system (global positioning system, GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a 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 a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto 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 transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos of various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG Moving Picture Experts Group
  • MPEG2 moving picture experts group
  • MPEG3 MPEG4
  • MPEG4 Moving Picture Experts Group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
  • RAM random access memories
  • NVM non-volatile memories
  • Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronization Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as the fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.;
  • SRAM static random-access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • DDR5 SDRAM double data rate synchronous dynamic random access memory
  • Non-volatile memory may include magnetic disk storage devices, flash memory.
  • Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle, and can include single-level memory cells (single-level cells, SLC), multi-level memory cells (multi-level memory cells) according to the level of storage cell potential cell, MLC), triple-level cell (TLC), quad-level cell (QLC), etc., according to storage specifications, it can include universal flash storage (UFS), embedded type multimedia memory card (embedded multi media Card, eMMC) and so on.
  • SLC single-level memory cells
  • multi-level memory cells multi-level memory cells
  • MLC multi-level memory cells
  • TLC triple-level cell
  • QLC quad-level cell
  • UFS universal flash storage
  • embedded type multimedia memory card embedded multi media Card
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
  • executable programs eg, machine instructions
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
  • the non-volatile memory can also store executable programs and store data of user and application programs, etc., and can be loaded into the random access memory in advance for the processor 110 to directly read and write.
  • the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also referred to as a "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 referred to as "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be answered by placing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a 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 a noise reduction function 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 implement directional recording functions.
  • the earphone jack 170D is used to connect wired earphones.
  • the earphone interface 170D can be the USB interface 130, or can be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 180A may be provided on the display screen 194 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 .
  • the angular velocity of electronic device 100 about three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display screen 194.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
  • Motor 191 can generate vibrating cues.
  • the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, 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 state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may 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 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to realize functions such as call and data communication.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, a runtime (Runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications (also referred to as applications) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • applications also referred to as applications
  • 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 may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, a package manager, a meta-capability manager, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide the communication function of the electronic device 100 .
  • the management of call status including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications from applications running in the background, and can also display notifications on the screen in the form of a dialog interface. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
  • a package manager can provide a package management service (Bundle Manager Service, BMS) for an application.
  • BMS can be used to implement functions such as application installation and uninstallation, component query matching, and permission management.
  • the BMS can verify the integrity of the installation package of the application through the cloud public key preset inside the device.
  • BMS can also be used to decompress the installation package of the application to obtain the public key of the application.
  • the BMS can query whether the application can share files of other applications based on the application's public key. If possible, the BMS can add the UID of the application to the user group that can share the file.
  • a meta-capability manager can provide a meta-capability management service (Ability Manager Service, AMS) for applications.
  • AMS can be used for application lifecycle management.
  • the AMS can be mainly responsible for pulling, managing, and destroying the application process.
  • a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • surface manager surface manager
  • media library Media Libraries
  • 3D graphics processing library eg: OpenGL ES
  • 2D graphics engine eg: SGL
  • the Surface Manager is used to manage the display subsystem and provides a fusion of two-dimensional (2-Dimensional, 2D) and three-dimensional (3-Dimensional, 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 a variety of 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, compositing, and layer processing.
  • 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 drivers, camera drivers, audio drivers, sensor drivers, and virtual card drivers.
  • a corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes touch operations into raw input events (including touch coordinates, timestamps of touch operations, etc.). Raw input events are stored at the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon, as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer, and then starts the camera driver by calling the kernel layer.
  • the camera 193 captures still images or video.
  • application A may be referred to as a first application
  • application B may be referred to as a second application
  • File A may be referred to as the first file
  • the embodiments of the present application provide a file sharing method.
  • an identifier for sharing file A with application B is written in the installation package of application A.
  • the mobile phone can add the identifier of application B to the sharing group that can share file A. This way, application B can access file A at runtime.
  • an application program may also be referred to as an application for short.
  • file A can be shared with application B, which means that application B can access file A, read the data of file A, and execute file A. All applications in the shared group of file A can access file A.
  • the developer generates the public-private key pair of application B, the public key publickeyB and the private key privatekeyB.
  • the developer of the application can generate a pair of public and private keys of the application B in the device that develops the application B.
  • the public-private key pair 301 of application B shown in FIG. 3 may include a public key publickeyB and a private key privatekeyB. Understandably, the public and private keys come in pairs, and they can decrypt each other. Content encrypted by the public key can only be decrypted by the private key. Content encrypted by the private key can only be decrypted by the public key. Public key encryption, private key decryption; private key signature, public key verification. The public key is public and the private key is kept secret.
  • the terminal can obtain the public key of the application from the installation package of the application.
  • the developer can upload the public key of application B to the application market to apply for the corresponding application signing certificate.
  • the application B signing certificate 302 shown in FIG. 3 can contain application B's public key publickeyB.
  • the signing certificate of application B can be used to identify the identity of the developer, and it can also contain basic information of the developer.
  • the application market can also be called the application store, that is, APP STORE, which is an electronic application store that provides paid or free games and application download services for electronic devices such as mobile phones and tablet computers.
  • APP STORE is an electronic application store that provides paid or free games and application download services for electronic devices such as mobile phones and tablet computers.
  • the developer develops application B, and obtains the source program package of application B.
  • the developer develops the application program B, and obtains the source program package of the application program B, for example, the source program package 303 of the application program B shown in FIG. 3 .
  • a source package can contain multiple files, each of which can contain source code written in a specific format.
  • the developer self-signs the application B, and obtains the shelf installation package of the application B.
  • the developer uses the private key privatekeyB of application B to self-sign application B to obtain the self-signed information signatureB.
  • the developer puts the self-signed information signatureB and the public key publickeyB into the package of application B, and obtains the shelf installation package of application B.
  • the developer uses the private key of the application market to sign the on-the-shelf installation package of application B to obtain the downloaded installation package of application B.
  • the developer uploads the shelf installation package of application B to the application market.
  • the application market uses the application market private key to sign the on-air installation package of application B to obtain the signature information signature.
  • the application market puts the signature information signature into the shelf installation package of application B to form a download installation package of application B.
  • the download installation package 306 of application B shown in FIG. 3 is a download installation package of application B shown in FIG. 3 .
  • the application market holds a unified public and private key pair.
  • the application market public-private key pair 305 shown in FIG. 3 may include the application market public key and the application market private key.
  • the application market can use the private key to sign the application's installation package on the shelf to obtain the signature information.
  • the public key of the application market can verify the signature information.
  • the mobile phone downloads the application from the application market and installs the application
  • the mobile phone downloads the download and installation package of application B from the application market, takes out the signature in the download and installation package of application B, and verifies the signature with the public key of the application market saved in the mobile phone. After the verification is passed, the mobile phone takes out the download The publickeyB in the installation package verifies the signature of signatureB. If the signature is successful, application B can be installed.
  • the BMS in the mobile phone can take out the signature information signature in the download and installation package of the application B, and use the application market public key preset in the mobile phone to perform the signature information signature. Check the signature. When the download and installation package of application B is tampered with, the signature information signature in the download and installation package of application B may fail to be verified. If the signature verification fails, the mobile phone fails to install the downloaded installation package and exits the installation. If the verification is passed, it means that the source of the downloaded installation package of the application is legal.
  • the BMS in the mobile phone takes out the self-signed information signatureB and the public key publickeyB in the download and installation package of application B.
  • the BMS verifies the signature of the self-signed information signatureB through the public key publickeyB. If the verification is passed, the mobile phone can successfully install application B.
  • Application B can be successfully installed only when the source package of application B, the self-signed information signatureB, and the public key publickeyB have not been tampered with, and publickeyB is the public key that matches the self-signed signatureB.
  • FIG. 4 shows a block diagram illustrating an implementation of a file sharing method provided by an embodiment of the present application.
  • a download and installation package 401 of application A may be included;
  • a package management service BMS402 may be included;
  • a download and installation package 403 of application B may be included;
  • the installation package 401 of the application A may include a file 4011 and a file 4012 .
  • File 4011 writes the code to share the file named getHilink.so with the application whose publickey is "abcdfgh".
  • the file 4012 is a file whose file name is getHilink.so.
  • the file 4012 can be obtained by decompressing the installation package 401 of the application A.
  • the package management service BMS 402 is provided by the package manager in FIG. 2 .
  • the package management service BMS402 can save the corresponding relationship 4021 between the file named getHilink.so in the file 4011 and the application program whose public key is "abcdfgh".
  • the BMS 402 establishes a sharing group 4022 of a file named getHilink.so according to the corresponding relationship.
  • Correspondence 4021 and sharing group 4022 can be stored in a database.
  • the publickeyB of application B is "abcdfgh”.
  • the BMS can add the UID (eg UIDB) of application B to the sharing group 4022 .
  • the download and installation package 402 of the application B may contain the public key publickeyB of the application B.
  • publickeyB can be "abcdfgh”.
  • FIG. 5 shows a schematic flowchart of a file sharing method provided by an embodiment of the present application.
  • a file sharing method provided by an embodiment of the present application may include:
  • the electronic device in response to operation A, acquires an installation package of application A.
  • Operation A may be an operation for the user to obtain the installation package of the application program A, for example, the operation A may be that the user downloads the installation package of the application program A from the application market.
  • the installation package of the application A downloaded by the user from the application market may include the source package of the application A, the public key of the application A and the self-signed information of the application A.
  • the installation package of application A may be referred to as the downloaded installation package of application A.
  • FIG. 3 For the process of generating the application A and listing it on the application market to form the download and installation package of the application A, reference may be made to the description in FIG. 3 , which will not be repeated here.
  • the electronic device determines that the installation package of application A carries a first identifier, and the first identifier is used to indicate that file A in the installation package of application A is shared with a shared object, and the shared object is an application that can access file A.
  • the electronic device can read the first identifier from the installation package of the application A.
  • the first identifier may be the source code in the source package of the application A.
  • the first identifier is used to indicate that the file A in the installation package of the application A is shared with the shared object.
  • Shared objects are applications that can access file A. It is understandable that the developer of application A may agree with developers of other applications to share a certain file of application A with other applications. In this way, other applications can call to read the data of file A to realize the functions provided by the source code in file A.
  • the first identification can be as follows:
  • the first identifier may specify a file that can be shared in application A and an object to which the file can be shared.
  • the file A may be the above-mentioned first identification file "getHilink.so".
  • the shared object of file A can be an application whose public key is "abcdfgh”.
  • the file "getHilink.so" may be decompressed to the application installation, for example, /data/appA/lib.
  • the electronic device can synchronize the correspondence between the file A (for example, the file "getHilink.so") and the shared object (for example, the application whose public key is "abcdfgh") to the BMS according to the first identifier, for example, the content in the above profile information .
  • the BMS may store the correspondence between the file A (for example, the file "getHilink.so") and the shared object (for example, the application whose public key is "abcdfgh”) in the database.
  • developer can share the file A in the application A to multiple shared objects. Developers can also share multiple files in Application A to one or more shared objects.
  • the electronic device establishes a sharing group of the file A based on the first identifier.
  • the electronic device may establish a sharing group of file A through the BMS.
  • the BMS can generate the shared group ID (group ID, GID) of file A.
  • the sharing group of file A may include the user IDs (user ID, UID) of all applications that can share file A and the UID of application A. If the electronic device has not installed the application program that can be shared by the file A specified in the first identifier, only the UID of the application program A is in the sharing group. This UID can be used to identify an application.
  • the BMS in the electronic device can assign a UID to the application.
  • the UID of the application does not change while the application exists on the electronic device. And an application can only have one UID.
  • applications in the electronic device can be divided into three types: file owner users, group users, and other users.
  • An application that provides shared files can be referred to as the file owner user.
  • group users other applications other than the application providing the files
  • groups other applications other than the application providing the files
  • groups other applications other than the application providing the files
  • groups applications in the electronic device that cannot share the shared file
  • Different types of applications have different permissions for shareable files.
  • the file owner user has the permission to read, write, and execute the file
  • the group user has the permission to read, execute, but not write the file
  • other users can neither read, write nor execute the shared file.
  • Operation B may be an operation for the user to obtain the installation package of application B.
  • operation B may be that the user downloads the installation package of application B from the application market.
  • the installation package of application B downloaded by the user from the application market may include the source package of application B, the public key of application B, and the self-signed information of application B.
  • the installation package of application B may be referred to as the downloaded installation package of application B.
  • the electronic device determines that the application B is the shared object of the file A according to the identifier of the application B and the first identifier.
  • the electronic device can obtain the identifier of the application B in the download and installation package of the application B.
  • the identity of the application B may be the public key publickeyB of the application B.
  • application B's publickeyB is "abcdfgh”.
  • the first identifier indicates that the file A of the application A is shared with the application whose publickeyB is "abcdfgh". In this way, the electronic device can determine that the application B is the shared object of the file A according to the identification of the application B and the first identification.
  • the electronic device adds the application B to the sharing group of the file A.
  • the electronic device may add the UID of application B to the user group sharing the file A (eg, the file "getHilink.so"). If the GID of the user group of the file is 1001, the UID of application A is 1001, and the UID of application B is 1002. Then, at this time, the shared group whose GID of file A is 1001 contains two users: UID 1001 (application A) and UID 1002 (application B).
  • the UID of the owner (eg, application A) of the shared file eg, file A
  • the UIDs of different applications are not the same.
  • the electronic device After the electronic device adds the application B to the sharing of the file A, when the application B calls the file A, the application B can read the data in the file A and the executable file A.
  • the AMS is responsible for the life cycle management of application B.
  • the BMS in the electronic device can obtain the public key publickeyA of the application A.
  • the BMS determines whether there is a file shared with application A in the electronic device according to publickeyA, and if so, the electronic device can add application A to the sharing group of the file. Further, the UID of application A can be added to the sharing group of the file.
  • the electronic device can share the specified file in application A, that is, file A, to a specified application, such as application B.
  • application B can access the file and execute file A.
  • other programs in the electronic device cannot access file A nor execute file A.
  • application A can not only share file A with application B, but also prevent file A of application A from being maliciously accessed by other applications in the electronic device.
  • the developer of the application A writes the first identifier in the source package of the application A.
  • the first identifier indicates that file A of application A is shared with application B.
  • the developer of application A may write the first identifier in the profile file of the source package of application A.
  • Application A may be installed in the electronic device first, or application B may be installed first.
  • the file sharing method provided by the embodiment of the present application may be performed according to the steps shown in FIG. 6 .
  • FIG. 6 shows a schematic flowchart of a file sharing method provided by an embodiment of the present application.
  • the file sharing method provided by the embodiment of the present application may include:
  • the electronic device in response to operation B, acquires an installation package of application B.
  • Operation B may be an operation for the user to obtain the installation package of application B.
  • operation B may be that the user downloads the installation package of application B from the application market.
  • the installation package of application B downloaded by the user from the application market may include the source package of application B, the public key of application B, and the self-signed information of application B.
  • the installation package of application B may be referred to as the downloaded installation package of application B.
  • the electronic device determines whether there is a file A that can be shared by the application B in the electronic device; if it exists, execute step S202, and if not, execute step S203.
  • the electronic device can obtain the identity of the application B from the installation package of the application B, for example, the public key publickeyB of the application B.
  • the electronic device can determine whether there is a file shared to application B in the electronic device according to publickeyB. If there is a correspondence between publickeyB and the shared file in the BMS, the electronic device determines that there is a file shared to application B in the electronic device.
  • the electronic device may perform step S202. If there is no corresponding relationship between the publickeyB and the shared file in the BMS, the electronic device determines that there is no file shared to the application B in the electronic device.
  • the electronic device may perform step S203.
  • the electronic device adds the application B to the sharing group of the file A.
  • the electronic device may add the UID of application B to the user group sharing the file A (eg, the file "getHilink.so").
  • a file's user group has a GID of 1001.
  • the owner of file A is application A
  • the UID of application A is 1001.
  • Application B has a UID of 1002.
  • the shared group whose GID of file A is 1001 contains two users: UID 1001 (application A) and UID 1002 (application B).
  • the UID of the owner (eg, application A) of the shared file eg, file A
  • the shared file may be the same as the GID of the user group sharing the file.
  • the UIDs of different applications are not the same.
  • the BMS in the electronic device can assign a UID to the application.
  • the UID of the application does not change while the application exists on the electronic device. And an application can only have one UID.
  • the electronic device After the electronic device adds the application B to the sharing of the file A, when the application B calls the file A, the application B can read the data in the file A and the executable file A.
  • the AMS is responsible for the life cycle management of application B.
  • Step S202 can refer to the description in step S105.
  • the electronic device acquires the installation package of the application A in response to the operation A.
  • Operation A may be an operation for the user to obtain the installation package of the application program A, for example, the operation A may be that the user downloads the installation package of the application program A from the application market.
  • the installation package of the application A downloaded by the user from the application market may include the source package of the application A, the public key of the application A and the self-signed information of the application A.
  • the installation package of application A may be referred to as the downloaded installation package of application A.
  • FIG. 3 For the process of generating the application A and listing it on the application market to form the download and installation package of the application A, reference may be made to the description in FIG. 3 , which will not be repeated here.
  • the user's operation A and operation B may be discontinuous operations. That is, the user may perform the operation A after the first time period after the operation B is performed. For example, the user may perform the operation of installing application A three days after performing the operation of installing application B.
  • the first time period may be 30 minutes, or may be one day, or may be one month, which is not limited in this embodiment of the present application.
  • the electronic device determines that the installation package of the application A carries a first identifier, and the first identifier indicates that the file A in the installation package of the application A is shared with the application B.
  • the electronic device can read the first identifier from the installation package of the application A.
  • the first identifier may be the source code in the source package of the application A.
  • the first identifier is used to indicate that file A in the installation package of application A is shared with application B. It is understandable that the developer of application A may agree with the developer of application B to share the file A of application A with application B. In this way, application B can call to read the data of file A, and realize the function provided by the source code in file A.
  • the first identification can be as follows:
  • the first identifier may specify a file that can be shared in application A and an object to which the file can be shared.
  • the file A may be the above-mentioned first identification file "getHilink.so".
  • the shared object of file A can be an application whose public key is "abcdfgh”.
  • the public key of application B is "abcdfgh”. Therefore, the first identification indicates that file A is to be shared with application B.
  • the file “getHilink.so” may be decompressed to the application installation, for example, /data/appA/lib.
  • the electronic device can synchronize the correspondence between the file A (for example, the file "getHilink.so") and the shared object (for example, the application whose public key is "abcdfgh") to the BMS according to the first identifier, for example, the content in the above profile information .
  • the BMS may store the correspondence between the file A (for example, the file "getHilink.so") and the shared object (for example, the application whose public key is "abcdfgh”) in the database.
  • the electronic device adds the application B to the sharing group of the file A.
  • the electronic device may add the UID of application B to the user group sharing the file A (eg, the file "getHilink.so").
  • a file's user group has a GID of 1001.
  • the owner of file A is application A
  • the UID of application A is 1001.
  • Application B has a UID of 1002.
  • the shared group whose GID of file A is 1001 contains two users: UID 1001 (application A) and UID 1002 (application B).
  • the UID of the owner (eg, application A) of the shared file eg, file A
  • the shared file may be the same as the GID of the user group sharing the file.
  • the UIDs of different applications are not the same.
  • the electronic device After the electronic device adds the application B to the sharing of the file A, when the application B calls the file A, the application B can read the data in the file A and the executable file A.
  • the AMS is responsible for the life cycle management of application B.
  • Step S205 may refer to the description in step S105 or step S202.
  • the electronic device can share the specified file in application A, that is, file A, to a specified application, such as application B.
  • application B can access the file and execute file A.
  • other programs in the electronic device cannot access file A nor execute file A.
  • application A can not only share file A with application B, but also prevent file A of application A from being maliciously accessed by other applications in the electronic device.
  • the electronic device When the application B of the electronic device wants to access the file A of the application A, the electronic device needs to determine whether the application B has the permission to access the application A. If application B is in the sharing group of file A, the electronic device determines that application B has access to application A; otherwise, the electronic device determines that application B does not have access to application A.
  • specific reference may be made to the schematic flowchart of the file sharing method shown in FIG. 7 .
  • FIG. 7 shows a file sharing method provided by an embodiment of the present application.
  • the file sharing method provided by the embodiment of the present application may include:
  • the application B in the electronic device calls the file A, where the file A is a file in the installation package of the application A.
  • the user operation may be an operation in which the user may click the icon of the application program B in the main interface of the electronic device.
  • the electronic device starts the application B.
  • the application can call file A at startup.
  • the user operation may also be an operation in which the user clicks a control in the user interface of application B.
  • application B calls file A.
  • File A is a file in the installation package of application A.
  • the file A may be an executable file, that is, the file A is a file that can be loaded and executed by the electronic device.
  • the electronic device determines whether application B is in the shared group of file A, where the shared group of file A is used to indicate that the application in the shared group of file A has permission to access file A, and the shared group of file A is controlled by the electronic device
  • the first identifier is established according to the first identifier in the installation package of the application program A, and the first identifier is used to indicate the shared object of the file A. If yes, go to step S302a; if not, go to step S302b.
  • the electronic device may determine whether the application is in the sharing group of file A according to the UID of application B. Specifically, the electronic device can check whether the UID of application B exists in the shared group of file A in the BMS.
  • the shared group of file A is used to indicate that the application in the shared group of file A has the right to access file A, and the shared group of file A is established by the electronic device according to the first identification in the installation package of application A.
  • the first identification Used to indicate the shared object of file A.
  • the electronic device may first check whether application B is the application that provides file A. If so, the electronic device may execute step S302a. If not, the electronic device checks whether the application is in the file A's share group. If so, the electronic device can determine the permission of the application in the shared group of file A set by the system. If the application in the shared group of the system setting file A can read the file A, and can also execute the file A, the electronic device can execute step S302a.
  • the BMS in the electronic device can assign the application A a unique UID of the electronic device, such as UIDA.
  • the BMS can decompress the resource files in the downloaded installation package of application A to a certain path in the system.
  • the electronic device may set the user owner of the files and folders in the path as the UID of the application A, for example, the user owner of the file A may be set as UIDA.
  • the electronic device may set the GID of the sharing group of the file A as the UID of the application A.
  • the BMS resolves that the application B can share the file A of the application A.
  • the BMS can trigger the system of the electronic device to add the UID of the application B to the sharing group of the file A.
  • the BMS can trigger the system to execute the gpasswd command to add the UID of application B to the share group of file A.
  • the system of the electronic device can add the UID of the application B to the sharing group of the file A, which is not limited in this embodiment of the present application.
  • the electronic device provides the data of the file A to the application B.
  • the electronic device allows application B to access the file.
  • the electronic device can provide the data of file A to application B. That is, application B can read the data of file A, and application B can also execute file A.
  • the electronic device determines that the application program B fails to call the file A.
  • the electronic device determines that the application B is not in the sharing group of the file A, the application B does not have the right to call the file A.
  • the electronic device determines that application B fails to call file A.
  • the user interface of application B may display a prompt of failure to call file A, such as "no access permission", "access failed”, and so on.
  • the application B can access the file A only when the electronic device determines that the application B is a member of the sharing group of the file A. In this way, file A can not only be shared with the specified application. Avoid malicious access to file A by other applications in the electronic device. App B can only access file A in app A, not all of app A's files. In this way, the normal operation of application A can be avoided.
  • FIG. 8 is a schematic diagram of a file sharing apparatus provided by an embodiment of the present application.
  • the file sharing apparatus 800 may include an obtaining module 801 and a permission setting module 802; wherein:
  • An obtaining module 801 configured to: obtain an installation package of a first application, wherein the installation package of the first application includes a first file and a first identifier, and the first identifier indicates that the shared object of the first file includes the second application .
  • the permission setting module 802 is configured to: provide the second application with the access permission of the first file according to the first identifier.
  • the permission setting module 802 can be used to:
  • the second application is added to the sharing group of the first file, wherein the sharing group is used to indicate the application having the permission to access the first file.
  • the permission setting module 802 can be used to:
  • the second application is added to the sharing group of the first file; the identification of the second application includes the identification carried in the installation package of the second application. For example, the public key of the second application.
  • the permission setting module 802 can be used to:
  • the identification of the second application is added to the sharing group of the first file, where the identification of the second application includes the identification assigned to the second application when the second application is installed, such as the UID of the second application .
  • the permission setting module 802 can be used to:
  • the identification of the second application is added to the sharing group of the first file.
  • the permission setting module 802 can be used to:
  • the sharing relationship indicated in the first identifier is established; the sharing relationship describes that the shared object of the first file includes the second application.
  • the corresponding relationship 4021 in FIG. 4 shows the sharing relationship between a file whose file name is getHilink.so and an application whose public key is "abcdfgh".
  • the obtaining module 801 may be configured to receive an access request for the first file by the second application.
  • the permission setting module 802 may be configured to confirm that the second application program has access permission to the first file.
  • the file sharing apparatus 800 may further include a providing module 803; wherein:
  • the providing module 803 may be used to provide the data of the first file to the second application.
  • the file sharing apparatus 800 can implement the file sharing method described in steps S100-S105 shown in FIG. 5, and the file sharing method described in steps S200-step S205 shown in FIG. 6, and The file sharing method described in step S300-step S302a and step S302b shown in FIG. 7 . specifically:
  • the obtaining module 801 can be used to perform step S100 , step S103 , step 200 and step 203 .
  • the authority setting module 802 can be used to execute steps S101, 102, S104, S105, S201, 202, S204, S205, and S300 and S301.
  • the providing module 803 can be used to perform steps S302a and S302b.
  • the file sharing apparatus can add the second application program to the sharing group of the first file in the installation package of the first application program according to the first identifier in the installation package of the first application program.
  • the second application has permission to access the first file. In this way, the first file can not only be shared with the designated application. Prevent malicious access to files by other applications in the file sharing device.
  • the second application can only access the first file in the first application, not all files of the first application. In this way, the normal operation of the first application program can be avoided.
  • the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting" depending on the context.
  • the phrases “in determining" or “if detecting (the stated condition or event)” can be interpreted to mean “if determining" or “in response to determining" or “on detecting (the stated condition or event)” or “in response to the detection of (the stated condition or event)”.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Telephone Function (AREA)

Abstract

La présente demande porte sur un procédé et un appareil de partage de fichier, ainsi que sur un dispositif électronique. Le procédé consiste : à obtenir un progiciel d'installation d'une première application, le progiciel d'installation de la première application comprenant un premier fichier et un premier identifiant, et le premier identifiant indiquant que des objets de partage du premier fichier comprennent une seconde application ; et à fournir une autorisation d'accès du premier fichier à la seconde application en fonction du premier identifiant. L'implémentation du procédé peut permettre à une application spécifiée (telle qu'une application B) de partager un fichier spécifié dans une application A. Ainsi, un partage de données entre des applications peut être réalisé, il est possible d'empêcher le partage par toutes les applications d'un fichier partageable d'une application, et il est possible d'empêcher le partage de toutes les données d'une application par d'autres applications.
PCT/CN2021/132422 2020-11-24 2021-11-23 Procédé et appareil de partage de fichier et dispositif électronique WO2022111469A1 (fr)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202011332002 2020-11-24
CN202011332002.2 2020-11-24
CN202110051249.5A CN114546969A (zh) 2020-11-24 2021-01-14 一种文件共享方法、装置及电子设备
CN202110051249.5 2021-01-14

Publications (1)

Publication Number Publication Date
WO2022111469A1 true WO2022111469A1 (fr) 2022-06-02

Family

ID=81668737

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132422 WO2022111469A1 (fr) 2020-11-24 2021-11-23 Procédé et appareil de partage de fichier et dispositif électronique

Country Status (2)

Country Link
CN (1) CN114546969A (fr)
WO (1) WO2022111469A1 (fr)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240073278A1 (en) * 2012-09-28 2024-02-29 Transform Sr Brands Llc Integrated experience for applications within a mobile application
CN117743445A (zh) * 2024-02-18 2024-03-22 荣耀终端有限公司 一种数据访问方法及电子设备
WO2024067053A1 (fr) * 2022-09-28 2024-04-04 华为技术有限公司 Procédé d'installation de programme d'application et dispositif électronique

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020885A (zh) * 2016-05-23 2016-10-12 北京金山安全软件有限公司 一种应用程序的提供方法、装置及电子设备
CN106855816A (zh) * 2016-12-13 2017-06-16 青岛海信电器股份有限公司 终端中应用程序的资源文件加载方法和装置
US20190102339A1 (en) * 2016-11-25 2019-04-04 Huawei Technologies Co., Ltd. Multimedia File Sharing Method and Terminal Device
CN109684278A (zh) * 2018-12-21 2019-04-26 广州酷狗计算机科技有限公司 文件获取方法、装置、终端及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020885A (zh) * 2016-05-23 2016-10-12 北京金山安全软件有限公司 一种应用程序的提供方法、装置及电子设备
US20190102339A1 (en) * 2016-11-25 2019-04-04 Huawei Technologies Co., Ltd. Multimedia File Sharing Method and Terminal Device
CN106855816A (zh) * 2016-12-13 2017-06-16 青岛海信电器股份有限公司 终端中应用程序的资源文件加载方法和装置
CN109684278A (zh) * 2018-12-21 2019-04-26 广州酷狗计算机科技有限公司 文件获取方法、装置、终端及存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240073278A1 (en) * 2012-09-28 2024-02-29 Transform Sr Brands Llc Integrated experience for applications within a mobile application
WO2024067053A1 (fr) * 2022-09-28 2024-04-04 华为技术有限公司 Procédé d'installation de programme d'application et dispositif électronique
CN117743445A (zh) * 2024-02-18 2024-03-22 荣耀终端有限公司 一种数据访问方法及电子设备

Also Published As

Publication number Publication date
CN114546969A (zh) 2022-05-27

Similar Documents

Publication Publication Date Title
KR102503341B1 (ko) 보안 서비스 삭제 방법 및 전자 장치
WO2022111469A1 (fr) Procédé et appareil de partage de fichier et dispositif électronique
WO2021159746A1 (fr) Procédé et système de partage de fichiers et dispositif associé
WO2020150917A1 (fr) Procédé de gestion d'autorisation d'application et dispositif électronique
WO2021253975A1 (fr) Procédé et appareil de gestion d'autorisation pour application, et dispositif électronique
WO2021052204A1 (fr) Procédé de découverte de dispositif basé sur un carnet d'adresses, procédé de communication audio et vidéo, et dispositif électronique
US20240232428A9 (en) Access control method, electronic device, and system
WO2022160991A1 (fr) Procédé de commande d'autorisation et dispositif électronique
WO2021057982A1 (fr) Procédé de traitement d'application et produit associé
WO2022089121A1 (fr) Procédé et appareil de traitement de message de poussée
WO2021073337A1 (fr) Procédé et appareil pour installer un module d'extension, et support de stockage
WO2022022422A1 (fr) Procédé de gestion d'autorisations et dispositif terminal
EP4280090A1 (fr) Procédé de contrôle d'accès, dispositif électronique et système
WO2022166502A1 (fr) Procédé et système de protection de données, support et dispositif électronique
CN114692119A (zh) 校验应用的方法和电子设备
WO2022111664A1 (fr) Procédé de correction, appareil associé et système
CN114006698B (zh) token刷新方法、装置、电子设备及可读存储介质
CN113590346B (zh) 处理业务请求的方法和电子设备
WO2022111529A1 (fr) Procédé de débogage de programme d'application et dispositif électronique
CN115203716A (zh) 权限同步方法、相关装置及系统
CN116982042A (zh) 灵活授权的访问控制方法、相关装置及系统
CN115017498A (zh) 小应用程序的操作方法和电子设备
CN115701018A (zh) 安全调用服务的方法、安全注册服务的方法及装置
WO2022068578A1 (fr) Procédé de partage de fichiers et dispositif électronique
WO2024061326A1 (fr) Procédé de protection de données, et dispositif électronique

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: 21896970

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: 21896970

Country of ref document: EP

Kind code of ref document: A1