Disclosure of Invention
The embodiment of the invention provides a distributed data storage method and a distributed data storage device, which are used for improving the production efficiency, enabling the digital printing process to be more automatic and specialized, saving the manual inspection cost and enhancing the safety control and cooperative work capacity of a process system.
One aspect of the embodiments of the present invention is to provide a distributed data storage method, including:
receiving a file uploading request sent by a user terminal;
acquiring an IP address and a storage address of a main storage server according to the file uploading request;
sending the IP address and the storage address of the main storage server to the user terminal so that the user terminal can upload files according to the IP address and the storage address of the main storage server;
receiving the file, and generating a standard PDF file, a printing inspection analysis report and a printable TIFF (TIFF) graph;
determining whether the file needs to be backed up according to a preset rule, wherein the preset rule is used for determining that at least one of the file, the standard PDF file, the printing inspection analysis report and the printable TIFF image needs to be backed up;
and if the file needs to be backed up, storing the file needing to be backed up to the secondary storage server.
Another aspect of an embodiment of the present invention is to provide a distributed data storage apparatus, including:
the receiving module is used for receiving a file uploading request sent by a user terminal;
the acquisition module is used for acquiring the IP address and the storage address of the main storage server according to the file uploading request;
the sending module is used for sending the IP address and the storage address of the main storage server to the user terminal so that the user terminal can upload files according to the IP address and the storage address of the main storage server;
the generating module is used for generating a standard PDF file, a printing inspection analysis report and a printable TIFF after the receiving module receives the file;
a determining module, configured to determine whether the file needs to be backed up according to a preset rule, where the preset rule is used to determine that at least one of the file, the standard PDF file, the print inspection analysis report, and the printable TIFF map needs to be backed up;
and the storage module is used for storing the files needing to be backed up to the secondary storage server if the files need to be backed up.
The distributed data storage method and the distributed data storage device provided by the embodiment of the invention can perform distributed storage on files based on a network file system, and a user can directly access the storage system, so that the storage system is more visual and efficient; based on a distributed storage design mode, storage resources can be dynamically added or changed at any time, and horizontal expansion storage is facilitated; the selective backup strategy leads the user to backup resources according to the needs, abandons irrelevant temporary data or non-critical data, and reduces the requirement of the system on storage space, thereby improving the production efficiency, ensuring that the digital printing process is more automatic and specialized, saving the manual inspection cost, and enhancing the safety control and cooperative working capability of the process system.
Detailed Description
FIG. 1 is a flow chart of a distributed data storage method according to an embodiment of the present invention; fig. 2 is an architecture diagram of a memory system according to another embodiment of the present invention. The embodiment of the invention provides a distributed data storage method, which comprises the following specific steps:
and step S101, receiving a file uploading request sent by a user terminal.
The execution subject of this embodiment may be a storage system, as shown in fig. 2, the storage system includes a storage access module 20, a message queue 21, a storage backup module 22, a storage scheduling module 23, a master storage server 24, and a slave storage server 25.
Specifically, the user terminal may be a terminal device used by typesetters, editors or auditors in digital book publishing, such as a personal computer, a tablet computer, a notebook computer, and the like. The file can be an electronic file edited by typesetters, editors or reviewers, such as an electronic book and a periodical. The storage access module 20 receives a file upload request sent by a user terminal.
And step S102, acquiring the IP address and the storage address of the main storage server according to the file uploading request.
The storage scheduling module 23 may be configured to obtain an IP address and a storage address of the primary storage server 24, specifically, the storage scheduling module 23 stores the IP address and the storage address of the primary storage server 24, the storage access module 20 sends request information to the storage scheduling module 23 to request to obtain the IP address and the storage address of the primary storage server 24, that is, the storage access module 20 calls the storage scheduling module 23 to request to obtain the IP address and the storage address of the primary storage server 24, and the storage scheduling module 23 returns the IP address and the storage address of the storage server to the storage access module 20.
Step S103, the IP address and the storage address of the main storage server are sent to the user terminal, so that the user terminal can upload files according to the IP address and the storage address of the main storage server.
The storage access module 20 sends the IP address and the storage address of the main storage server 24 to the user terminal, and the user terminal uploads the file according to the IP address and the storage address of the main storage server, specifically, the user terminal can send the file to be uploaded to the storage access module 20, and the storage access module 20 stores the file to be uploaded by the user terminal to the main storage server 24.
And step S104, receiving the file, and generating a standard PDF file, a printing inspection analysis report and a printable TIFF (TIFF picture).
In addition, the storage access module 20 generates a standard PDF file, a printing inspection analysis report, and a printable TIFF map after receiving a file that the user terminal needs to upload.
Step S105, determining whether the file needs to be backed up according to a preset rule, wherein the preset rule is used for determining that at least one of the file, the standard PDF file, the printing inspection analysis report and the printable TIFF image needs to be backed up.
In addition, the storage access module 20 calls the storage scheduling module 23 to query whether the file that needs to be uploaded by the user terminal needs to be backed up and the backup location, and in this embodiment, the file may be backed up to the secondary storage server 25.
The preset rule is used to set whether the file needs to be backed up, and the IP address of the server to be backed up, the directory of the backup storage, the number of the files that need to be backed up, and the backup time such as real-time backup or periodic backup, and further, the preset rule is used to set which of the file, the standard PDF file, the print inspection analysis report, and the printable TIFF map needs to be backed up.
And step S106, if the file needs to be backed up, storing the file needing to be backed up in the secondary storage server.
According to the embodiment, the files can be stored in a distributed manner based on the network file system, and a user can directly access the storage system, so that the storage system is more visual and efficient; based on a distributed storage design mode, storage resources can be dynamically added or changed at any time, and horizontal expansion storage is facilitated; the selective backup strategy leads the user to backup resources according to the needs, abandons irrelevant temporary data or non-critical data, and reduces the requirement of the system on storage space, thereby improving the production efficiency, ensuring that the digital printing process is more automatic and specialized, saving the manual inspection cost, and enhancing the safety control and cooperative working capability of the process system.
Fig. 3 is a flowchart of a distributed data storage method according to another embodiment of the present invention, and based on the embodiment shown in fig. 1, the distributed data storage method according to this embodiment includes the following steps:
step S301, receiving a file uploading request sent by a user terminal.
Step S301 is the same as step S101, and the detailed method is not described herein again.
Step S302, according to the file uploading request, the IP address and the storage address of the main storage server are obtained.
Step S302 is the same as step S102, and the detailed method is not described here again.
Step S303, sending the IP address and the storage address of the main storage server to the user terminal so that the user terminal can upload files according to the IP address and the storage address of the main storage server;
step S303 is the same as step S103, and the detailed method is not described here again.
And step S304, receiving the file and generating the ID of the file.
Step S305, generating the file name of the file according to the ID of the file and the IP address and/or the storage address of the main storage server.
In this embodiment, it is assumed that the IP address of the primary storage server is 192.168.0.101, the storage address of the primary storage server is uploadfile \ strororroot directory, the file name of the file is 16_17859.ps, and the file name 16_17859.ps is generated according to the ID of the file and the encoding of the primary storage server.
Step S306, generating a standard PDF file, a printing inspection analysis report and a printable TIFF picture.
Step S307, store the file in a directory corresponding to the storage address of the main storage server identified by the IP address.
For example, files 16_17859.ps are stored in \ \192.168.0.101\ uploadfile \ Stroreroot directory, and the path \ \192.168.0.101\ uploadfile \ Stroreroot \16_17859.ps is obtained.
Step S308, determining whether the file needs to be backed up according to a preset rule, wherein the preset rule is used for determining that at least one of the file, the standard PDF file, the printing inspection analysis report and the printable TIFF image needs to be backed up;
the preset rule is used for setting whether the file needs to be backed up, and an IP address of a server to be backed up, a directory stored by backup, the number of files needing to be backed up, and backup time such as real-time backup or periodic backup.
Step S309, if the file needs to be backed up, storing the file that needs to be backed up in the secondary storage server.
The storage access module 20 accesses a preset rule, determines that the file needs to be backed up, and the preset rule indicates that the file needs to be backed up to two locations, 192.168.0.102 and 192.168.0.103, and the storage access module 20 sends two backup messages to the message queue 21, where the two backup messages correspond to two backup messages backed up to 192.168.0.102 and 192.168.0.103, respectively.
The storage backup module 22 obtains two backup messages from the message queue 21, and stores the file and the standard PDF file into 192.168.0.102 copies and 192.168.0.103 copies according to the two backup messages, and during the storage, the file and the standard PDF file may be stored in real time or periodically.
In addition, when the user terminal requests to download the file, the storage access module calls the storage scheduling module to request to acquire the ID of the file and acquire the storage access rule of the file; the storage scheduling module dynamically acquires information of a storage server related to file storage for analysis, selects an IP address and a storage path of the storage server suitable for file downloading processing, and feeds back the IP address and the storage path to the storage access module; and the storage access module downloads the file to a specified position, if the file is downloaded successfully, the integrity of the file is verified, if the verification codes are consistent, the file is downloaded successfully and returned, and if the file is failed, a user is prompted to download the file unsuccessfully and return.
According to the embodiment, the files can be stored in a distributed manner based on the network file system, and a user can directly access the storage system, so that the storage system is more visual and efficient; based on a distributed storage design mode, storage resources can be dynamically added or changed at any time, and horizontal expansion storage is facilitated; the selective backup strategy leads the user to backup resources according to the needs, abandons irrelevant temporary data or non-critical data, and reduces the requirement of the system on storage space, thereby improving the production efficiency, ensuring that the digital printing process is more automatic and specialized, saving the manual inspection cost, and enhancing the safety control and cooperative working capability of the process system.
In addition, fig. 4 is a flowchart of a distributed data storage method according to another embodiment of the present invention, and fig. 5 is a flowchart of a distributed data storage method according to another embodiment of the present invention, and a specific method thereof is consistent with the above embodiment and is not repeated in detail.
Fig. 6 is a structural diagram of a distributed data storage apparatus according to an embodiment of the present invention. As shown in fig. 6, the distributed data storage device 60 includes a receiving module 61, an obtaining module 62, a sending module 63, a generating module 64, a determining module 65, and a storing module 66, where the receiving module 61 is configured to receive a file upload request sent by a user terminal; the obtaining module 62 is configured to obtain an IP address and a storage address of the main storage server according to the file uploading request; the sending module 63 is configured to send the IP address and the storage address of the primary storage server to the user terminal, so that the user terminal uploads a file according to the IP address and the storage address of the primary storage server; the generating module 64 is used for generating a standard PDF file, a printing inspection analysis report and a printable TIFF after the receiving module receives the file; the determining module 65 is configured to determine whether the file needs to be backed up according to a preset rule, where the preset rule is used to determine that at least one of the file, the standard PDF file, the print inspection analysis report, and the printable TIFF map needs to be backed up; the storage module 66 is used for storing the file to be backed up to the slave storage server if the file needs to be backed up.
The embodiment of the invention can perform distributed storage on the files based on the network file system, and the user can directly access the storage system, so that the storage system is more visual and efficient; based on a distributed storage design mode, storage resources can be dynamically added or changed at any time, and horizontal expansion storage is facilitated; the selective backup strategy leads the user to backup resources according to the needs, abandons irrelevant temporary data or non-critical data, and reduces the requirement of the system on storage space, thereby improving the production efficiency, ensuring that the digital printing process is more automatic and specialized, saving the manual inspection cost, and enhancing the safety control and cooperative working capability of the process system.
On the basis of the above embodiment, the generating module 64 is further configured to generate an ID of the file; and generating the file name of the file according to the ID of the file and the IP address and/or the storage address of the main storage server. The storage module 66 is further configured to store the file in a directory corresponding to the storage address of the primary storage server identified by the IP address. The preset rule further comprises an IP address of the slave storage server. The preset rule further comprises a storage address of the slave storage server.
The distributed data storage apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in fig. 1, and specific functions are not described herein again.
The embodiment of the invention can perform distributed storage on the files based on the network file system, and the user can directly access the storage system, so that the storage system is more visual and efficient; based on a distributed storage design mode, storage resources can be dynamically added or changed at any time, and horizontal expansion storage is facilitated; the selective backup strategy leads the user to backup resources according to the needs, abandons irrelevant temporary data or non-critical data, and reduces the requirement of the system on storage space, thereby improving the production efficiency, ensuring that the digital printing process is more automatic and specialized, saving the manual inspection cost, and enhancing the safety control and cooperative working capability of the process system.
In summary, the embodiment of the present invention can perform distributed storage on files based on a network file system, and a user can directly access the storage system, so that the storage system is more intuitive and efficient; based on a distributed storage design mode, storage resources can be dynamically added or changed at any time, and horizontal expansion storage is facilitated; the selective backup strategy leads the user to backup resources according to the needs, abandons irrelevant temporary data or non-critical data, and reduces the requirement of the system on storage space, thereby improving the production efficiency, ensuring that the digital printing process is more automatic and specialized, saving the manual inspection cost, and enhancing the safety control and cooperative working capability of the process system.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.