CN114265819A - Resource sharing method and related product - Google Patents

Resource sharing method and related product Download PDF

Info

Publication number
CN114265819A
CN114265819A CN202111536687.7A CN202111536687A CN114265819A CN 114265819 A CN114265819 A CN 114265819A CN 202111536687 A CN202111536687 A CN 202111536687A CN 114265819 A CN114265819 A CN 114265819A
Authority
CN
China
Prior art keywords
metadata
target
sharing
file
shared
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111536687.7A
Other languages
Chinese (zh)
Inventor
杨召君
芦志朋
钟云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Opper Software Technology Co ltd
Original Assignee
Nanjing Opper Software Technology Co ltd
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 Nanjing Opper Software Technology Co ltd filed Critical Nanjing Opper Software Technology Co ltd
Priority to CN202111536687.7A priority Critical patent/CN114265819A/en
Publication of CN114265819A publication Critical patent/CN114265819A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a resource sharing method and a related product, wherein the method comprises the following steps: determining a shared file and metadata corresponding to the shared file; establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files; synchronizing the target metadata to the second device. By adopting the embodiment of the application, the metadata and the file data can be separated, and only the metadata is synchronized in the synchronization process, so that the bandwidth required in network transmission is favorably reduced, and the file is favorably and rapidly synchronized.

Description

Resource sharing method and related product
Technical Field
The present application relates to the field of communications technologies, and in particular, to a resource sharing method and a related product.
Background
Under the era of mobile internet, the data updating speed is faster and faster. Generally, the data sharing method between devices includes: Hub-and-Spoke network system, Cloud Storage, local area network-based device data sharing method and the like. The Hub-and-Spoke system only synchronizes data of the main node and is not suitable for a scene shared by multiple devices; the Cloud Storage depends on a Cloud Storage service provider, and network bandwidth limitation, information security problems and the like may exist; in the local area network-based device data sharing method, the consumption of memory and storage and the time delay of network transmission both affect the user experience. Therefore, a resource sharing method is needed.
Disclosure of Invention
The embodiment of the application provides a resource sharing method and a related product, which are beneficial to sharing files and reducing the required bandwidth in network transmission.
In a first aspect, an embodiment of the present application provides a resource sharing method, which is applied to a first device, and the method includes:
determining a shared file and metadata corresponding to the shared file;
establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object;
determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files;
synchronizing the target metadata to the second device.
In a second aspect, an embodiment of the present application provides a resource sharing method, which is applied to a second device, and the method includes:
receiving target metadata sent by first equipment;
generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata;
and displaying the target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule.
In a third aspect, an embodiment of the present application provides a resource sharing apparatus, where the apparatus is applied to a first device, and the apparatus includes: a determining unit, a building unit, a retrieving unit and a synchronizing unit, wherein,
the determining unit is used for determining a shared file and metadata corresponding to the shared file;
the establishing unit is used for establishing a target sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object;
the retrieval unit is configured to determine a sharing range corresponding to a second device, and retrieve target metadata corresponding to the sharing range from the metadata directory, where the second device is any one of multiple sharing devices of the first device that share a file;
the synchronization unit is configured to synchronize the target metadata to the second device.
In a fourth aspect, an embodiment of the present application provides a resource sharing apparatus, where the apparatus is applied to a second device, and the apparatus includes: a receiving unit, a generating unit and a presenting unit, wherein,
the receiving unit is used for receiving the target metadata sent by the first equipment;
the generating unit is configured to generate a target shared N-ary tree corresponding to the first device according to the target metadata, where the target shared N-ary tree includes a metadata directory and a metadata object relationship corresponding to the target metadata;
and the display unit is used for displaying the target shared file corresponding to the target metadata in the preset page of the second device according to a preset rule.
In a fifth aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any of the methods in the first aspect or the second aspect of the embodiment of the present application.
In a sixth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect or the second aspect of the present application.
In a seventh aspect, this application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in any of the methods of the first aspect or the second aspect of this application. The computer program product may be a software installation package.
It can be seen that, in the embodiment of the present application, the first device may determine a shared file and metadata corresponding to the shared file; establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files; synchronizing the target metadata to the second device. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1A is a schematic architecture diagram of a resource sharing system according to an embodiment of the present application;
fig. 1B is a schematic view of a scenario of a resource sharing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a resource sharing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a resource sharing method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a resource sharing method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 6 is a block diagram illustrating functional units of a resource sharing apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram illustrating functional units of a resource sharing apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The electronic device may be a portable electronic device such as a cell phone, a tablet computer, a wearable electronic device with wireless communication capabilities (e.g., a smart watch, a smart prosthesis), an in-vehicle device, etc., that also incorporates other functionality such as personal digital assistant and/or music player functionality. Exemplary embodiments of the portable electronic device include, but are not limited to, portable electronic devices that carry an IOS system, an Android system, a Microsoft system, or other operating system. The portable electronic device may also be other portable electronic devices such as a Laptop computer (Laptop) or the like. It should also be understood that in other embodiments, the electronic device may not be a portable electronic device, but may be a desktop computer. In an embodiment of the present application, the electronic device may include a first device and a second device.
In a first section, example application scenarios disclosed in embodiments of the present application are described below.
Fig. 1A is a schematic diagram illustrating an architecture of a resource sharing system to which the present application is applicable, where the system architecture diagram may include a distributed file management module, a metadata synchronization module, a file monitoring module, a file data transmission module, a local storage module, and the like, and is not limited herein.
The distributed file management module may be configured to set a file sharing permission, specifically, may be configured to set a file sharing range, a file sharing device, a file sharing time, and the like, and is not limited herein; for example, for the first device, one or more files may be included, from which one or more files may be selected to be set as a shared file, which may be used for other device queries or acquisitions, etc., an accessible device, an accessible scope, and modification or deletion rights granted to the accessible device with respect to the shared file may be set, etc.
It should be noted that, in the present application, a plurality may refer to two or more, and will not be described in detail later.
The metadata synchronization module can be used for synchronizing metadata corresponding to shared files in different devices; the metadata synchronization module and the file data transmission module are in an isolated state, that is, the transmission of data in the two modules is isolated and independent and does not affect each other. The file data transmission module is used for transmitting file contents and can comprise at least one of the following: video data, image data, text data, etc., without limitation.
The file monitoring module is configured to monitor a state of a file, for example, whether the file is modified by a file name, deleted, modified by content, and the like, which is not limited herein.
The file management module is used for managing a file layout, a file directory, and the like of the shared file, and is not limited herein.
The local storage module may be configured to store file data shared by a local or other device, such as, for example, metadata, a file object, file content, and the like, which is not limited herein.
In one possible example, a user can set file sharing authority and a shared file capable of resource sharing, the file sharing authority is issued to the distributed management module, and the state change of the set shared file is monitored through the file monitoring module; the metadata synchronization module sends the metadata of the shared file to other devices in the local area network. After receiving the metadata on other devices, the file management module presents a basic file and directory name structure for the user. When a user initiates a file access request, the cross-device access of large data volume is completed through a file data transmission channel.
Fig. 1B is a schematic view of a scenario of a resource sharing method applied in the present application, where the resource sharing system may include a plurality of electronic devices, in the present application, only three of the devices are taken as examples, the electronic devices may include a first device and a second device, and other numbers of the electronic devices are consistent with the method described in the present application and are not described herein again.
The first device and/or the second device a and/or the second device B may include the resource sharing system shown in fig. 1A, and the first device and/or the second device a and/or the second device B may provide a file resource sharing service for devices in the same local area network or for a designated device through the resource sharing system.
In a specific implementation, the first device may determine a shared file and metadata corresponding to the shared file; establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; determining a sharing range corresponding to second equipment (second equipment A and/or second equipment B), and retrieving target metadata corresponding to the sharing range from a metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files; the target metadata is synchronized to the second device. The second device can receive the target metadata sent by the first device; generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object corresponding to the target metadata; and displaying the file object in a preset page of the second equipment according to a preset rule.
It can be seen that, in the present application, the metadata can be separated from the file data, and the transmission of the file resource is realized through the metadata, instead of transmitting all the file data to other sharing devices in a packaged manner, which is beneficial to reducing the bandwidth in network transmission. In addition, the user can set the authority of sharing the file by himself, which is beneficial to improving the information security.
In the second section, the scope of protection of the claims disclosed in the embodiments of the present application is described below.
Referring to fig. 2, fig. 2 is a flowchart illustrating a resource sharing method according to an embodiment of the present application, applied to a first device.
S201, determining a shared file and metadata corresponding to the shared file.
The shared file may be set by the user or default by the system, which is not limited herein. The shared file may refer to one or more files that are available for sharing. The shared file may indicate file resources that can be shared to other sharing devices, and may include at least one of: pictures, videos, text, etc., the first device may set the same or different shared files to different sharing devices through permission settings.
The first device and other sharing devices may be in the same local area network, and in some special scenarios, for example, when a network in the local area network is interrupted or fails, file sharing may also be implemented through a hotspot or in other manners.
Wherein the metadata may be used to include at least one of: a timestamp, a device name, a file thumbnail, etc., without limitation; the metadata may be used to characterize its corresponding shared file, or may be a characteristic or fingerprint of the shared file. The memory occupied by the metadata is far smaller than the file data corresponding to the shared file.
S202, establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object.
The shared N-ary tree may be configured to manage metadata corresponding to all files in the first device, may include shared files shared to other multiple shared devices, and may include a metadata directory generated by all metadata corresponding to all shared files and a file object corresponding to each shared file. The file object may be used to locate or index to a specific file in the local database and its corresponding file content, which may be a link or file path, etc.
The shared N-ary tree can comprise a father node and a plurality of child nodes, an N-ary tree data structure can be established through metadata, and the N-ary tree data structure can be used for quickly searching and positioning file contents corresponding to the metadata.
Wherein, the first device may comprise a plurality of shared N-trees; specifically, when the first device is used as a master device (a device that sends a shared file) or a sharing device (a device that receives a shared file) for sharing a file, the corresponding sharing N-ary trees are different. When the shared N-ary tree is used as the main device, the shared N-ary tree can be generated by the first device according to the metadata corresponding to the locally stored file, and the file content can be provided for other devices through the shared N-ary tree; when the first device serves as a sharing device, the first device can receive metadata sent by other main devices, the received metadata are used for generating shared N-ary trees corresponding to the other main devices, file contents shared by the other main devices can be obtained through the shared N-ary trees, and each other main device can correspond to one shared N-ary tree.
In a specific implementation, in the present application, the first device may serve as a master device, and when the first device serves as the master device, a shared file for sharing to a sharing device may be retrieved from a local database through authority information set by a user, and a sharing N-ary tree may be generated according to metadata of the shared file and an index node (inode number).
In one possible example, the method further includes the steps of: monitoring the state condition of the shared file; and if the state information of any one of the shared files is determined to be changed, updating the shared N-ary tree according to the state information.
The shared file includes a plurality of shared files, each shared file may correspond to one piece of state information, and the state condition of the shared file may be monitored through the state information, for example: whether the shared file is deleted, whether the file name of the shared file is renamed, whether the file format of the shared file is changed, and the like, which are not limited herein.
In one possible example, the updating the shared N-ary tree according to the state information may include: positioning a target node in the shared N-ary tree corresponding to the state information; updating metadata corresponding to the target node according to the position of the target node in the shared N-ary tree; and determining target sharing equipment corresponding to the target node, and synchronizing the updated metadata to the target sharing equipment.
The metadata and the shared file are in one-to-one correspondence, when the state information of the shared file changes, a target node can be located through an inode number of the shared file, the metadata corresponding to the target node is updated according to the position of the target node in the shared N-ary tree, and then a parent node corresponding to the target node is determined, so that a target sharing device is located, the target sharing device can comprise the second device, when the target sharing device is a plurality of target sharing devices, the updated metadata can be simultaneously sent to the target sharing devices, and the updated metadata is used for the target sharing devices to update the shared N-ary tree corresponding to the first device in the own device.
Therefore, in the application, as the metadata and the shared file are in one-to-one correspondence, when the shared file changes, the metadata in other shared devices can be updated through the metadata, so that the consistency of the shared file resources in the two devices is ensured.
Optionally, when the first device is used as a master device, a user corresponding to the first device sets a modification permission of the shared file through permission setting; if other sharing devices have the authority to modify the shared file, the metadata information about the target file in the N-ary trees of the two devices (the first device and the other sharing devices) can be synchronously modified after the state information of the shared file is changed.
S203, determining a sharing range corresponding to a second device, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second device is any one of a plurality of sharing devices of the first device sharing files.
The sharing scope may refer to a scope stored in the user or the first device for sharing files to the second device, and may include a specific number of files, file contents, and so on.
The sharing scope corresponding to each sharing device may be the same or different, and the second device may refer to any one of a plurality of sharing devices that the first device shares the shared file.
S204, synchronizing the target metadata to the second device.
The target shared file can be determined according to the sharing range of the shared file which is set by the first device and is shared into the second device, and the corresponding target metadata and the structural relationship of the target metadata in the shared N-ary tree, namely the metadata object relationship are determined; further, the target metadata and the metadata object relationship corresponding to the target metadata can be sent to the second device together, and the target metadata can be used for the second device to construct a target sharing N-ary tree corresponding to the first device according to the metadata object relationship; the target shared N-ary tree is different from the shared N-ary tree generated by the first device. The target metadata can be used for the second device to acquire file data (file content and the like) corresponding to the target metadata in the first device.
It can be seen that, in the resource sharing method described in the embodiment of the present application, the first device may determine the shared file and the metadata corresponding to the shared file; establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files; synchronizing the target metadata to the second device. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
Referring to fig. 3, fig. 3 is a flowchart illustrating a resource sharing method according to an embodiment of the present application, applied to a second device.
S301, receiving target metadata sent by the first device.
The target metadata corresponds to the second device, and may refer to metadata information corresponding to a shared file that the first device allows the second device to acquire.
After the first device sets the sharing range of the second device, the target metadata for the second device is determined, and then the second device can passively receive the target metadata sent by the first device; therefore, the method is beneficial to the user to access at any time, the first equipment does not need to be moved to obtain the target metadata, and the method is beneficial to improving the rapid synchronization of the files.
S302, generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata.
The target shared N-ary tree is different from the shared N-ary tree in the first device, and the shared N-ary tree in the first device may refer to an N-ary tree generated by all metadata corresponding to the shared file that the first device allows all other shared devices to acquire. The target N-ary tree may refer to an N-ary tree corresponding to the shared file in the first device, which is obtained by the second device. When the second device is used as a sharing device, a plurality of main devices can be corresponded to, and the shared files in the plurality of main devices can be accessed and obtained, wherein the second device comprises a shared N-ary tree corresponding to each main device.
The metadata object relationship is used to indicate a relationship between parent and child nodes of a target shared file corresponding to target metadata transmitted by the first device, that is, a relationship between inode numbers.
Unlike the sharing N-ary tree in the first device, the target sharing N-ary tree only includes the metadata directory corresponding to the target metadata and the metadata object relationship between the target metadata, and the sharing N-ary tree in the embodiment shown in fig. 2 includes the file object corresponding to the shared file, that is, the file path for searching the shared file in the local database.
In the target sharing N-ary tree, the marks can be distinguished through the inode number of the file system, the device ID of the first device can be used as a parent node, and the inode number corresponding to different metadata can be used as a child node, so that the marks of the target sharing N-ary tree metadata are realized. The parent node can be found through the inode number.
And S303, displaying the target shared file corresponding to the target metadata in a preset page of the second device according to a preset rule.
The preset rules and/or the preset pages can be set by the user or defaulted by the system, and are not limited herein; the preset page may refer to a page designated in the second device for presenting the target metadata.
In a possible example, the displaying, according to the preset rule, the target shared file corresponding to the target metadata in the preset page of the second device may include the following steps: if the target metadata is used for indicating video data and/or picture data, displaying a thumbnail corresponding to the video data and/or the picture data in the preset page; and if the target metadata is used for indicating text data, displaying a cover page of the text data in the preset page.
The thumbnail and the cover page can be specified by the first device when the authority is set, and the thumbnail and/or the cover page can be used for the user to know some relevant basic information of the shared file, such as image content corresponding to image data, or writer and abstract information corresponding to text information.
Therefore, in the application, the corresponding display mode can be determined according to different file types so that the user can obtain the basic information corresponding to the shared file, and therefore the user can select the file which the user wants, user experience can be improved, and practicability of data display can be improved.
In one possible example, the method may further include the steps of: responding to the selection of the user for the thumbnail and/or the cover, and sending a file acquisition request to the first device, wherein the file acquisition request is used for acquiring file content corresponding to the target metadata; and displaying the file content in the preset page.
The user can click and select the thumbnail, the first device can determine a main device (in the embodiment of the application, the first device is defaulted to be the first device) corresponding to the thumbnail or the cover when detecting that the user clicks the thumbnail or the cover, and then the target metadata corresponding to the thumbnail or the cover is sent to the main device, and further the main device can locate a node corresponding to the target metadata in a local corresponding shared N-ary tree according to the target metadata, and then index file data such as specific file content from a local database according to a file object corresponding to the node, and send the file content to the second device, so that sharing and synchronization of file resources are completed.
Therefore, in the application, the shared N-ary tree between the two devices can be established through the metadata, and the specific main device is positioned based on the parent-child relationship in the shared N-ary tree, so that the specific file content corresponding to the target metadata in the main device is obtained, the occupied bandwidth of network transmission is reduced, the rapid synchronization of the files is favorably realized, and the user can select the obtaining mode immediately, so that the waste of the network transmission bandwidth is favorably avoided.
It can be seen that, in the resource sharing method described in the embodiment of the present application, the second device may receive the target metadata sent by the first device; generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata; and displaying the target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
Referring to fig. 4, fig. 4 is an interaction diagram of a resource sharing method according to an embodiment of the present application, where the resource sharing method includes the following operations.
S401, the first device determines a shared file and metadata corresponding to the shared file.
S402, the first device establishes a sharing N-branch tree corresponding to the first device according to the metadata, wherein the sharing N-branch tree comprises a metadata directory and a file object.
S403, the first device determines a sharing range corresponding to the second device, and retrieves target metadata corresponding to the sharing range from the metadata directory, where the second device is any one of multiple sharing devices of the first device sharing files.
S404, the first device synchronizes the target metadata to the second device.
S405, the second device receives the target metadata sent by the first device.
S406, the second device generates a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata.
And S407, displaying, by the second device, the target shared file corresponding to the target metadata in a preset page of the second device according to a preset rule.
S408, responding to the selection of the user for the thumbnail and/or the cover, sending a file acquisition request to the first device by the second device, wherein the file acquisition request is used for acquiring the file content corresponding to the target metadata.
S409, the first equipment receives the file acquisition request sent by the second equipment, and determines the corresponding file content according to the target metadata.
And S410, the second equipment displays the file content in the preset page.
The above steps S401 to S404 may refer to steps S201 to S204 in the data synchronization method described in fig. 2. The above steps S405-S410 may refer to steps S301-S303 in the data synchronization method described in fig. 3. And will not be described in detail herein.
It can be seen that, in the data synchronization method described in the embodiment of the present application, the first device determines a shared file and metadata corresponding to the shared file; the first equipment establishes a sharing N-ary tree corresponding to the first equipment according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; the method comprises the steps that a first device determines a sharing range corresponding to a second device, and target metadata corresponding to the sharing range are obtained by retrieving from a metadata directory, wherein the second device is any one of a plurality of sharing devices of a file shared by the first device; the first device synchronizes the target metadata to the second device; the second equipment receives the target metadata sent by the first equipment; the second device generates a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata; the second equipment displays a target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule; responding to the selection of the user for the thumbnail and/or the cover, sending a file acquisition request to the first device by the second device, wherein the file acquisition request is used for acquiring file content corresponding to the target metadata; the first equipment receives a file acquisition request sent by the second equipment, and determines corresponding file content according to the target metadata; and the second equipment displays the file content in the preset page. Therefore, the shared N-ary tree between the two devices can be established through the metadata, and the specific main device is positioned based on the parent-child relationship in the shared N-ary tree, so that the specific file content corresponding to the target metadata in the main device is obtained, the co-workers occupying the bandwidth in network transmission are reduced, the rapid synchronization of the files is favorably realized, and the user can select the mode of obtaining the target metadata at once, so that the waste of the network transmission bandwidth is favorably avoided.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and as shown in the drawing, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory.
In one possible example, the electronic device includes a first device, the one or more programs are configured with instructions to be executed by the processor to:
determining a shared file and metadata corresponding to the shared file;
establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object;
determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files;
synchronizing the target metadata to the second device.
It can be seen that the electronic device described in the embodiment of the present application may determine a shared file and metadata corresponding to the shared file; establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files; synchronizing the target metadata to the second device. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
Optionally, the program further comprises instructions for performing the steps of:
monitoring the state condition of the shared file;
and if the state information of any one of the shared files is determined to be changed, updating the shared N-ary tree according to the state information.
Optionally, in the aspect of updating the shared N-ary tree according to the state information, the program includes instructions for performing the following steps:
positioning a target node in the shared N-ary tree corresponding to the state information;
updating metadata corresponding to the target node according to the position of the target node in the shared N-ary tree;
and determining target sharing equipment corresponding to the target node, and synchronizing the updated metadata to the target sharing equipment.
In one possible example, the electronic device includes a second device, the one or more programs are configured with instructions for executing, by the processor, the steps of:
receiving target metadata sent by first equipment;
generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata;
and displaying the target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule.
It can be seen that the electronic device described in the embodiment of the present application may receive target metadata sent by a first device; generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata; and displaying the target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In the case of dividing each functional module by corresponding functions, fig. 6 shows a schematic diagram of a resource sharing apparatus, as shown in fig. 6, the apparatus is applied to a first device, and the resource sharing apparatus 600 may include: a determining unit 601, a creating unit 602, a retrieving unit 603 and a synchronizing unit 604, wherein,
the determination unit 601 may be used to support the terminal device to perform step S201 described above and/or other processes for the techniques described herein.
The establishing unit 602 may be used to support the terminal device to perform step S202 described above, and/or other processes for the techniques described herein.
The retrieval unit 603 may be used to support the terminal device to perform step S203 described above, and/or other processes for the techniques described herein.
The synchronization unit 604 may be used to support the terminal device in performing step S204 described above, and/or other processes for the techniques described herein.
It can be seen that, the resource sharing apparatus provided in the embodiment of the present application may determine a shared file and metadata corresponding to the shared file; establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object; determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files; synchronizing the target metadata to the second device. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
Fig. 7 shows a schematic diagram of a resource sharing apparatus, which is applied to a second device, as shown in fig. 7, and the resource sharing apparatus 700 may include: a receiving unit 701, a generating unit 702 and a presenting unit 703, wherein,
the receiving unit 701 may be used to support the terminal device to perform step S301 described above, and/or other processes for the techniques described herein.
The generating unit 702 may be used to support the terminal device in performing step S302 described above, and/or other processes for the techniques described herein.
Presentation unit 703 may be used to support the terminal device in performing step S303 described above, and/or other processes for the techniques described herein.
It can be seen that the resource sharing apparatus provided in this embodiment of the present application may receive target metadata sent by a first device; generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata; and displaying the target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule. Therefore, the metadata and the file data are separated, and only the metadata are synchronized in the synchronization process, so that the bandwidth required in network transmission is reduced, and the file is synchronized quickly.
In a possible example, in terms of displaying, according to a preset rule, a target shared file corresponding to the target metadata in a preset page of the second device, the displaying unit 703 is specifically configured to:
if the target metadata is used for indicating video data and/or picture data, displaying a thumbnail corresponding to the video data and/or the picture data in the preset page;
and if the target metadata is used for indicating text data, displaying a cover page of the text data in the preset page.
It should be noted that all relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
The electronic device provided by the embodiment is used for executing the resource sharing method, so that the same effect as the implementation method can be achieved.
In case an integrated unit is employed, the electronic device may comprise a processing module, a storage module and a communication module. The processing module may be configured to control and manage actions of the electronic device, and for example, may be configured to support the electronic device to execute the steps executed by the determining unit 601, the establishing unit 602, the retrieving unit 603, and the synchronizing unit 604, or the steps executed by the receiving unit 701, the generating unit 702, and the displaying unit 703. The memory module may be used to support the electronic device in executing stored program codes and data, etc. The communication module can be used for supporting the communication between the electronic equipment and other equipment.
The processing module may be a processor or a controller. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., a combination of one or more microprocessors, a Digital Signal Processing (DSP) and a microprocessor, or the like. The storage module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (11)

1. A resource sharing method is applied to a first device, and is characterized in that the method comprises the following steps:
determining a shared file and metadata corresponding to the shared file;
establishing a sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object;
determining a sharing range corresponding to second equipment, and retrieving target metadata corresponding to the sharing range from the metadata directory, wherein the second equipment is any one of a plurality of sharing equipment of the first equipment for sharing files;
synchronizing the target metadata to the second device.
2. The method of claim 1, further comprising:
monitoring the state condition of the shared file;
and if the state information of any one of the shared files is determined to be changed, updating the shared N-ary tree according to the state information.
3. The method of claim 2, wherein the updating the shared N-ary tree according to the state information comprises:
positioning a target node in the shared N-ary tree corresponding to the state information;
updating metadata corresponding to the target node according to the position of the target node in the shared N-ary tree;
and determining target sharing equipment corresponding to the target node, and synchronizing the updated metadata to the target sharing equipment.
4. A resource sharing method is applied to a second device, and is characterized in that the method comprises the following steps:
receiving target metadata sent by first equipment;
generating a target sharing N-ary tree corresponding to the first device according to the target metadata, wherein the target sharing N-ary tree comprises a metadata directory and a metadata object relation corresponding to the target metadata;
and displaying the target shared file corresponding to the target metadata in a preset page of the second equipment according to a preset rule.
5. The method according to claim 4, wherein the displaying the target shared file corresponding to the target metadata in the preset page of the second device according to a preset rule comprises:
if the target metadata is used for indicating video data and/or picture data, displaying a thumbnail corresponding to the video data and/or the picture data in the preset page;
and if the target metadata is used for indicating text data, displaying a cover page of the text data in the preset page.
6. The method of claim 5, further comprising:
responding to the selection of the user for the thumbnail and/or the cover, and sending a file acquisition request to the first device, wherein the file acquisition request is used for acquiring file content corresponding to the target metadata;
and displaying the file content in the preset page.
7. An apparatus for resource sharing, the apparatus being applied to a first device, the apparatus comprising: a determining unit, a building unit, a retrieving unit and a synchronizing unit, wherein,
the determining unit is used for determining a shared file and metadata corresponding to the shared file;
the establishing unit is used for establishing a target sharing N-ary tree corresponding to the first device according to the metadata, wherein the sharing N-ary tree comprises a metadata directory and a file object;
the retrieval unit is configured to determine a sharing range corresponding to a second device, and retrieve target metadata corresponding to the sharing range from the metadata directory, where the second device is any one of multiple sharing devices of the first device that share a file;
the synchronization unit is configured to synchronize the target metadata to the second device.
8. An apparatus for resource sharing, the apparatus being applied to a second device, the apparatus comprising: a receiving unit, a generating unit and a presenting unit, wherein,
the receiving unit is used for receiving the target metadata sent by the first equipment;
the generating unit is configured to generate a target shared N-ary tree corresponding to the first device according to the target metadata, where the target shared N-ary tree includes a metadata directory and a metadata object relationship corresponding to the target metadata;
and the display unit is used for displaying the target shared file corresponding to the target metadata in the preset page of the second device according to a preset rule.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-3 or any of claims 4-6.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-3 or any one of claims 4-6.
11. A computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform the method as claimed in any one of claims 1 to 3 or any one of claims 4 to 6.
CN202111536687.7A 2021-12-15 2021-12-15 Resource sharing method and related product Pending CN114265819A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111536687.7A CN114265819A (en) 2021-12-15 2021-12-15 Resource sharing method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111536687.7A CN114265819A (en) 2021-12-15 2021-12-15 Resource sharing method and related product

Publications (1)

Publication Number Publication Date
CN114265819A true CN114265819A (en) 2022-04-01

Family

ID=80827350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111536687.7A Pending CN114265819A (en) 2021-12-15 2021-12-15 Resource sharing method and related product

Country Status (1)

Country Link
CN (1) CN114265819A (en)

Similar Documents

Publication Publication Date Title
US9766791B2 (en) Predictive caching and fetch priority
EP3623942A1 (en) Message processing method and apparatus, storage medium, and computer device
CN114356872A (en) File sharing method of cross-terminal equipment and related product
EP3136655B1 (en) Multimedia display method, device and equipment
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
CN107092652B (en) Navigation method and device for target page
US20150227605A1 (en) Information processing terminal, synchronization control method, and computer-readable recording medium
CN112528595B (en) Document processing method and device and electronic equipment
CN111190962A (en) File synchronization method and device and local terminal
CN103873519A (en) Data synchronization method, client end, server, terminal and system
KR20210057659A (en) File mangement method of mobile device and momible device implementing the same
CN114637703B (en) Data access device, method, readable medium and electronic equipment
CN111694629A (en) Information display method and device and electronic equipment
CN105915636B (en) A kind of synchronous method and device of contact information
US11128622B2 (en) Method for processing data request and system therefor, access device, and storage device
CN112732652A (en) Information display method and device and electronic equipment
KR101419275B1 (en) Data synchronizing and servicing apparatus and method based on cloud storage
CN114265819A (en) Resource sharing method and related product
CN111367606A (en) Application page display method, device, terminal and medium
CN114742013A (en) Online document display method and device and electronic equipment
CN111787043A (en) Data request method and device
CN112131181A (en) Storage path display method and device and electronic equipment
CN109947964A (en) Method and apparatus for more new information
WO2023051096A1 (en) Method for accessing resources, and electronic device
US20210141771A1 (en) Method of managing files by mobile device and mobile device for implementing the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination