CN116016553B - File sharing method and device based on network disk, network disk and storage medium - Google Patents

File sharing method and device based on network disk, network disk and storage medium Download PDF

Info

Publication number
CN116016553B
CN116016553B CN202310300896.4A CN202310300896A CN116016553B CN 116016553 B CN116016553 B CN 116016553B CN 202310300896 A CN202310300896 A CN 202310300896A CN 116016553 B CN116016553 B CN 116016553B
Authority
CN
China
Prior art keywords
file
content
files
information
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.)
Active
Application number
CN202310300896.4A
Other languages
Chinese (zh)
Other versions
CN116016553A (en
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.)
Tianjin Lenovo Collaboration Technology Inc
Original Assignee
Tianjin Lenovo Collaboration Technology Inc
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 Tianjin Lenovo Collaboration Technology Inc filed Critical Tianjin Lenovo Collaboration Technology Inc
Priority to CN202310300896.4A priority Critical patent/CN116016553B/en
Publication of CN116016553A publication Critical patent/CN116016553A/en
Application granted granted Critical
Publication of CN116016553B publication Critical patent/CN116016553B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a file sharing method and device based on a network disk, the network disk and a storage medium, wherein the method comprises the following steps: receiving a selection operation of a file and file content in a network disk, and acquiring file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs; and determining the number of the files to be shared according to the file ID information of the selected file in the selected operation and the file ID information of the file to which the content of the selected file belongs, and determining a file content integration rule according to the number of the files to be shared. The method, the device, the network disk and the storage medium for sharing the files based on the network disk can determine the file content integration rule according to the number of the selected files to be shared, integrate the data block streams according to the file content integration rule, and generate the file block streams for sharing, so that the sharing of the files is realized rapidly and simply.

Description

File sharing method and device based on network disk, network disk and storage medium
Technical Field
The invention belongs to the technical field of electronic information, and particularly relates to a file sharing method and device based on a network disk, the network disk and a storage medium.
Background
With the rapid development of internet cloud computing technology, network disk services have become a core content of contemporary information services. The network disk user can realize remote storage, reading and sharing of the files through the network disk, so that the use convenience and access flexibility of the data materials can be greatly improved.
The current file sharing mechanism can only share files at the level, and when a network disk user needs to share the files stored in the network disk, the network disk user needs to select the files first and then share the files entirely; along with the increase of the storage quantity of files in the network disk, when the network disk user needs to share the content in multiple files or multiple files, the multiple files or the content of the files need to be selected independently, the sharing operation is performed independently, the operation steps are complex and tedious, each file or the content of the file needs to be subjected to one-time sharing operation, the difficulty of the sharing operation of the network disk user is increased, and in addition, the sharing of the multiple files causes redundancy and bulkiness of sharing information, the redundancy of the shared files is complicated easily caused, and the operation efficiency and convenience of file sharing are greatly influenced.
Disclosure of Invention
In view of the above, the present invention aims to provide a method, an apparatus, a network disk and a storage medium for sharing files based on a network disk, so as to achieve the purposes of improving the efficiency of sharing files of the network disk and reducing the difficulty of sharing the content of a plurality of files or files.
In order to achieve the above purpose, the technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for sharing files based on a network disk, including:
receiving a selection operation of a file and file content in a network disk, and acquiring file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs;
determining the number of files to be shared according to the file ID information of the selected file in the selected operation and the file ID information of the file to which the content of the selected file belongs, and determining a file content integration rule according to the number of files to be shared;
acquiring content offset information corresponding to the content of the selected file in the selected operation;
obtaining a data block stream corresponding to the file selected by the selected operation according to the file ID information of the file selected by the selected operation, and obtaining a data block stream corresponding to the file content selected by the selected operation according to the file ID information of the file to which the file content selected by the selected operation belongs and the content offset information corresponding to the file content selected by the selected operation;
integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block stream;
And receiving sharing operation of the network disk user, and sharing the file block stream according to the sharing operation.
Further, the obtaining the content offset information corresponding to the content of the file selected by the selecting operation includes:
acquiring the sequence of the file contents selected by the selected operation, and acquiring corresponding content offset information;
according to the content offset information, acquiring a file block in which the content of the selected file is located and an address in the file block in which the content of the selected file is located;
generating a shared content sequence from the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the sequence;
and writing the sharing content sequence into metadata of the file to which the selected file content belongs according to the file ID information of the file to which the selected file content belongs, and adding sharing loading attributes for the sharing content sequence in the metadata of the file.
Further, the sharing loading attribute includes:
and loading according to the sequence of the file blocks corresponding to the shared content sequence in the file blocks corresponding to the file.
Further, the determining the number of the files to be shared according to the file ID information of the file selected by the selecting operation and the file ID information of the file to which the file content selected by the selecting operation belongs, and determining the file content integration rule according to the number of the files to be shared includes:
Obtaining the number of the files corresponding to the content of the selected file and the comparison result of the number of the files selected by the selected operation according to the file ID information of the selected file by the selected operation and the file ID information of the file to which the content of the selected file belongs;
determining the number of files to be shared according to the number of files corresponding to the content of the selected files in the selected operation and the comparison result of the number of the files selected in the selected operation;
and determining a file content integration rule according to the number of the files to be shared.
Further, after determining the number of files to be shared according to the number of files corresponding to the content of the selected file and the comparison result of the number of files selected by the selected operation, the method further includes:
and when the number of the files corresponding to the file content selected by the selected operation is inconsistent with the number of the files selected by the selected operation, taking the number of the files corresponding to the file content selected by the selected operation as the number of the files to be shared.
In a second aspect, an embodiment of the present invention further provides a file sharing device based on a network disk, including:
the receiving module is used for receiving the selected operation of the files and the file contents in the network disk, and acquiring the file ID information of the files selected by the selected operation and the file ID information of the files belonging to the file contents selected by the selected operation;
The determining module is used for determining the number of the files to be shared according to the file ID information of the file selected by the selected operation and the file ID information of the file to which the content of the file selected by the selected operation belongs, and determining a file content integration rule according to the number of the files to be shared;
the acquisition module is used for acquiring content offset information corresponding to the content of the selected file in the selected operation;
the reading module is used for obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file;
the integration module is used for integrating the data block flow corresponding to the file selected by the selected operation and the data block flow corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block flow;
and the sharing module is used for receiving the sharing operation of the network disk user and sharing the file block stream according to the sharing operation.
Further, the determining module includes:
The comparison unit is used for obtaining the number of the files corresponding to the content of the selected file in the selected operation and the comparison result of the number of the files in the selected operation according to the file ID information of the selected file in the selected operation and the file ID information of the file to which the content of the selected file in the selected operation belongs;
the computing unit is used for determining the number of the files to be shared according to the number of the files corresponding to the content of the files selected by the selected operation and the comparison result of the number of the files selected by the selected operation;
and the analysis unit is used for determining file content integration rules according to the number of the files to be shared.
Further, the obtaining module includes:
the invoking unit is used for acquiring the sequence of the file contents selected by the selected operation and acquiring corresponding content offset information;
the obtaining unit is used for obtaining the address of the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the content offset information;
the generating unit is used for generating a shared content sequence from the address of the file block where the file content is selected in the selected operation and the address in the file block where the file content is selected in the selected operation according to the sequence;
And the writing unit is used for writing the shared content sequences into metadata of the file to which the file content selected by the selected operation belongs respectively, and adding a shared loading attribute for the shared content sequences in the metadata of the file.
In a third aspect, an embodiment of the present invention further provides a network disk, including:
one or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the network disk-based file sharing method as provided in the foregoing embodiments.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a network disk-based file sharing method as provided in the above embodiments.
Compared with the prior art, the file sharing method and device based on the network disk, the network disk and the storage medium have the following advantages:
the method, the device, the network disk and the storage medium for sharing the files based on the network disk can determine the file content integration rule according to the number of the selected files to be shared, integrate the data block streams according to the file content integration rule, and generate the file block streams for sharing, so that the sharing of the files is realized rapidly and simply. The network disk users can select files to share, can select contents in the files to share, and can more conveniently obtain the shared contents by acquiring the selected files and/or data block flows corresponding to the selected file contents and integrating the data block flows according to the file content integration rules to generate the file block flows for sharing.
The method, the device, the network disk and the storage medium for sharing the files based on the network disk can also realize the independent and multi-file integration sharing of local files, the sharing mode is not the whole file sharing of the ancient board, the dynamic and flexible operation of the local file sharing and the multi-file integration sharing can be truly realized, the difficulty of the file sharing operation is reduced, and the file sharing efficiency is also improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention. In the drawings:
fig. 1 is a flow chart of a file sharing method based on a network disk according to a first embodiment of the present invention;
fig. 2 is a flow chart of a file sharing method based on a network disk according to a second embodiment of the present invention;
fig. 3 is a flow chart of a file sharing method based on a network disk according to a third embodiment of the present invention;
fig. 4 is a flow chart of a file sharing method based on a network disk according to a fourth embodiment of the present invention;
fig. 5 is a flow chart of a file sharing method based on a network disk according to a fifth embodiment of the present invention;
Fig. 6 is a schematic structural diagram of a file sharing device based on a network disk according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a mesh disc according to a seventh embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flow chart of a file sharing method based on a network disk according to a first embodiment of the present invention. The embodiment is applicable to the sharing operation of the files in the network disk, and specifically comprises the following steps:
step 101, receiving a selection operation of a file and file content in a network disk, and acquiring file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs.
The storage principle of the network disk is that the network company divides a part of capacity in a hard disk or a hard disk array of a server to registered users for use, and the file storage still needs to use disk resources, and the principle is that information in a logic file is stored in a physical disk block. The existing modes of storing files in physical disk blocks include a continuous file storage mode, a serial file storage mode, an index file storage mode and the like, and in order to realize file searching, specific file ID information (also called meta information or metadata) is needed when each file is stored, such as inode number, file size, access authority, creation time, modification time, data position on a disk and the like.
Since a large number of files may be stored simultaneously inside the net tray. Therefore, before sharing operation, the network disk user needs to select the file or the file content, and select the file or the file content to be shared. The file ID information of the selected file and the file ID information of the file to which the file content belongs in the selected operation are obtained, so that the file and the file content can be directly positioned in the storage position, further the file and the file content can be read, data support is provided for subsequent file and file content sharing, and subsequent file integration or sharing work is facilitated.
Step 102, determining the number of files to be shared according to the file ID information of the file selected by the selected operation and the file ID information of the file to which the file content selected by the selected operation belongs, and determining a file content integration rule according to the number of files to be shared.
Because a large number of files are stored in the network disk, when the network disk user performs file and file content sharing, the network disk user may select a plurality of files and file contents to share simultaneously, or may individually select a certain file or file content to share individually. Therefore, aiming at different selected operations of the network disk users, different file content integration rules need to be determined to integrate the files and the file contents in a targeted manner, so that the complexity in the sharing process is reduced, and the sharing efficiency of the files and the file contents is improved.
In order to meet the requirement of network disk users for sharing files, complicated operations and information redundancy during sharing of a plurality of files or file contents are reduced. The file sharing method based on the network disk can comprise a plurality of file content integration rules, and is used for integrating single file, single file part content, a plurality of files and a plurality of file contents, so that the subsequent sharing of single file content, multiple files or multiple file contents is conveniently realized, the operation difficulty of file sharing is reduced, redundant information in the file sharing process is reduced, and the efficiency and convenience of file sharing are improved.
Step 103, obtaining content offset information corresponding to the content of the file selected by the selected operation.
The offset is the number of bytes moved forward or backward from the specified location, and is used when finding the data used from the file. The offset is typically three, one is to move several bytes back from the beginning of the file to find the target (this is unsigned, since there is no data in front of the beginning). The second is to move several bytes forward from the end of the file to find the target (again without a sign). The third is the relative position, which is a forward or backward movement seek (signed) from the current position of the file.
Since the file is a sequence of bits, bytes, rows or records, and stored in a file block. So when the content in the file is selected, in practice the user of the disk will typically select a byte sequence. By acquiring the start and end positions (i.e., the offset) of the selected byte sequence, the file block corresponding to the selected file content and the address in the file block where the file block is located can be obtained.
Step 104, obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file.
Since the file is a named combination of related information recorded on the external memory. From the perspective of a disk user, a file is the smallest allocation unit of logical memory, that is, data can only be written to memory by the file. In general, files represent programs (source and target forms) and data. The data file may be digital, alphanumeric, or binary. The file may be free form, such as a text file, or may be in a strict format. Further, a file is typically a sequence of bits, bytes, rows, or records, the meaning of which is defined by the creator of the file and the network disk user, and stored in file blocks. Therefore, when the file or the file content is selected for sharing, the file block of the selected file can be acquired for subsequent integration or sharing operation.
After determining the file content integration rule, the file or the file content needs to be integrated according to the file content integration rule, so that the subsequent sharing operation is facilitated. In order to facilitate integration of files or file contents, metadata of the files and/or file contents can be directly acquired, and a data block stream is obtained.
In the practical application process, files with the same attribute can use a unified data block stream. By acquiring the unified data block stream, the subsequent data block streams can be spliced conveniently, so that a plurality of data block streams can be spliced to form a new file block stream, and the subsequent sharing operation of the file block stream is facilitated.
Optionally, the attributes described in this embodiment include, but are not limited to, one or more of the following: (1) name: the symbolic filename is unique information that is stored in human-readable form. (2) an identifier: such a unique tag (typically a number) identifies the file of the file system, which is the non-human readable name of the file. Type (3): systems supporting different types of files need this information. (4) position: the information is a pointer to the device and the location of the file on the device. (5) size: the attributes include the current size (in bytes, words, or blocks) of the file, and possibly the maximum size allowed. (6) protection: the access control information determines who can read, write, execute, etc. (7) time, date and user identification: the relevant information for file creation, last modification and last use may be saved.
Alternatively, the data block stream described in this embodiment may be one or both of a character stream and a byte stream. Where the byte stream processing unit is 1byte (byte), the operation bytes and byte array, the binary file is stored, and if the shared file is an audio file, picture, song, etc., the file block stream may be a preferred byte stream (1 byte=8 bits). The unit of character stream processing is a Unicode character of 2 bytes, and the character stream is formed by converting bytes into characters of a unit of Unicode character of 2 bytes by a Java virtual machine, and the character stream can be optimized (1 unicode=2 bytes=16 bits) if the shared file is related to Chinese or text. And a person skilled in the art can select other suitable data block streams according to the attribute of the actual file, so that when the file or the content of the file is shared, the multiple data block streams can be conveniently combined and integrated.
And 105, integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block stream.
In order to facilitate file sharing, operation steps of multi-file sharing are reduced, and redundancy of shared information is reduced. In practical application, after determining the file content integration rule, the file content integration rule is utilized to integrate the files or the file contents in the network disk, so that the data block streams corresponding to the files or the file contents are integrated to generate new file block streams for sharing.
For example, when a network disk user needs to select and share a file and file content of a word document in the network disk, metadata of the word document can be obtained, and a data block stream is formed. The unified data block stream is the character stream, so that character streams of a plurality of word documents can be conveniently spliced, and the character streams are used for being integrated to form a continuous file block stream, so that the file block stream can be conveniently shared subsequently, and a shared user can conveniently read data in the file blocks according to the file block stream. Other attribute files are similar, and can be selected according to actual needs by those skilled in the art, and are not described herein. By integrating the data block streams of the same attribute files to form a new file block stream, the shared user can directly read word document content stored in the network disk through the integrated file block stream, so that redundant information can be effectively reduced, and file sharing efficiency is improved.
And 106, receiving sharing operation of the network disk user, and sharing the file block stream according to the sharing operation.
The network disk user can share the newly generated file block stream to other network disk users through the Internet under the existing file sharing mechanism. For example, the newly generated file block stream may be sent to other network disk users by generating links, two-dimensional codes, and the like. Compared with the sharing of original files, the file block stream integrated by the file content integration rule contains metadata of all the shared files, and the shared network disk user can also directly read the file data stored in the network disk and check the corresponding shared content through the file block stream, so that the corresponding files do not need to be searched independently, and the review difficulty of the shared network disk user is reduced.
Compared with the prior art, the method and the device can determine the number of the files to be shared according to the file ID information of the files selected by the selecting operation and the file ID information of the files to which the file contents belong, and determine the file content integration rule according to the number of the files to be shared. And obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and further obtaining the data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file. And finally, integrating the data block streams according to the file content integration rule to generate a file block stream for sharing, thereby reducing the complexity of the sharing operation of the file and improving the convenience of file sharing.
Example two
Fig. 2 is a flow chart of a file sharing method based on a network disk according to a second embodiment of the present invention. The present embodiment optimizes the content offset information corresponding to the content of the file selected by the selected operation based on the above embodiment, and in this embodiment, specifically optimizes the content offset information to be: acquiring the sequence of the file contents selected by the selected operation, and acquiring corresponding content offset information; according to the content offset information, acquiring a file block in which the content of the selected file is located and an address in the file block in which the content of the selected file is located; generating a shared content sequence from the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the sequence; and writing the sharing content sequence into metadata of the file to which the selected file content belongs according to the file ID information of the file to which the selected file content belongs, and adding sharing loading attributes for the sharing content sequence in the metadata of the file.
Correspondingly, the file sharing method based on the network disk provided by the embodiment specifically includes:
step 201, receiving a selection operation of a file and a file content in a network disk, and obtaining file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs.
Step 202, determining the number of files to be shared according to the file ID information of the file selected by the selected operation and the file ID information of the file to which the file content selected by the selected operation belongs, and determining a file content integration rule according to the number of files to be shared.
Step 203, acquiring the sequence of the file contents selected by the selected operation, and acquiring corresponding content offset information.
Since the user selects the file contents when performing the selection operation, a plurality of partial contents of a single file or partial file contents of a plurality of files may be selected. In order to obtain the content offset information corresponding to the part of file content so as to facilitate subsequent file content sharing, the content offset information corresponding to the selected file content can be obtained one by one according to the sequence of the file content selected by the user selection operation, so that the content offset information of all the file content to be shared is obtained.
In the practical application process, if a user selects the content of a file for sharing, the user needs to open the file first and then can select the content in the file, and in a single file, the user can finish the selection of the content to be shared in the file with high probability. Therefore, by acquiring the sequence of the file contents selected by the selected operation and acquiring the corresponding content offset information according to the sequence of the file contents selected by the user selected operation, not only can the acquisition of the content offset information corresponding to the contents in a plurality of files be realized, but also the acquisition of the content offset information corresponding to the contents selected in a single file is more convenient, and the acquisition difficulty of the content offset information is reduced.
Step 204, according to the content offset information, obtaining the file block where the content of the selected file is located and the address in the file block where the content of the selected file is located.
For files or programs that require efficient, fast, and reliable data access, developers prefer to use data block (also called file block) storage. Data block storage is a technique for controlling data storage and memory devices. It will take any data (such as a file or database entry) and then divide it into equal sized data blocks. The data block storage system then stores the data blocks on the underlying physical storage in a manner optimized for quick access and retrieval.
When the file content is selected by the user through the selecting operation, the data block of the file corresponding to the file content is actually required to be obtained according to the file ID information, and then the specific data block corresponding to the selected file content in the file data block and the data position (i.e. address) in the data block can be obtained according to the content offset information.
Step 205, generating a shared content sequence from the file block where the file content is selected in the selected operation and the address in the file block where the file content is selected according to the sequence.
Because the sharing of the whole file in the network disk can be realized by acquiring the metadata of the file and sending the metadata of the file to other network disk users as index links, the other network disk users can obtain the file blocks corresponding to the file through the metadata of the file, and the file content of the whole file is obtained.
Aiming at the file content selected by the user, address information needs to be added for the selected file content due to lack of the file blocks and address information in the file blocks, so that the subsequent network disk user can directly obtain the file blocks of the file content according to the address information, and further obtain the file content in the file blocks.
For example, the file block where the file content is selected in the selecting operation and the address in the file block where the file content is selected may be generated into a shared content sequence, where the shared content sequence may be a byte identical to the metadata of the file to which the corresponding file content belongs, so as to facilitate writing the shared content sequence into the metadata of the file.
Step 206, writing the shared content sequence into metadata of the file to which the selected file content belongs according to the file ID information of the file to which the selected file content belongs, and adding a shared loading attribute to the shared content sequence in the metadata of the file.
In the actual application process, for the file content selected by each selected operation, the file ID information of the file to which the file content selected by the selected operation belongs can be obtained first, then the shared content sequence corresponding to the file content is written into the metadata of the file to which the shared content sequence belongs, and the shared loading attribute is added for the shared content sequence in the metadata of the file.
For file contents in a single file, the sequence selected by a user may be different from the sequence of the file contents in the file, so that the problem of confusion of the single file contents in the subsequent sharing and loading process may be caused. Therefore, in order to facilitate the subsequent shared users to view the file content more conveniently and clearly, a sharing loading attribute can be added to the sharing content sequence in the metadata of the file, so that a plurality of file contents shared in a single file can be loaded according to the original content sequence of the file in the subsequent loading process, and the shared users can view the file.
For example, the shared loading attribute may be loaded according to the order of the file blocks corresponding to the shared content sequence in the file blocks corresponding to the belonging files. Since the file contents in the file are sequentially stored in the file blocks, the display of the file contents is facilitated. Therefore, when the file metadata is written in the shared content sequences corresponding to the file contents in the single file, the sharing loading attribute can be added to the shared content sequences. When the shared user obtains the file content through the file metadata, the file blocks corresponding to the file content can be loaded according to the sharing loading attribute, so that a plurality of file contents in the shared file are obtained, and the arrangement sequence of the file contents is the same as the original sequence.
Step 207, obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file.
And step 208, integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block stream.
And 209, receiving a sharing operation of the network disk user, and sharing the file block stream according to the sharing operation.
The embodiment is specifically optimized by acquiring the content offset information corresponding to the content of the file selected by the selected operation: acquiring the sequence of the file contents selected by the selected operation, and acquiring corresponding content offset information; according to the content offset information, acquiring a file block in which the content of the selected file is located and an address in the file block in which the content of the selected file is located; generating a shared content sequence from the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the sequence; and writing the sharing content sequence into metadata of the file to which the selected file content belongs according to the file ID information of the file to which the selected file content belongs, and adding sharing loading attributes for the sharing content sequence in the metadata of the file.
Through the steps, not only can the content offset information corresponding to the content of the selected file be obtained, but also the file block corresponding to the content of the selected file and the address in the file block are obtained. And the shared content sequence is generated by the file block where the selected file content is located and the address in the file block where the file content is located, and the shared content sequence is written into the metadata of the file where the file content is located, so that the subsequent shared user can directly acquire the file block corresponding to the file content and the address in the file block where the file content is located through the shared content sequence in the metadata of the file, further the shared file content is more conveniently and rapidly obtained, the direct sharing and acquisition of local content of the file are realized, and the improvement of the sharing efficiency and the sharing effect of the file are facilitated.
In addition, according to the embodiment, the sharing loading attribute is added for the sharing content sequence, when the shared user obtains the file content through the file metadata, the file block corresponding to the file content can be loaded according to the sharing loading attribute, so that a plurality of file contents in the shared file are obtained, the arrangement sequence of the file contents is the same as the original sequence, the shared user can more conveniently and clearly check the file contents, and the reading difficulty of the shared user is reduced.
Example III
Fig. 3 is a flow chart of a file sharing method based on a network disk according to a third embodiment of the present invention.
In this embodiment, the number of files to be shared is determined according to the file ID information of the file selected by the selecting operation and the file ID information of the file to which the file content belongs, and the file content integration rule is determined according to the number of files to be shared, which is specifically optimized as follows: obtaining the number of the files corresponding to the content of the selected file and the comparison result of the number of the files selected by the selected operation according to the file ID information of the selected file by the selected operation and the file ID information of the file to which the content of the selected file belongs; determining the number of files to be shared according to the number of files corresponding to the content of the selected files in the selected operation and the comparison result of the number of the files selected in the selected operation; and determining a file content integration rule according to the number of the files to be shared.
Correspondingly, the file sharing method based on the network disk provided by the embodiment specifically includes:
step 301, receiving a selection operation of a file and a file content in a network disk, and obtaining file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs.
Step 302, obtaining the number of the files corresponding to the content of the selected file and the comparison result of the number of the files selected by the selected operation according to the file ID information of the selected file and the file ID information of the file to which the content of the selected file belongs.
Because a large number of files may exist in the network disk at the same time, and when the network disk user selects a file, the network disk user does not have to select the whole file, and may also select part of the content in a single file. Therefore, only the selected operation of receiving the files and the file contents may cause the situation that the number of the selected files is not matched with the number of the files corresponding to the selected file contents, so that further judgment on the number of the files to be shared is needed.
Illustratively, the network disk user has selected only a portion of the content in a single file, and has not selected any files. At this time, the number of files to be shared is zero, but in practice, the data block streams corresponding to part of the content in the single file still need to be integrated according to the file content integration rule corresponding to the selected single file. Therefore, it is necessary to judge this situation, so as to improve the accuracy of file content integration.
Similarly, when the network disk user selects a plurality of partial contents in a single file and does not select any file, the data block streams corresponding to the partial contents in the single file still need to be integrated according to the file content integration rule corresponding to the selected single file.
Otherwise, when the network disk user selects part of the content in the plurality of files and does not select any file, the data block streams corresponding to the part of the content in the plurality of files are integrated according to the file content integration rule corresponding to the plurality of files.
The file ID information is used as the unique identification information of the file, and the file ID information of the file is identical with the file content of the same file. Therefore, the number of the actual files to be shared can be obtained by comparing the file ID information of the files with the file content.
Step 303, determining the number of files to be shared according to the number of files corresponding to the content of the selected file in the selected operation and the comparison result of the number of files selected in the selected operation.
By acquiring the file ID information of the selected file and the file to which the content of the selected file belongs, information such as the inode number, the file size, the access authority, the creation time, the modification time, the position of the data on the disk and the like of the file can be obtained.
By matching and matching file ID information of the file to which the selected file content belongs, the file content with the same file ID information can be used as a file to be shared, and the files with the same file ID information are the same. Therefore, the repeated selected file content or files can be eliminated, and the number of files to be shared actually in the file content actually selected is further obtained and is used for determining file content integration rules subsequently.
In the actual application process, if a plurality of contents of a single file are selected, but no file is selected. At this time, by acquiring the file ID information and comparing, a plurality of contents all belong to the same file, and then the data block streams corresponding to part of the contents in the single file can be integrated according to the file content integration rule corresponding to the selected single file.
Otherwise, if the plurality of file contents and the plurality of files are selected, the part of file contents belong to the same file by acquiring the file ID information and comparing, and then the number of the files actually corresponding to the selected plurality of file contents can be obtained, and at the moment, the data block streams corresponding to the part of contents in the plurality of files are required to be integrated according to the file content integration rule corresponding to the plurality of files. Similarly, by acquiring the file ID information and comparing, the condition that the file content and the file to which the file content belongs are repeatedly selected can be obtained, so that the data block stream corresponding to the repeated file content can be conveniently processed by the subsequent file content integration rule, and repeated acquisition or integration of the data block stream with the repeated content is avoided.
And 304, determining a file content integration rule according to the number of the files to be shared.
The number of the files to be shared truly by the network disk user can be obtained by comparing the corresponding files of the selected file content with the actual number of the selected files, and the method is further used for determining the integration rule of the file content.
In this embodiment, when a plurality of files and a plurality of contents are selected, the number of files to be shared actually is obtained by obtaining and comparing the file ID information, and after determining the file content integration rule, the data block stream corresponding to the repeatedly selected file content can be removed by using the file content integration rule, so that the file information redundancy is reduced, and the integration and sharing efficiency of the data block stream is further improved.
Specifically, when the network disk user selects the file content to be shared, the file needs to be previewed or opened first, and then the content in the file is selected. After the network disk user selects part of the content of the file, the file is possibly selected again due to the preview condition and the actual need, and the whole file is shared. At this time, the file and the content thereof which are repeatedly selected can be obtained by acquiring the file ID information of the file corresponding to the content of the selected file and comparing the file ID information with the file ID information of the selected file, and then the data block stream corresponding to the content of the repeatedly selected file can be processed through the file content integration rule.
For example, when the whole file and part of the content thereof are repeatedly selected, only the data block stream corresponding to the whole file is acquired, so that repeated acquisition of the content in the same file is avoided. Similarly, when the same file content is selected for multiple times, the data block stream corresponding to the file content is only acquired once, and the data block stream of the file content is not repeatedly acquired, so that the redundancy of file information is further reduced, and repeated integration and sharing of the file content are avoided.
Step 305, obtaining content offset information corresponding to the content of the file selected by the selected operation.
Step 306, obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file.
Step 207, integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule, so as to generate a file block stream.
And 308, receiving sharing operation of the network disk user, and sharing the file block stream according to the sharing operation.
In this embodiment, the number of files to be shared is determined by using the file ID information of the file selected according to the selected operation and the file ID information of the file to which the content of the file selected by the selected operation belongs, and the file content integration rule is determined according to the number of files to be shared, which is specifically optimized as follows: obtaining the number of the files corresponding to the content of the selected file and the comparison result of the number of the files selected by the selected operation according to the file ID information of the selected file by the selected operation and the file ID information of the file to which the content of the selected file belongs; determining the number of files to be shared according to the number of files corresponding to the content of the selected files in the selected operation and the comparison result of the number of the files selected in the selected operation; and determining a file content integration rule according to the number of the files to be shared.
Through the steps, the number of the files actually corresponding to the file contents to be shared can be determined, so that the corresponding file content integration rule is determined to integrate the data block streams corresponding to the file contents. And meanwhile, the file and the content thereof which are repeatedly selected can be obtained by acquiring and comparing the file ID information of the file to which the content of the selected file belongs and the file ID information of the selected file, so that the repeated acquisition of the data block stream corresponding to the same file content during the subsequent acquisition of the data block stream is avoided, the redundancy of the file information is further reduced, and the repeated sharing and integration of the file content are avoided.
Example IV
Fig. 4 is a flow chart of a file sharing method based on a network disk according to a fourth embodiment of the present invention. In this embodiment, the number of files to be shared is determined according to the comparison result of the number of files corresponding to the content of the selected file according to the selected operation and the number of files selected by the selected operation, and the following steps are added: and when the number of the files corresponding to the file content selected by the selected operation is inconsistent with the number of the files selected by the selected operation, taking the number of the files corresponding to the file content selected by the selected operation as the number of the files to be shared.
Correspondingly, the file sharing method based on the network disk provided by the embodiment specifically includes:
step 401, receiving a selection operation of a file and a file content in a network disk, and obtaining file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs.
Step 402, obtaining the number of files corresponding to the content of the selected file and the comparison result of the number of files selected by the selected operation according to the file ID information of the selected file and the file ID information of the file to which the content of the selected file belongs.
Step 403, determining the number of files to be shared according to the number of files corresponding to the content of the selected file in the selected operation and the comparison result of the number of files selected in the selected operation.
And 404, when the number of files corresponding to the file content selected by the selected operation is inconsistent with the number of files selected by the selected operation, taking the number of files corresponding to the file content selected by the selected operation as the number of files to be shared.
After the network disk user selects the file, the content of the selected file is equal to the whole content of the selected file, so that the content of the selected file cannot be zero, and if the content of the selected file is zero, the network disk user does not perform the selection or sharing operation. The network disk user may select part of the content of the file in the actual operation process, but does not select any file, at this time, the number of the selected files is zero, but the number of the actually selected files cannot be processed according to zero, and still the content of the files needs to be integrated and shared; therefore, whether the network disk user selects part of the content of the file needs to be judged later, and the number of the files actually selected by the network disk user is further obtained, so that the data block streams corresponding to the file content can be integrated conveniently later according to the file content integration rule.
For example, if the number of files corresponding to the content of the selected file is zero and the number of the selected files is one, it is indicated that the network disk user only selects the files, and the data block streams of the files need to be integrated according to the file content integration rule corresponding to the selected single file. Otherwise, if the number of files corresponding to the selected file content is one and the number of the selected files is zero, the network disk user only selects part of the content in the single file to share, and still needs to integrate the data block streams corresponding to the part of the content in the single file according to the file content integration rule corresponding to the selected single file.
And similarly, if the number of the selected files or the number of the files corresponding to the content of the selected files is larger than one, the network disk user is informed of selecting the content of the plurality of files for sharing, and the data block streams corresponding to part of the content in the plurality of files are integrated according to the file content integration rule corresponding to the plurality of files.
In the actual application process, when the number of files corresponding to the selected file content is different from the number of the selected files, this means that the network disk user selects the content in other files in addition to the files with the corresponding number, so that the data block streams corresponding to part of the content in the files need to be integrated according to the file content integration rules corresponding to the files. At this time, if the number of files corresponding to the content of the file selected by the selected operation is greater than the number of files selected by the selected operation, in order to ensure the accuracy of integrating the content of the subsequent file, the number of files corresponding to the content of the file selected by the selected operation needs to be used as the number of files to be shared.
Step 405, determining a file content integration rule according to the number of the files to be shared.
Step 406, obtaining content offset information corresponding to the content of the file selected by the selected operation.
Step 407, obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file.
By combining the processing manner when the file and the file content are repeated in the second embodiment, if the whole file and part of the content thereof are selected, only the data block stream corresponding to the whole file can be obtained, and the data block stream of the repeated file content in the file is not obtained any more, so that the repeated obtaining of the file content is avoided, the redundancy of the file information is reduced, and the integration efficiency of the subsequent data block streams is improved.
Step 408, integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule, so as to generate a file block stream.
And 409, receiving a sharing operation of the network disk user, and sharing the file block stream according to the sharing operation.
According to the embodiment, the number of the files to be shared is determined through the comparison result of the number of the files corresponding to the content of the files selected according to the selected operation and the number of the files selected by the selected operation, and the following steps are added: when the number of the files corresponding to the file content selected by the selected operation is inconsistent with the number of the files selected by the selected operation, the number of the files corresponding to the file content selected by the selected operation is used as the number of the files to be shared, so that the actual number of the files to be shared by the network disk user can be obtained, and the file content integration rule can be more accurately determined.
Example five
Fig. 5 is a flow chart of a file sharing method based on a network disk according to a fifth embodiment of the present invention; the present embodiment optimizes the file content integration rule based on the above embodiment, and in this embodiment, the file content integration rule is specifically optimized as follows: and when the number of the files to be shared is single, directly generating a file block stream by using the data block stream corresponding to the file selected by the selected operation or the data block stream corresponding to the file content selected by the selected operation. And when the number of the files to be shared is multiple, merging the data block stream corresponding to the file selected by the selected operation with the data block stream corresponding to the file content selected by the selected operation according to a preset arrangement mode to generate a file block stream.
Correspondingly, the file sharing method based on the network disk provided by the embodiment specifically includes:
step 501, receiving a selection operation of a file and a file content in a network disk, and obtaining file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs.
Step 502, obtaining the number of files corresponding to the content of the selected file and the comparison result of the number of files selected by the selected operation according to the file ID information of the selected file and the file ID information of the file to which the content of the selected file belongs.
Step 503, determining the number of files to be shared according to the number of files corresponding to the content of the selected file and the comparison result of the number of files selected by the selected operation.
And 504, when the number of files corresponding to the file content selected by the selected operation is inconsistent with the number of files selected by the selected operation, taking the number of files corresponding to the file content selected by the selected operation as the number of files to be shared.
Step 505, determining a file content integration rule according to the number of the files to be shared.
Step 506, obtaining content offset information corresponding to the content of the file selected by the selected operation.
Step 507, obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file.
And step 508, integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block stream.
Step 509, when the number of files to be shared is single, directly generating a file block stream by using the data block stream corresponding to the file selected by the selected operation or the data block stream corresponding to the content of the file selected by the selected operation.
Since the data block stream of the single file or the file content in the single file can be directly obtained without merging or combining, when the single file or the file content of the single file is selected, the metadata (i.e., the data block stream) of the single file can be directly obtained as the file block stream. For the file content of the selected single file, loading can be performed subsequently according to the shared content sequence and the corresponding shared loading attribute in the metadata, so that the shared user can view the shared file content.
Compared with the existing whole file sharing, in the actual operation process, the network disk user can share the partial content of the file to be shared to the sharee by selecting the partial content of the file to generate the file block stream, so that the redundancy of the file information is reduced, the file sharing efficiency is improved, the sharee can acquire the shared content more directly, and the convenient sharing of the file is realized.
And 510, when the number of the files to be shared is multiple, merging the data block stream corresponding to the file selected by the selected operation with the data block stream corresponding to the file content selected by the selected operation according to a preset arrangement mode to generate a file block stream.
When the number of the files to be shared is multiple, the files or the file contents in the different files are necessarily present, and after the data block streams of the corresponding files and the file contents are obtained, the data block streams need to be combined to form a whole section of data block stream, so that the new file block stream can be generated. However, the merging of the data block streams needs to be performed in a regular arrangement mode, so that file contents in the file block streams generated after merging can be arranged and displayed in a certain sequence, and the file contents are convenient for a subsequent sharee to check.
Optionally, the preset arrangement includes, but is not limited to, one or several of the following:
1. and splicing the plurality of data block streams in sequence according to the file selection order to generate a file block stream, wherein the operation of selecting the file content can be equal to the operation of selecting the file. By adopting the mode, when the network disk user shares the file, the file or the file content to be shared can be sequentially selected according to the file preview condition and the file content which the network disk user wants to view in turn, and then the acquired data block streams are sequentially spliced according to the file selection sequence, so that the merging and integration of the data block streams are realized, and further the file block streams are generated.
2. And splicing the plurality of data block streams in sequence according to the selected sequence of the folders to generate a file block stream. By adopting the preset arrangement mode, when the network disk user shares files, according to the file preview condition, the network disk user can sequentially select the folders needing to be shared according to the file content in the folders which the network disk user wants to sequentially check, determine that the subsequent data block streams are spliced according to the folder selection sequence, and then the network disk user can splice the acquired data block streams according to the folder selection sequence even if the network disk user does not select the files or the file content according to the folder selection sequence, so that the file block streams are generated.
Specifically, by adopting the preset arrangement mode, the contents in the data block streams can be integrated according to folders, and after the data block streams in each folder are spliced according to the file or file content selection sequence in the folder, the data block streams corresponding to the folders are spliced according to the folder selection sequence. And finally, segmenting or grouping the contents in the file block stream according to the folders, and arranging the contents according to the selected sequence of the folders, so that sharees can conveniently and quickly view the file contents in the same folder.
3. And splicing the plurality of data block streams in sequence according to the file attribute information arrangement order to generate a file block stream. The file attribute information includes a name, an identifier, a type, a location, a size, a modification time, and the like. For example, taking the case of splicing sequentially according to the name arrangement sequence, the file block streams can be arranged according to a file name arrangement mechanism from the Arabic letters A to Z in the prior art to obtain the file attribute information arrangement sequence of the file, and then the data block streams obtained correspondingly are spliced sequentially according to the corresponding file name arrangement mode to generate the file block streams. In the practical application process, a person skilled in the art can select other types of file attribute information and the corresponding arrangement sequence thereof according to practical needs to arrange the data block streams so as to realize that the data block streams are spliced in sequence according to the arrangement sequence of the file attribute information of the corresponding file to generate the file block streams, and further realize that the content in the file block streams can be arranged according to rules, so that the content can be conveniently checked by a subsequent sharee, and the repeated description is omitted.
In an actual use process, before a network disk user selects a file or file content, a preset arrangement mode option can be provided for the network disk user, so that the network disk user can select a proper preset arrangement mode according to actual needs, and then when a plurality of files and/or a plurality of file contents are selected, the acquired data block streams can be spliced in sequence according to the preset arrangement mode selected by the network disk user, so that a new file block stream is generated.
And step 511, receiving a sharing operation of the network disk user, and sharing the file block stream according to the sharing operation.
The embodiment specifically optimizes the file content integration rule as follows: and when the number of the files to be shared is single, directly generating a file block stream by using the data block stream corresponding to the file selected by the selected operation or the data block stream corresponding to the file content selected by the selected operation. And when the number of the files to be shared is multiple, merging the data block stream corresponding to the file selected by the selected operation with the data block stream corresponding to the file content selected by the selected operation according to a preset arrangement mode to generate a file block stream. After the plurality of file block streams are obtained, the plurality of data block streams can be combined and integrated according to a preset arrangement mode, so that the plurality of data block streams can be spliced in sequence according to the preset arrangement mode, further the file block streams are generated, the contents in the file block streams can be arranged according to a rule, the file block streams are convenient for a sharer to check, and the convenience of file sharing is further improved.
Example six
Fig. 6 is a schematic structural diagram of a file sharing device based on a network disk according to a sixth embodiment of the present invention; as shown in fig. 6, the file sharing device based on a network disk includes:
the receiving module 601 is configured to receive a selection operation of a file and a file content in a network disk, and obtain file ID information of the file selected by the selection operation and file ID information of a file to which the file content selected by the selection operation belongs.
The determining module 602 is configured to determine the number of files to be shared according to the file ID information of the file selected by the selecting operation and the file ID information of the file to which the file content belongs, and determine a file content integration rule according to the number of files to be shared.
And the obtaining module 603 is configured to obtain content offset information corresponding to the content of the file selected by the selecting operation.
The reading module 604 is configured to obtain a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtain a data block stream corresponding to the selected file according to the file ID information of the file to which the content of the selected file belongs and the content offset information corresponding to the content of the selected file.
And the integration module 605 is configured to integrate, according to the file content integration rule, a data block stream corresponding to the file selected by the selected operation and a data block stream corresponding to the file content selected by the selected operation, so as to generate a file block stream.
And the sharing module 606 is configured to receive a sharing operation of the network disk user, and share the file block stream according to the sharing operation.
According to the file sharing device based on the network disk, the file content integration rule is determined by selecting the number of files, and the file block flow can be integrated according to the file content integration rule to generate the file block flow for sharing, so that the operation difficulty of file sharing can be reduced, the file information redundancy is reduced, and the file sharing efficiency is improved.
On the basis of the above embodiments, the determining module includes:
and the comparison unit is used for obtaining the number of the files corresponding to the content of the selected file in the selected operation and the comparison result of the number of the files in the selected operation according to the file ID information of the selected file in the selected operation and the file ID information of the file to which the content of the selected file in the selected operation belongs.
And the computing unit is used for determining the number of the files to be shared according to the number of the files corresponding to the content of the files selected by the selected operation and the comparison result of the number of the files selected by the selected operation.
And the analysis unit is used for determining file content integration rules according to the number of the files to be shared.
On the basis of the above embodiments, the obtaining module includes:
the invoking unit is used for acquiring the sequence of the file contents selected by the selected operation and acquiring corresponding content offset information;
the obtaining unit is used for obtaining the address of the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the content offset information;
the generating unit is used for generating a shared content sequence from the address of the file block where the file content is selected in the selected operation and the address in the file block where the file content is selected in the selected operation according to the sequence;
and the writing unit is used for writing the shared content sequences into metadata of the file to which the file content selected by the selected operation belongs respectively, and adding a shared loading attribute for the shared content sequences in the metadata of the file.
The file sharing device based on the network disk provided by the embodiment of the invention can execute the file sharing method based on the network disk provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example seven
Fig. 7 is a schematic structural diagram of a mesh disc according to a seventh embodiment of the present invention. Fig. 7 shows a block diagram of an exemplary network disk 12 suitable for use in implementing embodiments of the present invention. The net tray 12 shown in fig. 7 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
As shown in fig. 7, the network disk 12 is embodied in the form of a general purpose computing device. Components of the net tray 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The network disk 12 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed by the network disk 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The network disk 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard disk drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The network disk 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the network disk 12, and/or any devices (e.g., network card, modem, etc.) that enable the network disk 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the network disk 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, network adapter 20 communicates with other modules of network disk 12 via bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with the network disk 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes programs stored in the system memory 28 to perform various functional applications and data processing, for example, to implement the network disk-based file sharing method provided by the embodiment of the present invention.
Example eight
An eighth embodiment of the present invention further provides a storage medium containing computer executable instructions, which when executed by a computer processor, are configured to perform the network disk-based file sharing method according to any one of the foregoing embodiments.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. The file sharing method based on the network disk is characterized by comprising the following steps of:
receiving a selection operation of a file and file content in a network disk, and acquiring file ID information of the file selected by the selection operation and file ID information of the file to which the file content selected by the selection operation belongs;
determining the number of files to be shared according to the file ID information of the selected file in the selected operation and the file ID information of the file to which the content of the selected file belongs, and determining a file content integration rule according to the number of files to be shared;
Acquiring content offset information corresponding to the content of the selected file in the selected operation;
obtaining a data block stream corresponding to the file selected by the selected operation according to the file ID information of the file selected by the selected operation, and obtaining a data block stream corresponding to the file content selected by the selected operation according to the file ID information of the file to which the file content selected by the selected operation belongs and the content offset information corresponding to the file content selected by the selected operation;
integrating the data block stream corresponding to the file selected by the selected operation and the data block stream corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block stream;
receiving sharing operation of a network disk user, and sharing file block streams according to the sharing operation;
the obtaining the content offset information corresponding to the content of the file selected by the selecting operation includes:
acquiring the sequence of the file contents selected by the selected operation, and acquiring corresponding content offset information;
according to the content offset information, acquiring a file block in which the content of the selected file is located and an address in the file block in which the content of the selected file is located;
generating a shared content sequence from the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the sequence;
And writing the sharing content sequence into metadata of the file to which the selected file content belongs according to the file ID information of the file to which the selected file content belongs, and adding sharing loading attributes for the sharing content sequence in the metadata of the file.
2. The method of claim 1, wherein the sharing of the load attribute comprises:
and loading according to the sequence of the file blocks corresponding to the shared content sequence in the file blocks corresponding to the file.
3. The method according to claim 1, wherein the determining the number of files to be shared according to the file ID information of the selected file in the selecting operation and the file ID information of the file to which the content of the selected file belongs, and determining the file content integration rule according to the number of files to be shared, includes:
obtaining the number of the files corresponding to the content of the selected file and the comparison result of the number of the files selected by the selected operation according to the file ID information of the selected file by the selected operation and the file ID information of the file to which the content of the selected file belongs;
determining the number of files to be shared according to the number of files corresponding to the content of the selected files in the selected operation and the comparison result of the number of the files selected in the selected operation;
And determining a file content integration rule according to the number of the files to be shared.
4. The method according to claim 3, wherein after determining the number of files to be shared according to the comparison result of the number of files corresponding to the content of the selected file in the selecting operation and the number of files selected in the selecting operation, the method further comprises:
and when the number of the files corresponding to the file content selected by the selected operation is inconsistent with the number of the files selected by the selected operation, taking the number of the files corresponding to the file content selected by the selected operation as the number of the files to be shared.
5. The utility model provides a file sharing device based on net dish which characterized in that includes:
the receiving module is used for receiving the selected operation of the files and the file contents in the network disk, and acquiring the file ID information of the files selected by the selected operation and the file ID information of the files belonging to the file contents selected by the selected operation;
the determining module is used for determining the number of the files to be shared according to the file ID information of the file selected by the selected operation and the file ID information of the file to which the content of the file selected by the selected operation belongs, and determining a file content integration rule according to the number of the files to be shared;
The acquisition module is used for acquiring content offset information corresponding to the content of the selected file in the selected operation;
the reading module is used for obtaining a data block stream corresponding to the selected file according to the file ID information of the selected file, and obtaining a data block stream corresponding to the selected file according to the file ID information of the file to which the selected file content belongs and the content offset information corresponding to the selected file;
the integration module is used for integrating the data block flow corresponding to the file selected by the selected operation and the data block flow corresponding to the file content selected by the selected operation according to the file content integration rule to generate a file block flow;
and the sharing module is used for receiving the sharing operation of the network disk user and sharing the file block stream according to the sharing operation.
6. The network disk-based file sharing device according to claim 5, wherein the determining module comprises:
the comparison unit is used for obtaining the number of the files corresponding to the content of the selected file in the selected operation and the comparison result of the number of the files in the selected operation according to the file ID information of the selected file in the selected operation and the file ID information of the file to which the content of the selected file in the selected operation belongs;
The computing unit is used for determining the number of the files to be shared according to the number of the files corresponding to the content of the files selected by the selected operation and the comparison result of the number of the files selected by the selected operation;
and the analysis unit is used for determining file content integration rules according to the number of the files to be shared.
7. The network disk-based file sharing device according to claim 5, wherein the obtaining module comprises:
the invoking unit is used for acquiring the sequence of the file contents selected by the selected operation and acquiring corresponding content offset information;
the obtaining unit is used for obtaining the address of the file block where the file content selected by the selected operation is located and the address in the file block where the file content is located according to the content offset information;
the generating unit is used for generating a shared content sequence from the address of the file block where the file content is selected in the selected operation and the address in the file block where the file content is selected in the selected operation according to the sequence;
and the writing unit is used for writing the shared content sequences into metadata of the file to which the file content selected by the selected operation belongs respectively, and adding a shared loading attribute for the shared content sequences in the metadata of the file.
8. A net tray, the net tray comprising:
one or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the web-based file sharing method of any of claims 1-4.
9. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the web-based file sharing method of any of claims 1-4.
CN202310300896.4A 2023-03-27 2023-03-27 File sharing method and device based on network disk, network disk and storage medium Active CN116016553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310300896.4A CN116016553B (en) 2023-03-27 2023-03-27 File sharing method and device based on network disk, network disk and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310300896.4A CN116016553B (en) 2023-03-27 2023-03-27 File sharing method and device based on network disk, network disk and storage medium

Publications (2)

Publication Number Publication Date
CN116016553A CN116016553A (en) 2023-04-25
CN116016553B true CN116016553B (en) 2023-08-11

Family

ID=86025194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310300896.4A Active CN116016553B (en) 2023-03-27 2023-03-27 File sharing method and device based on network disk, network disk and storage medium

Country Status (1)

Country Link
CN (1) CN116016553B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104933062A (en) * 2014-03-19 2015-09-23 中国移动通信集团浙江有限公司 File merging method and apparatus
CN105049317A (en) * 2015-05-21 2015-11-11 腾讯科技(深圳)有限公司 Message forwarding method and apparatus
CN105718808A (en) * 2016-01-18 2016-06-29 天津科技大学 File encryption storage system and method based on multiple network disks
CN107622067A (en) * 2016-07-13 2018-01-23 杭州海康威视数字技术股份有限公司 A kind of storage, reading and display methods and device to multiple multimedia files
WO2019061346A1 (en) * 2017-09-29 2019-04-04 西门子公司 Resource integration processing method and apparatus, and storage medium
CN110855547A (en) * 2019-09-30 2020-02-28 华为终端有限公司 Mail merging method and electronic equipment
CN111078655A (en) * 2019-12-23 2020-04-28 腾讯科技(深圳)有限公司 Document content sharing method and device, terminal and storage medium
CN111970189A (en) * 2020-07-31 2020-11-20 腾讯科技(深圳)有限公司 Content sharing control method and device, electronic equipment and storage medium
CN113055444A (en) * 2021-02-22 2021-06-29 深圳市迅雷网络技术有限公司 File sharing method and related device thereof
CN113467660A (en) * 2021-07-15 2021-10-01 维沃移动通信有限公司 Information sharing method and electronic equipment
CN114003963A (en) * 2021-12-30 2022-02-01 天津联想协同科技有限公司 Method, system, network disk and storage medium for file authorization under enterprise network disk
CN114416667A (en) * 2022-03-29 2022-04-29 天津联想协同科技有限公司 Method and device for rapidly sharing network disk file, network disk and storage medium
CN115114253A (en) * 2022-07-19 2022-09-27 展讯通信(天津)有限公司 File sharing method and device, chip and electronic equipment
CN115826828A (en) * 2023-02-23 2023-03-21 天津联想协同科技有限公司 Network disk file operation method, device, terminal and storage medium
CN115840731A (en) * 2022-12-09 2023-03-24 阿里巴巴(中国)有限公司 File processing method, computing device and computer storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104933062A (en) * 2014-03-19 2015-09-23 中国移动通信集团浙江有限公司 File merging method and apparatus
CN105049317A (en) * 2015-05-21 2015-11-11 腾讯科技(深圳)有限公司 Message forwarding method and apparatus
CN105718808A (en) * 2016-01-18 2016-06-29 天津科技大学 File encryption storage system and method based on multiple network disks
CN107622067A (en) * 2016-07-13 2018-01-23 杭州海康威视数字技术股份有限公司 A kind of storage, reading and display methods and device to multiple multimedia files
WO2019061346A1 (en) * 2017-09-29 2019-04-04 西门子公司 Resource integration processing method and apparatus, and storage medium
CN110855547A (en) * 2019-09-30 2020-02-28 华为终端有限公司 Mail merging method and electronic equipment
CN111078655A (en) * 2019-12-23 2020-04-28 腾讯科技(深圳)有限公司 Document content sharing method and device, terminal and storage medium
CN111970189A (en) * 2020-07-31 2020-11-20 腾讯科技(深圳)有限公司 Content sharing control method and device, electronic equipment and storage medium
CN113055444A (en) * 2021-02-22 2021-06-29 深圳市迅雷网络技术有限公司 File sharing method and related device thereof
CN113467660A (en) * 2021-07-15 2021-10-01 维沃移动通信有限公司 Information sharing method and electronic equipment
CN114003963A (en) * 2021-12-30 2022-02-01 天津联想协同科技有限公司 Method, system, network disk and storage medium for file authorization under enterprise network disk
CN114416667A (en) * 2022-03-29 2022-04-29 天津联想协同科技有限公司 Method and device for rapidly sharing network disk file, network disk and storage medium
CN115114253A (en) * 2022-07-19 2022-09-27 展讯通信(天津)有限公司 File sharing method and device, chip and electronic equipment
CN115840731A (en) * 2022-12-09 2023-03-24 阿里巴巴(中国)有限公司 File processing method, computing device and computer storage medium
CN115826828A (en) * 2023-02-23 2023-03-21 天津联想协同科技有限公司 Network disk file operation method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN116016553A (en) 2023-04-25

Similar Documents

Publication Publication Date Title
US11146614B2 (en) Distributed computing on document formats
US7949938B2 (en) Comparing and merging multiple documents
CN108509556B (en) Data migration method and device, server and storage medium
CN106648569B (en) Target serialization realization method and device
CN114003963B (en) Method, system, network disk and storage medium for file authorization under enterprise network disk
US11429494B2 (en) File backup based on file type
CN113760839A (en) Log data compression processing method and device, electronic equipment and storage medium
US9213759B2 (en) System, apparatus, and method for executing a query including boolean and conditional expressions
US8589454B2 (en) Computer data file merging based on file metadata
US20140129564A1 (en) Providing file indexes and per-file viewing modes within a file management application
CN113448562B (en) Automatic logic code generation method and device and electronic equipment
CN113760894A (en) Data calling method and device, electronic equipment and storage medium
CN116016553B (en) File sharing method and device based on network disk, network disk and storage medium
US20200242178A1 (en) Search processing method and apparatus based on clipboard data
CN112039975A (en) Method, device, equipment and storage medium for processing message field
CN115408358B (en) Network disk online file management method and device, network disk and storage medium
US11157477B2 (en) Handling queries in document systems using segment differential based document text-index modelling
US9495151B1 (en) Automatic comment creation for computer files
KR101828466B1 (en) Method and apparatus for providing an object-based storage interface on the storage device based on file system
CN114265846A (en) Data operation method and device, electronic equipment and storage medium
US9767191B2 (en) Group based document retrieval
JP2925042B2 (en) Information link generation method
CN116010356B (en) Method, device, network disk and storage medium for quickly previewing file through label
JP5629438B2 (en) File management apparatus and control method thereof
CN115248803B (en) Collection method and device suitable for network disk file, network disk and storage medium

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
GR01 Patent grant
GR01 Patent grant