WO2022143081A1 - Data synchronization method and apparatus - Google Patents

Data synchronization method and apparatus Download PDF

Info

Publication number
WO2022143081A1
WO2022143081A1 PCT/CN2021/136803 CN2021136803W WO2022143081A1 WO 2022143081 A1 WO2022143081 A1 WO 2022143081A1 CN 2021136803 W CN2021136803 W CN 2021136803W WO 2022143081 A1 WO2022143081 A1 WO 2022143081A1
Authority
WO
WIPO (PCT)
Prior art keywords
mobile phone
media file
media
user
interface
Prior art date
Application number
PCT/CN2021/136803
Other languages
French (fr)
Chinese (zh)
Inventor
陈刚
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022143081A1 publication Critical patent/WO2022143081A1/en

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/178Techniques for file synchronisation in file systems
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Definitions

  • the present application relates to the field of communications, and in particular, to a data synchronization method and apparatus.
  • schemes such as “AirDrop” and “MFiles” can share some data (for example, picture data) between two devices. For example, after the connection between device A and device B is established, the user of device A can send 10 pictures of device A to device B, and the user of device B can choose to receive and store the 10 pictures. The 10 pictures are shared between them.
  • the embodiments of the present application provide a data synchronization method and apparatus, which can realize cross-device data sharing simply and conveniently, without requiring frequent manual operations by users, and can improve user experience.
  • an embodiment of the present application provides a data synchronization method.
  • the method includes: a first device acquires a media file update event; wherein the media file update event is used to add, modify or delete a first media file; the first device updates a metadata metadata corresponding to the first media file in the database, and update the thumbnail of the first media file in the media library; the first device sends a synchronization message to the second device, and the synchronization message includes the metadata corresponding to the first media file and the first media Thumbnail of the file.
  • the metadata database and the media library can be automatically synchronized between the first device and the second device, data sharing across devices can be easily and conveniently achieved, and frequent manual operations by the user are not required, which can improve user experience.
  • the synchronization message further includes at least one of a user account, device information of the first device, and an update type of the first media file, where the update type of the first media file includes addition, modification, or deletion.
  • the metadata database and the media library can be automatically synchronized between the first device and the second device, which can easily and conveniently implement cross-device data Sharing, without the need for frequent manual operations by the user, can improve the user experience.
  • the thumbnail image of the first media file includes a thumbnail image of a first type
  • the size of the thumbnail image of the first type ranges from 10 kilobytes (kb/K) to 20K.
  • the size of the first type of thumbnails may be 10K, 15K or 20K.
  • the method further includes: the first device receives a first request message, where the first request message is used to request a thumbnail image of a second type, and the size of the thumbnail image of the second type ranges from 100K to 300K; The first device sends a second type of thumbnail image to the second device.
  • the size of the second type of thumbnails may be 150K, 180K, 200K, 230K, and so on.
  • the first media file includes at least one of pictures, videos, audios, and documents.
  • the method further includes: the first device displays a first interface including the identifier of the second device; in response to the user's operation of clicking the identifier of the second device on the first interface, the first device displays the second interface
  • the second interface includes one or more thumbnail images of at least one type of media file of the second device.
  • the first device eg, mobile phone A
  • An operation of clicking the logo of the second device on an interface as shown in FIG.
  • the first device displays a second interface
  • the second interface includes at least one type of media files (for example, pictures, videos, audios, documents, etc.) of the second device ) of one or more thumbnails.
  • the picture may be, for example, A-002.jpg
  • the document may include, for example, cover design.pptx, and the like.
  • the first interface or the second interface includes a search control, and in response to an operation of inputting a keyword after the user clicks the search control, the first device displays a third interface, and the third interface includes data from the first device and the The identifier of the media file related to the keyword searched by the second device.
  • the first device displays the No. Three interfaces (eg, interface 441 )
  • the third interface includes the identifiers of the media files related to the keyword searched from the first device and the second device.
  • it can include TOEFL Ladder Skills.doc, TOEFL Listening Analysis.mp3, etc.
  • the method further includes: in response to the user's operation of clicking the first thumbnail on the second interface, the first device displays a first pop-up frame, and the first pop-up frame includes the first operation option; Clicking the operation of the first operation option, the first device displays a second pop-up box, and the second pop-up box includes one or more application programs or device identifiers; in response to the operation of the user clicking an application program or a device identifier, the first device will The first thumbnail is shared to the application program clicked by the user or the device corresponding to the device identifier. Exemplarily, as shown in (a) of FIG.
  • the first device in response to the user's operation of clicking the first thumbnail (eg, picture 450 ) on the second interface (eg, interface 430 ), the first device displays a first pop-up frame (for example, pop-up box 451), the first pop-up box includes a first operation option (for example, share option 452); in response to the operation of the user clicking the first operation option, as shown in (b) in FIG.
  • a first pop-up frame for example, pop-up box 451
  • the first pop-up box includes a first operation option (for example, share option 452)
  • the first device A second pop-up frame (eg, pop-up frame 453) may be displayed, and the second pop-up frame includes one or more application or device identifiers (eg, Nearby devices, etc.); in response to the operation of the user clicking on an application or a device identifier, the first device shares the first thumbnail to the device corresponding to the application or device identifier clicked by the user.
  • application or device identifiers eg, Nearby devices, etc.
  • the method when the first device is connected to the second device for the first time, the method further includes: the first device synchronizes the metadata corresponding to all media files of the first device and the thumbnail images corresponding to all media files to the first device.
  • Second equipment That is, when the first device and the second device are connected for the first time, the metadata corresponding to all the media files of the first device and the thumbnail images corresponding to all the media files of the first device can be automatically synchronized between the first device and the second device.
  • Device data sharing does not require users to perform frequent manual operations, which can improve user experience.
  • N is an integer greater than or equal to 2
  • the method further includes: the first device synchronizes the media updated on the first device after the last synchronization
  • the metadata corresponding to the file and the thumbnail corresponding to the updated media file are synchronized to the second device.
  • the metadata and thumbnails corresponding to the media files updated by the first device can be automatically synchronized between the first device and the second device, and there is no need to resynchronize all the media files, which can save resources and improve efficiency.
  • the method further includes: the first device analyzes the user's preferences and behavioral habits based on an artificial intelligence (artificial intelligence, AI) algorithm; and predicts the media files that the user needs to operate according to the user's preferences and behavioral habits;
  • the second type of thumbnails of the media files that the user needs to operate are sent to the second device.
  • the second device can cache the media files that the user may open locally in advance, and the user can quickly view the second type of thumbnail images later, which can improve user experience.
  • the first device deletes cold data based on a preset period; wherein the cold data includes thumbnails of media files whose access times are lower than a preset threshold. In this way, the memory space of the first device can be saved.
  • the method further includes: when the first device plays the media file of the second device for the first time, starting a streaming server proxy, and the streaming server proxy is used to encapsulate the media file of the second device into a streaming media format; A device obtains the media files of the second device from the second device in m times through the streaming server proxy and caches them; where m is an integer greater than or equal to 2; the first device plays the cached data.
  • the player does not need to wait for the media file (for example, the original video file) to be completely downloaded before starting the playback, and can play it in real time, thereby realizing a high-performance user experience similar to local playback.
  • the first device plays the media file of the second device for the Nth time, it obtains a uniform resource identifier (URI) of the media file of the second device, obtains the cached data according to the URI, and Play; wherein, N is an integer greater than or equal to 2.
  • URI uniform resource identifier
  • N is an integer greater than or equal to 2.
  • an embodiment of the present application provides a full synchronization method, including: when a first device is connected to a second device for the first time, the method further includes: the first device synchronizes metadata and all media files corresponding to all media files of the first device The thumbnails corresponding to the files are synchronized to the second device. That is, when the first device and the second device are connected for the first time, the metadata corresponding to all the media files of the first device and the thumbnail images corresponding to all the media files of the first device can be automatically synchronized between the first device and the second device.
  • Device data sharing does not require users to perform frequent manual operations, which can improve user experience.
  • an embodiment of the present application provides an incremental synchronization method, including: when the first device and the second device are connected for the Nth time, N is an integer greater than or equal to 2, and the method further includes: the first device synchronizes the last After synchronization, the metadata corresponding to the updated media file on the first device and the thumbnail corresponding to the updated media file are synchronized to the second device. That is, when the first device and the second device are connected for the Nth time, the metadata and thumbnail images corresponding to the media files updated by the first device can be automatically synchronized between the first device and the second device. Save resources and improve efficiency.
  • the embodiments of the present application provide an automatic caching method, including: the first device analyzes the user's preferences and behavioral habits based on an artificial intelligence AI algorithm; predicts the media files that the user needs to operate according to the user's preferences and behavioral habits; A second type of thumbnail image of the media file that the user needs to operate is sent to the second device.
  • the second device can cache the media files that the user may open locally in advance, and the user can quickly view the second type of thumbnail images later, which can improve user experience.
  • an embodiment of the present application provides an automatic aging method, including: a first device deletes cold data based on a preset period; wherein the cold data includes thumbnails of media files whose access times are lower than a preset threshold. In this way, the memory space of the first device can be saved.
  • an embodiment of the present application provides a streaming media playback method, including: when a first device plays a media file of a second device for the first time, starting a streaming server proxy, and the streaming server proxy is used to encapsulate the media file of the second device into a Streaming media format; the first device obtains the media files of the second device from the second device in m times through the streaming server proxy and caches them; where m is an integer greater than or equal to 2; the first device plays the cached data.
  • the player when the first device plays the media file of the second device for the first time, the player does not need to wait for the media file (for example, the original video file) to be completely downloaded before starting the playback, and can play it in real time, thereby realizing a high-performance user experience similar to local playback. .
  • the media file for example, the original video file
  • the first device plays the media file of the second device for the Nth time
  • the URI of the media file of the second device is obtained, and the cached data is obtained and played according to the URI; wherein, N is greater than or equal to 2 Integer.
  • N is greater than or equal to 2 Integer.
  • an embodiment of the present application provides an electronic device (eg, a first device or a second device), the electronic device having the function of implementing the method described in any of the foregoing aspects and any possible implementation manners thereof.
  • the functions can be implemented by hardware, or can be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium comprising computer instructions.
  • the computer instructions When executed on an electronic device, the electronic device is caused to perform the method described in any of the above aspects and any possible implementations thereof.
  • the present application provides a computer program product that, when the computer program product runs on a computer, causes the computer to execute the method described in the first aspect and any possible implementation manners thereof.
  • an embodiment of the present application provides a chip system, where the chip system includes one or more interface circuits and one or more processors.
  • the interface circuit and the processor are interconnected by wires.
  • the chip system can be applied to electronic equipment including a communication module and a memory.
  • the interface circuit is configured to receive signals from the memory of the electronic device and send the received signals to the processor, the signals including computer instructions stored in the memory.
  • the processor executes the computer instructions, the electronic device can execute the method described in any of the above aspects and any of its possible implementations.
  • an embodiment of the present application provides a data synchronization system, including two electronic devices (for example, a first device and a second device), and each electronic device can perform any of the above aspects and any possible implementation thereof way method.
  • the first device may acquire a media file update event; wherein, the media file update event is used to add, modify or delete the first media file; the first device updates the metadata corresponding to the first media file in the metadata database, and updates The thumbnail of the first media file in the media library; the first device sends a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and the thumbnail of the first media file.
  • the second device may receive the synchronization message from the first device.
  • FIG. 1A is a schematic diagram of a network architecture provided by an embodiment of the present application.
  • FIG. 1B is a schematic diagram of a network architecture provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a hardware structure of an electronic device 200 according to an embodiment of the present application
  • FIG. 3 is a schematic display diagram provided by an embodiment of the present application.
  • FIG. 4A is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 4B is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 4C is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 5A is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 5B is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 6A is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 6B is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 6C is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 6D is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 7A is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 7B is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 8A is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 8B is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 9A is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 9B is another schematic display diagram provided by an embodiment of the present application.
  • 10A is a schematic diagram of a software architecture of a mobile phone according to an embodiment of the present application.
  • 10B is a schematic diagram of a system architecture between a mobile phone A, a mobile phone B, and a cloud server according to an embodiment of the application;
  • 11A is a schematic diagram of signal interaction between a mobile phone A and a mobile phone B according to an embodiment of the application;
  • 11B is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the application.
  • 11C is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application.
  • 11D is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application.
  • FIG. 11E is another schematic display diagram provided by an embodiment of the present application.
  • FIG. 12 is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application.
  • FIG. 13 is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application.
  • FIG. 14 is another schematic diagram of a display provided by an embodiment of the present application.
  • FIG. 15 is another schematic diagram of signal interaction provided by an embodiment of the present application.
  • FIG. 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • the embodiments of the present application provide a distributed media data management method and framework, which can realize the localization of user access, retrieval, and sharing across devices, and is convenient to operate.
  • the system architecture involved in the embodiments of the present application may include multiple electronic devices, the multiple electronic devices may be networked, and information exchange may be performed between the multiple electronic devices after the networking.
  • the networking methods include but are not limited to the following methods:
  • Wireless fidelity (wireless fidelity, WIFI) networking mode multiple electronic devices can be connected to the same routing device (for example, a router).
  • a mobile phone 101 , a mobile phone 102 , a tablet computer 103 , a notebook computer 104 , and a smart TV 105 can be connected to a router 106 to form a home network.
  • multiple electronic devices can join the same hotspot device (for example, access the hotspot of the same mobile phone), and at this time, the information interaction between the electronic device and the electronic device can be forwarded through the hotspot device.
  • mobile phone 102, tablet computer 103, notebook computer 104, and smart TV 105 can be connected to mobile phone 101 to form a hotspot network, and mobile phone 101 can be used as a hotspot device to forward information for each electronic device.
  • (2) Cloud server networking mode Multiple electronic devices can be connected to the same cloud server. At this time, the information interaction between the electronic device and the electronic device can be forwarded through the cloud server.
  • the mobile phone 102 , the tablet computer 103 , the notebook computer 104 and the smart TV 105 can be connected to the router 106 to form a home network.
  • the router 106 can be connected to the server 201 , and the mobile phone 101 can also be connected to the server 201 , and the server 201 It can be used as a relay device to forward information for the router 106 and the mobile phone 101 , that is, the router 106 can exchange information with the mobile phone 101 through the server 201 .
  • the mobile phone 101 can exchange information with electronic devices such as the mobile phone 102 , the tablet computer 103 , the notebook computer 104 , and the smart TV 105 through the server 201 and the router 106 .
  • the mobile phone 101, the mobile phone 102, the tablet computer 103, the laptop computer 104, the smart TV 105 and the router 106 can all be connected to the server, and the server can be used as a relay device for the mobile phone 101, the mobile phone 102, the tablet computer 103, Information is forwarded between the notebook computer 104 , the smart TV 105 and the router 106 . That is, the mobile phone 101 , the mobile phone 102 , the tablet computer 103 , the notebook computer 104 , the smart TV 105 and the router 106 can exchange information through the server.
  • Bluetooth networking may also be performed between multiple electronic devices.
  • multiple electronic devices eg, mobile phone 102, tablet computer 103, laptop computer 104, smart TV 105, and router 106
  • the same Bluetooth device eg, mobile phone 101
  • the information exchange can be forwarded through the Bluetooth device.
  • Multiple electronic devices may use multiple networking methods, for example, at least two of the wireless fidelity networking method, the Bluetooth networking method, or the cloud server networking method, which are not limited in this application.
  • each electronic device shown in FIG. 1A or FIG. 1B is the electronic device 200 as an example to illustrate the structure of the electronic device provided by the embodiments of the present application. As shown in FIG. 1A or FIG. 1B (eg, the mobile phone 101 or the mobile phone 102 ) is the electronic device 200 as an example to illustrate the structure of the electronic device provided by the embodiments of the present application. As shown in FIG. 1A or FIG. 1B (eg, the mobile phone 101 or the mobile phone 102 ) is the electronic device 200 as an example to illustrate the structure of the electronic device provided by the embodiments of the present application. As shown in FIG.
  • the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, Antenna 1, Antenna 2, Mobile Communication Module 250, Wireless Communication Module 260, Audio Module 270, Speaker 270A, Receiver 270B, Microphone 270C, Headphone Interface 270D, Sensor Module 280, Key 290, Motor 291, Indicator 292, Camera 293, a display screen 294, and a subscriber identification module (subscriber identification module, SIM) card interface 295 and the like.
  • a processor 210 an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230
  • a charging management module 240 a power management module 241, a battery 242,
  • the above sensor module 280 may include sensors such as pressure sensor, gyro sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
  • sensors such as pressure sensor, gyro sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
  • the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or fewer components than shown, or combine some components, or separate some components, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 210 may include one or more processing units, for example, the processor 210 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. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller may be the nerve center and command center of the electronic device 200 .
  • 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 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 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 interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 .
  • the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 240 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger. While the charging management module 240 charges the battery 242 , the power management module 241 can also supply power to the electronic device.
  • the power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 .
  • the power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260.
  • the power management module 241 and the charging management module 240 may also be provided in the same device.
  • the wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, the baseband processor, and the like.
  • the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250
  • the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 200 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 250 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 200 .
  • the mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 250 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 250 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210 .
  • at least part of the functional modules of the mobile communication module 250 may be provided in the same device as at least part of the modules of the processor 210 .
  • the wireless communication module 260 can provide applications on the electronic device 200 including WLAN (such as (wireless fidelity, Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation ( frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN such as (wireless fidelity, Wi-Fi) network
  • Bluetooth bluetooth, BT
  • global navigation satellite system global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 260 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 260 receives electromagnetic waves via the antenna 2 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 260 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
  • the electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 294 is used to display images, videos, and the like.
  • the display screen 294 includes a display panel.
  • the electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor.
  • the ISP is used to process the data fed back by the camera 293 .
  • Camera 293 is used to capture still images or video.
  • the electronic device 200 may include 1 or N cameras 293 , where N is a positive integer greater than 1.
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 .
  • the processor 210 may execute instructions stored in the internal memory 221, and the internal memory 221 may include a program storage area and a data storage area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 and the like.
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor. Such as music playback, recording, etc.
  • the keys 290 include a power-on key, a volume key, and the like. Keys 290 may be mechanical keys. It can also be a touch key. Motor 291 can generate vibrating cues. The motor 291 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. The indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 295 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 200 by inserting into the SIM card interface 295 or pulling out from the SIM card interface 295 .
  • the electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 295 can support Nano SIM card, Micro SIM card, SIM card and so on.
  • the setting interface 303 shown in (b) of FIG. 3 can be entered.
  • a plurality of setting options may be included, for example, a personal account setting item (eg, Glen Gao), a WLAN setting item, a Bluetooth setting item, a mobile network setting item, a more connection setting item, a desktop and a wallpaper setting may be included items etc.
  • the mobile phone may display the more connection interface 305 .
  • connection options may be included, for example, a multi-device collaboration option, an NFC option, a Huawei Share option, a Huawei HiCar option, a mobile phone screen projection option, a printing option, a VPN option, and the like may be included.
  • the mobile phone may display a multi-device collaboration interface 307 .
  • a prompt animation/prompt picture 308 and a prompt text 309 may be included.
  • the prompt text 309 is used to prompt the user to "swipe up from the lower left corner of the screen when the screen is not locked to enter the device control center, and the local task can be connected to other nearby devices and quickly control the smart home", and the prompt animation 308 is used to show the user. Demonstrate the operation of swiping up from the lower left corner of the screen.
  • the device control center is a system APP.
  • the device control center can also be replaced with a file management (also called a file manager, a system APP).
  • the multi-device collaboration interface 307 may further include switches (buttons) 310 and prompt information 311 .
  • Prompt message 311 explains that "this service (multi-device collaboration service/function) and its underlying services (word processing, resource update AI intelligence, general card management service) need to be connected to the Internet, using storage, information, Bluetooth, telephone (reading device calls Status, make calls), location information, address book, memo, calendar permissions, access device and account information.
  • Turning on the switch ie switch 310) means that you agree to the above content and the statement on multi-device collaboration and privacy".
  • the user can learn about the permissions required for the multi-device collaborative service, and decide whether to turn on the switch 311 . If the user turns on the switch 311, it means that the user agrees to authorize various permissions required for the multi-device collaborative service, and the mobile phone A can enable the multi-device collaborative service/function.
  • a connection is established between the multiple devices. After the connection, any one of the multiple devices can realize cross-device data access, Search and share. Multiple devices may correspond to the same account (for example, a Huawei account), or multiple devices may correspond to different accounts, which are not limited in this application.
  • a search bar for example, including pictures, videos, documents, icons of media content such as apps
  • location for example, including my mobile phone, HUAWEI CLOUD, recently deleted, etc.
  • source for example, including downloading and receiving, etc. sources.
  • controls 402 for adding other devices may also be included.
  • the mobile phone may display an add device interface 403.
  • the devices currently searched by mobile phone A can be displayed, such as Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV, Mate 30 pro (mobile phone B), Mate pad pro (tablet computer) book (laptop), etc.
  • the interface 403 may also include options for adding network neighbors, adding FTP, and WebDAB, and help information 405, which can help the user answer the doubts about "how to connect to other devices?" and perform "device recommendation".
  • the control 404 corresponding to the Mate 30 pro (mobile phone B) as shown in (c) of FIG.
  • the mobile phone A may pop up a prompt box 406, which includes a text prompt 407a, a cancel button 408 and a connection button 409.
  • the text prompt 407a can prompt the user "After connecting, you can view the data of this device and share data between devices, whether to connect?", in response to the user's operation of clicking the connect button 409, mobile phone A can send a connection request to mobile phone B ,
  • the prompt text 407a in the prompt box 406 can be changed to 407b, and the prompt text 407b can prompt the user "waiting for Mate30 pro confirmation".
  • FIG. 1 the prompt text 407a in the prompt box 406 can be changed to 407b, and the prompt text 407b can prompt the user "waiting for Mate30 pro confirmation.".
  • a pop-up box 410 may pop up on the desktop of mobile phone B, and the pop-up box 410 may include text prompts 411 , Deny button 412 and Allow button 413.
  • the text prompt 411 can be used to prompt the user "HUAWEI P20 (ie mobile phone A) wants to connect to this device, after the connection, data can be shared between the devices, whether to connect?", in response to the user's operation of clicking the allow button 413, the mobile phone B can establish a connection with phone A so that data can be shared.
  • the pop-up box 410 may also include prompt text 414, which is used to prompt the user whether to select "trust this device and always allow the connection". If the user clicks the check box, the mobile phone B can automatically connect with the mobile phone A next time. There is no need to notify the user, and the user does not need to take a corresponding action (such as clicking the allow button), which can improve the user experience.
  • prompt text 414 is used to prompt the user whether to select "trust this device and always allow the connection”. If the user clicks the check box, the mobile phone B can automatically connect with the mobile phone A next time. There is no need to notify the user, and the user does not need to take a corresponding action (such as clicking the allow button), which can improve the user experience.
  • FIG. 4C in the “recent” interface 415 of mobile phone A, an instant entry 416 for viewing other devices may be displayed, and in response to the operation of the user clicking the instant entry 416, mobile phone A may An interface as shown in (b) in FIG. 4A is displayed.
  • FIG. 4C For the subsequent process, reference may be made to the related description about FIG. 4A , which will not be repeated here.
  • mobile phone A can establish connections with devices such as Mate pad pro (tablet computer), Huawei TV, and Mate book (laptop computer). In this way, users can access and share data across devices. For example, users can view data from devices such as Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV, and Mate book (laptop computer) on mobile phone A. In this way, the problem of inconvenience for users to find data caused by numerous personal terminal devices and scattered storage of personal data can be solved.
  • users can also cancel the connection between mobile phone A and Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV and Mate book (laptop computer) and other devices.
  • the mobile phone A in response to the user's long-pressing (for example, pressing and holding the screen for 2s) any position in the area 422 corresponding to the Mate 30 pro (mobile phone B), the mobile phone A can pop up a pop-up Box 423, the pop-up box 423 includes the cancel authorization option and the delete device option. If the user clicks the cancel authorization option, in response to the user's operation, as shown in (c) in FIG.
  • the mobile phone A can pop up the pop-up box 426, the pop-up box 426 includes the prompt information "After the authorization is cancelled, the devices will no longer share data, whether to cancel", and the temporarily cancel button and the cancel authorization button, and the user can click the corresponding button according to their own needs.
  • the delete device option as shown in (d) in FIG. 5B
  • mobile phone A may pop up a pop-up box 427, and the pop-up box 427 includes a prompt message "After deletion, data will no longer be shared between devices. , whether to delete" and the cancel button and delete button, users can click the corresponding buttons according to their own needs.
  • FIG. 5B the mobile phone A can pop up the pop-up box 426, the pop-up box 426 includes the prompt information "After the authorization is cancelled, the devices will no longer share data, whether to cancel", and the temporarily cancel button and the cancel authorization button, and the user can click the corresponding button according to their own needs.
  • the user can swipe left in the area 422 corresponding to the Mate 30 pro (mobile phone B), and the mobile phone A can display the cancel authorization icon 424 and the delete device icon 425. If the user clicks After canceling the authorization icon 424, in response to the user's operation, as shown in (c) of FIG. 5B, the mobile phone A may pop up a pop-up box 426, and the pop-up box 426 may refer to the above description. If the user clicks the delete device icon 425, as shown in (d) of FIG. 5B, in response to the user's operation, the mobile phone A may pop up a pop-up box 427, which can refer to the above description.
  • the user may view media files of other devices on cell phone A.
  • viewing media files may refer to viewing thumbnails of media files (for example, thumbnails of pictures, and cover thumbnails of audio and video) or the media files themselves (the media files themselves may be referred to as original media files, such as , the original media file can be the original image of the picture, the original file of the video, the original file of the audio, etc.).
  • FIG. 5A in response to the user clicking any position in the area 422 corresponding to the Mate 30 pro (mobile phone B), as shown in FIG.
  • the mobile phone A can display the media file interface 430 corresponding to the Mate 30 pro (mobile phone B) , the interface 430 may include a plurality of tabs, for example, tabs such as recent, picture, video, audio, document, and others may be included.
  • Mobile phone A can display the contents of the recent tab 431 by default, and the interface 430 can display media files (eg, pictures, videos, audios, documents, etc.) recently processed (downloaded, cached, uploaded) by different applications.
  • media files eg, pictures, videos, audios, documents, etc.
  • 2 media files (pictures) have just been processed (for example, within 5 minutes), namely A-001.jpg and A-001.jpg (the picture format is jpg), and the processing time is 2019/3/16.
  • the size is 9.34KB respectively.
  • WPS processed 5 media files (eg, documents) yesterday.
  • 8 media files (eg pictures) were processed yesterday.
  • Figure 6A The processed 8 media files are not displayed completely, the user can perform an operation of swiping up, and the mobile phone A can display more media files in response to the user's operation. As shown in FIG.
  • the mobile phone A in response to the user's operation of selecting the picture tab 432, can display the content of the picture tab 432, that is, when the picture tab 432 is selected, the interface 430 can display different pictures of the Mate 30 pro (mobile phone B)
  • the content of the folder for example, can include all pictures (223 items in total), screenshots (34 items in total), images (123 items in total), pictures (327 items in total) and mail (327 items in total) and other picture folders.
  • the mobile phone A in response to the user's operation of selecting the video tab 433, the mobile phone A can display the content of the video tab 433, that is, when the video tab 433 is selected, the interface 430 can display the video file of the Mate 30 pro (mobile phone B).
  • the content of the folder can include all videos (568 items in total), from 's videos (34 in total), from videos (123 in total), videos from Huawei Video (327 in total) and videos from videos (6 items in total) and other video folders. As shown in FIG.
  • the mobile phone A in response to the user's operation of selecting the audio tab 434, the mobile phone A can display the content of the audio tab 434, that is, when the audio tab 434 is selected, the interface 430 can display various
  • the icon and name of the audio for example can include xx1.mp3, xx2.mp3, xx3mp3, xx4.mp3, xx5.mp3, xx6.mp3, xx7.mp3, xx8.mp3, xx9.mp3, xx10.mp3, xx11.mp3 , xx12.mp3, etc.
  • mobile phone A in response to the user clicking on any position in the area corresponding to the Mate pad pro, Huawei TV or Mate book, mobile phone A can display the interface corresponding to the Mate pad pro, Huawei TV or Mate book, and the user can View media files of different devices through interfaces corresponding to different devices.
  • the interface corresponding to the Mate 30 pro please refer to the description of the interface corresponding to the Mate 30 pro above, which will not be repeated here.
  • the user can retrieve the media files of the device and other devices (other devices currently connected to the phone A) on the mobile phone A.
  • the mobile phone A may display this book by default.
  • the search results of the computer tab 418, the search results of the local computer can include files from "Huawei Cloud Disk” (for example, TOEFL Basic Lectures. mp4, etc.) and audio (eg, TOEFL Listening Fundamentals Course.mp3, etc.).
  • “Huawei Cloud Disk” for example, TOEFL Basic Lectures. mp4, etc.
  • audio eg, TOEFL Listening Fundamentals Course.mp3, etc.
  • mobile phone A may display search results of other devices, and the search results of other devices may include 10 files found by Mate 30Pro and 6 files found by Matebook item file.
  • the 10-item files found by the Mate 30Pro may include TOEFL problem solving skills.doc and the like.
  • users can choose to search for an item on a certain device.
  • the mobile phone A in response to the operation of the user clicking the search control 440, the mobile phone A can display the search interface 441 shown in (b) in FIG. 7B , In the search box 442 of the interface 441, the mobile phone A can receive the "TOEFL” input by the user, and in response to the operation of the user inputting "TOEFL", the mobile phone A can display the search results of the Mate 30 pro (mobile phone B) for "TOEFL", and search for "TOEFL”.
  • the result can be to find 10 items of files, for example, can include TOEFL problem solving skills.doc, TOEFL listening analysis.mp3 and TOEFL listening improvement.mp4 and other files.
  • the user can search for a certain content (for example, "TOEFL") in any device connected to mobile phone A, without the need to perform a corresponding search operation on the corresponding device (for example, Mate 30 pro (mobile phone B)), which can simplify User operation, improve user experience.
  • the user can share one or more media files of mobile phone B on mobile phone A to third-party applications or system applications.
  • the mobile phone A in response to the user's operation of long pressing the picture 450 , the mobile phone A may pop up a pop-up frame 451 , and in the pop-up frame 451 It includes multiple operation options, such as sharing, multiple selection, copying, details, and opening method.
  • the mobile phone A in response to the user's operation of clicking the share operation option 452, as shown in (b) in FIG. 8A, the mobile phone A may pop up a pop-up box 453, and the pop-up box 453 may include prompt information 454 and information about the application or service that can be shared.
  • the icon 455 and the prompt information 454 can be used to prompt the user: "A nearby device is being discovered. The other party needs to open Huawei Share in the notification bar. If you want to print, please make sure that the printer can be discovered.” Icons of applications or services that can be shared 455 for example can include Email, Huawei Cloud Disk, etc. If the user does not want to continue sharing, the user can click the cancel button 456 to cancel the sharing.
  • the embodiments of the present application can realize the localization of user data sharing, and solve the problem of inconvenience in user data sharing.
  • the mobile phone A in response to the user's operation of long pressing the picture 450, the mobile phone A can pop up the pop-up frame 460 and the pop-up frame 461,
  • the pop-up box 460 may include several operation options commonly used by the user, for example, may include operation options such as share, favorite, and delete.
  • the pop-up box 461 may include multiple operation options, for example, may include operation options such as multi-select, move, copy, rename, details, open method, set as, and set as private.
  • the mobile phone A can pop up a pop-up box 463, and the pop-up box 463 can include a plurality of position information that can be moved , for example, it can include the SD card and Huawei cloud disk in my mobile phone, and can also include different folders of other devices (for example, Mate 30 pro (mobile phone B)), for example, it can include the Alarms, folders such as apmmodel, edge, picture, and my files.
  • a prompt text 465 may be displayed above the pop-up box 463, prompting the user to "move 1 item to "Alarms", a total of 17.34MB".
  • one media file to be moved is the picture 450, and the picture 450 has a total of 17.34MB.
  • the embodiments of the present application can realize the localization of user data sharing, and solve the problem of inconvenience in user data sharing.
  • the embodiments of the present application support third-party applications to search, access, and share media files across devices. For example, when a user inserts an attachment in a mail application, he can search from the machine or from multiple devices connected to the machine.
  • the display style of the selection box on the media file 473a changes, indicating that the file is selected.
  • the upper part of the interface 472 may also include prompt information 474, prompting the user that "1/20 has been selected", that is, the user can select a total of 20 files, and one is currently selected.
  • the mobile phone A can return to display the new email interface 470.
  • an attachment display area 476 is added to the newly created email interface 470, and the attachment display area 476 is added.
  • user-selected attachments eg, coverdesign.pptx
  • the user may click on control 477 to delete the currently selected attachment.
  • the mobile phone A may display an interface 480a for browsing the tab, in the interface 480a, in response to the user selecting the Mate 30 pro (mobile phone B). ) operation, as shown in (c) of FIG. 9B , the mobile phone A can display the interface 480b, and the interface 480b displays the contents of the recent tab of the Mate 30pro (mobile phone B) by default.
  • the interface 480b may include prompt information 483 for prompting the user that the media file of the Mate 30 pro (mobile phone B) is currently being browsed.
  • the prompt message 484 can prompt the user that "2/20 has been selected", that is, the user can select a total of 20 files , two are currently selected. Then, in response to the user's operation of clicking the finish button 485, as shown in (d) of FIG. 9B, the mobile phone A can return to display the new email interface 470. At this time, an attachment display area 486 is added in the In the attachment display area 486, attachments selected by the user (eg, A-002.jpg and cover design.pptx) may be displayed.
  • the embodiments of the present application support searching, accessing, and sharing media files from third-party applications across devices, without first downloading media files of other devices to the local area, and without requiring users to perform cumbersome operations, which can improve user experience.
  • the software system of the above mobile phone may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of a mobile phone (mobile phone A or mobile phone B).
  • the mobile phone may also be a Hongmeng system, an IOS system, or other operating systems, which are not limited in this embodiment of the present application.
  • the software architecture of the mobile phone may include an application layer and a framework layer.
  • the application layer may include a series of application packages, and the application package may include, for example, applications such as mail, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • applications such as mail, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • the framework layer provides an application programming interface (API) and a programming framework for applications in the application layer.
  • API application programming interface
  • the framework layer includes some predefined functions.
  • the framework layer may include a unified operation framework 001, a distributed rights management module 002, a distributed database (also referred to as a distributed data management module) 003, a device management module (also referred to as a Peers management module) 004, Distributed storage module 005 and cross-device transfer module 006.
  • a distributed rights management module 002 a distributed database (also referred to as a distributed data management module) 003, a device management module (also referred to as a Peers management module) 004, Distributed storage module 005 and cross-device transfer module 006.
  • a distributed rights management module also referred to as a distributed data management module
  • a distributed database also referred to as a distributed data management module
  • a device management module also referred to as a Peers management module
  • Distributed storage module 005 a cross-device transfer module
  • Unified operation framework 001 It can encapsulate and shield the communication differences between near-field communication and far-field communication, as well as the storage differences between this device and other devices, and provide a unified northbound API to the application, so as to realize the management of the device by the application (adding, operations such as authentication, addition, deletion, modification, query (search), browsing, sharing, backup, and migration of media objects (ie, media files).
  • Distributed rights management module 002 used to provide rights management for distributed media access, including application rights management and user account rights management.
  • Distributed database 003 used to realize "plug and play access” of media metadata across devices based on full synchronization, incremental synchronization and real-time synchronization capabilities.
  • “Plug-and-play access” refers to storing media metadata of other devices (eg, phone B) on a certain device (eg, phone A) in advance, so that there is no need to spend time acquiring the media metadata of other devices during access , for quick access to media metadata from other devices.
  • the media metadata is data describing attribute information of media data (media content/media file). For example, the identification, type (audio, video, picture, etc.), size, storage location, etc. of the media file may be included.
  • Device management module 004 used for device discovery (for example, discovering other devices in the same local area network) and state management (for example, the connection with other devices), and can respond to the system's device chain establishment (connection establishment) and link disconnection (disconnection). Connect) event, trigger media metadata synchronization and state update, and notify the distributed database 003 of application data and state changes.
  • Distributed storage module 005 used for media data synchronization, thumbnail data synchronization and media data access across devices, caching (including transparent caching and stateful caching), and consistency maintenance (eg, intelligent aging).
  • Cross-device transmission module 006 used to control the cross-device transmission of media metadata and media data (for example, thumbnail data), and can receive media metadata and media data from other devices, or send media metadata and media data to other devices .
  • media metadata and media data for example, thumbnail data
  • the interaction interface 10 between the application layer and the unified operation framework 001 is a northbound API interface, which is an interface provided for applications to operate media objects.
  • the interactive interface 20 between the unified operation framework 001 and the distributed rights management module 002 is an authentication and authorization interface, which is an interface provided to the unified operation framework 001 for application authentication, account authentication, and media object rights management.
  • the interactive interface 21 between the unified operation framework 001 and the distributed database 003 is a database operation interface, which is an interface for adding, deleting, modifying and querying media metadata provided to the unified operation framework 001 .
  • the media metadata includes media metadata of local, cloud, and distributed terminals (ie, other devices).
  • the interaction interface 22 between the unified operation framework 001 and the cross-device transmission module 006 is a remote control interface, which is an interface for collaborative editing, cross-device copy/paste business control data, and content data transmission provided to the unified operation framework 001 .
  • the interactive interface 30 between the device management module 004 and the distributed database 003 is a device change notification and query interface, an interface provided to the distributed database 004 for remote device state change notification and real-time state query.
  • the remote device may include a PC, a PAD, a mobile phone, a NAS, a cloud server, and other devices.
  • the interactive interface 31 between the distributed database 003 and the cross-device transmission module 006 is a metadata synchronization interface, which is an interface for cross-device query and broadcast data transmission of metadata provided to the distributed database 003 .
  • the interactive interface 32 between the distributed database 003 and the distributed storage module 005 is a file operation interface, which is an operation interface for local, cloud, and distributed media files provided to the distributed database 003, and supports the addition of media files across devices. , delete, modify and query, etc.
  • the interaction interface 40 between the device management module 004 and the cross-device transmission module 006 is a device discovery and monitoring interface, and is a transmission interface for device state change information provided to the device management module 004 .
  • the interactive interface 50 between the distributed storage module 005 and the cross-device transmission module 006 is a file cache and synchronization interface, which is a cross-device media file transmission interface provided to the distributed storage module 005 .
  • the framework layer may also include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, and the like, which are not limited in this embodiment of the present application.
  • Activity Manager used to manage the life cycle of each application. Applications usually run in the operating system in the form of Activity. For each Activity, there will be a corresponding application record (ActivityRecord) in the activity manager, and this ActivityRecord records the state of the application's Activity. The activity manager can use this ActivityRecord as an identifier to schedule the Activity process of the application.
  • WindowManagerService used to manage the graphical user interface (graphical user interface, GUI) resources used on the screen, which can be used for: obtaining the display screen size, creating and destroying windows, displaying and hiding windows, Layout, focus management, input method and wallpaper management, etc.
  • the software architecture of the handset may also include system libraries and kernel layers (not shown in Figure 10A).
  • the system library and the kernel layer can be called the underlying system, and the underlying system includes the underlying display system for providing display services.
  • the underlying display system includes the display driver in the kernel layer and the surface manager in the system library.
  • a system library can include multiple functional modules. For example: surface manager, Media Libraries, OpenGL ES, SGL, etc.
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • OpenGL ES is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • SGL 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, and sensor drivers.
  • the device management module 004 can manage both near-field devices (eg, device discovery, device connection) and far-field devices (eg, device discovery, device connection), and the cross-device transmission module 006 Data synchronization/data transmission between near-field devices and data synchronization/data transmission between far-field devices can be performed.
  • near-field devices eg, device discovery, device connection
  • far-field devices eg, device discovery, device connection
  • cross-device transmission module 006 Data synchronization/data transmission between near-field devices and data synchronization/data transmission between far-field devices can be performed.
  • At least one of the following preconditions must be met: 1) Create a new device management table to store near-field device/far-field device information that has been connected to the local device; 2) Create a new data synchronization state table for Store the synchronization status of the local media data of the near-field device/far-field device; 3) Create a new album set/album table, which is used to store the album set and album information; 4) Create a new media asset/album relationship correspondence table, which is used to store media assets and The relationship of the album; 5) The near-field device/far-field device registers the local media data monitoring of the near-field device/far-field device.
  • the process of device discovery may include: receiving online/offline events of devices (near-field devices/far-field devices), and updating status information corresponding to the devices in the device management table.
  • the media data changes are recorded in the data synchronization state table.
  • the process of data synchronization may include: when the local device is connected to the near-field device/far-field device, the local-end device sends a data synchronization request to the near-field device/far-field device, and the near-field device/far-field device retrieves the data from the data synchronization state table. Extract the synchronization status of the media object from the media database, extract the changed data from the media database, and synchronize it to the local device.
  • the near-field device/far-field device can create a new album set/album table, media asset/album relationship correspondence table, and according to the link status of the device in the device management table, from the album set/album table, media asset/album relationship correspondence table.
  • the media file metadata synchronization (full synchronization, incremental synchronization, real-time synchronization) obtained from the table and MediaProvider database table is sent to the local device, and the synchronization of thumbnails is completed at the same time.
  • the near-field device/far-field device goes online for the first time, perform full synchronization of media metadata/thumbnail with the local device; when the near-field device/far-field device is not online for the first time, perform media metadata/thumbnail synchronization with the local device.
  • Incremental synchronization when the near-field device/far-field device and the local device are online, perform real-time synchronization of metadata/thumbnails.
  • abnormal recovery can be performed after the near-field device/far-field device and the local device are disconnected.
  • the near-field device/far-field device obtains the incremental metadata that needs to be synchronized in the album set/album table, and the corresponding table of media assets/album relationship according to the data status in the device management table and the data synchronization status table, and synchronizes the data.
  • To the local device and update the data synchronization status table.
  • the local device After the local device receives the synchronized metadata, it completes the data update of the local device's album set/album table, media asset/album relationship correspondence table, and synchronously updates the local near-field device/far-field device data (MediaProvider file surface). 3.
  • the local device receives the synchronization of the thumbnails of the near-field device/far-field device, it updates the thumbnails to the buffer.
  • full synchronization can be performed; incremental synchronization is not initiated; when the data version number of the local device is greater than the data version number of the remote device, real-time synchronization will be pulled up, that is, the data version number of the local device is greater than the data version number of the remote device , perform real-time synchronization.
  • the device is not online for the first time, it will not automatically start full synchronization.
  • the incrementally synchronized structured query language (SQL) file (the SQL file includes the metadata of the updated media file) is larger than 1 megabyte (mb) /M)
  • full synchronization will be started, that is, when the incrementally synchronized SQL file is larger than 1M, full synchronization can be started.
  • the data version number of the local device is +1.
  • the database (datebase, db) file (eg, SQL file) is successfully sent, the data version number of the peer device is set to the data version number (ie, the data version number) of the local device before full synchronization.
  • the data version number of the local device is +1; when the SQL file is successfully sent to the peer, the data version number of the peer device is set to the current local device data version number (that is, the data version number + 1) .
  • the data version number is used to record the number of data synchronizations, and the data version number can be incremented by one (+1) for each synchronization.
  • the device management module 004 of the mobile phone 100 may perform device discovery with the device management module 004 of the mobile phone 200 through the device cloud server.
  • the cross-device transmission module 006 of the mobile phone 100 can establish a device connection with the cross-device transmission module 006 of the mobile phone 200 through a peer-to-peer (P2P) server, so that data can be directly performed between the far-field devices (that is, the mobile phone 100 and the mobile phone 200).
  • P2P peer-to-peer
  • the far-field device communication protocol can be used for communication between the far-field devices, and the far-field device communication protocol includes Ethernet, 2/3/4/5G, and the like.
  • the device management module 004 can also be used to determine the specific message format, transmission rate, protocol specification, etc. when communicating between far-field devices.
  • the P2P server can adopt technologies such as network address translation (NAT) session traversal utilities for NAT (STUN) and traversal using relays around NAT (TURN).
  • NAT network address translation
  • STUN network address translation
  • TURN relays around NAT
  • the far-field device establishes a connection, which can implement P2P communication (ie, direct communication) between two far-field devices (for example, the mobile phone 100 and the mobile phone 200 ).
  • the mobile phone 100 and the mobile phone 200 can access the same local area network (for example, a Bluetooth local area network or a WIFI local area network), and the device management module 004 can exchange information with the device management module 004 of the mobile phone 200 based on the local area network, thereby Near-field devices can be managed.
  • the cross-device transmission module 006 of the mobile phone 100 can exchange information with the cross-device transmission module 006 of the mobile phone 200 based on the local area network, so as to perform data transmission with the near-field device.
  • Near-field device communication protocols can be used for communication between near-field devices.
  • Near-field device communication protocols include WIFI, bluetooth (BT), low energy bluetooth (BLE), NFC, infrared (wire), universal string At least one of the universal serial bus (USB).
  • the device management module 004 can also be used to determine the specific message format, transmission rate, protocol specification, etc. when communicating between near-field devices.
  • data synchronization can be performed after the mobile phone A and the mobile phone B are connected.
  • the data synchronization includes full synchronization and incremental synchronization.
  • FIG. 11A it is a signal interaction diagram of data synchronization, including:
  • Mobile phone A monitors media metadata changes and records the change status.
  • Mobile phone A monitors the change of media metadata and records the change status.
  • mobile phone A monitors the change of media metadata and records the change status.
  • the state tree of the distributed database in mobile phone A can always monitor whether the media metadata is changed, and record the change state. For example, after the user takes a photo through mobile phone A, the media metadata will be changed, and the state tree can monitor the change of the media metadata and record the data of the photo.
  • step s2 and step s3 can be performed.
  • Full synchronization refers to the cross-device synchronization of all media metadata, user accounts, and device attribute information between devices.
  • the state tree of mobile phone A records the synchronization state.
  • the state tree of mobile phone A can record all the media metadata, user account and device attribute information of mobile phone B.
  • steps s4 to s6 may be performed.
  • the state tree of mobile phone A obtains the incremental synchronization list.
  • the incremental synchronization list is a list of change information of media objects such as audio, video, pictures, and files after the last (previous) synchronization, including file name, path, creation time, modification implementation, size, playback duration, etc.
  • Incremental synchronization is the cross-device synchronization of the metadata of the changed media assets on the device after the device is disconnected and connected again.
  • the synchronization content includes the changed data, user account, device information, and change type (for example, add, modify, delete) .
  • the state tree of mobile phone A updates the synchronization state.
  • the mobile phone A and the mobile phone B can perform near field communication or far field communication.
  • Near field communication can complete information exchange between devices through routers and other devices.
  • Far-field communication can complete the information exchange between devices through the server.
  • the communication mode of mobile phone A and mobile phone B is not fixed and can be dynamically switched. For example, when the user controls the mobile phone B at home through the mobile phone A in the company, the mobile phone A and the mobile phone B perform far-field communication, using the far-field device communication protocol. If the user returns home, both mobile phone A and mobile phone B are connected to the home router network. At this time, mobile phone A and mobile phone B perform near field communication using the near field device communication protocol.
  • the local device (mobile phone A) and the near-field device (mobile phone B) perform device online and offline management.
  • the local device When the local device (mobile phone A) and the near-field device (mobile phone B) are connected for the first time, the local device can receive the device online/offline events of the near-field device. If there is no near-field device related information in the device management table of the local device, full synchronization can be performed.
  • the local device sends an online notification to the near-field device.
  • the near-field device can synchronize the database file (the metadata of the media file) in the MediaProvider to the local device, and also synchronize the related thumbnail files to the local device at the same time.
  • the local device after receiving the synchronization of the thumbnails of the near-field devices, the local device updates the thumbnails to the buffer.
  • S105 The local device sends a thumbnail synchronization status notification to the near-end device.
  • the local device receives the database file of the near-field device.
  • the local device stores the database file of the near-field device in the file directory of the MediaProvider of the local device, and the near-field device database of the local device can be named with the self_id in the device management table.
  • S107 The local device sends a metadata synchronization state notification to the near-end device.
  • the local device updates the device status table.
  • the local device can write the current state information of the near-end device into the device management table.
  • incremental synchronization may include the following steps:
  • the local device (mobile phone A) and the near-field device (mobile phone B) perform device online and offline management.
  • the local device can receive the device online/offline events of the near field device. If the device management table of the local device already has information related to the current near-field device, perform incremental synchronization.
  • the local device sends an incremental synchronization request to the near-field device.
  • the near-field device sends an SQL statement and a thumbnail image of the changed data to the local device.
  • the SQL statement for changing the data includes the metadata of the updated media file.
  • the SQL file is a database script file, which is a standard data query language used in the database. SQL statements are included in the SQL file. After synchronizing the SQL file to the peer device, and executing the SQL file on the peer device, the metadata of the updated media file can be refreshed to the database of the peer device.
  • the near-field device After the near-field device receives the online notification from the local device, the near-field device reads the device data version number from the device status table, compares it with the data version number of the changed data in the synchronization status table, and generates the SQL statement for the data change. Enter the text file, and obtain the thumbnail of the changed data, and then complete the synchronization of the metadata and the thumbnail through the data transmission channel.
  • the distributed database of the local device parses the SQL file, and inserts the updated metadata into the database.
  • the local device After the local device receives the text of the SQL statement for changing metadata synchronized by the near-field device, it can parse the text and execute the SQL statement to update the album set/album table, media assets/album in the near-field database of the local device Corresponding data in relational tables and other tables.
  • full synchronization can be performed.
  • S205 The local device sends a metadata synchronization state notification to the near-end device.
  • the local device after receiving the synchronization of the thumbnails of the near-field devices, the local device updates the thumbnails to the buffer.
  • S207 The local device sends a thumbnail synchronization status notification to the near-end device.
  • the local device writes the current state information of the near-end device into the device management table.
  • real-time data synchronization can be performed after mobile phone A and mobile phone B are connected.
  • the real-time synchronization of data is to perform cross-device synchronization in real time when the media data changes due to user operations (such as downloading pictures, taking pictures, etc.) while the device remains connected.
  • the synchronization content includes the changed media data, user account, device information, and change type. Wait.
  • Real-time synchronization needs to meet at least one of the following preconditions: 1) When the local device data version number is equal to the remote device data version number, real-time synchronization can be performed. If the data version number of the local device is greater than that of the remote device, incremental synchronization can be performed. 2) During real-time synchronization, when the local data version number is equal to 0, the data status table and the peer device status table can be cleared.
  • FIG. 11D it is a signal interaction diagram of real-time synchronization of data, including:
  • the application program of the mobile phone A applies to the unified operation framework of the mobile phone A for adding/deleting/modifying media files.
  • real-time synchronization can be triggered by an operation of a file by a user application (eg, a file manager). Alternatively, real-time synchronization can also be triggered automatically at preset time intervals.
  • the media files may include files such as pictures, videos, audios, and documents.
  • Applications can include third-party applications (eg, ) and system applications (eg, camera applications).
  • the camera application can apply to the unified operation framework to add a new photo.
  • mobile phone A can obtain the metadata of the changed media files from the album set/album table, the media asset/album relationship correspondence table, and the MediaProvider database table, write it into the SQL file, and synchronize it to the mobile phone in real time.
  • B the synchronization of thumbnails is completed at the same time.
  • Mobile phone A can perform the following steps:
  • the unified operation framework of the mobile phone A notifies the distributed database of the mobile phone A to update the media metadata.
  • media metadata of photos taken by the user may be added to the distributed database of mobile phone A, such as the size and storage location of the photos taken by the user.
  • the distributed database of the mobile phone A notifies the distributed storage module of the mobile phone A to update the media file.
  • the distributed storage module of the mobile phone A stores the photos taken by the user.
  • the distributed database of mobile phone A notifies the unified operation framework of mobile phone B of the synchronously changed media metadata.
  • the changed media metadata can be included in the SQL file.
  • mobile phone B After mobile phone B receives the SQL file synchronized by mobile phone A, it completes the data update of mobile phone B's album set/album table and the corresponding table of media assets/album relationship according to the changes, and Synchronously update the local near-field device data (MediaProvider's file table).
  • MediaProvider stores information of multimedia files such as pictures, videos, and audios, and provides basic methods such as addition, deletion, modification, and search, which can be used by applications such as video players, music players, and galleries.
  • Step 1103 and step 1104 may be performed simultaneously.
  • the unified operation framework of the mobile phone B notifies the distributed database of the mobile phone B to update the changed media metadata.
  • the distributed database of the mobile phone B requests the first type of thumbnails of the original media file (original media data) from the distributed database of the mobile phone A.
  • the original media file may be, for example, an original image of a picture, an original file of a video, an original file of an audio, and the like.
  • the thumbnail of the original media file may be, for example, a thumbnail of a picture, a thumbnail of a cover of an audio or video, and the like.
  • the thumbnails of the original media files can be classified into two types according to their sizes.
  • the size of the thumbnails of the first type can be between 10K and 20K, for example, 10K, 15K or 20K.
  • the resolution of the first type of thumbnails may be 256*256. Refer to the description of step 1109 for the second type of thumbnails.
  • the distributed database of mobile phone A sends the first type of thumbnail images of the original media file to the distributed database of mobile phone B.
  • the distributed database of the mobile phone B instructs the distributed storage module of the mobile phone B to cache the thumbnails of the first type of the original media file.
  • the distributed storage module of the mobile phone B can cache the thumbnails of the first type of the original media files (the user does not perceive the caching process) into the buffer. Among them, the cache represents the state after the data reading (pulling) is completed.
  • the distributed database of the mobile phone B requests the second type of thumbnail images of the original media file from the distributed database of the mobile phone A.
  • the size of the thumbnail of the second type of the original media file is about 200K, for example, it can be 150K, 180K, 200K, 230K and so on.
  • the distributed database of mobile phone A sends the second-type thumbnail of the original media file to the distributed database of mobile phone B.
  • the distributed database of the mobile phone B instructs the distributed storage module of the mobile phone B to cache the second type of thumbnails of the original media file.
  • the distributed storage module of the mobile phone B instructs to cache the thumbnails of the second type of the original media files.
  • the unified operation framework of the mobile phone B notifies that the application media file of the mobile phone B is changed.
  • a photo 502 can be obtained.
  • the first type of thumbnail (ie, picture 503 ) of the photo (original image) newly taken by mobile phone B can be updated in real time to mobile phone A’s on the interface.
  • the second-type thumbnail of the picture 503 can also be cached in the mobile phone A, so that when the user clicks on the picture 503, a larger and clearer picture can be viewed.
  • the mobile phone A in response to the user clicking the share operation option 452, can share the media files on the mobile phone B to a third-party application or a system application.
  • the mobile phone A may share the second type of thumbnails of the media files by default, or the user may choose to share the original media files.
  • the local device can update the device status table and set the data version number of the peer device as the current local device data version number; when the real-time synchronization fails, the data version number of the local device is incremented by one (+1) .
  • transparent caching technology can be used.
  • the transparent cache technology can actively cache the file when the file is read for the first time. If the user needs the file next time, the system can retrieve it from the local cache.
  • Transparent caching technology can include processes such as automatic caching, automatic write-back, automatic aging and automatic update.
  • the automatic caching means that the media library can automatically cache the media files of the remote device to the local.
  • the media library can shield the location difference of media files, and users access the files of the remote device in the same way as the local files, for example, they can be accessed based on a uniform resource identifier (URI) or storage path.
  • URI uniform resource identifier
  • Auto-write-back means that when a user actively saves a media file or an application automatically saves a media file, the media library automatically synchronizes the saved media file to the remote end and replaces the remote historical file.
  • Automatic aging means that the media library automatically clears the cold data outside the aging period (for example, two weeks, one month, etc.) without additional processing by the developer.
  • Automatic update means that after the media file of the remote device is modified, the media library automatically updates the local cache according to the new file (modified file) of the remote end.
  • the automatic caching process may include steps 1201-1203, wherein:
  • the distributed database of mobile phone A requests the second type of thumbnail images of the original media file from the distributed database of mobile phone B.
  • Phone A can automatically cache some media files. For example, as shown in FIG. 6A , the mobile phone can automatically cache the media files corresponding to the thumbnails (the first type of thumbnails) that fill the screen under the recent tab 431 (the media files here refer to the second type of thumbnails of the original media files). Sketch map). As shown in FIG. 6B , the mobile phone can automatically cache the media files covering the screen under the picture tag 432 . As shown in FIG. 6C , the mobile phone can automatically cache the media files that cover the screen under the video tag 433 . As shown in FIG. 6D , the mobile phone can automatically cache the media files that cover the screen under the picture tag 434.
  • mobile phone A can analyze the user's preferences and behavioral habits based on the AI algorithm, predict the user's operation, and cache the cross-device media files that the user may open locally in advance.
  • the distributed database of the mobile phone B sends the media file to the distributed database of the mobile phone A.
  • the distributed database of the mobile phone A caches the media files in the distributed storage module of the mobile phone A.
  • the automatic write-back process may include steps 1204-1208, wherein:
  • the distributed database of the mobile phone A sends the content editing information of the cached file (ie, the cached media file) to the distributed storage module of the mobile phone A.
  • the distributed database of mobile phone A sends the write-back status of the content of the cache file to the distributed database of mobile phone B.
  • the distributed database of the mobile phone B notifies the distributed storage module of the mobile phone B of the content of the updated media file.
  • the distributed storage module of the mobile phone B updates the content of the media file.
  • the distributed database of the mobile phone B updates the media metadata.
  • the automatic aging process may include step 1209, wherein:
  • the distributed database of the mobile phone A notifies the distributed storage module of the mobile phone A to age the cache files based on the aging policy.
  • the aging strategy may be, for example, purging cold data (unused data) every two weeks or every month.
  • the cold data includes thumbnails of media files whose access times are below a preset threshold.
  • the automatic update process may include steps 1210-1215, wherein:
  • the distributed database of the mobile phone B sends the local (mobile phone B local) media file update status to the distributed storage module of the mobile phone B.
  • the distributed storage module of the mobile phone B updates the media files according to the update situation of the local (mobile phone B local) media files.
  • the distributed database of the mobile phone B updates the media metadata.
  • the distributed database of the mobile phone B can update the corresponding media metadata according to the update situation of the local media files.
  • the distributed database of the mobile phone B synchronizes the media metadata with the distributed database of the mobile phone A.
  • the distributed database of mobile phone A requests the updated media file from the distributed database of mobile phone B.
  • the updated media file refers to the second type of thumbnails of the updated original media file.
  • the distributed database of the mobile phone B sends the updated media file to the distributed database of the mobile phone A.
  • the distributed database of the mobile phone A notifies the distributed storage module of the mobile phone A to update the cache file.
  • the distributed storage module of the mobile phone A can update the previous (last cached) cache file according to the updated media file.
  • Lightweight streaming includes a first-play phase and a buffered-play phase.
  • the first play stage may include steps 1301-1307, wherein:
  • the application program of the mobile phone A requests the unified operation framework of the mobile phone A to play the remote media file.
  • the application program of the mobile phone A can request the unified operation framework of the mobile phone A to play the remote media file.
  • the mobile phone in response to the user's operation of clicking all videos 490 on the interface 430 , as shown in (b) of FIG. 14 , the mobile phone can display all the video interfaces 491 , in response to the user clicking on the interface 491
  • the mobile phone can display an interface 493, and the interface 493 can include a play button 494.
  • the mobile phone A's The application can request the unified operation framework of the mobile phone A to play the remote media file (ie the video 492 ).
  • the unified operation framework of the mobile phone A obtains the media file resources from the distributed storage module of the mobile phone A.
  • the distributed storage module of the mobile phone A requests the unified operation framework of the mobile phone A to start the streaming agent.
  • the streaming proxy is the streaming server proxy, which can encapsulate the media file information pulled across the devices into a streaming media format and send it to the application.
  • the application is unaware of the transfer of media information across devices.
  • the distributed storage module of mobile phone A obtains and caches the media file from the distributed storage module of mobile phone B.
  • the distributed storage module of mobile phone A may obtain media files (eg, video files) from the distributed storage module of mobile phone B in m times and cache them. Among them, m is an integer greater than or equal to 2.
  • the unified operation framework of the mobile phone A returns the URL of the cached media file to the application program of the mobile phone A.
  • the unified operation framework of the mobile phone A reads the buffered data from the distributed storage module of the mobile phone A.
  • the unified operation framework of the mobile phone A can read the buffered data (buffered media data) from the distributed storage module of the mobile phone A in m times.
  • the application program of the mobile phone A plays the remote media file in a streaming media manner.
  • the application program of the mobile phone A obtains the buffered data in m times from the unified operation framework of the mobile phone A, and can play the buffered media file in m times.
  • the buffer playback stage may include steps 1308-1310, wherein:
  • the application program of the mobile phone A may request the unified operation framework of the mobile phone A to play the remote media file.
  • the application program of the mobile phone A can request the unified operation framework of the mobile phone A to play the remote media file.
  • the unified operation framework of the mobile phone A obtains the media file resources from the distributed storage module of the mobile phone A.
  • the distributed storage module of the mobile phone A returns the URI of the buffered file to the application program of the mobile phone A, and the application program of the mobile phone A directly plays the remote media file.
  • the playback end does not need to wait for the media file (for example, the original video file) to be completely downloaded before starting playback, and can play in real time, thereby realizing a high-performance user experience similar to local playback.
  • the media file for example, the original video file
  • an embodiment of the present application provides a data synchronization method, including:
  • the first device acquires a media file update event; wherein the media file update event is used to add, modify or delete a first media file.
  • the media file update event may be triggered by a user, or automatically triggered by the first device based on a preset policy. It should be noted that the user can trigger an update event of the local media file on the first device, or can trigger an update event of the local media file of the first device on another device (a device connected to the first device, such as a second device).
  • the first media file includes at least one of pictures, videos, audios, and documents.
  • the first device updates the metadata corresponding to the first media file in the metadata database, and updates the thumbnail image of the first media file in the media library.
  • the metadata database stores metadata corresponding to all media files of the first device, and the media library stores thumbnail images of all media files of the first device.
  • the metadata database reference may be made to the above description about the distributed database, and for the media library, reference may be made to the above description about the distributed storage module, which will not be repeated here.
  • the thumbnails of the first media files include thumbnails of the first type, and the size of the thumbnails of the first type ranges from 10K to 20K.
  • the first device sends a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and a thumbnail image of the first media file.
  • the synchronization message further includes at least one of a user account, device information of the first device, and an update type of the first media file, where the update type of the first media file includes addition, modification, or deletion.
  • the first device receives a first request message, where the first request message is used to request a second type of thumbnail image, and the size of the second type of thumbnail image ranges from 100K to 300K;
  • the second device sends a second type of thumbnail image.
  • the first device may analyze the user's preferences and behavioral habits based on an AI algorithm; predict the media files that the user needs to operate according to the user's preferences and behavioral habits;
  • the thumbnail is sent to the second device.
  • the first device when the first device is connected to the second device for the first time, the first device synchronizes the metadata corresponding to all media files of the first device and the thumbnail images corresponding to all media files to the second device.
  • the first device when the first device is connected to the second device for the Nth time, stores the metadata corresponding to the media file updated on the first device after the last synchronization and the thumbnail image corresponding to the updated media file Sync to the second device.
  • N is an integer greater than or equal to 2.
  • the first device deletes the cold data in the cached media file based on a preset period.
  • the cold data includes thumbnails of media files whose access times are below a preset threshold.
  • the streaming server proxy when the first device plays the media file of the second device for the first time, the streaming server proxy is started, and the streaming server proxy is used to encapsulate the media file of the second device into a streaming media format;
  • the agent obtains the media files of the second device from the second device in m times and caches them; where m is an integer greater than or equal to 2; the first device plays the cached data.
  • the URI of the media file of the second device is obtained, and the cached data is obtained and played according to the URI; wherein, N is an integer greater than or equal to 2 .
  • the first device displays a first interface containing the logo of the second device; in response to the user's operation of clicking the logo of the second device on the first interface, the first device displays a second interface, and the second interface One or more thumbnail images of at least one type of media file of the second device are included.
  • the first interface or the second interface includes a search control, and in response to an operation of inputting a keyword after the user clicks on the search control, the first device displays a third interface, and the third interface includes data from the first device and the third interface.
  • the identifier of the media file related to the keyword searched by the device in response to an operation of inputting a keyword after the user clicks on the search control, the first device displays a third interface, and the third interface includes data from the first device and the third interface. The identifier of the media file related to the keyword searched by the device.
  • the first device in response to the user's operation of clicking the first thumbnail on the second interface, displays a first pop-up box, and the first pop-up box includes the first operation option; in response to the user clicking the first operation option operation, the first device displays a second pop-up frame, and the second pop-up frame includes one or more application programs or device identifiers; in response to the operation of the user clicking on an application program or a device identifier, the first device shares the first thumbnail image to the device corresponding to the application or device ID that the user clicked.
  • the first device in the embodiment shown in FIG. 15 may be the mobile phone A in the foregoing embodiment, and the second device may be the mobile phone B in the foregoing embodiment.
  • the first device may be the mobile phone B in the foregoing embodiment, and the second device may be the mobile phone A in the foregoing embodiment, which is not limited in this application.
  • the foregoing embodiment reference may be made to the foregoing embodiment, and details are not described here.
  • the first device after acquiring the media file update event, can update the metadata corresponding to the first media file in the metadata database, and update the thumbnail of the first media file in the media library;
  • the device may send a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and a thumbnail image of the first media file.
  • the metadata database and the media library can be automatically synchronized between the first device and the second device, data sharing across devices can be easily and conveniently achieved, and frequent manual operations by the user are not required, which can improve user experience.
  • an electronic device such as the electronic device 200 shown in FIG. 2
  • the electronic device may include: a communication module, a memory, and one or more processors.
  • the communication module and memory are coupled to the processor.
  • the memory is used to store computer program code comprising computer instructions.
  • the chip system includes at least one processor 1601 and at least one interface circuit 1602 .
  • the processor 1601 and the interface circuit 1602 may be interconnected by wires.
  • interface circuit 1602 may be used to receive signals from other devices (eg, memory of an electronic device).
  • the interface circuit 1602 may be used to send signals to other devices (eg, the processor 1601).
  • the interface circuit 1602 may read instructions stored in memory in the electronic device and send the instructions to the processor 1601 .
  • the electronic device such as the electronic device 200 shown in FIG. 2 can be made to execute each step in the above embodiments.
  • the interface circuit 1602 may read the instructions stored in the memory in the server and send the instructions to the processor 1601 .
  • the server can be caused to perform the steps in the above-mentioned embodiments.
  • the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A data synchronization method and apparatus, capable of simply and conveniently implementing cross-device data sharing, without requiring frequent manual operations of a user, thereby improving user experience. The method comprises: a first device acquires a media file update event (1501), wherein the media file update event is used for adding, modifying or deleting a first media file; the first device updates metadata, in a metadata library, corresponding to the first media file, and updates a thumbnail of the first media file in a media library (1502); and the first device sends a synchronization message to a second device (1503), wherein the synchronization message comprises the metadata corresponding to the first media file and the thumbnail of the first media file.

Description

一种数据同步方法和装置A data synchronization method and device
本申请要求于2020年12月31日提交国家知识产权局、申请号为202011635721.1、申请名称为“一种数据同步方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011635721.1 and the application title "A method and device for data synchronization", which was submitted to the State Intellectual Property Office on December 31, 2020, the entire contents of which are incorporated herein by reference. middle.
技术领域technical field
本申请涉及通信领域,尤其涉及一种数据同步方法和装置。The present application relates to the field of communications, and in particular, to a data synchronization method and apparatus.
背景技术Background technique
随着智能手机、平板、个人计算机(personal computer,PC)等数字化设备的普及和发展,个人终端数量激增,不同设备的数据分散存储,如何实现安全便捷地跨设备数据分享成为一个亟待解决的问题。With the popularization and development of digital devices such as smart phones, tablets, and personal computers (PCs), the number of personal terminals has surged, and the data of different devices is stored in a decentralized manner. How to achieve safe and convenient data sharing across devices has become an urgent problem to be solved. .
目前,“隔空投送”、“MFiles”等方案可以实现在两台设备之间共享一些数据(例如,图片数据)。例如,设备A和设备B建立连接后,设备A的用户可以将设备A的10张图片发送给设备B,设备B的用户可以选择接收并存储该10张图片,这样,设备A与设备B之间实现了该10张图片的共享。Currently, schemes such as "AirDrop" and "MFiles" can share some data (for example, picture data) between two devices. For example, after the connection between device A and device B is established, the user of device A can send 10 pictures of device A to device B, and the user of device B can choose to receive and store the 10 pictures. The 10 pictures are shared between them.
但是,上述方案在数据传输过程中耗费时间,且需要用户频繁操作(例如,需要勾选待分享的图片以及待分享的设备),无法很好实现跨设备数据分享。However, the above solution is time-consuming in the data transmission process, and requires frequent operations by the user (for example, it is necessary to select the pictures to be shared and the devices to be shared), which cannot well realize cross-device data sharing.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种数据同步方法和装置,能够简单便捷地实现跨设备数据分享,无需用户进行频繁地手动操作,可以提高用户体验。The embodiments of the present application provide a data synchronization method and apparatus, which can realize cross-device data sharing simply and conveniently, without requiring frequent manual operations by users, and can improve user experience.
第一方面,本申请实施例提供一种数据同步方法,方法包括:第一设备获取媒体文件更新事件;其中,媒体文件更新事件用于增加、修改或删除第一媒体文件;第一设备更新元数据库中第一媒体文件对应的元数据,并更新媒体库中第一媒体文件的缩略图;第一设备向第二设备发送同步消息,同步消息包括第一媒体文件对应的元数据和第一媒体文件的缩略图。这样,第一设备和第二设备之间可以自动同步元数据库和媒体库,能够简单便捷地实现跨设备数据分享,无需用户进行频繁地手动操作,可以提高用户体验。In a first aspect, an embodiment of the present application provides a data synchronization method. The method includes: a first device acquires a media file update event; wherein the media file update event is used to add, modify or delete a first media file; the first device updates a metadata metadata corresponding to the first media file in the database, and update the thumbnail of the first media file in the media library; the first device sends a synchronization message to the second device, and the synchronization message includes the metadata corresponding to the first media file and the first media Thumbnail of the file. In this way, the metadata database and the media library can be automatically synchronized between the first device and the second device, data sharing across devices can be easily and conveniently achieved, and frequent manual operations by the user are not required, which can improve user experience.
在一种可能的实现方式中,同步消息还包括用户账号、第一设备的设备信息以及第一媒体文件的更新类型中的至少一种,第一媒体文件的更新类型包括增加、修改或删除。基于用户账号、第一设备的设备信息以及第一媒体文件的更新类型中的至少一种,第一设备和第二设备之间可以自动同步元数据库和媒体库,能够简单便捷地实现跨设备数据分享,无需用户进行频繁地手动操作,可以提高用户体验。In a possible implementation manner, the synchronization message further includes at least one of a user account, device information of the first device, and an update type of the first media file, where the update type of the first media file includes addition, modification, or deletion. Based on at least one of the user account, the device information of the first device, and the update type of the first media file, the metadata database and the media library can be automatically synchronized between the first device and the second device, which can easily and conveniently implement cross-device data Sharing, without the need for frequent manual operations by the user, can improve the user experience.
在一种可能的实现方式中,第一媒体文件的缩略图包括第一类型的缩略图,第一类型的缩略图的大小范围为10千字节(kb/K)~20K。例如,第一类型的缩略图的大小可以为10K、15K或20K。In a possible implementation manner, the thumbnail image of the first media file includes a thumbnail image of a first type, and the size of the thumbnail image of the first type ranges from 10 kilobytes (kb/K) to 20K. For example, the size of the first type of thumbnails may be 10K, 15K or 20K.
在一种可能的实现方式中,方法还包括:第一设备接收第一请求消息,第一请求消息用于请求第二类型的缩略图,第二类型的缩略图的大小范围为100K~300K;第一 设备向第二设备发送第二类型的缩略图。示例性的,第二类型的缩略图的大小可以为150K、180K、200K、230K等。In a possible implementation manner, the method further includes: the first device receives a first request message, where the first request message is used to request a thumbnail image of a second type, and the size of the thumbnail image of the second type ranges from 100K to 300K; The first device sends a second type of thumbnail image to the second device. Exemplarily, the size of the second type of thumbnails may be 150K, 180K, 200K, 230K, and so on.
在一种可能的实现方式中,第一媒体文件包括图片、视频、音频、文档中的至少一种。In a possible implementation manner, the first media file includes at least one of pictures, videos, audios, and documents.
在一种可能的实现方式中,方法还包括:第一设备显示包含第二设备的标识的第一界面;响应于用户在第一界面点击第二设备的标识的操作,第一设备显示第二界面,第二界面包括第二设备的至少一种类型的媒体文件的一个或多个缩略图。示例性的,如图5A所示,第一设备(例如,手机A)可以显示包含第二设备的标识(例如,Mate 30 pro)的第一界面(例如,界面420),响应于用户在第一界面点击第二设备的标识的操作,如图6A所示,第一设备显示第二界面,第二界面包括第二设备的至少一种类型的媒体文件(例如,图片、视频、音频、文档)的一个或多个缩略图。其中,图片例如可以是A-002.jpg,文档例如可以包括封面设计.pptx等。In a possible implementation manner, the method further includes: the first device displays a first interface including the identifier of the second device; in response to the user's operation of clicking the identifier of the second device on the first interface, the first device displays the second interface The second interface includes one or more thumbnail images of at least one type of media file of the second device. Exemplarily, as shown in FIG. 5A , the first device (eg, mobile phone A) may display a first interface (eg, interface 420 ) containing the identification of the second device (eg, Mate 30 pro), in response to the user clicking on the first interface (eg, interface 420 ). An operation of clicking the logo of the second device on an interface, as shown in FIG. 6A , the first device displays a second interface, and the second interface includes at least one type of media files (for example, pictures, videos, audios, documents, etc.) of the second device ) of one or more thumbnails. The picture may be, for example, A-002.jpg, and the document may include, for example, cover design.pptx, and the like.
在一种可能的实现方式中,第一界面或第二界面包括搜索控件,响应于用户点击搜索控件后输入关键词的操作,第一设备显示第三界面,第三界面包括从第一设备和第二设备搜索到的与关键词相关的媒体文件的标识。示例性的,如图7B中的(a)所示,响应于用户点击搜索控件440后输入关键词(例如,托福)的操作,如图7B中的(b)所示,第一设备显示第三界面(例如,界面441),第三界面包括从第一设备和第二设备搜索到的与关键词相关的媒体文件的标识。例如,可以包括托福阶梯技巧.doc、托福听力解析.mp3等。In a possible implementation manner, the first interface or the second interface includes a search control, and in response to an operation of inputting a keyword after the user clicks the search control, the first device displays a third interface, and the third interface includes data from the first device and the The identifier of the media file related to the keyword searched by the second device. Exemplarily, as shown in (a) of FIG. 7B , in response to an operation of inputting a keyword (for example, TOEFL) after the user clicks the search control 440, as shown in (b) of FIG. 7B , the first device displays the No. Three interfaces (eg, interface 441 ), the third interface includes the identifiers of the media files related to the keyword searched from the first device and the second device. For example, it can include TOEFL Ladder Skills.doc, TOEFL Listening Analysis.mp3, etc.
在一种可能的实现方式中,方法还包括:响应于用户在第二界面点击第一缩略图的操作,第一设备显示第一弹框,第一弹框包括第一操作选项;响应于用户点击第一操作选项的操作,第一设备显示第二弹框,第二弹框包括一个或多个应用程序或设备标识;响应于用户点击一个应用程序或一个设备标识的操作,第一设备将第一缩略图分享至用户点击的应用程序或设备标识对应的设备。示例性的,如图8A中的(a)所示,响应于用户在第二界面(例如,界面430)点击第一缩略图(例如,图片450)的操作,第一设备显示第一弹框(例如,弹框451),第一弹框包括第一操作选项(例如,分享选项452);响应于用户点击第一操作选项的操作,如图8A中的(b)所示,第一设备可以显示第二弹框(例如弹框453),第二弹框包括一个或多个应用程序或设备标识(例如,
Figure PCTCN2021136803-appb-000001
附近设备等);响应于用户点击一个应用程序或一个设备标识的操作,第一设备将第一缩略图分享至用户点击的应用程序或设备标识对应的设备。
In a possible implementation manner, the method further includes: in response to the user's operation of clicking the first thumbnail on the second interface, the first device displays a first pop-up frame, and the first pop-up frame includes the first operation option; Clicking the operation of the first operation option, the first device displays a second pop-up box, and the second pop-up box includes one or more application programs or device identifiers; in response to the operation of the user clicking an application program or a device identifier, the first device will The first thumbnail is shared to the application program clicked by the user or the device corresponding to the device identifier. Exemplarily, as shown in (a) of FIG. 8A , in response to the user's operation of clicking the first thumbnail (eg, picture 450 ) on the second interface (eg, interface 430 ), the first device displays a first pop-up frame (for example, pop-up box 451), the first pop-up box includes a first operation option (for example, share option 452); in response to the operation of the user clicking the first operation option, as shown in (b) in FIG. 8A, the first device A second pop-up frame (eg, pop-up frame 453) may be displayed, and the second pop-up frame includes one or more application or device identifiers (eg,
Figure PCTCN2021136803-appb-000001
Nearby devices, etc.); in response to the operation of the user clicking on an application or a device identifier, the first device shares the first thumbnail to the device corresponding to the application or device identifier clicked by the user.
在一种可能的实现方式中,第一设备与第二设备首次连接时,方法还包括:第一设备将第一设备的全部媒体文件对应的元数据和全部媒体文件对应的缩略图同步给第二设备。即第一设备与第二设备首次连接时,第一设备和第二设备之间可以自动同步第一设备的全部媒体文件对应的元数据和全部媒体文件对应的缩略图,能够简单便捷地实现跨设备数据分享,无需用户进行频繁地手动操作,可以提高用户体验。In a possible implementation manner, when the first device is connected to the second device for the first time, the method further includes: the first device synchronizes the metadata corresponding to all media files of the first device and the thumbnail images corresponding to all media files to the first device. Second equipment. That is, when the first device and the second device are connected for the first time, the metadata corresponding to all the media files of the first device and the thumbnail images corresponding to all the media files of the first device can be automatically synchronized between the first device and the second device. Device data sharing does not require users to perform frequent manual operations, which can improve user experience.
在一种可能的实现方式中,第一设备与第二设备第N次连接时,N为大于或等于2的整数,方法还包括:第一设备将上一次同步后第一设备上更新的媒体文件对应的元数据和更新的媒体文件对应的缩略图同步给第二设备。第一设备与第二设备第N次 连接时,第一设备和第二设备之间可以自动同步第一设备更新的媒体文件对应的元数据和缩略图,无需重新同步全部的媒体文件,可以节省资源,提高效率。In a possible implementation manner, when the first device is connected to the second device for the Nth time, N is an integer greater than or equal to 2, and the method further includes: the first device synchronizes the media updated on the first device after the last synchronization The metadata corresponding to the file and the thumbnail corresponding to the updated media file are synchronized to the second device. When the first device and the second device are connected for the Nth time, the metadata and thumbnails corresponding to the media files updated by the first device can be automatically synchronized between the first device and the second device, and there is no need to resynchronize all the media files, which can save resources and improve efficiency.
在一种可能的实现方式中,方法还包括:第一设备基于人工智能(artificial intelligence,AI)算法分析用户的喜好、行为习惯;根据用户的喜好、行为习惯预判用户需要操作的媒体文件;将用户需要操作的媒体文件的第二类型的缩略图发送给第二设备。这样,第二设备可以提前将用户可能打开的媒体文件缓存到本地,用户后续可以迅速查看第二类型的缩略图,可以提高用户体验。In a possible implementation manner, the method further includes: the first device analyzes the user's preferences and behavioral habits based on an artificial intelligence (artificial intelligence, AI) algorithm; and predicts the media files that the user needs to operate according to the user's preferences and behavioral habits; The second type of thumbnails of the media files that the user needs to operate are sent to the second device. In this way, the second device can cache the media files that the user may open locally in advance, and the user can quickly view the second type of thumbnail images later, which can improve user experience.
在一种可能的实现方式中,第一设备基于预设周期删除冷数据;其中,冷数据包括访问次数低于预设阈值的媒体文件的缩略图。这样,可以节省第一设备的内存空间。In a possible implementation manner, the first device deletes cold data based on a preset period; wherein the cold data includes thumbnails of media files whose access times are lower than a preset threshold. In this way, the memory space of the first device can be saved.
在一种可能的实现方式中,方法还包括:第一设备首次播放第二设备的媒体文件时,启动流服务器代理,流服务器代理用于将第二设备的媒体文件封装成流媒体格式;第一设备通过流服务器代理分m次从第二设备获取第二设备的媒体文件并缓存;其中,m为大于等于2的整数;第一设备播放缓存数据。这样,第一设备首次播放第二设备的媒体文件时,播放端无需等待媒体文件(例如,原始视频文件)完整下载后再启动播放,可以实时播放,从而可以实现类本地播放的高性能用户体验。In a possible implementation manner, the method further includes: when the first device plays the media file of the second device for the first time, starting a streaming server proxy, and the streaming server proxy is used to encapsulate the media file of the second device into a streaming media format; A device obtains the media files of the second device from the second device in m times through the streaming server proxy and caches them; where m is an integer greater than or equal to 2; the first device plays the cached data. In this way, when the first device plays the media file of the second device for the first time, the player does not need to wait for the media file (for example, the original video file) to be completely downloaded before starting the playback, and can play it in real time, thereby realizing a high-performance user experience similar to local playback. .
在一种可能的实现方式中,第一设备第N次播放第二设备的媒体文件时,获取第二设备的媒体文件的统一资源标识符(uniform resource identifier,URI),根据URI获取缓存数据并播放;其中,N为大于等于2的整数。这样,第一设备第N次播放第二设备的媒体文件时,可以根据URI获取缓存数据并直接播放媒体文件,无需重新缓存数据,可以降低第一设备的功耗。In a possible implementation manner, when the first device plays the media file of the second device for the Nth time, it obtains a uniform resource identifier (URI) of the media file of the second device, obtains the cached data according to the URI, and Play; wherein, N is an integer greater than or equal to 2. In this way, when the first device plays the media file of the second device for the Nth time, it can obtain the cached data according to the URI and directly play the media file without re-cache the data, which can reduce the power consumption of the first device.
第二方面,本申请实施例提供一种全量同步方法,包括:第一设备与第二设备首次连接时,方法还包括:第一设备将第一设备的全部媒体文件对应的元数据和全部媒体文件对应的缩略图同步给第二设备。即第一设备与第二设备首次连接时,第一设备和第二设备之间可以自动同步第一设备的全部媒体文件对应的元数据和全部媒体文件对应的缩略图,能够简单便捷地实现跨设备数据分享,无需用户进行频繁地手动操作,可以提高用户体验。In a second aspect, an embodiment of the present application provides a full synchronization method, including: when a first device is connected to a second device for the first time, the method further includes: the first device synchronizes metadata and all media files corresponding to all media files of the first device The thumbnails corresponding to the files are synchronized to the second device. That is, when the first device and the second device are connected for the first time, the metadata corresponding to all the media files of the first device and the thumbnail images corresponding to all the media files of the first device can be automatically synchronized between the first device and the second device. Device data sharing does not require users to perform frequent manual operations, which can improve user experience.
第三方面,本申请实施例提供一种增量同步方法,包括:第一设备与第二设备第N次连接时,N为大于或等于2的整数,方法还包括:第一设备将上一次同步后第一设备上更新的媒体文件对应的元数据和更新的媒体文件对应的缩略图同步给第二设备。即第一设备与第二设备第N次连接时,第一设备和第二设备之间可以自动同步第一设备更新的媒体文件对应的元数据和缩略图,无需重新同步全部的媒体文件,可以节省资源,提高效率。In a third aspect, an embodiment of the present application provides an incremental synchronization method, including: when the first device and the second device are connected for the Nth time, N is an integer greater than or equal to 2, and the method further includes: the first device synchronizes the last After synchronization, the metadata corresponding to the updated media file on the first device and the thumbnail corresponding to the updated media file are synchronized to the second device. That is, when the first device and the second device are connected for the Nth time, the metadata and thumbnail images corresponding to the media files updated by the first device can be automatically synchronized between the first device and the second device. Save resources and improve efficiency.
第四方面,本申请实施例提供一种自动缓存方法,包括:第一设备基于人工智能AI算法分析用户的喜好、行为习惯;根据用户的喜好、行为习惯预判用户需要操作的媒体文件;将用户需要操作的媒体文件的第二类型的缩略图发送给第二设备。这样,第二设备可以提前将用户可能打开的媒体文件缓存到本地,用户后续可以迅速查看第二类型的缩略图,可以提高用户体验。In a fourth aspect, the embodiments of the present application provide an automatic caching method, including: the first device analyzes the user's preferences and behavioral habits based on an artificial intelligence AI algorithm; predicts the media files that the user needs to operate according to the user's preferences and behavioral habits; A second type of thumbnail image of the media file that the user needs to operate is sent to the second device. In this way, the second device can cache the media files that the user may open locally in advance, and the user can quickly view the second type of thumbnail images later, which can improve user experience.
第五方面,本申请实施例提供一种自动老化方法,包括:第一设备基于预设周期删除冷数据;其中,冷数据包括访问次数低于预设阈值的媒体文件的缩略图。这样, 可以节省第一设备的内存空间。In a fifth aspect, an embodiment of the present application provides an automatic aging method, including: a first device deletes cold data based on a preset period; wherein the cold data includes thumbnails of media files whose access times are lower than a preset threshold. In this way, the memory space of the first device can be saved.
第六方面,本申请实施例提供一种流媒体播放方法,包括:第一设备首次播放第二设备的媒体文件时,启动流服务器代理,流服务器代理用于将第二设备的媒体文件封装成流媒体格式;第一设备通过流服务器代理分m次从第二设备获取第二设备的媒体文件并缓存;其中,m为大于等于2的整数;第一设备播放缓存数据。这样,第一设备首次播放第二设备的媒体文件时,播放端无需等待媒体文件(例如,原始视频文件)完整下载后再启动播放,可以实时播放,从而可以实现类本地播放的高性能用户体验。In a sixth aspect, an embodiment of the present application provides a streaming media playback method, including: when a first device plays a media file of a second device for the first time, starting a streaming server proxy, and the streaming server proxy is used to encapsulate the media file of the second device into a Streaming media format; the first device obtains the media files of the second device from the second device in m times through the streaming server proxy and caches them; where m is an integer greater than or equal to 2; the first device plays the cached data. In this way, when the first device plays the media file of the second device for the first time, the player does not need to wait for the media file (for example, the original video file) to be completely downloaded before starting the playback, and can play it in real time, thereby realizing a high-performance user experience similar to local playback. .
在一种可能的实现方式中,第一设备第N次播放第二设备的媒体文件时,获取第二设备的媒体文件的URI,根据URI获取缓存数据并播放;其中,N为大于等于2的整数。这样,第一设备第N次播放第二设备的媒体文件时,可以根据URI获取缓存数据并直接播放媒体文件,无需重新缓存数据,可以降低第一设备的功耗。In a possible implementation manner, when the first device plays the media file of the second device for the Nth time, the URI of the media file of the second device is obtained, and the cached data is obtained and played according to the URI; wherein, N is greater than or equal to 2 Integer. In this way, when the first device plays the media file of the second device for the Nth time, it can obtain the cached data according to the URI and directly play the media file without re-cache the data, which can reduce the power consumption of the first device.
第七方面,本申请实施例提供一种电子设备(例如,第一设备或第二设备),该电子设备具有实现上述任一方面及其任一种可能的实现方式所述的方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a seventh aspect, an embodiment of the present application provides an electronic device (eg, a first device or a second device), the electronic device having the function of implementing the method described in any of the foregoing aspects and any possible implementation manners thereof. The functions can be implemented by hardware, or can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
第八方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令。当计算机指令在电子设备上运行时,使得该电子设备执行上述任一方面及其任一种可能的实现方式所述的方法。In an eighth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device is caused to perform the method described in any of the above aspects and any possible implementations thereof.
第九方面,本申请提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面及其任一种可能的实现方式所述的方法。In a ninth aspect, the present application provides a computer program product that, when the computer program product runs on a computer, causes the computer to execute the method described in the first aspect and any possible implementation manners thereof.
第十方面,本申请实施例提供一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。该芯片系统可以应用于包括通信模块和存储器的电子设备。该接口电路用于从电子设备的存储器接收信号,并向处理器发送接收到的信号,该信号包括存储器中存储的计算机指令。当处理器执行该计算机指令时,电子设备可以执行上述任一方面及其任一种可能的实现方式所述的方法。In a tenth aspect, an embodiment of the present application provides a chip system, where the chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by wires. The chip system can be applied to electronic equipment including a communication module and a memory. The interface circuit is configured to receive signals from the memory of the electronic device and send the received signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device can execute the method described in any of the above aspects and any of its possible implementations.
第十一方面,本申请实施例提供一种数据同步系统,包括两个电子设备(例如第一设备和第二设备),每个电子设备可以执行上述任一方面及其任一种可能的实现方式的方法。In an eleventh aspect, an embodiment of the present application provides a data synchronization system, including two electronic devices (for example, a first device and a second device), and each electronic device can perform any of the above aspects and any possible implementation thereof way method.
示例性的,第一设备可以获取媒体文件更新事件;其中,媒体文件更新事件用于增加、修改或删除第一媒体文件;第一设备更新元数据库中第一媒体文件对应的元数据,并更新媒体库中第一媒体文件的缩略图;第一设备向第二设备发送同步消息,同步消息包括第一媒体文件对应的元数据和第一媒体文件的缩略图。第二设备可以接收来自第一设备的同步消息。Exemplarily, the first device may acquire a media file update event; wherein, the media file update event is used to add, modify or delete the first media file; the first device updates the metadata corresponding to the first media file in the metadata database, and updates The thumbnail of the first media file in the media library; the first device sends a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and the thumbnail of the first media file. The second device may receive the synchronization message from the first device.
附图说明Description of drawings
图1A为本申请实施例提供的一种网络架构示意图;FIG. 1A is a schematic diagram of a network architecture provided by an embodiment of the present application;
图1B为本申请实施例提供的一种网络架构示意图;FIG. 1B is a schematic diagram of a network architecture provided by an embodiment of the present application;
图2为本申请实施例提供的一种电子设备200的硬件结构示意图;FIG. 2 is a schematic diagram of a hardware structure of an electronic device 200 according to an embodiment of the present application;
图3为本申请实施例提供的一种显示示意图;FIG. 3 is a schematic display diagram provided by an embodiment of the present application;
图4A为本申请实施例提供的又一种显示示意图;FIG. 4A is another schematic display diagram provided by an embodiment of the present application;
图4B为本申请实施例提供的又一种显示示意图;FIG. 4B is another schematic display diagram provided by an embodiment of the present application;
图4C为本申请实施例提供的又一种显示示意图;FIG. 4C is another schematic display diagram provided by an embodiment of the present application;
图5A为本申请实施例提供的又一种显示示意图;FIG. 5A is another schematic display diagram provided by an embodiment of the present application;
图5B为本申请实施例提供的又一种显示示意图;FIG. 5B is another schematic display diagram provided by an embodiment of the present application;
图6A为本申请实施例提供的又一种显示示意图;FIG. 6A is another schematic display diagram provided by an embodiment of the present application;
图6B为本申请实施例提供的又一种显示示意图;FIG. 6B is another schematic display diagram provided by an embodiment of the present application;
图6C为本申请实施例提供的又一种显示示意图;FIG. 6C is another schematic display diagram provided by an embodiment of the present application;
图6D为本申请实施例提供的又一种显示示意图;FIG. 6D is another schematic display diagram provided by an embodiment of the present application;
图7A为本申请实施例提供的又一种显示示意图;FIG. 7A is another schematic display diagram provided by an embodiment of the present application;
图7B为本申请实施例提供的又一种显示示意图;FIG. 7B is another schematic display diagram provided by an embodiment of the present application;
图8A为本申请实施例提供的又一种显示示意图;FIG. 8A is another schematic display diagram provided by an embodiment of the present application;
图8B为本申请实施例提供的又一种显示示意图;FIG. 8B is another schematic display diagram provided by an embodiment of the present application;
图9A为本申请实施例提供的又一种显示示意图;FIG. 9A is another schematic display diagram provided by an embodiment of the present application;
图9B为本申请实施例提供的又一种显示示意图;FIG. 9B is another schematic display diagram provided by an embodiment of the present application;
图10A为本申请实施例提供的一种手机的软件架构示意图;10A is a schematic diagram of a software architecture of a mobile phone according to an embodiment of the present application;
图10B为本申请实施例提供的一种手机A、手机B和云服务器之间的系统架构示意图;10B is a schematic diagram of a system architecture between a mobile phone A, a mobile phone B, and a cloud server according to an embodiment of the application;
图11A为本申请实施例提供的一种手机A和手机B之间的信号交互示意图;11A is a schematic diagram of signal interaction between a mobile phone A and a mobile phone B according to an embodiment of the application;
图11B为本申请实施例提供的又一种手机A和手机B之间的信号交互示意图;11B is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the application;
图11C为本申请实施例提供的又一种手机A和手机B之间的信号交互示意图;11C is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application;
图11D为本申请实施例提供的又一种手机A和手机B之间的信号交互示意图;11D is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application;
图11E为本申请实施例提供的又一种显示示意图;FIG. 11E is another schematic display diagram provided by an embodiment of the present application;
图12为本申请实施例提供的又一种手机A和手机B之间的信号交互示意图;12 is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application;
图13为本申请实施例提供的又一种手机A和手机B之间的信号交互示意图;13 is another schematic diagram of signal interaction between mobile phone A and mobile phone B according to an embodiment of the present application;
图14为本申请实施例提供的又一种显示示意图;FIG. 14 is another schematic diagram of a display provided by an embodiment of the present application;
图15为本申请实施例提供的又一种信号交互示意图;FIG. 15 is another schematic diagram of signal interaction provided by an embodiment of the present application;
图16为本申请实施例提供的一种芯片结构示意图。FIG. 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“至少一个”是指一个或多个,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, in the description of the present application, unless otherwise specified, "at least one" refers to one or more, and "a plurality" refers to two or more than two. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like are not necessarily different.
随着智能手机、平板、个人计算机(personal computer,PC)和智能家电等数字化设备的普及和发展,个人终端数量及媒体数据量激增。并且,手机的拍照技术的发展使得个人影像内容海量出现,导致单个设备的存储空间紧张。上述情况下,用户对 智能查找及共享的需求与日俱增,推动了分布式媒体数据管理发展。With the popularization and development of digital devices such as smart phones, tablets, personal computers (PCs), and smart home appliances, the number of personal terminals and the amount of media data surge. In addition, the development of the camera technology of mobile phones has resulted in the mass appearance of personal image content, resulting in a shortage of the storage space of a single device. Under the above circumstances, users' demand for intelligent search and sharing is increasing day by day, which promotes the development of distributed media data management.
本申请实施例提供一种分布式媒体数据管理方法和框架,可以实现用户跨设备访问、检索、分享本地化,操作便捷。The embodiments of the present application provide a distributed media data management method and framework, which can realize the localization of user access, retrieval, and sharing across devices, and is convenient to operate.
本申请实施例涉及的系统架构可以包括多个电子设备,多个电子设备之间可以进行组网,组网后多个电子设备之间可以进行信息交互。组网方式包含不限于以下方式:The system architecture involved in the embodiments of the present application may include multiple electronic devices, the multiple electronic devices may be networked, and information exchange may be performed between the multiple electronic devices after the networking. The networking methods include but are not limited to the following methods:
(1)、无线保真(wireless fidelity,WIFI)组网方式:多个电子设备可以接入同一个路由设备(例如,路由器)。如图1A所示,手机101、手机102、平板电脑103、笔记本电脑104、智慧电视105可以接入路由器106,组成一个家庭网络。或者,多个电子设备可以加入同一个热点设备(例如,接入同一个手机的热点),此时电子设备和电子设备之间的信息交互,可以通过热点设备转发。例如,手机102、平板电脑103、笔记本电脑104、智慧电视105可以接入手机101,组成一个热点网络,手机101可以作为热点设备为各个电子设备转发信息。(1) Wireless fidelity (wireless fidelity, WIFI) networking mode: multiple electronic devices can be connected to the same routing device (for example, a router). As shown in FIG. 1A , a mobile phone 101 , a mobile phone 102 , a tablet computer 103 , a notebook computer 104 , and a smart TV 105 can be connected to a router 106 to form a home network. Alternatively, multiple electronic devices can join the same hotspot device (for example, access the hotspot of the same mobile phone), and at this time, the information interaction between the electronic device and the electronic device can be forwarded through the hotspot device. For example, mobile phone 102, tablet computer 103, notebook computer 104, and smart TV 105 can be connected to mobile phone 101 to form a hotspot network, and mobile phone 101 can be used as a hotspot device to forward information for each electronic device.
(2)、云端服务器组网方式:多个电子设备可以连接到同一个云端服务器,此时电子设备和电子设备之间的信息交互,可以通过云端服务器转发。如图1B所示,手机102、平板电脑103、笔记本电脑104、智慧电视105可以接入路由器106,组成一个家庭网络,路由器106可以连接到服务器201,手机101也可以连接到服务器201,服务器201可以作为中转设备为路由器106和手机101转发信息,即路由器106可以通过服务器201与手机101进行信息交互。手机101可以通过服务器201和路由器106与手机102、平板电脑103、笔记本电脑104、智慧电视105等电子设备进行信息交互。(2) Cloud server networking mode: Multiple electronic devices can be connected to the same cloud server. At this time, the information interaction between the electronic device and the electronic device can be forwarded through the cloud server. As shown in FIG. 1B , the mobile phone 102 , the tablet computer 103 , the notebook computer 104 and the smart TV 105 can be connected to the router 106 to form a home network. The router 106 can be connected to the server 201 , and the mobile phone 101 can also be connected to the server 201 , and the server 201 It can be used as a relay device to forward information for the router 106 and the mobile phone 101 , that is, the router 106 can exchange information with the mobile phone 101 through the server 201 . The mobile phone 101 can exchange information with electronic devices such as the mobile phone 102 , the tablet computer 103 , the notebook computer 104 , and the smart TV 105 through the server 201 and the router 106 .
在一种可能的设计中,手机101、手机102、平板电脑103、笔记本电脑104、智慧电视105和路由器106都可以连接到服务器,服务器可以作为中转设备为手机101、手机102、平板电脑103、笔记本电脑104、智慧电视105和路由器106之间转发信息。即手机101、手机102、平板电脑103、笔记本电脑104、智慧电视105和路由器106之间可以通过服务器进行信息交互。In a possible design, the mobile phone 101, the mobile phone 102, the tablet computer 103, the laptop computer 104, the smart TV 105 and the router 106 can all be connected to the server, and the server can be used as a relay device for the mobile phone 101, the mobile phone 102, the tablet computer 103, Information is forwarded between the notebook computer 104 , the smart TV 105 and the router 106 . That is, the mobile phone 101 , the mobile phone 102 , the tablet computer 103 , the notebook computer 104 , the smart TV 105 and the router 106 can exchange information through the server.
或者,多个电子设备之间还可以进行蓝牙组网。例如,多个电子设备(例如,手机102、平板电脑103、笔记本电脑104、智慧电视105和路由器106)可以连接到同一个蓝牙设备(例如,手机101),此时电子设备和电子设备之间的信息交互,可以通过蓝牙设备转发。Alternatively, Bluetooth networking may also be performed between multiple electronic devices. For example, multiple electronic devices (eg, mobile phone 102, tablet computer 103, laptop computer 104, smart TV 105, and router 106) may be connected to the same Bluetooth device (eg, mobile phone 101), and the electronic device and the electronic device The information exchange can be forwarded through the Bluetooth device.
多个电子设备可以采用多种组网方式,例如,同时采用无线保真组网方式、蓝牙组网方式或云端服务器组网方式中的至少两种,本申请不做限定。Multiple electronic devices may use multiple networking methods, for example, at least two of the wireless fidelity networking method, the Bluetooth networking method, or the cloud server networking method, which are not limited in this application.
本申请实施例中以图1A或图1B所示的各个电子设备(如手机101或手机102)是电子设备200为例,对本申请实施例提供的电子设备的结构进行举例说明。如图2所示,电子设备200可以包括:处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。In the embodiments of the present application, each electronic device shown in FIG. 1A or FIG. 1B (eg, the mobile phone 101 or the mobile phone 102 ) is the electronic device 200 as an example to illustrate the structure of the electronic device provided by the embodiments of the present application. As shown in FIG. 2, the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, Antenna 1, Antenna 2, Mobile Communication Module 250, Wireless Communication Module 260, Audio Module 270, Speaker 270A, Receiver 270B, Microphone 270C, Headphone Interface 270D, Sensor Module 280, Key 290, Motor 291, Indicator 292, Camera 293, a display screen 294, and a subscriber identification module (subscriber identification module, SIM) card interface 295 and the like.
其中,上述传感器模块280可以包括压力传感器,陀螺仪传感器,气压传感器, 磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器和骨传导传感器等传感器。The above sensor module 280 may include sensors such as pressure sensor, gyro sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
可以理解的是,本实施例示意的结构并不构成对电子设备200的具体限定。在另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200 . In other embodiments, the electronic device 200 may include more or fewer components than shown, or combine some components, or separate some components, or different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units, for example, the processor 210 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. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
控制器可以是电子设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 200 . 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.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 210 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.
可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备200的结构限定。在另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 . In other embodiments, the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为电子设备供电。The charging management module 240 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. While the charging management module 240 charges the battery 242 , the power management module 241 can also supply power to the electronic device.
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294,摄像头293,和无线通信模块260等供电。在一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。The power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 . The power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260. In some embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
电子设备200的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。在一些实施例中,电子设备200的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得电子设备200可以通过无线通信技术与网络以及其他设备通信。The wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, the baseband processor, and the like. In some embodiments, the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology.
天线1和天线2用于发射和接收电磁波信号。电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, 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.
移动通信模块250可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。The mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 200 . The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like. The mobile communication module 250 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.
移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the same device as at least part of the modules of the processor 210 .
无线通信模块260可以提供应用在电子设备200上的包括WLAN(如(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 260 can provide applications on the electronic device 200 including WLAN (such as (wireless fidelity, Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation ( frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 260 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
电子设备200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏294用于显示图像,视频等。该显示屏294包括显示面板。Display screen 294 is used to display images, videos, and the like. The display screen 294 includes a display panel.
电子设备200可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。ISP用于处理摄像头293反馈的数据。摄像头293用于捕获静态图像或视频。在一些实施例中,电子设备200可以包括1个或N个摄像头293,N为大于1的正整数。The electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor. The ISP is used to process the data fed back by the camera 293 . Camera 293 is used to capture still images or video. In some embodiments, the electronic device 200 may include 1 or N cameras 293 , where N is a positive integer greater than 1.
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备200的各种功能应用以及数据处理。例如,在本申请实施例中,处理器210可以通过执行存储在内部存储器221中的指令,内部存储器221可以包括存储程序区和存储数据区。Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 . For example, in this embodiment of the present application, the processor 210 may execute instructions stored in the internal memory 221, and the internal memory 221 may include a program storage area and a data storage area.
其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取 存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 and the like. In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
电子设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor. Such as music playback, recording, etc.
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和电子设备200的接触和分离。电子设备200可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口295可以支持Nano SIM卡,Micro SIM卡,SIM卡等。The keys 290 include a power-on key, a volume key, and the like. Keys 290 may be mechanical keys. It can also be a touch key. Motor 291 can generate vibrating cues. The motor 291 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. The indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like. The SIM card interface 295 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 200 by inserting into the SIM card interface 295 or pulling out from the SIM card interface 295 . The electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support Nano SIM card, Micro SIM card, SIM card and so on.
为了便于理解,以电子设备为手机为例,结合附图对本申请实施例提供的方法进行具体介绍。For ease of understanding, taking the electronic device as a mobile phone as an example, the method provided by the embodiments of the present application is described in detail with reference to the accompanying drawings.
如图3中的(a)所示,在手机A的主界面301打开设置应用302后,可以进入如图3中的(b)所示的设置界面303。在设置界面303中,可以包括多个设置选项,例如可以包括个人账号设置项(例如,Glen Gao)、WLAN设置项、蓝牙设置项、移动网络设置项、更多连接设置项、桌面和壁纸设置项等。响应于用户点击更多连接设置项对应的控件304,如图3中的(c)所示,手机可以显示更多连接界面305。在更多连接界面305中,可以包括多个连接选项,例如可以包括多设备协同选项、NFC选项、Huawei Share选项、Huawei HiCar选项、手机投屏选项、打印选项和VPN选项等。响应于用户点击“多设备协同”对应的控件306,如图3中的(d)所示,手机可以显示多设备协同界面307。在多设备协同界面307中,可以包括提示动画/提示图片308和提示文字309。提示文字309用于提示用户在“非锁屏时自屏幕左下角上划即可进入设备控制中心,可将本机任务接续至附近其他设备及快捷控制智能家居”,提示动画308用于向用户演示自屏幕左下角上划的操作。当然,也可以是非锁屏时自屏幕右下角上划进入设备控制中心,本申请不做限定。其中,设备控制中心是一种系统APP。设备控制中心也可以替换为文件管理(也可以称为文件管理器,一种系统APP)。多设备协同界面307中还可以包括开关(按钮)310以及提示信息311。提示信息311说明了“本服务(多设备协同服务/功能)及其底层服务(文字处理、资源更新AI智能、通用卡片管理服务)需联网,使用存储、信息、蓝牙、电话(读取设备通话状态、拨打电话)、位置信息、通讯录、备忘录、日历权限,获取设备和账号信息。打开开关(即开关310),则表示您同意上述内容及关于多设备协同与隐私的声明”。用户可以在阅读提示信息311后了解多设备协同服务所需的权限,并决定是否打开开关311。若用户打开开关311,表示用户同意授权多设备协同服务所需使用的各种权限,手机A可以开启多设备协同服务/功能。As shown in (a) of FIG. 3 , after opening the setting application 302 on the main interface 301 of the mobile phone A, the setting interface 303 shown in (b) of FIG. 3 can be entered. In the setting interface 303, a plurality of setting options may be included, for example, a personal account setting item (eg, Glen Gao), a WLAN setting item, a Bluetooth setting item, a mobile network setting item, a more connection setting item, a desktop and a wallpaper setting may be included items etc. In response to the user clicking the control 304 corresponding to the more connection setting items, as shown in (c) of FIG. 3 , the mobile phone may display the more connection interface 305 . In the more connection interface 305, a plurality of connection options may be included, for example, a multi-device collaboration option, an NFC option, a Huawei Share option, a Huawei HiCar option, a mobile phone screen projection option, a printing option, a VPN option, and the like may be included. In response to the user clicking the control 306 corresponding to "multi-device collaboration", as shown in (d) in FIG. 3 , the mobile phone may display a multi-device collaboration interface 307 . In the multi-device collaboration interface 307, a prompt animation/prompt picture 308 and a prompt text 309 may be included. The prompt text 309 is used to prompt the user to "swipe up from the lower left corner of the screen when the screen is not locked to enter the device control center, and the local task can be connected to other nearby devices and quickly control the smart home", and the prompt animation 308 is used to show the user. Demonstrate the operation of swiping up from the lower left corner of the screen. Of course, when the screen is not locked, it can also be swiped up from the lower right corner of the screen to enter the device control center, which is not limited in this application. Among them, the device control center is a system APP. The device control center can also be replaced with a file management (also called a file manager, a system APP). The multi-device collaboration interface 307 may further include switches (buttons) 310 and prompt information 311 . Prompt message 311 explains that "this service (multi-device collaboration service/function) and its underlying services (word processing, resource update AI intelligence, general card management service) need to be connected to the Internet, using storage, information, Bluetooth, telephone (reading device calls Status, make calls), location information, address book, memo, calendar permissions, access device and account information. Turning on the switch (ie switch 310) means that you agree to the above content and the statement on multi-device collaboration and privacy". After reading the prompt information 311 , the user can learn about the permissions required for the multi-device collaborative service, and decide whether to turn on the switch 311 . If the user turns on the switch 311, it means that the user agrees to authorize various permissions required for the multi-device collaborative service, and the mobile phone A can enable the multi-device collaborative service/function.
多个设备(例如,手机A和手机B)同时开启多设备协同服务/功能后,该多个设备之间建立连接,连接后,在多个设备中的任一个设备可以实现跨设备数据访问、检索和分享。多个设备可以对应同一个账号(例如,华为账号),或者,多个设备可以分别对应不同账号,本申请不做限定。After multiple devices (for example, mobile phone A and mobile phone B) enable the multi-device collaborative service/function at the same time, a connection is established between the multiple devices. After the connection, any one of the multiple devices can realize cross-device data access, Search and share. Multiple devices may correspond to the same account (for example, a Huawei account), or multiple devices may correspond to different accounts, which are not limited in this application.
又例如,如图4A中的(a)所示,在手机A的设备控制中心的“浏览”界面401中,可以包括搜索栏、各种媒体内容的图标(例如,包括图片、视频、文档、应用等媒体内容的图标)、位置(例如,包括我的手机、华为云盘、最近删除等位置)、来源(例如,包括下载与接收、
Figure PCTCN2021136803-appb-000002
等来源)。在界面401中,还可以包括用于添加其它设备的控件402。响应于用户点击控件402的操作,如图4A中的(b)所示,手机可以显示添加设备界面403。在添加设备界面403中,可以显示手机A当前搜索到的设备(例如,连接到同一局域网的设备),例如可以包括Mate 30 pro(手机B),Mate pad pro(平板电脑)、华为电视、Mate book(笔记本电脑)等。界面403中还可以包括用于添加网络邻居、添加FTP、WebDAB的选项以及帮助信息405,帮助信息405可以帮助用户解答“如何连接其他设备?”的疑惑,并可以进行“设备推荐”。响应于用户点击Mate 30 pro(手机B)对应的控件404的操作,如图4A中的(c)所示,手机A可以弹出提示框406,提示框406包括文字提示407a、取消按钮408和连接按钮409。文字提示407a可以向用户提示“连接后,您可以查看该设备数据,并在设备之间共享数据,是否连接?”,响应于用户点击连接按钮409的操作,手机A可以向手机B发送连接请求,同时,如图4A中的(d)所示,提示框406中的提示文字407a可以变为407b,提示文字407b可以向用户提示“等待Mate30 pro确认...”。如图4B所示,假设手机A向手机B发送连接请求时,手机B处于亮屏状态且当前显示内容为桌面,手机B的桌面可以弹出弹框410,弹框410中可以包括文字提示411、拒绝按钮412和允许按钮413。文字提示411可以用于向用户提示“HUAWEI P20(即手机A)想要连接此设备,连接后,可在设备之间共享数据,是否连接?”,响应于用户点击允许按钮413的操作,手机B可以与手机A建立连接,从而可以共享数据。可选的,弹框410中还可以包括提示文字414,用于提示用户是否选择“信任此设备,始终允许连接”,若用户点击了勾选框,手机B下次可以与手机A自动连接,无需通知用户,用户也无需进行相应操作(例如点击允许按钮),可以提高用户体验。
For another example, as shown in (a) of FIG. 4A , in the “Browse” interface 401 of the device control center of mobile phone A, a search bar, icons of various media content (for example, including pictures, videos, documents, icons of media content such as apps), location (for example, including my mobile phone, HUAWEI CLOUD, recently deleted, etc.), source (for example, including downloading and receiving,
Figure PCTCN2021136803-appb-000002
etc. sources). In interface 401, controls 402 for adding other devices may also be included. In response to the user's operation of clicking the control 402, as shown in (b) of FIG. 4A, the mobile phone may display an add device interface 403. In the adding device interface 403, the devices currently searched by mobile phone A (for example, devices connected to the same local area network) can be displayed, such as Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV, Mate 30 pro (mobile phone B), Mate pad pro (tablet computer) book (laptop), etc. The interface 403 may also include options for adding network neighbors, adding FTP, and WebDAB, and help information 405, which can help the user answer the doubts about "how to connect to other devices?" and perform "device recommendation". In response to the user's operation of clicking the control 404 corresponding to the Mate 30 pro (mobile phone B), as shown in (c) of FIG. 4A , the mobile phone A may pop up a prompt box 406, which includes a text prompt 407a, a cancel button 408 and a connection button 409. The text prompt 407a can prompt the user "After connecting, you can view the data of this device and share data between devices, whether to connect?", in response to the user's operation of clicking the connect button 409, mobile phone A can send a connection request to mobile phone B , At the same time, as shown in (d) of FIG. 4A , the prompt text 407a in the prompt box 406 can be changed to 407b, and the prompt text 407b can prompt the user "waiting for Mate30 pro confirmation...". As shown in FIG. 4B , assuming that when mobile phone A sends a connection request to mobile phone B, mobile phone B is in a bright screen state and the current display content is the desktop, a pop-up box 410 may pop up on the desktop of mobile phone B, and the pop-up box 410 may include text prompts 411 , Deny button 412 and Allow button 413. The text prompt 411 can be used to prompt the user "HUAWEI P20 (ie mobile phone A) wants to connect to this device, after the connection, data can be shared between the devices, whether to connect?", in response to the user's operation of clicking the allow button 413, the mobile phone B can establish a connection with phone A so that data can be shared. Optionally, the pop-up box 410 may also include prompt text 414, which is used to prompt the user whether to select "trust this device and always allow the connection". If the user clicks the check box, the mobile phone B can automatically connect with the mobile phone A next time. There is no need to notify the user, and the user does not need to take a corresponding action (such as clicking the allow button), which can improve the user experience.
在一种可能的设计中,如图4C所示,在手机A的“最近”界面415中,可以显示用于查看其它设备的即时入口416,响应于用户点击即时入口416的操作,手机A可以显示如图4A中的(b)所示的界面。后续过程可以参考关于图4A的相关描述,在此不做赘述。In a possible design, as shown in FIG. 4C , in the “recent” interface 415 of mobile phone A, an instant entry 416 for viewing other devices may be displayed, and in response to the operation of the user clicking the instant entry 416, mobile phone A may An interface as shown in (b) in FIG. 4A is displayed. For the subsequent process, reference may be made to the related description about FIG. 4A , which will not be repeated here.
类似手机A与Mate 30 pro(手机B)建立连接的过程,手机A可以分别与Mate pad pro(平板电脑)、华为电视和Mate book(笔记本电脑)等设备建立连接。这样,用户可以实现跨设备数据访问和分享,例如用户可以在手机A上查看Mate 30 pro(手机B),Mate pad pro(平板电脑)、华为电视和Mate book(笔记本电脑)等设备的数据。这样,可以解决个人终端设备众多,个人数据分散存储导致的用户查找数据不方便的问题。Similar to the process of establishing a connection between mobile phone A and Mate 30 pro (mobile phone B), mobile phone A can establish connections with devices such as Mate pad pro (tablet computer), Huawei TV, and Mate book (laptop computer). In this way, users can access and share data across devices. For example, users can view data from devices such as Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV, and Mate book (laptop computer) on mobile phone A. In this way, the problem of inconvenience for users to find data caused by numerous personal terminal devices and scattered storage of personal data can be solved.
手机A与Mate 30 pro(手机B),Mate pad pro(平板电脑)、华为电视和Mate book(笔记本电脑)等设备建立连接后,如图5A所示,在浏览界面420的其他设备选项421下方,可以显示手机A当前连接的全部设备,例如可以包括Mate 30 pro(手机B),Mate pad pro(平板电脑)、华为电视和Mate book(笔记本电脑)。After mobile phone A is connected to devices such as Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV, and Mate book (laptop), as shown in FIG. 5A , under the other device option 421 of the browsing interface 420 , can display all devices currently connected to mobile phone A, such as Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV and Mate book (laptop).
进一步的,用户也可以取消手机A与Mate 30 pro(手机B),Mate pad pro(平 板电脑)、华为电视和Mate book(笔记本电脑)等设备之间的连接。例如,如图5B中的(a)所示,响应于用户长按(例如,按住屏幕2s)Mate 30 pro(手机B)对应的区域422中的任一位置的操作,手机A可以弹出弹框423,弹框423中包括取消授权选项和删除设备选项,若用户点击取消授权选项,响应于用户的操作,如图5B中的(c)所示,手机A可以弹出弹框426,弹框426中包括提示信息“取消授权后,设备之间不再共享数据,是否取消”以及暂不取消按钮和取消授权按钮,用户可以根据自身的需求点击相应的按钮。若用户点击删除设备选项,如图5B中的(d)所示,响应于用户的操作,手机A可以弹出弹框427,弹框427中包括提示信息“删除后,设备之间不再共享数据,是否删除”以及取消按钮和删除按钮,用户可以根据自身的需求点击相应的按钮。又例如,如图5B中的(b)所示,用户可以在Mate 30 pro(手机B)对应的区域422中向左滑动,手机A可以显示取消授权图标424和删除设备图标425,若用户点击取消授权图标424,响应于用户的操作,如图5B中的(c)所示,手机A可以弹出弹框426,弹框426可以参见上文的说明。若用户点击删除设备图标425,如图5B中的(d)所示,响应于用户的操作,手机A可以弹出弹框427,弹框427可以参见上文的说明。Further, users can also cancel the connection between mobile phone A and Mate 30 pro (mobile phone B), Mate pad pro (tablet computer), Huawei TV and Mate book (laptop computer) and other devices. For example, as shown in (a) of FIG. 5B, in response to the user's long-pressing (for example, pressing and holding the screen for 2s) any position in the area 422 corresponding to the Mate 30 pro (mobile phone B), the mobile phone A can pop up a pop-up Box 423, the pop-up box 423 includes the cancel authorization option and the delete device option. If the user clicks the cancel authorization option, in response to the user's operation, as shown in (c) in FIG. 5B, the mobile phone A can pop up the pop-up box 426, the pop-up box 426 includes the prompt information "After the authorization is cancelled, the devices will no longer share data, whether to cancel", and the temporarily cancel button and the cancel authorization button, and the user can click the corresponding button according to their own needs. If the user clicks the delete device option, as shown in (d) in FIG. 5B , in response to the user's operation, mobile phone A may pop up a pop-up box 427, and the pop-up box 427 includes a prompt message "After deletion, data will no longer be shared between devices. , whether to delete" and the cancel button and delete button, users can click the corresponding buttons according to their own needs. For another example, as shown in (b) in FIG. 5B, the user can swipe left in the area 422 corresponding to the Mate 30 pro (mobile phone B), and the mobile phone A can display the cancel authorization icon 424 and the delete device icon 425. If the user clicks After canceling the authorization icon 424, in response to the user's operation, as shown in (c) of FIG. 5B, the mobile phone A may pop up a pop-up box 426, and the pop-up box 426 may refer to the above description. If the user clicks the delete device icon 425, as shown in (d) of FIG. 5B, in response to the user's operation, the mobile phone A may pop up a pop-up box 427, which can refer to the above description.
在一些实施例中,用户可以在手机A上查看其他设备的媒体文件。本申请实施例中,查看媒体文件可以是指查看媒体文件的缩略图(例如,图片的缩略图,音频、视频的封面缩略图)或媒体文件本身(媒体文件本身可以称为原始媒体文件,例如,原始媒体文件可以是图片的原图,视频的原文件、音频的原文件等)。如图5A所示,响应于用户点击Mate 30 pro(手机B)对应的区域422中的任一位置,如图6A所示,手机A可以显示Mate 30 pro(手机B)对应的媒体文件界面430,界面430中可以包括多个选项卡,例如可以包括最近、图片、视频、音频、文档、其他等选项卡。手机A可以默认展示最近选项卡431的内容,此时界面430中可以显示不同应用程序最近处理(下载、缓存、上传)的媒体文件(例如,图片、视频、音频、文档等)。例如,
Figure PCTCN2021136803-appb-000003
刚刚(例如,5分钟内)处理了2项媒体文件(图片),分别为A-001.jpg和A-001.jpg(图片格式为jpg),其处理时间都为2019/3/16,其大小分别为9.34KB。类似的,WPS昨天处理了5项媒体文件(例如,文档)。
Figure PCTCN2021136803-appb-000004
昨天处理了8项媒体文件(例如,图片)。图6A中
Figure PCTCN2021136803-appb-000005
处理的8项媒体文件未显示完整,用户可以进行向上滑动的操作,手机A响应于用户的操作,可以显示更多媒体文件。如图6B所示,响应于用户选择图片选项卡432的操作,手机A可以展示图片选项卡432的内容,即选中图片选项卡432时,界面430可以显示Mate 30 pro(手机B)的不同图片文件夹的内容,例如可以包括全部图片(共223项)、截屏(共34项截屏)、图像(共123项),图片(共327项)和邮件(共327项)等图片文件夹。如图6C所示,响应于用户选择视频选项卡433的操作,手机A可以展示视频选项卡433的内容,即选中视频选项卡433时,界面430可以显示Mate 30 pro(手机B)的视频文件夹的内容,例如可以包括全部视频(共568项)、来自
Figure PCTCN2021136803-appb-000006
的视频(共34项)、来自
Figure PCTCN2021136803-appb-000007
的视频(共123项),来自华为视频的视频(共327项)和来自
Figure PCTCN2021136803-appb-000008
的视频(共6项)等视频文件夹。如图6D所示,响应于用户选择音频选项卡434的操作,手机A可以展示音频选项卡434的内容,即选中音频选项卡434时,界面430可以显示来自Mate 30 pro(手 机B)的各个音频的图标和名称,例如可以包括xx1.mp3、xx2.mp3、xx3mp3、xx4.mp3、xx5.mp3、xx6.mp3、xx7.mp3、xx8.mp3、xx9.mp3、xx10.mp3、xx11.mp3、xx12.mp3等等。
In some embodiments, the user may view media files of other devices on cell phone A. In this embodiment of the present application, viewing media files may refer to viewing thumbnails of media files (for example, thumbnails of pictures, and cover thumbnails of audio and video) or the media files themselves (the media files themselves may be referred to as original media files, such as , the original media file can be the original image of the picture, the original file of the video, the original file of the audio, etc.). As shown in FIG. 5A , in response to the user clicking any position in the area 422 corresponding to the Mate 30 pro (mobile phone B), as shown in FIG. 6A , the mobile phone A can display the media file interface 430 corresponding to the Mate 30 pro (mobile phone B) , the interface 430 may include a plurality of tabs, for example, tabs such as recent, picture, video, audio, document, and others may be included. Mobile phone A can display the contents of the recent tab 431 by default, and the interface 430 can display media files (eg, pictures, videos, audios, documents, etc.) recently processed (downloaded, cached, uploaded) by different applications. E.g,
Figure PCTCN2021136803-appb-000003
2 media files (pictures) have just been processed (for example, within 5 minutes), namely A-001.jpg and A-001.jpg (the picture format is jpg), and the processing time is 2019/3/16. The size is 9.34KB respectively. Similarly, WPS processed 5 media files (eg, documents) yesterday.
Figure PCTCN2021136803-appb-000004
8 media files (eg pictures) were processed yesterday. Figure 6A
Figure PCTCN2021136803-appb-000005
The processed 8 media files are not displayed completely, the user can perform an operation of swiping up, and the mobile phone A can display more media files in response to the user's operation. As shown in FIG. 6B, in response to the user's operation of selecting the picture tab 432, the mobile phone A can display the content of the picture tab 432, that is, when the picture tab 432 is selected, the interface 430 can display different pictures of the Mate 30 pro (mobile phone B) The content of the folder, for example, can include all pictures (223 items in total), screenshots (34 items in total), images (123 items in total), pictures (327 items in total) and mail (327 items in total) and other picture folders. As shown in FIG. 6C, in response to the user's operation of selecting the video tab 433, the mobile phone A can display the content of the video tab 433, that is, when the video tab 433 is selected, the interface 430 can display the video file of the Mate 30 pro (mobile phone B). The content of the folder, for example, can include all videos (568 items in total), from
Figure PCTCN2021136803-appb-000006
's videos (34 in total), from
Figure PCTCN2021136803-appb-000007
videos (123 in total), videos from Huawei Video (327 in total) and videos from
Figure PCTCN2021136803-appb-000008
videos (6 items in total) and other video folders. As shown in FIG. 6D, in response to the user's operation of selecting the audio tab 434, the mobile phone A can display the content of the audio tab 434, that is, when the audio tab 434 is selected, the interface 430 can display various The icon and name of the audio, for example can include xx1.mp3, xx2.mp3, xx3mp3, xx4.mp3, xx5.mp3, xx6.mp3, xx7.mp3, xx8.mp3, xx9.mp3, xx10.mp3, xx11.mp3 , xx12.mp3, etc.
这样,手机A与Mate 30 pro(手机B)建立连接后,用户可以在手机A上查看Mate 30 pro(手机B)的数据,可以实现跨设备数据访问本地化。In this way, after the connection between mobile phone A and Mate 30 pro (mobile phone B) is established, the user can view the data of Mate 30 pro (mobile phone B) on mobile phone A, which can realize the localization of data access across devices.
类似的,如图5A所示,响应于用户点击Mate pad pro、华为电视或Mate book对应的区域中的任一位置,手机A可以显示Mate pad pro、华为电视或Mate book对应的界面,用户可以通过不同设备分别对应的界面查看不同设备的媒体文件。具体描述可以参考上文中关于Mate 30 pro对应的界面的描述,在此不做赘述。Similarly, as shown in FIG. 5A, in response to the user clicking on any position in the area corresponding to the Mate pad pro, Huawei TV or Mate book, mobile phone A can display the interface corresponding to the Mate pad pro, Huawei TV or Mate book, and the user can View media files of different devices through interfaces corresponding to different devices. For the specific description, please refer to the description of the interface corresponding to the Mate 30 pro above, which will not be repeated here.
在一些实施例中,用户可以在手机A上检索本设备和其他设备(手机A当前连接的其他设备)的媒体文件。如图7A中的(a)所示,响应于用户在手机A的最近界面415的搜索框417中输入“托福”的操作,如图7A中的(b)所示,手机A可以默认显示本机选项卡418的搜索结果,本机的搜索结果可以包括来自“华为云盘”的文件(例如,托福基础讲义.doc等)、手机A本地的视频(例如,6秒钟讲解托福考试内容.mp4等)和音频(例如,托福听力基础课程.mp3等)。如图7A中的(c)所示,响应于用户选择其他设备选项卡421的操作,手机A可以显示其他设备的搜索结果,其他设备的搜索结果可以包括Mate 30Pro找到10项文件和Matebook找到6项文件。示例性的,Mate 30Pro找到10项文件可以包括托福解题技巧.doc等。Matebook找到6项文件可以包括托福考试突破.mp4等。用户可以通过点击查看更多按钮查看Mate 30Pro或Matebook找到的更多文件。这样,用户可以在手机A连接的全部设备上搜索某项内容,无需在不同的设备上分别进行搜索操作,可以简化用户的操作,提高用户体验。即本申请实施例可以实现跨设备融合检索,能够解决用户数据散落各处,不易查找的问题。In some embodiments, the user can retrieve the media files of the device and other devices (other devices currently connected to the phone A) on the mobile phone A. As shown in (a) of FIG. 7A, in response to the user's operation of inputting "TOEFL" in the search box 417 of the recent interface 415 of the mobile phone A, as shown in (b) of FIG. 7A, the mobile phone A may display this book by default. The search results of the computer tab 418, the search results of the local computer can include files from "Huawei Cloud Disk" (for example, TOEFL Basic Lectures. mp4, etc.) and audio (eg, TOEFL Listening Fundamentals Course.mp3, etc.). As shown in (c) of FIG. 7A, in response to the user's operation of selecting the other devices tab 421, mobile phone A may display search results of other devices, and the search results of other devices may include 10 files found by Mate 30Pro and 6 files found by Matebook item file. Exemplarily, the 10-item files found by the Mate 30Pro may include TOEFL problem solving skills.doc and the like. Matebook finds 6 files that can include TOEFL Breakthrough.mp4 and so on. Users can view more files found by the Mate 30Pro or Matebook by clicking the View More button. In this way, the user can search for a certain content on all the devices connected to the mobile phone A, and there is no need to perform search operations on different devices, which can simplify the user's operation and improve the user experience. That is, the embodiment of the present application can realize cross-device fusion retrieval, and can solve the problem that user data is scattered everywhere and is difficult to find.
或者,用户可以选择在某个设备上搜索某项内容。例如,如图7B中的(a)所示,在手机A的界面430中,响应于用户点击搜索控件440的操作,手机A可以显示如图7B中的(b)所示的搜索界面441,在界面441的搜索框442中,手机A可以接收用户输入的“托福”,响应于用户输入“托福”的操作,手机A可以显示Mate 30 pro(手机B)针对“托福”的搜索结果,搜索结果可以是找到10项文件,例如可以包括托福解题技巧.doc、托福听力解析.mp3和托福听力提高.mp4等文件。这样,用户可以在手机A连接的任一个设备中搜索某项内容(例如,“托福”),无需在相应的设备(例如,Mate 30 pro(手机B))上进行相应的搜索操作,可以简化用户的操作,提高用户体验。Alternatively, users can choose to search for an item on a certain device. For example, as shown in (a) in FIG. 7B , in the interface 430 of the mobile phone A, in response to the operation of the user clicking the search control 440, the mobile phone A can display the search interface 441 shown in (b) in FIG. 7B , In the search box 442 of the interface 441, the mobile phone A can receive the "TOEFL" input by the user, and in response to the operation of the user inputting "TOEFL", the mobile phone A can display the search results of the Mate 30 pro (mobile phone B) for "TOEFL", and search for "TOEFL". The result can be to find 10 items of files, for example, can include TOEFL problem solving skills.doc, TOEFL listening analysis.mp3 and TOEFL listening improvement.mp4 and other files. In this way, the user can search for a certain content (for example, "TOEFL") in any device connected to mobile phone A, without the need to perform a corresponding search operation on the corresponding device (for example, Mate 30 pro (mobile phone B)), which can simplify User operation, improve user experience.
用户可以在手机A上将手机B的一项或多项媒体文件分享至第三方应用程序或系统应用程序。在一种可能的设计中,如图8A中的(a)所示,在手机A的界面430中,响应于用户长按图片450的操作,手机A可以弹出弹框451,弹框451中可以包括多个操作选项,例如可以包括分享、多选、复制、详情和打开方式等操作选项。响应于用户点击分享操作选项452的操作,如图8A中的(b)所示,手机A可以弹出弹框453,在弹框453中可以包括提示信息454和可被分享的应用程序或服务的图标455,提示信息454可以用于提示用户:“正在发现附近的设备,对方需要在通知栏开启Huawei Share,如需打印,请确保打印机可被发现。”可被分享的应用程序或服务的图 标455例如可以包括
Figure PCTCN2021136803-appb-000009
邮箱、华为云盘等。若用户不想继续分享,可以点击取消按钮456取消分享。本申请实施例可以实现用户数据分享本地化,解决用户数据分享不便利的问题。
The user can share one or more media files of mobile phone B on mobile phone A to third-party applications or system applications. In a possible design, as shown in (a) of FIG. 8A , in the interface 430 of the mobile phone A, in response to the user's operation of long pressing the picture 450 , the mobile phone A may pop up a pop-up frame 451 , and in the pop-up frame 451 It includes multiple operation options, such as sharing, multiple selection, copying, details, and opening method. In response to the user's operation of clicking the share operation option 452, as shown in (b) in FIG. 8A, the mobile phone A may pop up a pop-up box 453, and the pop-up box 453 may include prompt information 454 and information about the application or service that can be shared. The icon 455 and the prompt information 454 can be used to prompt the user: "A nearby device is being discovered. The other party needs to open Huawei Share in the notification bar. If you want to print, please make sure that the printer can be discovered." Icons of applications or services that can be shared 455 for example can include
Figure PCTCN2021136803-appb-000009
Email, Huawei Cloud Disk, etc. If the user does not want to continue sharing, the user can click the cancel button 456 to cancel the sharing. The embodiments of the present application can realize the localization of user data sharing, and solve the problem of inconvenience in user data sharing.
在另一种可能的设计中,如图8B中的(a)所示,在手机A的界面430中,响应于用户长按图片450的操作,手机A可以弹出弹框460和弹框461,弹框460中可以包括用户常用的几个操作选项,例如可以包括分享、收藏和删除等操作选项。弹框461中可以包括多个操作选项,例如可以包括多选、移动、复制、重命名、详情、打开方式、设置为和设为私密等操作选项。响应于用户点击弹框461中的移动操作选项462的操作,如图8B中的(b)所示,手机A可以弹出弹框463,在弹框463中可以包括多个可被移动的位置信息,例如可以包括我的手机中的SD卡和华为云盘,还可以包括其他设备(例如,Mate 30 pro(手机B))的不同文件夹,例如可以包括Mate 30 pro(手机B)的Alarms、apmmodel、edge、picture和我的文件等文件夹。响应于用户点击Alarms文件夹对应的区域464中的任一位置的操作,在弹框463的上方可以显示提示文字465,提示用户“移动1项到“Alarms”,共17.34MB”。其中,被移动的1项媒体文件即图片450,图片450共17.34MB。本申请实施例可以实现用户数据分享本地化,解决用户数据分享不便利的问题。In another possible design, as shown in (a) of FIG. 8B, in the interface 430 of the mobile phone A, in response to the user's operation of long pressing the picture 450, the mobile phone A can pop up the pop-up frame 460 and the pop-up frame 461, The pop-up box 460 may include several operation options commonly used by the user, for example, may include operation options such as share, favorite, and delete. The pop-up box 461 may include multiple operation options, for example, may include operation options such as multi-select, move, copy, rename, details, open method, set as, and set as private. In response to the user's operation of clicking the move operation option 462 in the pop-up box 461, as shown in (b) of FIG. 8B, the mobile phone A can pop up a pop-up box 463, and the pop-up box 463 can include a plurality of position information that can be moved , for example, it can include the SD card and Huawei cloud disk in my mobile phone, and can also include different folders of other devices (for example, Mate 30 pro (mobile phone B)), for example, it can include the Alarms, folders such as apmmodel, edge, picture, and my files. In response to the user's operation of clicking any position in the area 464 corresponding to the Alarms folder, a prompt text 465 may be displayed above the pop-up box 463, prompting the user to "move 1 item to "Alarms", a total of 17.34MB". Among them, one media file to be moved is the picture 450, and the picture 450 has a total of 17.34MB. The embodiments of the present application can realize the localization of user data sharing, and solve the problem of inconvenience in user data sharing.
本申请实施例支持第三方应用跨设备查找、访问、分享媒体文件。例如,用户在邮件应用插入附件时,可以从本机中查找,也可以从与本机连接的多个设备中查找。The embodiments of the present application support third-party applications to search, access, and share media files across devices. For example, when a user inserts an attachment in a mail application, he can search from the machine or from multiple devices connected to the machine.
在一种可能的实现方式中,如图9A中的(a)所示,当用户在手机A进入到新建邮件界面470时,可以点击添加附件的控件471,响应于用户点击控件471的操作,如图9A中的(b)所示,手机A可以显示标签页(Tab)为最近的界面472,在界面472中,每个媒体文件的图标上显示一个选择框,可供用户选择。例如,媒体文件473a的图标上可以显示选择框473b。响应于用户点击媒体文件473a(即封面设计.pptx)的操作,如图9A中的(c)所示,媒体文件473a上的选择框的显示样式改变,表示该文件已选中。界面472的上方还可以包括提示信息474,提示用户当前“已选择1/20”,即用户总共可以选择20个文件,当前已选中一个。响应于用户点击完成按钮475的操作,如图9A中的(d)所示,手机A可以返回显示新建邮件界面470,此时,在新建邮件界面470中增加了附件显示区域476,在附件显示区域476中,可以显示用户选择的附件(例如,封面设计.pptx)。可选的,用户可以点击控件477删除当前选择的附件。In a possible implementation, as shown in (a) of FIG. 9A , when the user enters the new email interface 470 on the mobile phone A, he can click the control 471 for adding an attachment, and in response to the user's operation of clicking the control 471, As shown in (b) of FIG. 9A , the mobile phone A can display a tab page (Tab) as the most recent interface 472, in the interface 472, a selection box is displayed on the icon of each media file for the user to select. For example, a selection box 473b may be displayed on the icon of the media file 473a. In response to the user's operation of clicking on the media file 473a (ie, cover design.pptx), as shown in (c) of FIG. 9A , the display style of the selection box on the media file 473a changes, indicating that the file is selected. The upper part of the interface 472 may also include prompt information 474, prompting the user that "1/20 has been selected", that is, the user can select a total of 20 files, and one is currently selected. In response to the operation of the user clicking the finish button 475, as shown in (d) in FIG. 9A, the mobile phone A can return to display the new email interface 470. At this time, an attachment display area 476 is added to the newly created email interface 470, and the attachment display area 476 is added. In area 476, user-selected attachments (eg, coverdesign.pptx) may be displayed. Optionally, the user may click on control 477 to delete the currently selected attachment.
在另一种可能的实现方式中,如图9A中的(a)所示,当用户在手机A进入到新建邮件界面470时,可以点击为邮件添加附件的控件471,响应于用户点击控件471的操作,如图9B中的(a)所示,手机A可以显示标签页(Tab)为最近的界面472,在界面472中,每个媒体文件的图标上悬浮显示一个选择框,可供用户选择。响应于用户点击浏览标签页的图标480的操作,如图9B中的(b)所示,手机A可以显示浏览标签页的界面480a,在界面480a中,响应于用户选择Mate 30 pro(手机B)的操作,如图9B中的(c)所示,手机A可以显示界面480b,界面480b默认显示Mate 30pro(手机B)的最近选项卡的内容。界面480b中可以包括提示信息483,用于提示用户当前正在浏览Mate 30 pro(手机B)的媒体文件。当用户选中媒体文件481(即 A-002.jpg)和媒体文件482(即封面设计.pptx)后,提示信息484可以提示用户当前“已选择2/20”,即用户总共可以选择20个文件,当前已选中两个。而后,响应于用户点击完成按钮485的操作,如图9B中的(d)所示,手机A可以返回显示新建邮件界面470,此时,在新建邮件界面470中增加了附件显示区域486,在附件显示区域486中,可以显示用户选择的附件(例如,A-002.jpg和封面设计.pptx)。In another possible implementation, as shown in (a) of FIG. 9A , when the user enters the new email interface 470 on the mobile phone A, he can click the control 471 for adding an attachment to the email, and in response to the user clicking the control 471 operation, as shown in (a) of FIG. 9B , the mobile phone A can display the tab page (Tab) as the most recent interface 472. In the interface 472, a selection box is displayed floating on the icon of each media file, which is available for the user choose. In response to the user's operation of clicking on the icon 480 of the browse tab, as shown in (b) in FIG. 9B , the mobile phone A may display an interface 480a for browsing the tab, in the interface 480a, in response to the user selecting the Mate 30 pro (mobile phone B). ) operation, as shown in (c) of FIG. 9B , the mobile phone A can display the interface 480b, and the interface 480b displays the contents of the recent tab of the Mate 30pro (mobile phone B) by default. The interface 480b may include prompt information 483 for prompting the user that the media file of the Mate 30 pro (mobile phone B) is currently being browsed. When the user selects the media file 481 (ie A-002.jpg) and the media file 482 (ie the cover design.pptx), the prompt message 484 can prompt the user that "2/20 has been selected", that is, the user can select a total of 20 files , two are currently selected. Then, in response to the user's operation of clicking the finish button 485, as shown in (d) of FIG. 9B, the mobile phone A can return to display the new email interface 470. At this time, an attachment display area 486 is added in the In the attachment display area 486, attachments selected by the user (eg, A-002.jpg and cover design.pptx) may be displayed.
本申请实施例支持从第三方应用跨设备查找、访问、分享媒体文件,无需将其他设备的媒体文件先下载到本地,也无需用户进行繁琐的操作,可以提高用户体验。The embodiments of the present application support searching, accessing, and sharing media files from third-party applications across devices, without first downloading media files of other devices to the local area, and without requiring users to perform cumbersome operations, which can improve user experience.
上述手机(例如,手机A或手机B)的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明手机(手机A或手机B)的软件结构。当然,手机也可以是鸿蒙系统、IOS系统或者其他操作系统,本申请实施例不做限定。The software system of the above mobile phone (eg, mobile phone A or mobile phone B) may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of a mobile phone (mobile phone A or mobile phone B). Of course, the mobile phone may also be a Hongmeng system, an IOS system, or other operating systems, which are not limited in this embodiment of the present application.
如图10A所示,手机的软件架构可以包括应用程序层和框架层。As shown in FIG. 10A , the software architecture of the mobile phone may include an application layer and a framework layer.
其中,应用程序层可以包括一系列应用程序包,应用程序包例如可以包括邮件,相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。The application layer may include a series of application packages, and the application package may include, for example, applications such as mail, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。框架层包括一些预先定义的函数。The framework layer provides an application programming interface (API) and a programming framework for applications in the application layer. The framework layer includes some predefined functions.
示例性的,框架层可以包括统一操作框架001、分布式权限管理模块002、分布式数据库(也可以称为分布式数据管理模块)003、设备管理模块(也可以称为Peers管理模块)004、分布式存储模块005和跨设备传输模块006。下面对各个模块的功能进行简要说明。Exemplarily, the framework layer may include a unified operation framework 001, a distributed rights management module 002, a distributed database (also referred to as a distributed data management module) 003, a device management module (also referred to as a Peers management module) 004, Distributed storage module 005 and cross-device transfer module 006. The function of each module is briefly described below.
统一操作框架001:可以封装并屏蔽近场通信、远场通信的通信差异,以及本设备、其他设备的存储差异,向应用程序提供统一的北向API,从而实现应用程序对设备的管理(添加、删除等)以及对媒体对象(即媒体文件)的鉴权、增加、删除、修改、查询(搜索)、浏览、分享、备份、迁移等操作。Unified operation framework 001: It can encapsulate and shield the communication differences between near-field communication and far-field communication, as well as the storage differences between this device and other devices, and provide a unified northbound API to the application, so as to realize the management of the device by the application (adding, operations such as authentication, addition, deletion, modification, query (search), browsing, sharing, backup, and migration of media objects (ie, media files).
分布式权限管理模块002:用于提供媒体分布式访问的权限管理,包括应用权限管理和用户账号权限管理等。Distributed rights management module 002: used to provide rights management for distributed media access, including application rights management and user account rights management.
分布式数据库003:用于基于全量同步、增量同步和实时同步能力,实现跨设备媒体元数据的“即插即用访问”。“即插即用访问”是指提前在某个设备(例如,手机A)上存储其他设备(例如,手机B)的媒体元数据,这样,无需在访问时消耗时间获取其他设备的媒体元数据,可以快速访问其他设备的媒体元数据。其中,媒体元数据是描述媒体数据(媒体内容/媒体文件)的属性信息的数据。例如,可以包括媒体文件的标识、类型(音频、视频、图片等)、大小、存储位置等。Distributed database 003: used to realize "plug and play access" of media metadata across devices based on full synchronization, incremental synchronization and real-time synchronization capabilities. "Plug-and-play access" refers to storing media metadata of other devices (eg, phone B) on a certain device (eg, phone A) in advance, so that there is no need to spend time acquiring the media metadata of other devices during access , for quick access to media metadata from other devices. The media metadata is data describing attribute information of media data (media content/media file). For example, the identification, type (audio, video, picture, etc.), size, storage location, etc. of the media file may be included.
设备管理模块004:用于设备发现(例如,发现同一局域网中的其他设备)和状态管理(例如,与其他设备的连接情况),可以响应系统的设备建链(建连)、断链(断连)事件,触发媒体元数据同步和状态更新,向分布式数据库003通知应用数据和状态变化。Device management module 004: used for device discovery (for example, discovering other devices in the same local area network) and state management (for example, the connection with other devices), and can respond to the system's device chain establishment (connection establishment) and link disconnection (disconnection). Connect) event, trigger media metadata synchronization and state update, and notify the distributed database 003 of application data and state changes.
分布式存储模块005:用于媒体数据同步,缩略图数据同步和媒体数据跨设备访问、缓存(包括透明缓存和有状态缓存),一致性维护(例如,智能老化)。Distributed storage module 005: used for media data synchronization, thumbnail data synchronization and media data access across devices, caching (including transparent caching and stateful caching), and consistency maintenance (eg, intelligent aging).
跨设备传输模块006:用于控制媒体元数据、媒体数据(例如,缩略图数据)的跨设备传输,可以从其他设备接收媒体元数据、媒体数据,或者向其他设备发送媒体元数据、媒体数据。Cross-device transmission module 006: used to control the cross-device transmission of media metadata and media data (for example, thumbnail data), and can receive media metadata and media data from other devices, or send media metadata and media data to other devices .
需要说明的是,不同模块之间具有不同的交互接口,不同交互接口的功能和作用不同。It should be noted that different modules have different interaction interfaces, and the functions and roles of different interaction interfaces are different.
例如,应用程序层与统一操作框架001之间的交互接口10是北向API接口,是一种提供给应用程序进行媒体对象操作的接口。For example, the interaction interface 10 between the application layer and the unified operation framework 001 is a northbound API interface, which is an interface provided for applications to operate media objects.
统一操作框架001与分布式权限管理模块002之间的交互接口20是鉴权、授权接口,是一种提供给统一操作框架001的应用鉴权、账号鉴权、媒体对象权限管理的接口。The interactive interface 20 between the unified operation framework 001 and the distributed rights management module 002 is an authentication and authorization interface, which is an interface provided to the unified operation framework 001 for application authentication, account authentication, and media object rights management.
统一操作框架001与分布式数据库003之间的交互接口21是数据库操作接口,是一种提供给统一操作框架001的媒体元数据增加、删除、修改、查询的接口。其中,媒体元数据包括本地、云、分布式终端(即其他设备)的媒体元数据。The interactive interface 21 between the unified operation framework 001 and the distributed database 003 is a database operation interface, which is an interface for adding, deleting, modifying and querying media metadata provided to the unified operation framework 001 . The media metadata includes media metadata of local, cloud, and distributed terminals (ie, other devices).
统一操作框架001与跨设备传输模块006之间的交互接口22是远程控制接口,是一种提供给统一操作框架001的协同编辑、跨设备拷贝/粘贴的业务的控制数据、内容数据传输的接口。The interaction interface 22 between the unified operation framework 001 and the cross-device transmission module 006 is a remote control interface, which is an interface for collaborative editing, cross-device copy/paste business control data, and content data transmission provided to the unified operation framework 001 .
设备管理模块004与分布式数据库003之间的交互接口30是设备变更通知、查询接口,提供给分布式数据库004的远端设备状态变更通知、状态实时查询的接口。其中,远端设备可以包括PC、PAD、手机、NAS、云服务器等设备。The interactive interface 30 between the device management module 004 and the distributed database 003 is a device change notification and query interface, an interface provided to the distributed database 004 for remote device state change notification and real-time state query. The remote device may include a PC, a PAD, a mobile phone, a NAS, a cloud server, and other devices.
分布式数据库003与跨设备传输模块006之间的交互接口31是元数据同步接口,是一种提供给分布式数据库003的元数据跨设备查询、广播的数据传输的接口。The interactive interface 31 between the distributed database 003 and the cross-device transmission module 006 is a metadata synchronization interface, which is an interface for cross-device query and broadcast data transmission of metadata provided to the distributed database 003 .
分布式数据库003与分布式存储模块005之间的交互接口32是文件操作接口,是一种提供给分布式数据库003的本地、云、分布式媒体文件的操作接口,支持跨设备的媒体文件增加、删除、修改和查询等。The interactive interface 32 between the distributed database 003 and the distributed storage module 005 is a file operation interface, which is an operation interface for local, cloud, and distributed media files provided to the distributed database 003, and supports the addition of media files across devices. , delete, modify and query, etc.
设备管理模块004与跨设备传输模块006之间的交互接口40是设备发现、监听接口,是一种提供给设备管理模块004的设备状态变更信息的传输接口。The interaction interface 40 between the device management module 004 and the cross-device transmission module 006 is a device discovery and monitoring interface, and is a transmission interface for device state change information provided to the device management module 004 .
分布式存储模块005与跨设备传输模块006之间的交互接口50是文件缓存、同步接口,是一种提供给分布式存储模块005的跨设备媒体文件的传输接口。The interactive interface 50 between the distributed storage module 005 and the cross-device transmission module 006 is a file cache and synchronization interface, which is a cross-device media file transmission interface provided to the distributed storage module 005 .
另外,框架层还可以包括活动管理器、窗口管理器,内容提供器,视图系统,资源管理器,通知管理器等,本申请实施例对此不做任何限制。其中,活动管理器(Activity Manager):用于管理每个应用的生命周期。应用通常以Activity的形式运行在操作系统中。对于每一个Activity,在活动管理器中都会有一个与之对应的应用记录(ActivityRecord),这个ActivityRecord记录了该应用的Activity的状态。活动管理器可以利用这个ActivityRecord作为标识,调度应用的Activity进程。窗口管理器(WindowManagerService):用于管理在屏幕上使用的图形用户界面(graphical user interface,GUI)资源,具体可用于:获取显示屏大小、窗口的创建和销毁、窗口的显示与隐藏、窗口的布局、焦点的管理以及输入法和壁纸管理等。In addition, the framework layer may also include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, and the like, which are not limited in this embodiment of the present application. Among them, Activity Manager (Activity Manager): used to manage the life cycle of each application. Applications usually run in the operating system in the form of Activity. For each Activity, there will be a corresponding application record (ActivityRecord) in the activity manager, and this ActivityRecord records the state of the application's Activity. The activity manager can use this ActivityRecord as an identifier to schedule the Activity process of the application. Window Manager (WindowManagerService): used to manage the graphical user interface (graphical user interface, GUI) resources used on the screen, which can be used for: obtaining the display screen size, creating and destroying windows, displaying and hiding windows, Layout, focus management, input method and wallpaper management, etc.
手机的软件架构还可以包括系统库和内核层(图10A中未示出)。系统库和内核层等可称为底层系统,底层系统中包括用于提供显示服务的底层显示系统,例如,底 层显示系统包括内核层中的显示驱动以及系统库中的surface manager等。The software architecture of the handset may also include system libraries and kernel layers (not shown in Figure 10A). The system library and the kernel layer can be called the underlying system, and the underlying system includes the underlying display system for providing display services. For example, the underlying display system includes the display driver in the kernel layer and the surface manager in the system library.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),OpenGL ES,SGL等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。OpenGL ES用于实现三维图形绘图,图像渲染,合成,和图层处理等。SGL是2D绘图的绘图引擎。A system library can include multiple functional modules. For example: surface manager, Media Libraries, OpenGL ES, SGL, etc. The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. SGL 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, and sensor drivers.
需要说明的是,设备管理模块004既可以进行近场设备的管理(例如,设备发现、设备连接),也可以进行远场设备的管理(例如,设备发现、设备连接),跨设备传输模块006可以进行近场设备之间的数据同步/数据传输,也可以进行远场设备之间的数据同步/数据传输。It should be noted that the device management module 004 can manage both near-field devices (eg, device discovery, device connection) and far-field devices (eg, device discovery, device connection), and the cross-device transmission module 006 Data synchronization/data transmission between near-field devices and data synchronization/data transmission between far-field devices can be performed.
设备发现和数据同步前需要满足以下至少一个前置条件:1)新建设备管理表,用于存放与本地设备连接过的近场设备/远场设备信息;2)新建数据同步状态表,用于存放近场设备/远场设备本地媒体数据的同步状态;3)新建相册集/相册表,用于存放相册集、相册信息;4)新建媒体资产/相册关系对应表,用于存放媒体资产与相册的关系;5)近场设备/远场设备注册近场设备/远场设备本地媒体数据监听。Before device discovery and data synchronization, at least one of the following preconditions must be met: 1) Create a new device management table to store near-field device/far-field device information that has been connected to the local device; 2) Create a new data synchronization state table for Store the synchronization status of the local media data of the near-field device/far-field device; 3) Create a new album set/album table, which is used to store the album set and album information; 4) Create a new media asset/album relationship correspondence table, which is used to store media assets and The relationship of the album; 5) The near-field device/far-field device registers the local media data monitoring of the near-field device/far-field device.
其中,设备发现的过程可以包括:接收设备(近场设备/远场设备)的上线/下线事件,并更新设备管理表中设备对应的状态信息。设备断连时,将媒体数据变更记录到数据同步状态表中。The process of device discovery may include: receiving online/offline events of devices (near-field devices/far-field devices), and updating status information corresponding to the devices in the device management table. When the device is disconnected, the media data changes are recorded in the data synchronization state table.
数据同步的过程可以包括:当本端设备与近场设备/远场设备连接时,本端设备向近场设备/远场设备发送数据同步请求,近场设备/远场设备从数据同步状态表中提取媒体对象同步状态,从媒体数据库中提取变更数据,同步给本端设备。示例性的,近场设备/远场设备可以新建相册集/相册表、媒体资产/相册关系对应表,依据设备管理表里面设备的链接状态,从相册集/相册表、媒体资产/相册关系对应表、MediaProvider数据库表中获取媒体文件元数据同步(全量同步、增量同步、实时同步)至本端设备,同时完成缩略图的同步。近场设备/远场设备首次上线时,与本端设备进行媒体元数据/缩略图的全量同步;近场设备/远场设备非首次上线时,与本端设备进行媒体元数据/缩略图的增量同步;近场设备/远场设备与本端设备为在线连接状态时,进行元数据/缩略图的实时同步。The process of data synchronization may include: when the local device is connected to the near-field device/far-field device, the local-end device sends a data synchronization request to the near-field device/far-field device, and the near-field device/far-field device retrieves the data from the data synchronization state table. Extract the synchronization status of the media object from the media database, extract the changed data from the media database, and synchronize it to the local device. Exemplarily, the near-field device/far-field device can create a new album set/album table, media asset/album relationship correspondence table, and according to the link status of the device in the device management table, from the album set/album table, media asset/album relationship correspondence table. The media file metadata synchronization (full synchronization, incremental synchronization, real-time synchronization) obtained from the table and MediaProvider database table is sent to the local device, and the synchronization of thumbnails is completed at the same time. When the near-field device/far-field device goes online for the first time, perform full synchronization of media metadata/thumbnail with the local device; when the near-field device/far-field device is not online for the first time, perform media metadata/thumbnail synchronization with the local device. Incremental synchronization; when the near-field device/far-field device and the local device are online, perform real-time synchronization of metadata/thumbnails.
另外,近场设备/远场设备与本端设备之间断联后可以进行异常恢复。示例性的,近场设备/远场设备依据设备管理表、数据同步状态表中的数据状态,获取相册集/相册表、媒体资产/相册关系对应表中的需要同步的增量元数据,同步给本端设备,并更新数据同步状态表。本端设备接收到同步的元数据后,完成本端设备的相册集/相册表、媒体资产/相册关系对应表的数据更新,并同步更新本地的近场设备/远场设备数据(MediaProvider的file表)。3、本端设备接收到近场设备/远场设备的缩略图同步后,将缩略图更新至缓冲区中。In addition, abnormal recovery can be performed after the near-field device/far-field device and the local device are disconnected. Exemplarily, the near-field device/far-field device obtains the incremental metadata that needs to be synchronized in the album set/album table, and the corresponding table of media assets/album relationship according to the data status in the device management table and the data synchronization status table, and synchronizes the data. To the local device, and update the data synchronization status table. After the local device receives the synchronized metadata, it completes the data update of the local device's album set/album table, media asset/album relationship correspondence table, and synchronously updates the local near-field device/far-field device data (MediaProvider file surface). 3. After the local device receives the synchronization of the thumbnails of the near-field device/far-field device, it updates the thumbnails to the buffer.
设备上线与数据同步的时序联系可以是:无设备上线(本地数据版本号(version) =0)时,不启动全量同步;不启动增量同步;清空数据状态表。设备首次上线时,可以执行全量同步;不主动启动增量同步;当本地设备的数据版本号大于远程设备数据版本号时实时同步会被拉起,即本地设备数据版本号大于远程设备数据版本号时,执行实时同步。设备非首次上线时,不会主动启动全量同步,当增量同步的结构化查询语言(structured query language,SQL)文件(SQL文件中包括更新的媒体文件的元数据)大于1兆字节(mb/M)时全量同步会被拉起,即当增量同步的SQL文件大于1M时可以启动全量同步。当确定进行全量同步时,本地设备数据版本号+1。当数据库(datebase,db)文件(例如,SQL文件)发送成功时,对端设备的数据版本号置为全量同步之前的本地设备数据版本号(即数据版本号)。当确定进行增量同步时,本地设备数据版本号+1;当SQL文件成功发送到对端时,对端设备的数据版本号置为当前的本地设备数据版本号(即数据版本号+1)。其中,数据版本号用于记录数据同步的次数,每同步一次,数据版本号可以加一(+1)。The timing relationship between device online and data synchronization may be: when no device is online (local data version number (version) = 0), full synchronization is not started; incremental synchronization is not started; and the data status table is cleared. When the device goes online for the first time, full synchronization can be performed; incremental synchronization is not initiated; when the data version number of the local device is greater than the data version number of the remote device, real-time synchronization will be pulled up, that is, the data version number of the local device is greater than the data version number of the remote device , perform real-time synchronization. When the device is not online for the first time, it will not automatically start full synchronization. When the incrementally synchronized structured query language (SQL) file (the SQL file includes the metadata of the updated media file) is larger than 1 megabyte (mb) /M), full synchronization will be started, that is, when the incrementally synchronized SQL file is larger than 1M, full synchronization can be started. When it is determined to perform full synchronization, the data version number of the local device is +1. When the database (datebase, db) file (eg, SQL file) is successfully sent, the data version number of the peer device is set to the data version number (ie, the data version number) of the local device before full synchronization. When it is determined to perform incremental synchronization, the data version number of the local device is +1; when the SQL file is successfully sent to the peer, the data version number of the peer device is set to the current local device data version number (that is, the data version number + 1) . The data version number is used to record the number of data synchronizations, and the data version number can be incremented by one (+1) for each synchronization.
示例性的,在远场通信中,如图10B所示,手机100的设备管理模块004可以通过设备云服务器与手机200的设备管理模块004进行设备发现。手机100的跨设备传输模块006可以通过点对点(peer to peer,P2P)服务器与手机200的跨设备传输模块006建立设备连接,进而远场设备(即手机100和手机200)之间可以直接进行数据传输。其中,远场设备之间可以采用远场设备通信协议进行通信,远场设备通信协议包括以太网、2/3/4/5G等。设备管理模块004还可以用于确定远场设备之间进行通信时的具体的消息格式、传输速率、协议规范等。Exemplarily, in the far-field communication, as shown in FIG. 10B , the device management module 004 of the mobile phone 100 may perform device discovery with the device management module 004 of the mobile phone 200 through the device cloud server. The cross-device transmission module 006 of the mobile phone 100 can establish a device connection with the cross-device transmission module 006 of the mobile phone 200 through a peer-to-peer (P2P) server, so that data can be directly performed between the far-field devices (that is, the mobile phone 100 and the mobile phone 200). transmission. Among them, the far-field device communication protocol can be used for communication between the far-field devices, and the far-field device communication protocol includes Ethernet, 2/3/4/5G, and the like. The device management module 004 can also be used to determine the specific message format, transmission rate, protocol specification, etc. when communicating between far-field devices.
其中,P2P服务器可以采用网络地址转换(network address translation,NAT)会话穿透效用(session traversal utilities for NAT,STUN)和使用中继穿透NAT(traversal using relays around NAT,TURN)等技术为两台远场设备建立连接,能够实现两台远场设备(例如,手机100和手机200)之间进行P2P通信(即直接进行通信)。Among them, the P2P server can adopt technologies such as network address translation (NAT) session traversal utilities for NAT (STUN) and traversal using relays around NAT (TURN). The far-field device establishes a connection, which can implement P2P communication (ie, direct communication) between two far-field devices (for example, the mobile phone 100 and the mobile phone 200 ).
示例性的,在近场通信中,手机100和手机200可以接入同一局域网(例如,蓝牙局域网或WIFI局域网),设备管理模块004可以基于局域网与手机200的设备管理模块004进行信息交互,从而可以对近场设备进行管理。手机100的跨设备传输模块006可以基于局域网与手机200的跨设备传输模块006进行信息交互,从而可以与近场设备进行数据传输。近场设备之间可以采用近场设备通信协议进行通信,近场设备通信协议包括WIFI、蓝牙(bluetooth,BT)、低能耗蓝牙(bluetooth low energy,BLE)、NFC、红外(线)、通用串行总线(universal serial bus,USB)中的至少一个。设备管理模块004还可以用于确定近场设备之间进行通信时的具体的消息格式、传输速率、协议规范等。Exemplarily, in the near field communication, the mobile phone 100 and the mobile phone 200 can access the same local area network (for example, a Bluetooth local area network or a WIFI local area network), and the device management module 004 can exchange information with the device management module 004 of the mobile phone 200 based on the local area network, thereby Near-field devices can be managed. The cross-device transmission module 006 of the mobile phone 100 can exchange information with the cross-device transmission module 006 of the mobile phone 200 based on the local area network, so as to perform data transmission with the near-field device. Near-field device communication protocols can be used for communication between near-field devices. Near-field device communication protocols include WIFI, bluetooth (BT), low energy bluetooth (BLE), NFC, infrared (wire), universal string At least one of the universal serial bus (USB). The device management module 004 can also be used to determine the specific message format, transmission rate, protocol specification, etc. when communicating between near-field devices.
在本申请实施例中,手机A和手机B连接后,可以进行数据同步。其中,数据同步包括全量同步和增量同步。In the embodiment of the present application, after the mobile phone A and the mobile phone B are connected, data synchronization can be performed. The data synchronization includes full synchronization and incremental synchronization.
如图11A所示,为一种数据同步的信号交互图,包括:As shown in Figure 11A, it is a signal interaction diagram of data synchronization, including:
s1a、手机A监听媒体元数据变更,记录变更状态。s1a. Mobile phone A monitors media metadata changes and records the change status.
s1b、手机A监听媒体元数据变更,记录变更状态。s1b. Mobile phone A monitors the change of media metadata and records the change status.
s1n、手机A监听媒体元数据变更,记录变更状态。s1n, mobile phone A monitors the change of media metadata and records the change status.
手机A中的分布式数据库的状态树可以一直监听媒体元数据是否变更,记录变更 状态。例如,用户通过手机A拍摄了一张照片后,媒体元数据会发生变更,状态树可以监听到媒体元数据变更,并记录该照片的数据。The state tree of the distributed database in mobile phone A can always monitor whether the media metadata is changed, and record the change state. For example, after the user takes a photo through mobile phone A, the media metadata will be changed, and the state tree can monitor the change of the media metadata and record the data of the photo.
手机A和手机B首次连接时,可以执行步骤s2和步骤s3。When mobile phone A and mobile phone B are connected for the first time, step s2 and step s3 can be performed.
s2、手机A与手机B之间进行全量数据同步(即全量同步)。s2. Perform full data synchronization between mobile phone A and mobile phone B (that is, full synchronization).
全量同步是指设备之间进行的全部媒体元数据、用户账号以及设备属性信息的跨设备同步。Full synchronization refers to the cross-device synchronization of all media metadata, user accounts, and device attribute information between devices.
s3、手机A的状态树记录同步状态。s3. The state tree of mobile phone A records the synchronization state.
手机A的状态树可以记录手机B的全部媒体元数据、用户账号以及设备属性信息等。The state tree of mobile phone A can record all the media metadata, user account and device attribute information of mobile phone B.
手机A和手机B后续连接(第n次连接,n大于等于2)时,可以执行步骤s4-步骤s6。When the mobile phone A and the mobile phone B are subsequently connected (the nth connection, n is greater than or equal to 2), steps s4 to s6 may be performed.
s4、手机A的状态树获取增量同步列表。s4. The state tree of mobile phone A obtains the incremental synchronization list.
其中,增量同步列表是上一次(前一次)同步之后的音频、视频、图片、文件等媒体对象的变更信息列表,包括文件名、路径、创建时间、修改实现、大小、播放时长等。The incremental synchronization list is a list of change information of media objects such as audio, video, pictures, and files after the last (previous) synchronization, including file name, path, creation time, modification implementation, size, playback duration, etc.
s5、手机A与手机B之间进行增量数据同步(即增量同步)。s5. Perform incremental data synchronization (ie, incremental synchronization) between mobile phone A and mobile phone B.
增量同步是设备连接断开后,再次连接时,设备上变更媒体资产的元数据的跨设备同步,同步内容包含变更数据、用户账号、设备信息以及变更类型(例如,增加、修改、删除)。Incremental synchronization is the cross-device synchronization of the metadata of the changed media assets on the device after the device is disconnected and connected again. The synchronization content includes the changed data, user account, device information, and change type (for example, add, modify, delete) .
s6、手机A的状态树更新同步状态。s6. The state tree of mobile phone A updates the synchronization state.
需要说明的是,手机A和手机B可以进行近场通信或远场通信。近场通信可以通过路由器等设备完成设备间信息交互。远场通信可以通过服务器完成设备间信息交互。It should be noted that the mobile phone A and the mobile phone B can perform near field communication or far field communication. Near field communication can complete information exchange between devices through routers and other devices. Far-field communication can complete the information exchange between devices through the server.
需要注意的是,手机A和手机B的通信方式不是固定的,可以动态切换。例如用户在公司通过手机A控制家里的手机B时,手机A和手机B进行远场通信,采用远场设备通信协议。如果用户回到家中,手机A和手机B都接入到了家庭路由器网络中,此时手机A和手机B进行近场通信,采用近场设备通信协议。It should be noted that the communication mode of mobile phone A and mobile phone B is not fixed and can be dynamically switched. For example, when the user controls the mobile phone B at home through the mobile phone A in the company, the mobile phone A and the mobile phone B perform far-field communication, using the far-field device communication protocol. If the user returns home, both mobile phone A and mobile phone B are connected to the home router network. At this time, mobile phone A and mobile phone B perform near field communication using the near field device communication protocol.
示例性的,如图11B所示,以本端设备(手机A)与近场设备(手机B)之间进行全量同步的过程为例,包括以下步骤:Exemplarily, as shown in FIG. 11B , taking the process of performing full synchronization between the local device (mobile phone A) and the near-field device (mobile phone B) as an example, the following steps are included:
S101、本端设备(手机A)与近场设备(手机B)进行设备上下线管理。S101, the local device (mobile phone A) and the near-field device (mobile phone B) perform device online and offline management.
当本端设备(手机A)与近场设备(手机B)与首次连接时,本端设备可以接收近场设备的设备上线/下线事件。如果本端设备的设备管理表中没有近场设备相关的信息,可以进行全量同步。When the local device (mobile phone A) and the near-field device (mobile phone B) are connected for the first time, the local device can receive the device online/offline events of the near-field device. If there is no near-field device related information in the device management table of the local device, full synchronization can be performed.
S102、本端设备向近场设备发送上线通知。S102, the local device sends an online notification to the near-field device.
S103、近场设备收到本地设备的上线通知后,可以将MediaProvider中的数据库文件(媒体文件的元数据)同步给本地设备,相关的缩略图文件也同时同步给本地设备。S103 , after receiving the online notification from the local device, the near-field device can synchronize the database file (the metadata of the media file) in the MediaProvider to the local device, and also synchronize the related thumbnail files to the local device at the same time.
S104、本端设备接收到近场设备的缩略图同步后,将缩略图更新至缓冲区中。S104 , after receiving the synchronization of the thumbnails of the near-field devices, the local device updates the thumbnails to the buffer.
S105、本端设备向近端设备发送缩略图同步状态通知。S105: The local device sends a thumbnail synchronization status notification to the near-end device.
S106、本端设备接收近场设备的数据库文件。S106, the local device receives the database file of the near-field device.
示例性的,本端设备将近场设备的数据库文件存入本端设备的MediaProvider的文 件目录下,可以以设备管理表中的self_id命名本端设备的近场设备数据库。Exemplarily, the local device stores the database file of the near-field device in the file directory of the MediaProvider of the local device, and the near-field device database of the local device can be named with the self_id in the device management table.
S107、本端设备向近端设备发送元数据同步状态通知。S107: The local device sends a metadata synchronization state notification to the near-end device.
S108、本端设备更新设备状态表。S108, the local device updates the device status table.
本端设备可以将近端设备当前的状态信息写入设备管理表中。The local device can write the current state information of the near-end device into the device management table.
如图11C所示,增量同步可以包括以下步骤:As shown in Figure 11C, incremental synchronization may include the following steps:
S201、本端设备(手机A)与近场设备(手机B)进行设备上下线管理。S201, the local device (mobile phone A) and the near-field device (mobile phone B) perform device online and offline management.
当本端设备(手机A)与近场设备(手机B)与后续连接时,本端设备可以接收近场设备的设备上线/下线事件。如果本端设备的设备管理表中已经有当前近场端设备相关的信息,进行增量同步。When the local device (mobile phone A) and the near field device (mobile phone B) are subsequently connected, the local device can receive the device online/offline events of the near field device. If the device management table of the local device already has information related to the current near-field device, perform incremental synchronization.
S202、本端设备向近场设备发送增量同步请求。S202, the local device sends an incremental synchronization request to the near-field device.
S203、近场设备向本端设备发送变更数据的SQL语句和缩略图。S203, the near-field device sends an SQL statement and a thumbnail image of the changed data to the local device.
其中,变更数据的SQL语句中包括更新的媒体文件的元数据。其中,SQL文件是数据库脚本文件,是用于数据库中的标准数据查询语言。SQL文件中包括SQL语句。将SQL文件同步到对端设备后,在对端设备执行SQL文件,可以将更新的媒体文件的元数据刷新到对端设备的数据库中。Wherein, the SQL statement for changing the data includes the metadata of the updated media file. The SQL file is a database script file, which is a standard data query language used in the database. SQL statements are included in the SQL file. After synchronizing the SQL file to the peer device, and executing the SQL file on the peer device, the metadata of the updated media file can be refreshed to the database of the peer device.
近场设备收到本地设备的上线通知后,近场设备从设备状态表中读取设备数据版本号,并与同步状态表中变更的数据的数据版本号进行对比,生成数据变更的SQL语句存入文本文件,并获取变更数据的缩略图,然后通过数据传输通道,完成元数据和缩略图的同步。After the near-field device receives the online notification from the local device, the near-field device reads the device data version number from the device status table, compares it with the data version number of the changed data in the synchronization status table, and generates the SQL statement for the data change. Enter the text file, and obtain the thumbnail of the changed data, and then complete the synchronization of the metadata and the thumbnail through the data transmission channel.
S204、本端设备的分布式数据库解析SQL文件,将更新的元数据插入数据库中。S204, the distributed database of the local device parses the SQL file, and inserts the updated metadata into the database.
本端设备接收到近场设备同步的变更元数据的SQL语句的文本后,可以对文本进行解析并执行SQL语句,更新本端设备中近场数据库中的相册集/相册表、媒体资产/相册关系对应表等表相应的数据。另外,当增量同步的SQL文件的大小大于1M时,可以执行全量同步。After the local device receives the text of the SQL statement for changing metadata synchronized by the near-field device, it can parse the text and execute the SQL statement to update the album set/album table, media assets/album in the near-field database of the local device Corresponding data in relational tables and other tables. In addition, when the size of the incrementally synchronized SQL file is greater than 1M, full synchronization can be performed.
S205、本端设备向近端设备发送元数据同步状态通知。S205: The local device sends a metadata synchronization state notification to the near-end device.
S206、本端设备接收到近场设备的缩略图同步后,将缩略图更新至缓冲区中。S206 , after receiving the synchronization of the thumbnails of the near-field devices, the local device updates the thumbnails to the buffer.
S207、本端设备向近端设备发送缩略图同步状态通知。S207: The local device sends a thumbnail synchronization status notification to the near-end device.
S208、本端设备将近端设备当前的状态信息写入设备管理表中。S208, the local device writes the current state information of the near-end device into the device management table.
在一种可能的实现方式中,手机A和手机B连接后,可以进行数据的实时同步。数据的实时同步是设备保持连接状态时,用户操作(例如,下载图片、拍照等)导致媒体数据变化时,实时进行跨设备同步,同步内容包含变更的媒体数据、用户账号、设备信息以及变更类型等。In a possible implementation manner, after mobile phone A and mobile phone B are connected, real-time data synchronization can be performed. The real-time synchronization of data is to perform cross-device synchronization in real time when the media data changes due to user operations (such as downloading pictures, taking pictures, etc.) while the device remains connected. The synchronization content includes the changed media data, user account, device information, and change type. Wait.
实时同步需要满足以下至少一个前置条件:1)当本地的设备数据版本号等于远端设备数据版本号时可以进行实时同步。如果本地设备的数据版本号大于远端设备的数据版本号时,可以进行增量同步。2)在进行实时同步时,当本地数据版本号等于0时,可以将数据状态表和对端设备状态表清空。Real-time synchronization needs to meet at least one of the following preconditions: 1) When the local device data version number is equal to the remote device data version number, real-time synchronization can be performed. If the data version number of the local device is greater than that of the remote device, incremental synchronization can be performed. 2) During real-time synchronization, when the local data version number is equal to 0, the data status table and the peer device status table can be cleared.
如图11D所示,为一种数据的实时同步的信号交互图,包括:As shown in FIG. 11D , it is a signal interaction diagram of real-time synchronization of data, including:
1101、手机A的应用程序向手机A的统一操作框架申请增加/删除/修改媒体文件。1101. The application program of the mobile phone A applies to the unified operation framework of the mobile phone A for adding/deleting/modifying media files.
手机A和手机B处于连接状态时,实时同步可以由用户应用程序(例如,文件管 理器)对文件的操作所触发。或者,实时同步也可以间隔预设时间自动触发。其中,媒体文件可以包括图片、视频、音频、文档等文件。应用程序可以包括第三方应用(例如,
Figure PCTCN2021136803-appb-000010
)和系统应用(例如,相机应用)。
When mobile phone A and mobile phone B are in a connected state, real-time synchronization can be triggered by an operation of a file by a user application (eg, a file manager). Alternatively, real-time synchronization can also be triggered automatically at preset time intervals. The media files may include files such as pictures, videos, audios, and documents. Applications can include third-party applications (eg,
Figure PCTCN2021136803-appb-000010
) and system applications (eg, camera applications).
举例来说,若用户通过手机A的相机拍摄了一种照片,相机应用可以向统一操作框架申请增加新拍摄的照片。For example, if the user takes a photo through the camera of mobile phone A, the camera application can apply to the unified operation framework to add a new photo.
手机A可以依据设备管理表里面设备的链接状态,从相册集/相册表、媒体资产/相册关系对应表、MediaProvider数据库表中获取媒体文件发生变更的元数据写入SQL文件中,实时同步至手机B,同时完成缩略图的同步。手机A具体可以执行以下步骤:According to the link status of the devices in the device management table, mobile phone A can obtain the metadata of the changed media files from the album set/album table, the media asset/album relationship correspondence table, and the MediaProvider database table, write it into the SQL file, and synchronize it to the mobile phone in real time. B, the synchronization of thumbnails is completed at the same time. Mobile phone A can perform the following steps:
1102、手机A的统一操作框架通知手机A的分布式数据库更新媒体元数据。1102. The unified operation framework of the mobile phone A notifies the distributed database of the mobile phone A to update the media metadata.
例如,可以在手机A的分布式数据库新增用户拍摄的照片的媒体元数据,例如用户拍摄的照片的尺寸大小、存储位置等。For example, media metadata of photos taken by the user may be added to the distributed database of mobile phone A, such as the size and storage location of the photos taken by the user.
1103、手机A的分布式数据库通知手机A的分布式存储模块更新媒体文件。1103. The distributed database of the mobile phone A notifies the distributed storage module of the mobile phone A to update the media file.
手机A的分布式存储模块存储用户拍摄的照片。The distributed storage module of the mobile phone A stores the photos taken by the user.
1104、手机A的分布式数据库通知手机B的统一操作框架同步变更的媒体元数据。1104. The distributed database of mobile phone A notifies the unified operation framework of mobile phone B of the synchronously changed media metadata.
变更的媒体元数据可以包含在SQL文件中,手机B接收到手机A同步的SQL文件后,根据变更情况,完成手机B的相册集/相册表、媒体资产/相册关系对应表的数据更新,并同步更新本地的近场设备数据(MediaProvider的file表)。其中,MediaProvider中存储图片、视频、音频等多媒体文件的信息,提供了基本的增删改查等相关方法,可以供视频播放器、音乐播放器、图库等应用程序使用。The changed media metadata can be included in the SQL file. After mobile phone B receives the SQL file synchronized by mobile phone A, it completes the data update of mobile phone B's album set/album table and the corresponding table of media assets/album relationship according to the changes, and Synchronously update the local near-field device data (MediaProvider's file table). Among them, MediaProvider stores information of multimedia files such as pictures, videos, and audios, and provides basic methods such as addition, deletion, modification, and search, which can be used by applications such as video players, music players, and galleries.
步骤1103和步骤1104可以同时执行。Step 1103 and step 1104 may be performed simultaneously.
1105、手机B的统一操作框架通知手机B的分布式数据库更新变更的媒体元数据。1105. The unified operation framework of the mobile phone B notifies the distributed database of the mobile phone B to update the changed media metadata.
1106、手机B的分布式数据库向手机A的分布式数据库请求原始媒体文件(原始媒体数据)的第一类型的缩略图。1106. The distributed database of the mobile phone B requests the first type of thumbnails of the original media file (original media data) from the distributed database of the mobile phone A.
其中,原始媒体文件例如可以是图片的原图,视频的原文件、音频的原文件等。原始媒体文件的缩略图例如可以是图片的缩略图,音频、视频的封面缩略图等。原始媒体文件的缩略图根据大小可以分为两种类型,第一类型的缩略图的大小可以在10~20K之间,例如可以为10K、15K或20K。第一类型的缩略图的分辨率可以为256*256。第二类型的缩略图参见步骤1109的说明。The original media file may be, for example, an original image of a picture, an original file of a video, an original file of an audio, and the like. The thumbnail of the original media file may be, for example, a thumbnail of a picture, a thumbnail of a cover of an audio or video, and the like. The thumbnails of the original media files can be classified into two types according to their sizes. The size of the thumbnails of the first type can be between 10K and 20K, for example, 10K, 15K or 20K. The resolution of the first type of thumbnails may be 256*256. Refer to the description of step 1109 for the second type of thumbnails.
1107、手机A的分布式数据库向手机B的分布式数据库发送原始媒体文件的第一类型的缩略图。1107. The distributed database of mobile phone A sends the first type of thumbnail images of the original media file to the distributed database of mobile phone B.
1108、手机B的分布式数据库向手机B的分布式存储模块指示缓存原始媒体文件的第一类型的缩略图。1108. The distributed database of the mobile phone B instructs the distributed storage module of the mobile phone B to cache the thumbnails of the first type of the original media file.
手机B的分布式存储模块可以将原始媒体文件的第一类型的缩略图缓存(缓存过程用户不感知)至缓冲区中。其中,缓存表示数据读取(拉取)完成后的状态。The distributed storage module of the mobile phone B can cache the thumbnails of the first type of the original media files (the user does not perceive the caching process) into the buffer. Among them, the cache represents the state after the data reading (pulling) is completed.
1109、手机B的分布式数据库向手机A的分布式数据库请求原始媒体文件的第二类型的缩略图。1109. The distributed database of the mobile phone B requests the second type of thumbnail images of the original media file from the distributed database of the mobile phone A.
其中,原始媒体文件的第二类型的缩略图的大小约为200K,例如可以为150K、180K、200K、230K等。The size of the thumbnail of the second type of the original media file is about 200K, for example, it can be 150K, 180K, 200K, 230K and so on.
1110、手机A的分布式数据库向手机B的分布式数据库发送原始媒体文件的第二 类型的缩略图。1110. The distributed database of mobile phone A sends the second-type thumbnail of the original media file to the distributed database of mobile phone B.
1111、手机B的分布式数据库向手机B的分布式存储模块指示缓存原始媒体文件的第二类型的缩略图。1111. The distributed database of the mobile phone B instructs the distributed storage module of the mobile phone B to cache the second type of thumbnails of the original media file.
手机B的分布式存储模块指示缓存原始媒体文件的第二类型的缩略图。The distributed storage module of the mobile phone B instructs to cache the thumbnails of the second type of the original media files.
1112、手机B的统一操作框架通知手机B的应用程序媒体文件发生变更。1112. The unified operation framework of the mobile phone B notifies that the application media file of the mobile phone B is changed.
假设手机A与手机B建立连接,如图11E中的(a)所示,响应于用户在手机B上点击拍照按钮501的操作,如图11E中的(b)所示,可以得到照片502。基于图11E所示的实时同步方法,如图11E中的(c)所示,手机B新拍摄的照片(原图)的第一类型的缩略图(即图片503)可以实时更新到手机A的界面上。并且,图片503的第二类型的缩略图也可以缓存到手机A中,这样,用户点击图片503时,可以查看更大更清晰的图片。Assuming that mobile phone A and mobile phone B are connected, as shown in (a) of FIG. 11E, in response to the user's operation of clicking the camera button 501 on mobile phone B, as shown in (b) of FIG. 11E, a photo 502 can be obtained. Based on the real-time synchronization method shown in FIG. 11E , as shown in (c) of FIG. 11E , the first type of thumbnail (ie, picture 503 ) of the photo (original image) newly taken by mobile phone B can be updated in real time to mobile phone A’s on the interface. In addition, the second-type thumbnail of the picture 503 can also be cached in the mobile phone A, so that when the user clicks on the picture 503, a larger and clearer picture can be viewed.
这样,无需在每个设备上都存储一份其他设备的原始媒体文件,仅需在每个设备上缓存其他设备的原始媒体文件的缩略图(第一类型的缩略图、第二类型的缩略图),可以降低个人设备容量爆盘的风险,也可以避免将数据放在云端,在访问云端数据时需要重新下载(非常麻烦)的问题。In this way, instead of storing a copy of the original media files of other devices on each device, it is only necessary to cache the thumbnails of the original media files of other devices on each device (the first type of thumbnails, the second type of thumbnails ), which can reduce the risk of bursting the capacity of personal devices, and also avoid the problem of storing data in the cloud and re-downloading (very troublesome) when accessing cloud data.
又例如,如图8A中的(a)所示,响应于用户点击分享操作选项452的操作,手机A可以将手机B上的媒体文件分享至第三方应用程序或系统应用程序。手机A可以缺省分享媒体文件的第二类型的缩略图,或者由用户选择分享原始媒体文件。For another example, as shown in (a) of FIG. 8A , in response to the user clicking the share operation option 452, the mobile phone A can share the media files on the mobile phone B to a third-party application or a system application. The mobile phone A may share the second type of thumbnails of the media files by default, or the user may choose to share the original media files.
当实时同步成功时,本地设备可以更新设备状态表,将对端设备的数据版本号置为当前的本地设备数据版本号;当实时同步失败时,本地设备的数据版本号加一(+1)。When the real-time synchronization is successful, the local device can update the device status table and set the data version number of the peer device as the current local device data version number; when the real-time synchronization fails, the data version number of the local device is incremented by one (+1) .
为了实现用户跨设备进行媒体访问和在本地进行媒体访问的一致性体验,可以采用透明缓存技术。透明缓存技术可以在第一次读取文件时主动将文件缓存起来,如果下次用户又需要该文件,系统可以从本地缓存调取。透明缓存技术可以包括自动缓存、自动回写、自动老化和自动更新等过程。其中,自动缓存是指媒体库(media library)可以自动将远端设备的媒体文件缓存到本地。媒体库可以屏蔽媒体文件的位置差异,用户访问远端设备的文件和本地文件的方式是一样的,例如都可以基于通一资源标志符(uniform resource identifier,URI)或存储路径的方式访问。自动回写是指用户主动保存或应用自动保存媒体文件时,媒体库自动将保存的媒体文件同步到远端,替换远端的历史文件。自动老化是指媒体库自动将老化周期(例如,两周、一个月等)外的冷数据清除,无需开发者额外处理。自动更新是指远端设备的媒体文件被修改后,媒体库自动根据远端的新文件(修改后的文件)更新本地缓存。In order to achieve a consistent experience of media access across devices and local media access, transparent caching technology can be used. The transparent cache technology can actively cache the file when the file is read for the first time. If the user needs the file next time, the system can retrieve it from the local cache. Transparent caching technology can include processes such as automatic caching, automatic write-back, automatic aging and automatic update. The automatic caching means that the media library can automatically cache the media files of the remote device to the local. The media library can shield the location difference of media files, and users access the files of the remote device in the same way as the local files, for example, they can be accessed based on a uniform resource identifier (URI) or storage path. Auto-write-back means that when a user actively saves a media file or an application automatically saves a media file, the media library automatically synchronizes the saved media file to the remote end and replaces the remote historical file. Automatic aging means that the media library automatically clears the cold data outside the aging period (for example, two weeks, one month, etc.) without additional processing by the developer. Automatic update means that after the media file of the remote device is modified, the media library automatically updates the local cache according to the new file (modified file) of the remote end.
如图12所示,自动缓存过程可以包括步骤1201-步骤1203,其中:As shown in FIG. 12, the automatic caching process may include steps 1201-1203, wherein:
1201、手机A的分布式数据库向手机B的分布式数据库请求原始媒体文件的第二类型的缩略图。1201. The distributed database of mobile phone A requests the second type of thumbnail images of the original media file from the distributed database of mobile phone B.
手机A可以自动缓存部分媒体文件。例如,如图6A所示,手机可以自动缓存最近标签431下铺满屏幕的缩略图(第一类型的缩略图)对应的媒体文件(这里的媒体文件是指原始媒体文件的第二类型的缩略图)。如图6B所示,手机可以自动缓存图片标签432下铺满屏幕的媒体文件。如图6C所示,手机可以自动缓存视频标签433下铺满屏幕的媒体文件。如图6D所示,手机可以自动缓存图片标签434下铺满屏幕 的媒体文件。Phone A can automatically cache some media files. For example, as shown in FIG. 6A , the mobile phone can automatically cache the media files corresponding to the thumbnails (the first type of thumbnails) that fill the screen under the recent tab 431 (the media files here refer to the second type of thumbnails of the original media files). Sketch map). As shown in FIG. 6B , the mobile phone can automatically cache the media files covering the screen under the picture tag 432 . As shown in FIG. 6C , the mobile phone can automatically cache the media files that cover the screen under the video tag 433 . As shown in FIG. 6D , the mobile phone can automatically cache the media files that cover the screen under the picture tag 434.
在一种可能的设计中,手机A可以基于AI算法分析用户的喜好,行为习惯,预判用户的操作,提前将用户可能打开的跨设备媒体文件缓存到本地。In a possible design, mobile phone A can analyze the user's preferences and behavioral habits based on the AI algorithm, predict the user's operation, and cache the cross-device media files that the user may open locally in advance.
1202、手机B的分布式数据库向手机A的分布式数据库发送媒体文件。1202. The distributed database of the mobile phone B sends the media file to the distributed database of the mobile phone A.
1203、手机A的分布式数据库向手机A的分布式存储模块缓存媒体文件。1203. The distributed database of the mobile phone A caches the media files in the distributed storage module of the mobile phone A.
自动回写过程可以包括步骤1204-步骤1208,其中:The automatic write-back process may include steps 1204-1208, wherein:
1204、手机A的分布式数据库向手机A的分布式存储模块发送缓存文件(即缓存的媒体文件)内容编辑情况。1204. The distributed database of the mobile phone A sends the content editing information of the cached file (ie, the cached media file) to the distributed storage module of the mobile phone A.
1205、手机A的分布式数据库向手机B的分布式数据库发送缓存文件内容回写情况。1205. The distributed database of mobile phone A sends the write-back status of the content of the cache file to the distributed database of mobile phone B.
1206、手机B的分布式数据库向手机B的分布式存储模块通知更新媒体文件的内容。1206. The distributed database of the mobile phone B notifies the distributed storage module of the mobile phone B of the content of the updated media file.
手机B的分布式存储模块更新媒体文件的内容。The distributed storage module of the mobile phone B updates the content of the media file.
1207、手机B的分布式数据库更新媒体元数据。1207. The distributed database of the mobile phone B updates the media metadata.
1208、手机B的分布式数据库与手机A的分布式数据库进行媒体元数据同步。1208. Perform media metadata synchronization between the distributed database of the mobile phone B and the distributed database of the mobile phone A.
自动老化过程可以包括步骤1209,其中:The automatic aging process may include step 1209, wherein:
1209、手机A的分布式数据库通知手机A的分布式存储模块基于老化策略,老化缓存文件。1209. The distributed database of the mobile phone A notifies the distributed storage module of the mobile phone A to age the cache files based on the aging policy.
老化策略例如可以是每两周或者每个月清除冷数据(未使用过的数据)。例如,冷数据包括访问次数低于预设阈值的媒体文件的缩略图。The aging strategy may be, for example, purging cold data (unused data) every two weeks or every month. For example, the cold data includes thumbnails of media files whose access times are below a preset threshold.
自动更新过程可以包括步骤1210-步骤1215,其中:The automatic update process may include steps 1210-1215, wherein:
1210、手机B的分布式数据库向手机B的分布式存储模块发送本地(手机B本地)媒体文件更新情况。1210. The distributed database of the mobile phone B sends the local (mobile phone B local) media file update status to the distributed storage module of the mobile phone B.
手机B的分布式存储模块根据本地(手机B本地)媒体文件更新情况更新媒体文件。The distributed storage module of the mobile phone B updates the media files according to the update situation of the local (mobile phone B local) media files.
1211、手机B的分布式数据库更新媒体元数据。1211. The distributed database of the mobile phone B updates the media metadata.
手机B的分布式数据库可以根据本地媒体文件更新情况更新相应的媒体元数据。The distributed database of the mobile phone B can update the corresponding media metadata according to the update situation of the local media files.
1212、手机B的分布式数据库向手机A的分布式数据库同步媒体元数据。1212. The distributed database of the mobile phone B synchronizes the media metadata with the distributed database of the mobile phone A.
1213、手机A的分布式数据库向手机B的分布式数据库请求更新后的媒体文件。1213. The distributed database of mobile phone A requests the updated media file from the distributed database of mobile phone B.
更新后的媒体文件是指更新后的原始媒体文件的第二类型的缩略图。The updated media file refers to the second type of thumbnails of the updated original media file.
1214、手机B的分布式数据库向手机A的分布式数据库发送更新后的媒体文件。1214. The distributed database of the mobile phone B sends the updated media file to the distributed database of the mobile phone A.
1215、手机A的分布式数据库通知手机A的分布式存储模块更新缓存文件。1215. The distributed database of the mobile phone A notifies the distributed storage module of the mobile phone A to update the cache file.
手机A的分布式存储模块可以根据更新后的媒体文件更新之前(上一次缓存)的缓存文件。The distributed storage module of the mobile phone A can update the previous (last cached) cache file according to the updated media file.
为了实现跨设备播放能够达到类本地播放的高性能用户体验,可以采用轻量流传输技术。轻量流传输包括首次播放阶段和缓冲播放阶段。In order to achieve a high-performance user experience similar to local playback for cross-device playback, a lightweight streaming technology can be used. Lightweight streaming includes a first-play phase and a buffered-play phase.
如图13所示,首次播放阶段可以包括步骤1301-步骤1307,其中:As shown in Figure 13, the first play stage may include steps 1301-1307, wherein:
1301、手机A的应用程序向手机A的统一操作框架请求播放远端媒体文件。1301. The application program of the mobile phone A requests the unified operation framework of the mobile phone A to play the remote media file.
用户在手机A首次点击远端媒体文件(例如,手机B的一个视频)的播放按钮后, 手机A的应用程序可以向手机A的统一操作框架请求播放远端媒体文件。如图14中的(a)所示,响应于用户在界面430点击所有视频490的操作,如图14中的(b)所示,手机可以显示所有视频界面491,响应于用户在界面491点击视频492(时长为10s)的操作,如图14中的(c)所示,手机可以显示界面493,界面493中可以包括播放按钮494,响应于用户首次点击播放按钮494的操作,手机A的应用程序可以向手机A的统一操作框架请求播放远端媒体文件(即视频492)。After the user clicks the play button of the remote media file (eg, a video of the mobile phone B) for the first time on the mobile phone A, the application program of the mobile phone A can request the unified operation framework of the mobile phone A to play the remote media file. As shown in (a) of FIG. 14 , in response to the user's operation of clicking all videos 490 on the interface 430 , as shown in (b) of FIG. 14 , the mobile phone can display all the video interfaces 491 , in response to the user clicking on the interface 491 For the operation of the video 492 (the duration is 10s), as shown in (c) in Figure 14, the mobile phone can display an interface 493, and the interface 493 can include a play button 494. In response to the operation of the user clicking the play button 494 for the first time, the mobile phone A's The application can request the unified operation framework of the mobile phone A to play the remote media file (ie the video 492 ).
1302、手机A的统一操作框架从手机A的分布式存储模块获取媒体文件资源。1302. The unified operation framework of the mobile phone A obtains the media file resources from the distributed storage module of the mobile phone A.
1303、手机A的分布式存储模块向手机A的统一操作框架请求启动流代理。其中,流代理即流服务器代理,可以将跨设备拉取的媒体文件信息封装成流媒体格式,发送给应用程序。应用程序不感知媒体信息跨设备传输过程。1303. The distributed storage module of the mobile phone A requests the unified operation framework of the mobile phone A to start the streaming agent. The streaming proxy is the streaming server proxy, which can encapsulate the media file information pulled across the devices into a streaming media format and send it to the application. The application is unaware of the transfer of media information across devices.
1304、手机A的分布式存储模块从手机B的分布式存储模块获取媒体文件并缓存。1304. The distributed storage module of mobile phone A obtains and caches the media file from the distributed storage module of mobile phone B.
手机A的分布式存储模块可以分m次从手机B的分布式存储模块获取媒体文件(例如,视频文件)并缓存。其中,m为大于等于2的整数。The distributed storage module of mobile phone A may obtain media files (eg, video files) from the distributed storage module of mobile phone B in m times and cache them. Among them, m is an integer greater than or equal to 2.
1305、手机A的统一操作框架向手机A的应用程序返回缓存的媒体文件的URL。1305. The unified operation framework of the mobile phone A returns the URL of the cached media file to the application program of the mobile phone A.
1306、手机A的统一操作框架从手机A的分布式存储模块读取缓冲数据。1306. The unified operation framework of the mobile phone A reads the buffered data from the distributed storage module of the mobile phone A.
手机A的统一操作框架可以从手机A的分布式存储模块分m次读取缓冲数据(缓冲的媒体数据)。The unified operation framework of the mobile phone A can read the buffered data (buffered media data) from the distributed storage module of the mobile phone A in m times.
1307、手机A的应用程序以流媒体方式播放远端媒体文件。1307. The application program of the mobile phone A plays the remote media file in a streaming media manner.
手机A的应用程序从手机A的统一操作框架分m次获取缓冲数据,并可以分m次播放缓冲的媒体文件。The application program of the mobile phone A obtains the buffered data in m times from the unified operation framework of the mobile phone A, and can play the buffered media file in m times.
缓冲播放阶段可以包括步骤1308-步骤1310,其中:The buffer playback stage may include steps 1308-1310, wherein:
1308、手机A的应用程序可以向手机A的统一操作框架请求播放远端媒体文件。1308. The application program of the mobile phone A may request the unified operation framework of the mobile phone A to play the remote media file.
用户在手机A再次点击远端媒体文件的播放按钮后,手机A的应用程序可以向手机A的统一操作框架请求播放远端媒体文件。After the user clicks the play button of the remote media file on the mobile phone A again, the application program of the mobile phone A can request the unified operation framework of the mobile phone A to play the remote media file.
1309、手机A的统一操作框架从手机A的分布式存储模块获取媒体文件资源。1309. The unified operation framework of the mobile phone A obtains the media file resources from the distributed storage module of the mobile phone A.
1310、手机A的分布式存储模块向手机A的应用程序返回缓冲文件的URI,手机A的应用程序直接播放远端媒体文件。1310. The distributed storage module of the mobile phone A returns the URI of the buffered file to the application program of the mobile phone A, and the application program of the mobile phone A directly plays the remote media file.
这样,播放端无需等待媒体文件(例如,原始视频文件)完整下载后再启动播放,可以实时播放,从而可以实现类本地播放的高性能用户体验。In this way, the playback end does not need to wait for the media file (for example, the original video file) to be completely downloaded before starting playback, and can play in real time, thereby realizing a high-performance user experience similar to local playback.
如图15所示,本申请实施例提供一种数据同步方法,包括:As shown in FIG. 15 , an embodiment of the present application provides a data synchronization method, including:
1501、第一设备获取媒体文件更新事件;其中,媒体文件更新事件用于增加、修改或删除第一媒体文件。1501. The first device acquires a media file update event; wherein the media file update event is used to add, modify or delete a first media file.
其中,媒体文件更新事件可以是用户触发的,或第一设备基于预设策略自动触发的。需要说明的是,用户可以在第一设备触发本地媒体文件的更新事件,或者可以在其他设备(与第一设备连接的设备,例如第二设备)触发第一设备的本地媒体文件的更新事件。The media file update event may be triggered by a user, or automatically triggered by the first device based on a preset policy. It should be noted that the user can trigger an update event of the local media file on the first device, or can trigger an update event of the local media file of the first device on another device (a device connected to the first device, such as a second device).
其中,第一媒体文件包括图片、视频、音频、文档中的至少一种。Wherein, the first media file includes at least one of pictures, videos, audios, and documents.
1502、第一设备更新元数据库中第一媒体文件对应的元数据,并更新媒体库中第一媒体文件的缩略图。1502. The first device updates the metadata corresponding to the first media file in the metadata database, and updates the thumbnail image of the first media file in the media library.
其中,元数据库中存储有第一设备的全部媒体文件对应的元数据,媒体库中存储有第一设备的全部媒体文件的缩略图。其中,元数据库可以参考上文关于分布式数据库的相关描述,媒体库可以参考上文关于分布式存储模块的描述,在此不做赘述。The metadata database stores metadata corresponding to all media files of the first device, and the media library stores thumbnail images of all media files of the first device. For the metadata database, reference may be made to the above description about the distributed database, and for the media library, reference may be made to the above description about the distributed storage module, which will not be repeated here.
其中,第一媒体文件的缩略图包括第一类型的缩略图,第一类型的缩略图的大小范围为10K~20K。The thumbnails of the first media files include thumbnails of the first type, and the size of the thumbnails of the first type ranges from 10K to 20K.
1503、第一设备向第二设备发送同步消息,同步消息包括第一媒体文件对应的元数据和第一媒体文件的缩略图。1503. The first device sends a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and a thumbnail image of the first media file.
同步消息还包括用户账号、第一设备的设备信息以及第一媒体文件的更新类型中的至少一种,第一媒体文件的更新类型包括增加、修改或删除。The synchronization message further includes at least one of a user account, device information of the first device, and an update type of the first media file, where the update type of the first media file includes addition, modification, or deletion.
在一种可能的设计中,第一设备接收第一请求消息,第一请求消息用于请求第二类型的缩略图,第二类型的缩略图的大小范围为100K~300K;第一设备向第二设备发送第二类型的缩略图。In a possible design, the first device receives a first request message, where the first request message is used to request a second type of thumbnail image, and the size of the second type of thumbnail image ranges from 100K to 300K; The second device sends a second type of thumbnail image.
在一种可能的设计中,第一设备可以基于AI算法分析用户的喜好、行为习惯;根据用户的喜好、行为习惯预判用户需要操作的媒体文件;将用户需要操作的媒体文件的第二类型的缩略图发送给第二设备。In a possible design, the first device may analyze the user's preferences and behavioral habits based on an AI algorithm; predict the media files that the user needs to operate according to the user's preferences and behavioral habits; The thumbnail is sent to the second device.
在一种可能的设计中,第一设备与第二设备首次连接时,第一设备将第一设备的全部媒体文件对应的元数据和全部媒体文件对应的缩略图同步给第二设备。In a possible design, when the first device is connected to the second device for the first time, the first device synchronizes the metadata corresponding to all media files of the first device and the thumbnail images corresponding to all media files to the second device.
在一种可能的设计中,第一设备与第二设备第N次连接时,第一设备将上一次同步后第一设备上更新的媒体文件对应的元数据和更新的媒体文件对应的缩略图同步给第二设备。其中,N为大于或等于2的整数。In a possible design, when the first device is connected to the second device for the Nth time, the first device stores the metadata corresponding to the media file updated on the first device after the last synchronization and the thumbnail image corresponding to the updated media file Sync to the second device. Wherein, N is an integer greater than or equal to 2.
在一种可能的设计中,第一设备基于预设周期删除缓存的媒体文件中的冷数据。例如,冷数据包括访问次数低于预设阈值的媒体文件的缩略图。In a possible design, the first device deletes the cold data in the cached media file based on a preset period. For example, the cold data includes thumbnails of media files whose access times are below a preset threshold.
在一种可能的设计中,第一设备首次播放第二设备的媒体文件时,启动流服务器代理,流服务器代理用于将第二设备的媒体文件封装成流媒体格式;第一设备通过流服务器代理分m次从第二设备获取第二设备的媒体文件并缓存;其中,m为大于等于2的整数;第一设备播放缓存数据。In a possible design, when the first device plays the media file of the second device for the first time, the streaming server proxy is started, and the streaming server proxy is used to encapsulate the media file of the second device into a streaming media format; The agent obtains the media files of the second device from the second device in m times and caches them; where m is an integer greater than or equal to 2; the first device plays the cached data.
在一种可能的设计中,第一设备第N次播放第二设备的媒体文件时,获取第二设备的媒体文件的URI,根据URI获取缓存数据并播放;其中,N为大于等于2的整数。In a possible design, when the first device plays the media file of the second device for the Nth time, the URI of the media file of the second device is obtained, and the cached data is obtained and played according to the URI; wherein, N is an integer greater than or equal to 2 .
在一种可能的设计中,第一设备显示包含第二设备的标识的第一界面;响应于用户在第一界面点击第二设备的标识的操作,第一设备显示第二界面,第二界面包括第二设备的至少一种类型的媒体文件的一个或多个缩略图。In a possible design, the first device displays a first interface containing the logo of the second device; in response to the user's operation of clicking the logo of the second device on the first interface, the first device displays a second interface, and the second interface One or more thumbnail images of at least one type of media file of the second device are included.
在一种可能的设计中,第一界面或第二界面包括搜索控件,响应于用户点击搜索控件后输入关键词的操作,第一设备显示第三界面,第三界面包括从第一设备和第二设备搜索到的与关键词相关的媒体文件的标识。In a possible design, the first interface or the second interface includes a search control, and in response to an operation of inputting a keyword after the user clicks on the search control, the first device displays a third interface, and the third interface includes data from the first device and the third interface. The identifier of the media file related to the keyword searched by the device.
在一种可能的设计中,响应于用户在第二界面点击第一缩略图的操作,第一设备显示第一弹框,第一弹框包括第一操作选项;响应于用户点击第一操作选项的操作,第一设备显示第二弹框,第二弹框包括一个或多个应用程序或设备标识;响应于用户点击一个应用程序或一个设备标识的操作,第一设备将第一缩略图分享至用户点击的应用程序或设备标识对应的设备。In a possible design, in response to the user's operation of clicking the first thumbnail on the second interface, the first device displays a first pop-up box, and the first pop-up box includes the first operation option; in response to the user clicking the first operation option operation, the first device displays a second pop-up frame, and the second pop-up frame includes one or more application programs or device identifiers; in response to the operation of the user clicking on an application program or a device identifier, the first device shares the first thumbnail image to the device corresponding to the application or device ID that the user clicked.
需要说明的是,图15所述的实施例中的第一设备可以为前述实施例中的手机A,第二设备可以为前述实施例中的手机B。或者,第一设备可以为前述实施例中的手机B,第二设备可以为前述实施例中的手机A,本申请不做限定。图15所述的实施例中未详述的部分,可以参考前述实施例,在此不做赘述。It should be noted that, the first device in the embodiment shown in FIG. 15 may be the mobile phone A in the foregoing embodiment, and the second device may be the mobile phone B in the foregoing embodiment. Alternatively, the first device may be the mobile phone B in the foregoing embodiment, and the second device may be the mobile phone A in the foregoing embodiment, which is not limited in this application. For parts not described in detail in the embodiment shown in FIG. 15 , reference may be made to the foregoing embodiment, and details are not described here.
基于本申请实施例提供的方法,第一设备获取媒体文件更新事件后,可以更新元数据库中第一媒体文件对应的元数据,并更新媒体库中第一媒体文件的缩略图;而后,第一设备可以向第二设备发送同步消息,同步消息包括第一媒体文件对应的元数据和第一媒体文件的缩略图。这样,第一设备和第二设备之间可以自动同步元数据库和媒体库,能够简单便捷地实现跨设备数据分享,无需用户进行频繁地手动操作,可以提高用户体验。Based on the method provided by the embodiment of the present application, after acquiring the media file update event, the first device can update the metadata corresponding to the first media file in the metadata database, and update the thumbnail of the first media file in the media library; The device may send a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and a thumbnail image of the first media file. In this way, the metadata database and the media library can be automatically synchronized between the first device and the second device, data sharing across devices can be easily and conveniently achieved, and frequent manual operations by the user are not required, which can improve user experience.
本申请另一些实施例提供了一种电子设备(如图2所示的电子设备200),该电子设备可以包括:通信模块、存储器和一个或多个处理器。该通信模块、存储器与处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。Other embodiments of the present application provide an electronic device (such as the electronic device 200 shown in FIG. 2 ), the electronic device may include: a communication module, a memory, and one or more processors. The communication module and memory are coupled to the processor. The memory is used to store computer program code comprising computer instructions.
本申请另一实施例提供一种芯片系统,如图16所示,该芯片系统包括至少一个处理器1601和至少一个接口电路1602。处理器1601和接口电路1602可通过线路互联。例如,接口电路1602可用于从其它装置(例如,电子设备的存储器)接收信号。又例如,接口电路1602可用于向其它装置(例如处理器1601)发送信号。Another embodiment of the present application provides a chip system. As shown in FIG. 16 , the chip system includes at least one processor 1601 and at least one interface circuit 1602 . The processor 1601 and the interface circuit 1602 may be interconnected by wires. For example, interface circuit 1602 may be used to receive signals from other devices (eg, memory of an electronic device). As another example, the interface circuit 1602 may be used to send signals to other devices (eg, the processor 1601).
例如,接口电路1602可读取电子设备中存储器中存储的指令,并将该指令发送给处理器1601。当所述指令被处理器1601执行时,可使得电子设备(如图2所示的电子设备200)执行上述各实施例中的各个步骤。For example, the interface circuit 1602 may read instructions stored in memory in the electronic device and send the instructions to the processor 1601 . When the instructions are executed by the processor 1601, the electronic device (such as the electronic device 200 shown in FIG. 2) can be made to execute each step in the above embodiments.
又例如,接口电路1602可读取服务器中存储器中存储的指令,并将该指令发送给处理器1601。当所述指令被处理器1601执行时,可使得服务器执行上述实施例中的各个步骤。For another example, the interface circuit 1602 may read the instructions stored in the memory in the server and send the instructions to the processor 1601 . When the instructions are executed by the processor 1601, the server can be caused to perform the steps in the above-mentioned embodiments.
当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。Certainly, the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以 是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (17)

  1. 一种数据同步方法,其特征在于,所述方法包括:A data synchronization method, characterized in that the method comprises:
    第一设备获取媒体文件更新事件;其中,所述媒体文件更新事件用于增加、修改或删除第一媒体文件;The first device acquires a media file update event; wherein, the media file update event is used to add, modify or delete the first media file;
    所述第一设备更新元数据库中所述第一媒体文件对应的元数据,并更新媒体库中所述第一媒体文件的缩略图;The first device updates the metadata corresponding to the first media file in the metadata database, and updates the thumbnail of the first media file in the media library;
    所述第一设备向第二设备发送同步消息,所述同步消息包括所述第一媒体文件对应的元数据和所述第一媒体文件的缩略图。The first device sends a synchronization message to the second device, where the synchronization message includes metadata corresponding to the first media file and a thumbnail image of the first media file.
  2. 根据权利要求1所述的方法,其特征在于,The method of claim 1, wherein:
    所述同步消息还包括用户账号、所述第一设备的设备信息以及所述第一媒体文件的更新类型中的至少一种,所述第一媒体文件的更新类型包括增加、修改或删除。The synchronization message further includes at least one of a user account, device information of the first device, and an update type of the first media file, where the update type of the first media file includes addition, modification, or deletion.
  3. 根据权利要求1或2所述的方法,其特征在于,The method according to claim 1 or 2, characterized in that,
    所述第一媒体文件的缩略图包括第一类型的缩略图,所述第一类型的缩略图的大小范围为10千字节~20千字节。The thumbnails of the first media file include thumbnails of a first type, and the size of the thumbnails of the first type ranges from 10 kilobytes to 20 kilobytes.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, wherein the method further comprises:
    所述第一设备接收第一请求消息,所述第一请求消息用于请求第二类型的缩略图,所述第二类型的缩略图的大小范围为100千字节~300千字节;The first device receives a first request message, where the first request message is used to request a thumbnail image of a second type, and the size of the thumbnail image of the second type ranges from 100 kilobytes to 300 kilobytes;
    所述第一设备向所述第二设备发送所述第二类型的缩略图。The first device sends the second type of thumbnails to the second device.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,The method according to any one of claims 1-4, wherein,
    所述第一媒体文件包括图片、视频、音频、文档中的至少一种。The first media file includes at least one of pictures, videos, audios, and documents.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一设备与所述第二设备首次连接时,所述方法还包括:The method according to any one of claims 1-5, wherein when the first device is connected to the second device for the first time, the method further comprises:
    所述第一设备将所述第一设备的全部媒体文件对应的元数据和所述全部媒体文件对应的缩略图同步给所述第二设备。The first device synchronizes the metadata corresponding to all media files of the first device and the thumbnail images corresponding to all media files to the second device.
  7. 根据权利要求6所述的方法,其特征在于,所述第一设备与所述第二设备第N次连接时,N为大于或等于2的整数,所述方法还包括:The method according to claim 6, wherein when the first device is connected to the second device for the Nth time, N is an integer greater than or equal to 2, and the method further comprises:
    所述第一设备将上一次同步后所述第一设备上更新的媒体文件对应的元数据和所述更新的媒体文件对应的缩略图同步给所述第二设备。The first device synchronizes the metadata corresponding to the media file updated on the first device and the thumbnail image corresponding to the updated media file to the second device after the last synchronization.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-7, wherein the method further comprises:
    所述第一设备基于人工智能AI算法分析用户的喜好、行为习惯;The first device analyzes the user's preferences and behavioral habits based on the artificial intelligence AI algorithm;
    根据所述用户的喜好、行为习惯预判所述用户需要操作的媒体文件;Predict the media files that the user needs to operate according to the user's preferences and behavioral habits;
    将所述用户需要操作的媒体文件的第二类型的缩略图发送给所述第二设备。Sending thumbnail images of the second type of media files that the user needs to operate to the second device.
  9. 根据权利要求1-8任一项所述的方法,其特征在于,The method according to any one of claims 1-8, wherein,
    所述第一设备基于预设周期删除冷数据;其中,所述冷数据包括访问次数低于预设阈值的媒体文件的缩略图。The first device deletes cold data based on a preset period; wherein the cold data includes thumbnails of media files whose access times are lower than a preset threshold.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-9, wherein the method further comprises:
    所述第一设备首次播放所述第二设备的媒体文件时,启动流服务器代理,所述流服务器代理用于将所述第二设备的媒体文件封装成流媒体格式;When the first device plays the media file of the second device for the first time, a streaming server proxy is started, and the streaming server proxy is used to encapsulate the media file of the second device into a streaming media format;
    所述第一设备通过所述流服务器代理分m次从所述第二设备获取所述第二设备的 媒体文件并缓存;其中,m为大于等于2的整数;The first device obtains and caches the media files of the second device from the second device in m times by the streaming server proxy; wherein, m is an integer greater than or equal to 2;
    所述第一设备播放缓存数据。The first device plays the cached data.
  11. 根据权利要求10所述的方法,其特征在于,The method of claim 10, wherein:
    所述第一设备第N次播放所述第二设备的媒体文件时,获取所述第二设备的媒体文件的统一资源标识符URI,根据所述URI获取缓存数据并播放;其中,N为大于等于2的整数。When the first device plays the media file of the second device for the Nth time, it obtains the uniform resource identifier URI of the media file of the second device, obtains the cached data according to the URI, and plays it; wherein, N is greater than An integer equal to 2.
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-11, wherein the method further comprises:
    所述第一设备显示包含所述第二设备的标识的第一界面;The first device displays a first interface that includes an identification of the second device;
    响应于用户在所述第一界面点击所述第二设备的标识的操作,所述第一设备显示第二界面,所述第二界面包括所述第二设备的至少一种类型的媒体文件的一个或多个缩略图。In response to the user's operation of clicking on the identifier of the second device on the first interface, the first device displays a second interface, the second interface including at least one type of media file of the second device. One or more thumbnails.
  13. 根据权利要求12所述的方法,其特征在于,The method of claim 12, wherein:
    所述第一界面或所述第二界面包括搜索控件,响应于所述用户点击所述搜索控件后输入关键词的操作,所述第一设备显示第三界面,所述第三界面包括从所述第一设备和所述第二设备搜索到的与所述关键词相关的媒体文件的标识。The first interface or the second interface includes a search control, and in response to an operation of inputting a keyword after the user clicks on the search control, the first device displays a third interface, and the third interface includes a The identifier of the media file related to the keyword searched by the first device and the second device.
  14. 根据权利要求12或13所述的方法,其特征在于,所述方法还包括:The method according to claim 12 or 13, wherein the method further comprises:
    响应于所述用户在所述第二界面点击第一缩略图的操作,所述第一设备显示第一弹框,所述第一弹框包括第一操作选项;In response to the operation of the user clicking the first thumbnail on the second interface, the first device displays a first pop-up frame, and the first pop-up frame includes a first operation option;
    响应于所述用户点击所述第一操作选项的操作,所述第一设备显示第二弹框,所述第二弹框包括一个或多个应用程序或设备标识;In response to the operation of the user clicking the first operation option, the first device displays a second pop-up box, and the second pop-up box includes one or more application programs or device identifiers;
    响应于所述用户点击一个应用程序或一个设备标识的操作,所述第一设备将所述第一缩略图分享至所述用户点击的应用程序或设备标识对应的设备。In response to the operation of the user clicking on an application or a device identifier, the first device shares the first thumbnail to the device corresponding to the application or device identifier clicked by the user.
  15. 一种第一设备,其特征在于,所述第一设备包括:无线通信模块、存储器和一个或多个处理器;所述无线通信模块、所述存储器与所述处理器耦合;A first device, characterized in that the first device comprises: a wireless communication module, a memory, and one or more processors; the wireless communication module, the memory are coupled to the processor;
    其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述计算机指令被所述处理器执行时,使得所述第一设备执行如权利要求1-14中任一项所述的方法。Wherein, the memory is used to store computer program codes, and the computer program codes include computer instructions; when the computer instructions are executed by the processor, the first device is made to execute any one of claims 1-14. method described in item.
  16. 一种计算机可读存储介质,其特征在于,包括计算机指令;A computer-readable storage medium, comprising computer instructions;
    当所述计算机指令在第一设备上运行时,使得所述第一设备执行如权利要求1-14中任一项所述的方法。The computer instructions, when executed on a first device, cause the first device to perform the method of any of claims 1-14.
  17. 一种数据同步系统,其特征在于,包括第一设备和第二设备,所述第一设备执行如权利要求1-14中任一项所述的方法。A data synchronization system, comprising a first device and a second device, wherein the first device executes the method according to any one of claims 1-14.
PCT/CN2021/136803 2020-12-31 2021-12-09 Data synchronization method and apparatus WO2022143081A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011635721.1A CN114691631A (en) 2020-12-31 2020-12-31 Data synchronization method and device
CN202011635721.1 2020-12-31

Publications (1)

Publication Number Publication Date
WO2022143081A1 true WO2022143081A1 (en) 2022-07-07

Family

ID=82135149

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136803 WO2022143081A1 (en) 2020-12-31 2021-12-09 Data synchronization method and apparatus

Country Status (2)

Country Link
CN (1) CN114691631A (en)
WO (1) WO2022143081A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610634A (en) * 2023-07-19 2023-08-18 南京中孚信息技术有限公司 File synchronization system and method for network disk terminal
CN117408655A (en) * 2023-12-13 2024-01-16 国网浙江省电力有限公司金华供电公司 Financial tax data management method and platform based on full-service view angle

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277580B (en) * 2022-07-25 2024-02-13 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment, business system and storage medium
CN117917630A (en) * 2022-10-21 2024-04-23 华为技术有限公司 Distributed data management method, electronic equipment and system
CN116701526A (en) * 2022-12-05 2023-09-05 荣耀终端有限公司 Data synchronization method and electronic equipment
CN115941674B (en) * 2023-02-21 2023-07-14 荣耀终端有限公司 Multi-device application connection method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609858A (en) * 2003-10-24 2005-04-27 微软公司 System and method for file sharing in peer-to-peer group shared spaces
CN103152398A (en) * 2013-02-07 2013-06-12 中国科学院计算技术研究所 Method and system for file synchronization among multiple terminal files
US20160103850A1 (en) * 2011-11-29 2016-04-14 International Business Machines Corporation Synchronizing Updates Across Cluster Filesystems
CN112035420A (en) * 2020-09-03 2020-12-04 西北工业大学 Data sharing method, sharing device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609858A (en) * 2003-10-24 2005-04-27 微软公司 System and method for file sharing in peer-to-peer group shared spaces
US20160103850A1 (en) * 2011-11-29 2016-04-14 International Business Machines Corporation Synchronizing Updates Across Cluster Filesystems
CN103152398A (en) * 2013-02-07 2013-06-12 中国科学院计算技术研究所 Method and system for file synchronization among multiple terminal files
CN112035420A (en) * 2020-09-03 2020-12-04 西北工业大学 Data sharing method, sharing device and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610634A (en) * 2023-07-19 2023-08-18 南京中孚信息技术有限公司 File synchronization system and method for network disk terminal
CN117408655A (en) * 2023-12-13 2024-01-16 国网浙江省电力有限公司金华供电公司 Financial tax data management method and platform based on full-service view angle
CN117408655B (en) * 2023-12-13 2024-03-05 国网浙江省电力有限公司金华供电公司 Financial tax data management method and platform based on full-service view angle

Also Published As

Publication number Publication date
CN114691631A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
WO2022143081A1 (en) Data synchronization method and apparatus
US11265373B2 (en) Systems and methods to discover and notify devices that come in close proximity with each other
US11082397B2 (en) Management system and method for remote controller of electronic device
KR102356349B1 (en) File processing method and mobile terminal
JP2016529599A (en) Content clipboard synchronization
WO2021027633A1 (en) Picture processing method and related apparatus
CN111221845A (en) Cross-device information searching method and terminal device
US20150350371A1 (en) Caching and syncing mechanisms for a cloud library
EP4102379A1 (en) Data sharing method, electronic device and system
US20140297586A1 (en) Device and method for cloud file management
US11080243B2 (en) Synchronizing virtualized file systems
KR20200003356A (en) Management system and method for remote controller of electronic device
KR102095666B1 (en) Information input methods, devices, programs and storage media
WO2022170891A1 (en) File continuation method and apparatus, and terminal device and storage medium
CN111600862B (en) User account management method and device
TWI599892B (en) Home network system file management and sharing methods
WO2024046184A1 (en) File management and application management method, and electronic device
WO2016070371A1 (en) Method for mobile terminal and web terminal interconnection and streaming and streaming media playback
EP4273680A1 (en) Image deletion operation notification method, device, and storage medium
WO2023237047A1 (en) Data processing method and electronic device
WO2023143377A1 (en) Content management method, and electronic device and system
WO2023160238A1 (en) Image display method and related electronic device
WO2023030102A1 (en) Task synchronization system and method, and device
KR101797522B1 (en) System of providing mixed media and method thereof
CN116954426A (en) Method and device for hiding photo

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

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

Country of ref document: EP

Kind code of ref document: A1