CN117056288A - Method and system for searching and downloading server file - Google Patents

Method and system for searching and downloading server file Download PDF

Info

Publication number
CN117056288A
CN117056288A CN202311035976.8A CN202311035976A CN117056288A CN 117056288 A CN117056288 A CN 117056288A CN 202311035976 A CN202311035976 A CN 202311035976A CN 117056288 A CN117056288 A CN 117056288A
Authority
CN
China
Prior art keywords
file
server
retrieval
inotify
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311035976.8A
Other languages
Chinese (zh)
Inventor
刘炳成
杨青峰
孙志成
李子申
王晨旭
王宁波
汪亮
刘振耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qilu Aerospace Information Research Institute
Aerospace Information Research Institute of CAS
Original Assignee
Qilu Aerospace Information Research Institute
Aerospace Information Research Institute of CAS
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 Qilu Aerospace Information Research Institute, Aerospace Information Research Institute of CAS filed Critical Qilu Aerospace Information Research Institute
Priority to CN202311035976.8A priority Critical patent/CN117056288A/en
Publication of CN117056288A publication Critical patent/CN117056288A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Abstract

A server file retrieval downloading method and system, comprising: confirming that the server is provided with an inotify tool, and monitoring file system operation; constructing a mysql server as a service database; collecting related events of the monitored file or directory by using an inotify tool, and writing the detected change condition of the server file into a log; constructing a java frame; connecting a service database in java, and regularly reading a record log by using a set of timing Task tools Spring-Task carried by Spring through a program written by the java; the user browses the viewing server file and downloads the desired data file through the retrieval function. The invention has the advantage of simple operation, does not need to know the destination address of destination downloading, has stronger universality and is suitable for various systems.

Description

Method and system for searching and downloading server file
Technical Field
The invention relates to the technical field of file retrieval and downloading of a computer Linux server, in particular to a method and a system for retrieving and downloading a server file.
Background
With the continuous development and perfection of the global satellite navigation system (GlobalNavigationSatelliteSystem, GNSS), GNSS has become a main means for obtaining high-precision positioning results. The user realizes positioning by obtaining satellite navigation data such as observation data, broadcast ephemeris, precise ephemeris, antenna phase center correction, ionosphere correction file, troposphere delay data, code deviation file and the like. Most units store these data files in the server and these data files are increasing in time. In general, we want to download the required files from the server to the computer, mainly, the client downloads the files by selecting the destination address of the download, the time spent selecting the path is determined by the directory level, and a great deal of time is spent manually searching the required data files, which greatly reduces the working efficiency. Next, the above-described function performs a download operation by copying the destination path address information and then by pasting. This operation is cumbersome and requires a range of system attributes, with limitations.
Disclosure of Invention
In order to overcome the problems in the prior art, the invention provides a server file retrieval and downloading method and a system, in particular to a server file retrieval and downloading method and a system based on java/mysql/inotify combination.
The invention is realized by the following technical scheme:
the invention relates to a server file retrieval and downloading method, which comprises the following steps:
step 1, confirming that a server is provided with an inotify tool, and monitoring file system operation;
step 2, constructing a mysql server as a service database;
step 3, collecting related events of the monitored file or directory by using an inotify tool, and writing the detected change condition of the server file into a log;
step 4, constructing a java frame;
step 5, connecting a service database in the java in the step 4, and regularly reading the record log in the step 3 by using a set of timing Task tools Spring-Task carried by Spring and through a program written by the java;
and 6, the user browses and views the server file and downloads the required data file through the retrieval function.
Further, a database is created as a search database for storing relevant data information for file search and download.
Further, by using the connection database, a search table is created according to specific service requirements as a search table to be accessed during search.
Further, in step 3, the inotify tool is used to detect a single file, or to detect an entire directory.
Furthermore, when the detection pair is a directory, the directory itself and the internal content thereof are all detection objects, and once the directory change to be monitored is monitored, an inotify tool running in the background automatically records the directory file change condition.
Further, the method comprises the steps of: monitoring whether the operation of deleting the file, modifying the file or writing the file occurs to the catalog needing to be synchronized; when yes, the inotify tool automatically records the related directory file operation into a log.
In step 5, the read file change information is written into the data table with file name, file path, file type and date of year.
The invention also relates to a server file retrieval and downloading system, which comprises the following steps:
the method comprises the steps of confirming an installation module, confirming that a server is installed with an inotify tool, and monitoring file system operation;
the database module is used for constructing a mysql server as a service database;
the writing module is used for collecting related events of the monitored file or directory by utilizing an inotify tool and writing the detected change condition of the server file into a log;
building a module and building a java frame;
the reading module is connected with a service database in the java of the step 4, and the record log in the step 3 is read at fixed time by using a set of timing Task tools Spring-Task carried by Spring and a program written by the java;
and the downloading module users browse and view the server files and download the required data files through the retrieval function.
The invention also relates to an electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method.
The invention also relates to a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method.
The technical scheme of the invention can realize the following beneficial technical effects:
(1) The invention has the advantage of simple operation, and the destination address of destination downloading does not need to be known.
(2) The invention has strong universality and is suitable for various systems.
(3) The server file retrieval and downloading method based on myslq and java solves the problem of overlarge file server pressure caused by large access quantity.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
Detailed Description
The objects, technical solutions and advantages of the present invention will become more apparent by the following detailed description of the present invention with reference to the accompanying drawings. It should be understood that the description is only illustrative and is not intended to limit the scope of the invention. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the present invention.
The present invention will be described in detail with reference to the accompanying drawings and examples.
The invention provides a server file retrieval and downloading method and a system, in particular to a server file retrieval and downloading method and a system based on java/mysql/inotify combination. The change condition of the file server is detected by using inotify in the background, so that the purpose of real-time monitoring is realized. The inotify tool can be used for detecting a single file, and can also be used for detecting the whole catalog, when the detection object is the catalog, the catalog itself and the content in the catalog can be the detection object, once the detection object changes, the inotify tool can immediately respond to the change of the file, and the change of the file is sent to the mysql database and stored in a related data table. The method combines the file server and the mysql database to realize real-time synchronization. And extracting corresponding data from the mysql database by using the java web terminal to realize the retrieval and downloading of the file server.
The implementation example specifically comprises the following steps:
and step 1, confirming that the server has installed inotify. The Inotify tool has Linux features that monitor file system operations such as reading, writing, and creating. Specifically, the server is a server for storing files.
To use inotify, a Linux machine with 2.6.13 or update kernel must be provided. If the kernel version is not known, uname-a may be entered by using the shell, and if the kernel version listed is not below 2.6.13, the system supports inotify. If the kernel version is lower than 2.6.13, the installation can be realized by an inotify tool, which is a set of c development interface library functions provided for an inotify file monitoring tool under linux, and a series of command line tools are also provided, and the tools can be used for monitoring events of a file system. Independent of the other than requiring the kernel to support inotify. After installation, two functions of inotifywait and inotifywatch are obtained by default. inotifywait is used to monitor changes in files or directories and inotifywatch is used to count the number of file system accesses. The invention mainly uses the inotifywait function.
And 2, constructing a mysql server as a service database.
In this embodiment, a database is also created as a search database for storing relevant data information for file search and download. By using a Navicat connection database, search tables are created according to specific service requirements, and the tables are used as search tables accessed during search, specifically server file information tables, wherein the tables comprise file names, file paths, file types and annual product days.
And step 3, collecting related events of the monitored file or directory through an inotify API by utilizing an inotify tool, specifically an inotifywait function, and writing the detected change condition of the server file into a log.
And running an inotifywait function in the inotify by using the written script background in the Linux server to ensure that the inotify can run in real time. inotify can be used for single file detection, and can also detect the whole directory. When the detection pair is a directory, the directory itself and the internal content thereof become detection objects, and once the directory change to be monitored is monitored, the inotify running in the background automatically records the directory file change condition, including:
monitoring whether the operation of deleting the file, modifying the file or writing the file occurs to the directory to be synchronized by using an inotify command in the background; when yes, inotify automatically records the related directory file operation into a log.
And 4, constructing a java frame based on the springboot.
The Spring boot is a set of brand new open source framework provided on the basis of Spring, and aims to simplify the construction and development process of Spring application. The configuration environment selected at this time is springboot2.0 or more, jdk8 or more.
And 5, connecting a service database in the java in the step 4, using a set of timing Task tools Spring-Task carried by Spring, writing a program by the java, regularly reading the record log in the step 3, writing the read file change information into a data table data_center_file by using sql sentences, and writing file name_name, file path file_path, file type file_type and yearly long-pending date file_ doy information into the data table data_center_file.
Step 6, the user can browse the view server file through the web and download the required data file through the retrieval function.
Keywords of a desired file, such as a fuzzy file name, a file type, or chronological information of the file, may be searched through the web interface retrieval function. And according to the search information input by the user, performing related search operation in the mysql data table, and returning the path information of the target file. And acquiring an input stream of the downloaded file according to the retrieved file path, creating a buffer zone, acquiring an OutputStream object, writing the FileOutputstream stream into the buffer zone, and finally inputting data in the buffer zone into a client by using the OutputStream to obtain the file to be downloaded.
The invention also relates to a server file retrieval and downloading system, which comprises the following steps:
the method comprises the steps of confirming an installation module, confirming that a server is installed with an inotify tool, and monitoring file system operation;
the database module is used for constructing a mysql server as a service database;
the writing module is used for collecting related events of the monitored file or directory by utilizing an inotify tool and writing the detected change condition of the server file into a log;
building a module and building a java frame;
the reading module is connected with a service database in the java of the step 4, and the record log in the step 3 is read at fixed time by using a set of timing Task tools Spring-Task carried by Spring and a program written by the java;
and the downloading module users browse and view the server files and download the required data files through the retrieval function.
The invention also relates to an electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method.
The invention also relates to a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method.
In summary, the present invention provides a method and a system for searching and downloading a server file, including: confirming that the server is provided with an inotify tool, and monitoring file system operation; constructing a mysql server as a service database; collecting related events of the monitored file or directory by using an inotify tool, and writing the detected change condition of the server file into a log; constructing a java frame; connecting a service database in java, and regularly reading a record log by using a set of timing Task tools Spring-Task carried by Spring through a program written by the java; the user browses the viewing server file and downloads the desired data file through the retrieval function. The invention has the advantage of simple operation, does not need to know the destination address of destination downloading, has stronger universality, is suitable for various systems, and solves the problem of overlarge pressure of a file server due to large access quantity because of the server file retrieval downloading method built based on mysql and java.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explanation of the principles of the present invention and are in no way limiting of the invention. Accordingly, any modification, equivalent replacement, improvement, etc. made without departing from the spirit and scope of the present invention should be included in the scope of the present invention. Furthermore, the appended claims are intended to cover all such changes and modifications that fall within the scope and boundary of the appended claims, or equivalents of such scope and boundary.

Claims (10)

1. The server file retrieval and downloading method is characterized by comprising the following steps:
step 1, confirming that a server is provided with an inotify tool, and monitoring file system operation;
step 2, constructing a mysql server as a service database;
step 3, collecting related events of the monitored file or directory by using an inotify tool, and writing the detected change condition of the server file into a log;
step 4, constructing a java frame;
step 5, connecting a service database in the java in the step 4, and regularly reading the record log in the step 3 by using a set of timing Task tools Spring-Task carried by Spring and through a program written by the java;
and 6, the user browses and views the server file and downloads the required data file through the retrieval function.
2. The server file retrieval and downloading method as recited in claim 1, wherein a database is created as the retrieval database for storing related data information of file retrieval and downloading.
3. The server file retrieval downloading method as recited in claim 2, wherein the retrieval table is created according to specific service requirements by using a connection database as the retrieval table accessed at the time of retrieval.
4. The server file retrieval download method according to claim 1, wherein in step 3, an inotify tool is used for single file detection, or entire directory detection.
5. The method according to claim 4, wherein when the detection pair is a directory, the directory itself and its internal content are all objects of detection, and an inotify tool running in the background automatically records the directory file change condition once the directory change to be monitored is monitored.
6. The server file retrieval downloading method as recited in claim 5, comprising: monitoring whether the operation of deleting the file, modifying the file or writing the file occurs to the catalog needing to be synchronized; when yes, the inotify tool automatically records the related directory file operation into a log.
7. The method according to claim 5, wherein in step 5, the file change information read is written in a data table with file name, file path, file type, and date of year information.
8. A server file retrieval download system, comprising:
the method comprises the steps of confirming an installation module, confirming that a server is installed with an inotify tool, and monitoring file system operation;
the database module is used for constructing a mysql server as a service database;
the writing module is used for collecting related events of the monitored file or directory by utilizing an inotify tool and writing the detected change condition of the server file into a log;
building a module and building a java frame;
the reading module is connected with a service database in the java of the step 4, and the record log in the step 3 is read at fixed time by using a set of timing Task tools Spring-Task carried by Spring and a program written by the java;
and the downloading module users browse and view the server files and download the required data files through the retrieval function.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the preceding claims 1 to 7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of the preceding claims 1 to 7.
CN202311035976.8A 2023-08-17 2023-08-17 Method and system for searching and downloading server file Pending CN117056288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311035976.8A CN117056288A (en) 2023-08-17 2023-08-17 Method and system for searching and downloading server file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311035976.8A CN117056288A (en) 2023-08-17 2023-08-17 Method and system for searching and downloading server file

Publications (1)

Publication Number Publication Date
CN117056288A true CN117056288A (en) 2023-11-14

Family

ID=88660432

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311035976.8A Pending CN117056288A (en) 2023-08-17 2023-08-17 Method and system for searching and downloading server file

Country Status (1)

Country Link
CN (1) CN117056288A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002251302A (en) * 2001-02-23 2002-09-06 Ntt Comware Corp Batch retrieval tool for log file and computer program used for the same
US20030236864A1 (en) * 2002-06-24 2003-12-25 Culture.Com Technology (Macau) Ltd. File downloading system and method
CN103139241A (en) * 2011-11-24 2013-06-05 腾讯科技(深圳)有限公司 Off-line download system and method for network resource files
CN104714878A (en) * 2013-12-11 2015-06-17 阿里巴巴集团控股有限公司 Method and device for collecting log data
US20170075920A1 (en) * 2015-09-10 2017-03-16 Gary Howard Mckay System and methods for detecting precise file system events from a large number and assortment of automatically-generated file system events during user operations
CN106959866A (en) * 2016-01-08 2017-07-18 阿里巴巴集团控股有限公司 A kind of log collection client and its upgrade method
CN108062323A (en) * 2016-11-08 2018-05-22 北京国双科技有限公司 A kind of log read method and device
CN112579321A (en) * 2020-12-23 2021-03-30 京东数字科技控股股份有限公司 Method, device and equipment for downloading service data
US20220043774A1 (en) * 2020-08-10 2022-02-10 Spinnaker Support, LLC Systems, methods, and storage media for transferring data files
CN114500106A (en) * 2022-04-02 2022-05-13 北京指掌易科技有限公司 Security management method, device, equipment and storage medium for server
CN115309702A (en) * 2022-10-09 2022-11-08 中孚信息股份有限公司 File retrieval management method, device, system and equipment based on USN log

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002251302A (en) * 2001-02-23 2002-09-06 Ntt Comware Corp Batch retrieval tool for log file and computer program used for the same
US20030236864A1 (en) * 2002-06-24 2003-12-25 Culture.Com Technology (Macau) Ltd. File downloading system and method
CN103139241A (en) * 2011-11-24 2013-06-05 腾讯科技(深圳)有限公司 Off-line download system and method for network resource files
CN104714878A (en) * 2013-12-11 2015-06-17 阿里巴巴集团控股有限公司 Method and device for collecting log data
US20170075920A1 (en) * 2015-09-10 2017-03-16 Gary Howard Mckay System and methods for detecting precise file system events from a large number and assortment of automatically-generated file system events during user operations
CN106959866A (en) * 2016-01-08 2017-07-18 阿里巴巴集团控股有限公司 A kind of log collection client and its upgrade method
CN108062323A (en) * 2016-11-08 2018-05-22 北京国双科技有限公司 A kind of log read method and device
US20220043774A1 (en) * 2020-08-10 2022-02-10 Spinnaker Support, LLC Systems, methods, and storage media for transferring data files
CN112579321A (en) * 2020-12-23 2021-03-30 京东数字科技控股股份有限公司 Method, device and equipment for downloading service data
CN114500106A (en) * 2022-04-02 2022-05-13 北京指掌易科技有限公司 Security management method, device, equipment and storage medium for server
CN115309702A (en) * 2022-10-09 2022-11-08 中孚信息股份有限公司 File retrieval management method, device, system and equipment based on USN log

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李雪;咸迪;: "跨平台文件共享系统设计与实现", 计算机技术与发展, no. 06 *

Similar Documents

Publication Publication Date Title
AU2021202623B2 (en) System for synchronization of changes in edited websites and interactive applications
KR102579190B1 (en) Backup and restore in distributed databases using consistent database snapshots
EP3125119B1 (en) A method for restoring files from a continuous recovery system
US8386431B2 (en) Method and system for determining database object associated with tenant-independent or tenant-specific data, configured to store data partition, current version of the respective convertor
US9483257B2 (en) Universal and adaptive software development platform for data-driven applications
CN102567140B (en) Use the file system backup of change journal
JP2003528395A (en) Method and apparatus for automatically locating data in a computer network
WO2016016734A1 (en) Managing web browser cache for offline browsing
US20140156603A1 (en) Method and an apparatus for splitting and recovering data in a power system
US20140156595A1 (en) Synchronisation system and method
EP2767912A2 (en) In-memory real-time synchronized database system and method
CN101425922A (en) Method and device for tracking and positioning change in web service updating process
KR100497301B1 (en) Portable information apparatus
CN101882135A (en) Data processing method and device
US20190147047A1 (en) Object-level image query and retrieval
CN117056288A (en) Method and system for searching and downloading server file
CN107004036B (en) Method and system for searching logs containing a large number of entries
WO2005045578A2 (en) System and method for personalization of handwriting recognition
CN116414935A (en) Method for distributed Search space vector data based on Elastic Search
CN108959548B (en) Service request processing method and device
US20100228787A1 (en) Online data volume deletion
CN114978852A (en) GNSS data receiving and multi-channel parallel transmission method based on 4G network
US11281444B2 (en) Application update monitoring computer systems
JP2005327297A (en) Knowledge information collecting system and knowledge information collecting method
US20050246385A1 (en) Database-rearranging program, database-rearranging method, and database-rearranging apparatus

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