WO2015154678A1 - File processing method, device, and network system - Google Patents

File processing method, device, and network system Download PDF

Info

Publication number
WO2015154678A1
WO2015154678A1 PCT/CN2015/076110 CN2015076110W WO2015154678A1 WO 2015154678 A1 WO2015154678 A1 WO 2015154678A1 CN 2015076110 W CN2015076110 W CN 2015076110W WO 2015154678 A1 WO2015154678 A1 WO 2015154678A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
computing device
server
link
data file
Prior art date
Application number
PCT/CN2015/076110
Other languages
French (fr)
Chinese (zh)
Inventor
黄欢
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2015154678A1 publication Critical patent/WO2015154678A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to the field of the Internet, and in particular, to a file processing method, a file processing device, and a network system for preprocessing a file to be distributed to a server.
  • Internet information is generally stored on servers linked to the network. Users can access these servers to get information.
  • network technology the information acquired by users is becoming more and more abundant. The interaction between the current web page and the user and the readability are also getting better. For example, in a web page, a large number of JS scripts and CSS files are used to define how the page is displayed and how it interacts with the user.
  • the network information needs to be edited before the network information is uploaded to the server, and various JS scripts and CSS files are also required to be edited and processed.
  • various JS scripts and CSS files are also required to be edited and processed.
  • the content of JS scripts and CSS files is increasing. If these files are not directly processed and uploaded to the server, when the number of users accessing the server is large, the performance of the server may be degraded, and the user access error may be caused by errors in the contents of the files.
  • the present invention has been made in order to provide a file processing method, apparatus and network system that overcomes the above problems or at least partially solves or alleviates the above problems.
  • a file processing apparatus resides in the computing device and includes: a content reader adapted to read file content of the file to be processed; a link finder adapted to find in the read file content in the computing device a link to the data file; a link processor adapted to connect the data file corresponding to the link of the data file in the found computing device with the file connected to the computing device Establishing an association, obtaining a link address of the data file in the computing device on the file server, and replacing a link to the external file in the file content with a link of the data file in the computing device The obtained link address on the file server; and an output device adapted to output the processed file content.
  • a file processing method is provided, the method being adapted to be executed in a computing device to process a file, the method comprising the steps of: reading a file content of a file to be processed; Searching for a link to the data file in the computing device in the file content; associating the data file corresponding to the link of the data file in the found computing device with the file server communicatively connected to the computing device, and acquiring the data in the computing device a link address of the file on the file server, and a link to the external file in the file content is replaced by a link of the data file in the computing device to the obtained link address on the file server; and the output is The content of the processed file.
  • a network system comprising a server; a file server; a plurality of clients communicating with the server and the file server via the network; and a computing device comprising the file processing device according to the present invention
  • the computing device is coupled to the server and the file server, transfers the file processed by the file processing device to the server and stores therein, and transfers the data file in the corresponding computing device to the file server and stores therein for being served by multiple clients. Any one of the terminals downloads the file from the server and downloads the corresponding data file from the file server and processes it.
  • a computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform according to any of the above File processing method.
  • a computer readable medium storing a computer program for executing the above file processing method is provided.
  • editing may be performed in the file processing device, and some may be referred to locally on the file processing device during editing.
  • Data files for example, image files, audio and video files, etc.
  • the data files referenced in the CSS and/or JS files must also be uploaded to the server and maintained in a relative positional relationship.
  • it is easy to omit the file or the relative positional relationship is wrong, which causes the client to process the CSS and/or JS files inaccurately.
  • the CSS and/or JS files can be preprocessed in the file processing device, and the data files referenced in the CSS and/or JS files are automatically posted to the file server, and the CSS and/or JS files are modified accordingly.
  • the corresponding reference method ensures that after the CSS and/or JS files are uploaded to the server, the user downloads the files to the client for processing without problems.
  • FIG. 1 shows a schematic diagram of a network system in accordance with one embodiment of the present invention
  • FIG. 2 shows a schematic diagram of a file processing device in accordance with one embodiment of the present invention
  • FIG. 3 shows a flow chart of a file processing method according to an embodiment of the present invention
  • Figure 4 is a schematic block diagram showing a computing device for performing a file processing method in accordance with the present invention
  • Fig. 5 schematically shows a storage unit for holding or carrying program code implementing a file processing method according to the present invention.
  • FIG. 1 shows a schematic diagram of a network system 100 in accordance with one embodiment of the present invention.
  • network system 100 includes a plurality of clients 110, 120, and 130, servers 140 that provide network information (e.g., web pages) for these clients, and associated file servers 160. These devices communicate with each other via the internet.
  • network information e.g., web pages
  • clients 110-130 may be any device in the art that can present network information (eg, web pages and associated data files) obtained from server 140 and/or file server 160, These include but are not limited to desktop computers, notebook computers, personal digital assistants, smart mobile terminals, tablets, and the like.
  • the client 110-130 typically runs a modern operating system that utilizes the operating system to manage hardware resources in the client.
  • a web browser is typically run on client 110 for presenting web pages retrieved from server 140 and/or file server 160 and associated data (eg, images, audio and video referenced in web pages, etc.).
  • Server 140 returns the requested network information to client 110 at the request of client 110.
  • Network information is typically web pages and various files referenced in the page, such as image files, multimedia files such as various audio and/or video files.
  • the network system 100 may further include a file server 160 for storing various multimedia files.
  • the client 110 can retrieve a web page from the server 140 and retrieve multimedia data associated with the web page from the file server 160.
  • file server 160 and server 140 may be different servers or the same server. In the present invention, it is logically divided into different servers for convenience of explanation.
  • computing device 150 processes various network information files, such as web pages, to be uploaded to server 140. For example, a web page or the like can be edited, the rendering effect of the web page or the like is previewed on the computing device 150, and then the processed file of the computing device 150 is transmitted to the server and stored therein for the client to download the file from the server.
  • network information files such as web pages
  • File processing device 200 is also included in computing device 150.
  • the file processing device 200 processes web page related files (eg, CSS or JS script files, etc.) edited in the computing device 150.
  • the file processing device 200 preprocesses the web page related files before uploading them in the server 140, optimizes the contents of the files, and transfers the data files referenced in the files to the file server 160. And transferring the optimized webpage related file to the server 140, so that when the client 110 requests the webpage from the server 140, the webpage related file and the corresponding data file are respectively acquired from the server 140 and the file server 160, and The client renders the content of these web pages.
  • FIG. 2 shows a schematic diagram of a file processing device 200 in accordance with one embodiment of the present invention.
  • the file processing apparatus 200 includes a content reader 210, a link finder 220, a link processor 230, and an output device 240.
  • the file processing device 200 will be initiated by a user of the computing device 150 in which the file processing device 200 resides to process various web page related texts that the user has prepared. Pieces. For example, the user of computing device 150 has edited the web page and is ready to publish the web page and associated content for retrieval by client 110 from server 140 and for presentation on client 110's browser. Subsequently, the user of computing device 150 will launch file processing device 200 to preprocess various web page related files. The user usually specifies the file directory to be preprocessed.
  • the web page related file may be a page related file such as a CSS file and/or a JS script that is invoked by the web page to help present the web content at the client and/or to enhance interaction with the user at the client.
  • These files conform to the HTML standard and are widely used in HTML.
  • other files such as images, audio and/or video other than these files are also cited.
  • a web page related file is a CSS file
  • a fragment of the CSS file is shown below:
  • the background:url is also used in the CSS file to reference image files outside the CSS file, such as colorbox/themes/1/images/controls.png
  • the file processing device 200 processes the files in the user-specified directory one by one. For example, the file processing device 200 can find all the webpage related files under the directory and process them one by one. For example, the file processing device 200 searches for files with the file suffixes named css and/or js in the directory, and processes them one by one.
  • the content reader 210 reads the file contents of a web page related file.
  • the content reader 210 can read the file contents of the web page related file from the mass storage such as a hard disk into the cache for subsequent processing.
  • the content reader 210 may even analyze the file content, for example, using an HTML engine to derive an organizational structure of the content in the file. For example, in the case of CSS, a tag (tag) and a corresponding value (value) of each CSS can be obtained.
  • the content can be directly read out and cached.
  • the link finder 220 then analyzes the contents of the read file to find out where the reference to the other data files in the computing device 150, and the file location and file name of the referenced file, A link to other data files in computing device 150.
  • the link finder 220 may determine the reference to the data file by looking up the suffix name of the data file (for example, when the data file is an image file, the suffix name is usually png, jpg, etc.) .
  • the link finder 220 may determine whether a data file exists and data by determining a CSS tag or a JS script unit that may reference the data file, and then determining values corresponding to the tags or scripts. The details of the file.
  • the link finder 220 when the content reader 210 obtains the organizational structure of the file, the link finder 220 can traverse in the organizational structure to find the corresponding data file information. It should be noted that the present invention is not limited to the specific implementation of the link finder 220, and all manners in which the related information of the referenced data file can be found from the read file contents are within the scope of the present invention. .
  • link finder 220 can find 4 referenced data file information, but their contents are the same, both colorbox/themes/1/images/controls.png.
  • the link processor 230 processes the found data file information.
  • the data file information includes the location of the referenced data file relative to the currently processed web page related file.
  • the link processor 230 can acquire the referenced data file based on the location information.
  • Link processor 230 then associates the data file with file server 160. Specifically, the link processor 230 determines whether the data file exists in the file server 160. If the data file exists in the file server 160, the link address of the data file in the file server 160 is directly obtained; if the data file does not exist in the file server 160, the data file is The file is uploaded to the file server 160 and the link address of the data file in the file server 160 is obtained.
  • the data file is necessarily stored in the file server 160, so that an association can be established between the data file and the file server 160.
  • the link corresponding to the data file among the cached file contents may be replaced with a link to the file server 160. Since the link finder 220 can find a link to the data file, a link to the local data file can be made to a link to the file server 160 in a similar manner as the link finder 220.
  • link processor 230 may calculate a hash value of a local data file, such as an MD5 value, and transmit the value to file server 160.
  • the file server 160 includes a storage device in which the hash value of each data file in the file server 160 and the corresponding storage location are recorded.
  • the file server 160 receives the hash value sent by the link processor 230, it searches for the storage device.
  • the same hash value if present, indicates that the data file has been stored in the file server 160, at which point the storage location information (i.e., link information) of the data file in the file server 160 can be directly returned. If not, file server 160 returns a file absence message to link processor 230.
  • Link processor 230 can then transfer the data file to file server 160.
  • the file server 160 can store the data file and store the hash value and storage location of the data file in a storage device.
  • the output device 240 reads the content of the processed web page related file and outputs it to the outside of the file processing apparatus 200.
  • the output device 240 may directly transfer the processed webpage related file to the server 140, or may be stored locally in the computing device 150, and wait for all webpage related file processing to be completed, and then uniformly transmitted by the computing device 150 to the server 140. And store it.
  • the file processing device 200 further includes a content compression device 250.
  • the content compression device 250 may perform compression processing on the processed web page related file before the output device 240 outputs the web page related file. Since the browser at the client 110 supports receiving and processing the compressed file, the webpage related file can be compressed and stored in the server 140, and the client 110 can directly obtain the compressed file for processing. Further saving network bandwidth consumption between the client and the server.
  • the content compression device 250 can also perform some optimization processing, for example, deleting invalid characters such as carriage returns, spaces, and the like in the webpage related files, so that the size of the webpage related files is smaller.
  • some optimization processing for example, deleting invalid characters such as carriage returns, spaces, and the like in the webpage related files, so that the size of the webpage related files is smaller.
  • the web page related file and its referenced data file can be published to the server 140 and/or the file server 160 at one time while maintaining the correctness of the reference to the data file. In this way, it is not necessary to publish webpage related files and referenced data files one by one at the time of publishing, thereby simplifying the process of publishing webpage related files.
  • the file processing apparatus 200 according to the present invention determines whether the data file has already been stored in the file server 160, so that it is possible to prevent multiple storage of one data file, and to maintain the data file. It is very important in terms of version consistency.
  • FIG. 3 shows a flow diagram of a file processing method 300 in accordance with one embodiment of the present invention.
  • the method is adapted to be executed in the computing device 150 shown in FIG. 1, particularly the file processing device 200 shown in FIG. 2, to publish web page related files to the server 140 and/or file server 160.
  • method 300 will be invoked by a user of computing device 150 to process various web page related files that the user has prepared. For example, the user of computing device 150 has edited the web page and is ready to publish the web page and associated content for retrieval by client 110 from server 140 and for presentation on client 110's browser. The user of computing device 150 then invokes method 300 to preprocess various web page related files. The user usually specifies the file directory to be preprocessed.
  • the web page related file may be a page related file such as a CSS file and/or a JS script that is invoked by the web page to help present the web content at the client and/or to enhance interaction with the user at the client.
  • These files conform to the HTML standard and are widely used in HTML.
  • other files such as images, audio and/or video other than these files are also cited.
  • the method is suitable for processing files in a user-specified directory one by one. For example, the method will find all files in the directory with the suffixes named css and/or js and process them one by one.
  • step S310 the file content of a web page related file is read.
  • the file content of the webpage related file may be read from the mass storage such as a hard disk into the cache for subsequent processing.
  • the content of the file may even be analyzed, for example, using an HTML engine to obtain an organizational structure of the content in the file. For example, in the case of CSS, a tag (tag) and a corresponding value (value) of each CSS can be obtained.
  • the content can be directly read out and cached.
  • step S320 the content of the file read in step S310 is analyzed to find out the reference to other data files in the computing device 150 in the file content, and the file location of the referenced file and The file name is a link to other data files in computing device 150.
  • the reference to the data file can be determined by looking up the suffix name of the data file (eg, when the data file is an image file, the suffix name is typically png, jpg, etc.).
  • step S320 it may be determined whether a data file exists by determining a CSS tag or a JS script unit that may reference the data file, and then determining values corresponding to the tags or scripts, and The details of the data file. Yet another according to the invention In the embodiment, when the organization structure of the file is obtained in step S310, then in step S320, it is possible to traverse in the organizational structure to find the corresponding data file information. It should be noted that the present invention is not limited to the specific implementation of step S320, and all manners in which relevant information of the referenced data file can be found from the contents of the read file are within the scope of the present invention.
  • step S320 four referenced data file information can be found, but their contents are the same, both are colorbox/themes/1/images/controls.png.
  • the found data file information is processed in step S330.
  • the data file information includes the location of the referenced data file relative to the currently processed web page related file.
  • the referenced data file may be acquired based on the location information.
  • the data file is then associated with the file server 160. Specifically, in step S330, it is determined whether or not the data file exists in the file server 160. If the data file exists in the file server 160, the link address of the data file in the file server 160 is directly obtained; if the data file does not exist in the file server 160, the data file is uploaded to the file server 160, and The link address of the data file in the file server 160 is obtained.
  • step S330 the link corresponding to the data file among the cached file contents may be replaced with the link to the file server 160. Since the link to the data file can be found in step S320, a link to the local data file can be taken as a link to the file server 160 in a similar manner to step S320.
  • a hash value of the local data file such as an MD5 value
  • the file server 160 includes a storage device in which the hash value of each data file in the file server 160 and the corresponding storage location are recorded.
  • the file server 160 receives the hash value sent by the computing device 150, it searches for the same hash value in the storage device. If it exists, it indicates that the data file has been stored in the file server 160.
  • the storage location information i.e., link information
  • file server 160 If not, file server 160 returns a message that the file does not exist to computing device 150. Subsequently, in step S330, the data file can be transferred to the file server 160.
  • the file server 160 can store the data file and store the hash value and storage location of the data file in a storage device.
  • the content of the processed web page related file is read in step S340 and output to the outside of the file processing apparatus 200.
  • the processed webpage related files may be directly transferred to the server 140, or may be stored locally in the computing device 150, and wait for all webpage related file processing to be completed, and then uniformly transmitted by the computing device 150 to the server 140 and stored. .
  • the file processing method 300 further includes step S350.
  • Step S350 may perform compression processing on the processed webpage related file before outputting the webpage related file in step S340. Since the browser at the client 110 supports receiving and processing the compressed file, the webpage related file can be compressed and stored in the server 140, and the client 110 can directly obtain the compressed file for processing. Further saving network bandwidth consumption between the client and the server.
  • step S350 some optimization processing may be performed in step S350. For example, invalid characters such as carriage returns and spaces in the webpage related file may be deleted, so that the size of the webpage related file is smaller. When the number of clients 110 is large, a small modification of the file size of the webpage can save a lot of network bandwidth.
  • the web page related file and its referenced data file can be published to the server 140 and/or the file server 160 at one time while maintaining the correctness of the reference to the data file. In this way, it is not necessary to publish webpage related files and referenced data files one by one at the time of publishing, thereby simplifying the process of publishing webpage related files.
  • the file processing method 300 according to the present invention determines whether the data file has already been stored in the file server 160, so that it is possible to prevent multiple storage of one data file, and to maintain the data file. It is very important in terms of version consistency.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the equipment Line combination.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the various components in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 4 illustrates a computing device that can implement a file processing method in accordance with the present invention.
  • the computing device conventionally includes a processor 410 and a computer program product or computer readable medium in the form of a memory 420.
  • the memory 420 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 420 has a memory space 430 for program code 431 for performing any of the method steps described above.
  • storage space 430 for program code may include various program code 431 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such computer program products are typically portable or fixed storage units as described with reference to FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 420 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 431', i.e., code readable by a processor, such as 410, that when executed by a computing device causes the computing device to perform the methods described above Each step.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Provided is a file processing device (200) residing in a computing device, the file processing device (200) comprising: a content reader (210), suitable for reading the content of the file to be processed; a link finder (220), suitable for finding in the content of the read file a link to the data file in the computing device; a link processor (230), suitable for establishing an association between the data file in the computing device and a file server (160) having a communications connection to the computing device, obtaining the link address of the data file, in the computing device, on the file server (160), and in the file content, replacing the link to the external file with the obtained link address on the file server (160); an output apparatus (240), suitable for outputting the processed file content. Also disclosed are a corresponding file processing method and a network system comprising the file processing device.

Description

一种文件处理方法、设备和网络系统File processing method, device and network system 技术领域Technical field
本发明涉及互联网领域,尤其涉及对要发布到服务器的文件进行预处理的文件处理方法、文件处理设备和网络系统。The present invention relates to the field of the Internet, and in particular, to a file processing method, a file processing device, and a network system for preprocessing a file to be distributed to a server.
背景技术Background technique
随着互联网络的发展,越来越多的用户通过互联网来获取信息,互联网的信息一般存储在链接到网络中的服务器上。用户可以访问这些服务器来获取信息。随着网络技术的发展,用户获取的信息也越来越丰富。现在的网络页面与用户的交互性以及可阅读性也越来也好。例如,在网页中,会采用大量的JS脚本和CSS文件来定义页面的显示方式以及与用户的交互方式等。With the development of the Internet, more and more users access information through the Internet. Internet information is generally stored on servers linked to the network. Users can access these servers to get information. With the development of network technology, the information acquired by users is becoming more and more abundant. The interaction between the current web page and the user and the readability are also getting better. For example, in a web page, a large number of JS scripts and CSS files are used to define how the page is displayed and how it interacts with the user.
另外,为了便于用户从服务器获取内容,在将网络信息上传到服务器上之前,需要对网络信息进行编辑,这时也需要对各种JS脚本和CSS文件也进行编辑和处理。随着网页日益复杂,JS脚本和CSS文件的内容也越来越多。如果不对这些文件进行处理而直接上传到服务器上,当访问该服务器的用户数量较大时,容易导致服务器的性能下降,而且也可能因为这些文件内容存在错误而导致用户访问出错。In addition, in order to facilitate the user to obtain content from the server, the network information needs to be edited before the network information is uploaded to the server, and various JS scripts and CSS files are also required to be edited and processed. As web pages become more complex, the content of JS scripts and CSS files is increasing. If these files are not directly processed and uploaded to the server, when the number of users accessing the server is large, the performance of the server may be degraded, and the user access error may be caused by errors in the contents of the files.
因此,需要一种能够在将诸如JS脚本和CSS文件之类的各种文件在上传到服务器之前进行预处理以便用户可以高效而准确地从服务器获取信息的文件处理方案。Therefore, there is a need for a file processing scheme that is capable of pre-processing various files such as JS scripts and CSS files before they are uploaded to the server so that the user can efficiently and accurately obtain information from the server.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的文件处理方法、设备和网络系统。In view of the above problems, the present invention has been made in order to provide a file processing method, apparatus and network system that overcomes the above problems or at least partially solves or alleviates the above problems.
根据本发明的一个方面,提供了一种文件处理设备。该文件处理设备驻留在计算设备中,并且包括:内容读取器,适于读取要处理文件的文件内容;链接查找器,适于在所读取的文件内容中查找到计算设备中的数据文件的链接;链接处理器,适于将查找到的计算设备中的数据文件的链接对应的数据文件和与该计算设备通信连接的文件服 务器建立关联,获取该计算设备中的数据文件在所述文件服务器上的链接地址,并在所述文件内容中将到外部文件的链接由所述计算设备中的数据文件的链接替换为所获取的、在文件服务器上的链接地址;以及输出装置,适于输出经处理的文件内容。According to an aspect of the invention, a file processing apparatus is provided. The file processing device resides in the computing device and includes: a content reader adapted to read file content of the file to be processed; a link finder adapted to find in the read file content in the computing device a link to the data file; a link processor adapted to connect the data file corresponding to the link of the data file in the found computing device with the file connected to the computing device Establishing an association, obtaining a link address of the data file in the computing device on the file server, and replacing a link to the external file in the file content with a link of the data file in the computing device The obtained link address on the file server; and an output device adapted to output the processed file content.
根据本发明的另一个方面,提供了一种文件处理方法,该方法适于在计算设备中执行来对文件进行处理,该方法包括步骤:读取要处理文件的文件内容;在所读取的文件内容中查找到计算设备中的数据文件的链接;将查找到的计算设备中的数据文件的链接对应的数据文件和与该计算设备通信连接的文件服务器建立关联,获取该计算设备中的数据文件在所述文件服务器上的链接地址,并在文件内容中将到外部文件的链接由所述计算设备中的数据文件的链接替换为所获取的、在文件服务器上的链接地址;以及输出经处理的文件内容。According to another aspect of the present invention, a file processing method is provided, the method being adapted to be executed in a computing device to process a file, the method comprising the steps of: reading a file content of a file to be processed; Searching for a link to the data file in the computing device in the file content; associating the data file corresponding to the link of the data file in the found computing device with the file server communicatively connected to the computing device, and acquiring the data in the computing device a link address of the file on the file server, and a link to the external file in the file content is replaced by a link of the data file in the computing device to the obtained link address on the file server; and the output is The content of the processed file.
根据本发明的又一个方面,提供了一种网络系统,该系统包括服务器;文件服务器;多个客户端,经由网络与服务器以及文件服务器进行通信;以及计算设备,包括根据本发明的文件处理设备,其中计算设备耦接到服务器和文件服务器,将文件处理设备处理后的文件传输到服务器并存储其中,并且将相应的计算设备中的数据文件传输到文件服务器并存储其中,以便由多个客户端中的任一个分别从服务器下载该文件以及从文件服务器下载相应的数据文件并进行处理。According to still another aspect of the present invention, a network system is provided, the system comprising a server; a file server; a plurality of clients communicating with the server and the file server via the network; and a computing device comprising the file processing device according to the present invention The computing device is coupled to the server and the file server, transfers the file processed by the file processing device to the server and stores therein, and transfers the data file in the corresponding computing device to the file server and stores therein for being served by multiple clients. Any one of the terminals downloads the file from the server and downloads the corresponding data file from the file server and processes it.
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据上述的任一个所述的文件处理方法。According to still another aspect of the present invention, a computer program is provided, comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform according to any of the above File processing method.
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了执行上述文件处理方法的计算机程序。According to still another aspect of the present invention, a computer readable medium storing a computer program for executing the above file processing method is provided.
在将诸如CSS和/或JS文件之类的网页相关文件上传到服务器上以便由用户从客户端下载时,可以在文件处理设备中进行编辑,在编辑时可能会引用一些在文件处理设备本地的数据文件(例如,图像文件,音频和视频文件等)。为了让用户可以准确地在客户端地利用CSS和/或JS文件来处理来自服务器端的网页,必须将CSS和/或JS文件中引用的数据文件也上传到服务器上并保持相对位置关系,当这些数据文件较多时,很容易遗漏文件或者相对位置关系发生错误,从而导致客户端对CSS和/或JS文件的处理不准确。根据本发明的文件处理 方式,可以在文件处理设备中对CSS和/或JS文件进行预处理,自动地将这些CSS和/或JS文件中引用的数据文件发布到文件服务器中,并相应修改CSS和/或JS文件的相应引用方式,从而确保在将CSS和/或JS文件上传到服务器中之后,用户下载这些文件到客户端进行处理时,不会出现问题。When uploading webpage related files such as CSS and/or JS files to the server for downloading from the client by the user, editing may be performed in the file processing device, and some may be referred to locally on the file processing device during editing. Data files (for example, image files, audio and video files, etc.). In order to allow users to accurately use CSS and/or JS files on the client side to process web pages from the server side, the data files referenced in the CSS and/or JS files must also be uploaded to the server and maintained in a relative positional relationship. When there are many data files, it is easy to omit the file or the relative positional relationship is wrong, which causes the client to process the CSS and/or JS files inaccurately. File processing according to the present invention In this way, the CSS and/or JS files can be preprocessed in the file processing device, and the data files referenced in the CSS and/or JS files are automatically posted to the file server, and the CSS and/or JS files are modified accordingly. The corresponding reference method ensures that after the CSS and/or JS files are uploaded to the server, the user downloads the files to the client for processing without problems.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本发明一个实施例的网络系统的示意图;1 shows a schematic diagram of a network system in accordance with one embodiment of the present invention;
图2示出了根据本发明一个实施例的文件处理设备的示意图;2 shows a schematic diagram of a file processing device in accordance with one embodiment of the present invention;
图3示出了根据本发明一个实施例的文件处理方法的流程图;FIG. 3 shows a flow chart of a file processing method according to an embodiment of the present invention; FIG.
图4示意性地示出了用于执行根据本发明的文件处理方法的计算设备的框图;以及Figure 4 is a schematic block diagram showing a computing device for performing a file processing method in accordance with the present invention;
图5示意性地示出了用于保持或者携带实现根据本发明的文件处理方法的程序代码的存储单元。Fig. 5 schematically shows a storage unit for holding or carrying program code implementing a file processing method according to the present invention.
具体实施方式detailed description
下面结合附图和具体的实施方式对本发明作进一步的描述。The invention is further described below in conjunction with the drawings and specific embodiments.
图1示出了根据本发明一个实施例的网络系统100的示意图。如图1所示,网络系统100包括多个客户端110、120和130,为这些客户端提供网络信息(例如网页)的服务器140以及相关联的文件服务器160。这些设备经由互联网络而相互通信。FIG. 1 shows a schematic diagram of a network system 100 in accordance with one embodiment of the present invention. As shown in FIG. 1, network system 100 includes a plurality of clients 110, 120, and 130, servers 140 that provide network information (e.g., web pages) for these clients, and associated file servers 160. These devices communicate with each other via the internet.
在下文中将以客户端110为例来指示所有的客户端。在本发明中,客户端110-130可以是本领域任何可以呈现从服务器140和/或文件服务器160获取的网络信息(例如网页以及相关联的数据文件)的设备, 包括但不限于桌面型计算机、笔记本式计算机、个人数字助理、智能移动终端、平板电脑等。客户端110-130中通常运行现代的操作系统,利用操作系统来管理客户端中的硬件资源。客户端110上通常运行有网页浏览器,用于呈现从服务器140和/或文件服务器160获取的网页以及相关联的数据(例如网页中引用的图像,音频和视频等)。In the following, the client 110 will be taken as an example to indicate all clients. In the present invention, clients 110-130 may be any device in the art that can present network information (eg, web pages and associated data files) obtained from server 140 and/or file server 160, These include but are not limited to desktop computers, notebook computers, personal digital assistants, smart mobile terminals, tablets, and the like. The client 110-130 typically runs a modern operating system that utilizes the operating system to manage hardware resources in the client. A web browser is typically run on client 110 for presenting web pages retrieved from server 140 and/or file server 160 and associated data (eg, images, audio and video referenced in web pages, etc.).
服务器140应客户端110的请求而将所请求的网络信息返回客户端110。网络信息通常为网页页面以及在页面中引用的各种文件,例如图像文件,各种音频和/或视频文件等多媒体文件。为了便于文件管理,网络系统100中还可以包括文件服务器160,用于存储各种多媒体文件。客户端110可以从服务器140获取网页,并从文件服务器160获取与该网页相关联的多媒体数据。应当注意的是,文件服务器160和服务器140可以是不同的服务器,也可以是相同的服务器。在本发明中,仅仅是为了便于说明起见而从逻辑上将其划分为不同的服务器。 Server 140 returns the requested network information to client 110 at the request of client 110. Network information is typically web pages and various files referenced in the page, such as image files, multimedia files such as various audio and/or video files. In order to facilitate file management, the network system 100 may further include a file server 160 for storing various multimedia files. The client 110 can retrieve a web page from the server 140 and retrieve multimedia data associated with the web page from the file server 160. It should be noted that file server 160 and server 140 may be different servers or the same server. In the present invention, it is logically divided into different servers for convenience of explanation.
另外,在网络系统100中,还包括计算设备150。计算设备150对要上传到服务器140的各种网络信息文件,如网页等进行处理。例如可以对网页等进行编辑,在计算设备150上预览网页的呈现效果等,随后将计算设备150处理完成后的文件传输到服务器并存储其中,以便由客户端从服务器下载该文件。Additionally, in network system 100, computing device 150 is also included. Computing device 150 processes various network information files, such as web pages, to be uploaded to server 140. For example, a web page or the like can be edited, the rendering effect of the web page or the like is previewed on the computing device 150, and then the processed file of the computing device 150 is transmitted to the server and stored therein for the client to download the file from the server.
计算设备150中还包括文件处理设备200。文件处理设备200会对计算设备150中编辑好的网页相关文件(例如,CSS或者JS脚本文件等)进行处理。具体而言,文件处理设备200会在将网页相关文件上传在服务器140中之前对这些文件进行预处理,对这些文件的内容进行优化,并且将这些文件中所引用的数据文件传输到文件服务器160中,并且将经过优化的网页相关文件传输到服务器140中,这样客户端110在向服务器140请求网页时,会分别从服务器140和文件服务器160获取网页相关文件以及相对应的数据文件,并且在客户端呈现这些网页的内容。 File processing device 200 is also included in computing device 150. The file processing device 200 processes web page related files (eg, CSS or JS script files, etc.) edited in the computing device 150. Specifically, the file processing device 200 preprocesses the web page related files before uploading them in the server 140, optimizes the contents of the files, and transfers the data files referenced in the files to the file server 160. And transferring the optimized webpage related file to the server 140, so that when the client 110 requests the webpage from the server 140, the webpage related file and the corresponding data file are respectively acquired from the server 140 and the file server 160, and The client renders the content of these web pages.
图2示出了根据本发明一个实施例的文件处理设备200的示意图。如图2所示,文件处理设备200包括内容读取器210、链接查找器220、链接处理器230和输出装置240。FIG. 2 shows a schematic diagram of a file processing device 200 in accordance with one embodiment of the present invention. As shown in FIG. 2, the file processing apparatus 200 includes a content reader 210, a link finder 220, a link processor 230, and an output device 240.
一般而言,文件处理设备200会由文件处理设备200驻留其中的计算设备150的用户启动来处理该用户已经准备好的各种网页相关文 件。例如计算设备150的用户已经编辑好网页,并准备将这些网页以及相关联的内容发布出去以便由客户端110来从服务器140获取并呈现在客户端110的浏览器上。随后,计算设备150的用户就会启动文件处理设备200来对各种网页相关文件进行预处理。用户通常会指定要进行预处理的文件目录。In general, the file processing device 200 will be initiated by a user of the computing device 150 in which the file processing device 200 resides to process various web page related texts that the user has prepared. Pieces. For example, the user of computing device 150 has edited the web page and is ready to publish the web page and associated content for retrieval by client 110 from server 140 and for presentation on client 110's browser. Subsequently, the user of computing device 150 will launch file processing device 200 to preprocess various web page related files. The user usually specifies the file directory to be preprocessed.
网页相关文件可以是诸如CSS文件和/或JS脚本之类、会由网页调用来帮助在客户端来呈现网页内容和/或提高与客户端处的用户之间的交互的页面相关文件。这些文件符合HTML标准,并且在HTML中被广泛使用。这些网页相关文件中,还会引用在这些文件之外的图像、音频和/或视频之类的其它文件。The web page related file may be a page related file such as a CSS file and/or a JS script that is invoked by the web page to help present the web content at the client and/or to enhance interaction with the user at the client. These files conform to the HTML standard and are widely used in HTML. In these web page related files, other files such as images, audio and/or video other than these files are also cited.
例如,当网页相关文件为CSS文件时,下文中示出了CSS文件的一个片段:For example, when a web page related file is a CSS file, a fragment of the CSS file is shown below:
#colorbox{}#colorbox{}
#cboxTopLeft{width:21px;height:21px;background:url(colorbox/themes/1/images/controls.png)-100px 0 no-r epeat;}#cboxTopLeft{width:21px;height:21px;background:url(colorbox/themes/1/images/controls.png)-100px 0 no-r epeat;}
#cboxTopRight{width:21px;height:21px;backgroun d:url(colorbox/themes/1/images/controls.png)-129px 0 no-repeat;}#cboxTopRight{width:21px;height:21px;backgroun d:url(colorbox/themes/1/images/controls.png)-129px 0 no-repeat;}
#cboxBottomLeft{width:21px;height:21px;backgro und:url(colorbox/themes/1/images/controls.png)-100px-29p x no-repeat;}#cboxBottomLeft{width:21px;height:21px;backgro und:url(colorbox/themes/1/images/controls.png)-100px-29p x no-repeat;}
#cboxBottomRight{width:21px;height:21px;backgr ound:url(colorbox/themes/1/images/controls.png)-129px-29px no-repeat;}#cboxBottomRight{width:21px;height:21px;backgr ound:url(colorbox/themes/1/images/controls.png)-129px-29px no-repeat;}
在上面的示例中,在CSS文件中还使用background:url来引用在该CSS文件之外的图像文件,例如colorbox/themes/1/images/controls.pngIn the above example, the background:url is also used in the CSS file to reference image files outside the CSS file, such as colorbox/themes/1/images/controls.png
文件处理设备200逐个地对用户指定目录下的文件进行处理,例如文件处理设备200可以查找到在该目录下的所有网页相关文件,并逐个进行处理。例如,文件处理设备200会查找该该目录下所有文件后缀名为css和/或js的文件,并逐个进行处理。 The file processing device 200 processes the files in the user-specified directory one by one. For example, the file processing device 200 can find all the webpage related files under the directory and process them one by one. For example, the file processing device 200 searches for files with the file suffixes named css and/or js in the directory, and processes them one by one.
内容读取器210会读取一个网页相关文件的文件内容。例如,内容读取器210可以将网页相关文件的文件内容从诸如硬盘之类的大容量存储器读取到缓存中,以便于后续处理。在一个实施例中,内容读取器210甚至可以例如利用HTML引擎对该文件内容分析,从而得到该文件中内容的组织结构。例如就CSS而言,可以获得每个CSS的标签(tag)和对应的值(value)。当然,根据本发明的另一个实施例,可以直接将内容读取出来并进行缓存即可。The content reader 210 reads the file contents of a web page related file. For example, the content reader 210 can read the file contents of the web page related file from the mass storage such as a hard disk into the cache for subsequent processing. In one embodiment, the content reader 210 may even analyze the file content, for example, using an HTML engine to derive an organizational structure of the content in the file. For example, in the case of CSS, a tag (tag) and a corresponding value (value) of each CSS can be obtained. Of course, according to another embodiment of the present invention, the content can be directly read out and cached.
链接查找器220随后对所读取的文件内容进行分析,以查找出该文件内容中,对计算设备150中的其他数据文件的引用之处,以及所引用文件的文件位置和文件名,即到计算设备150中的其他数据文件的链接。根据本发明的一个实施例,链接查找器220可以通过查找数据文件的后缀名(例如,当数据文件为图像文件时,其后缀名通常是png、jpg等)来确定对数据文件的引用之处。根据本发明的还有一个实施例,链接查找器220可以通过确定可能会引用数据文件的CSS标签或者JS脚本单元,随后确定与这些标签或者脚本相对应的值来确定是否存在数据文件,以及数据文件的详细信息。根据本发明的又一个实施例,当内容读取器210获得了文件的组织结构时,则链接查找器220可以在该组织结构中遍历以查找相应的数据文件信息。应当注意的是,本发明不受限于链接查找器220的具体实现方式,所有可以从所读取的文件内容中查找到引用的数据文件的相关信息的方式都在本发明的保护范围之内。The link finder 220 then analyzes the contents of the read file to find out where the reference to the other data files in the computing device 150, and the file location and file name of the referenced file, A link to other data files in computing device 150. According to one embodiment of the present invention, the link finder 220 may determine the reference to the data file by looking up the suffix name of the data file (for example, when the data file is an image file, the suffix name is usually png, jpg, etc.) . According to still another embodiment of the present invention, the link finder 220 may determine whether a data file exists and data by determining a CSS tag or a JS script unit that may reference the data file, and then determining values corresponding to the tags or scripts. The details of the file. In accordance with still another embodiment of the present invention, when the content reader 210 obtains the organizational structure of the file, the link finder 220 can traverse in the organizational structure to find the corresponding data file information. It should be noted that the present invention is not limited to the specific implementation of the link finder 220, and all manners in which the related information of the referenced data file can be found from the read file contents are within the scope of the present invention. .
例如,在上面的示例中,链接查找器220可以查找到4个引用的数据文件信息,但是它们的内容是一样的,都是colorbox/themes/1/images/controls.png。For example, in the above example, link finder 220 can find 4 referenced data file information, but their contents are the same, both colorbox/themes/1/images/controls.png.
在链接查找器220查找到引用的数据文件信息之后,链接处理器230对所查找到的数据文件信息进行处理。数据文件信息包括所引用的数据文件相对于当前被处理的网页相关文件的位置。链接处理器230可以根据该位置信息获取所引用的数据文件。随后,链接处理器230要将该数据文件和文件服务器160建立关联。具体而言,链接处理器230确定在文件服务器160中是否存在该数据文件。如果在文件服务器160中存在该数据文件,则直接获取数据文件在文件服务器160中的链接地址;如果在文件服务器160中不存在该数据文件,则将该数据文 件上传到文件服务器160中,并获取该数据文件在文件服务器160中的链接地址。After the link finder 220 finds the referenced data file information, the link processor 230 processes the found data file information. The data file information includes the location of the referenced data file relative to the currently processed web page related file. The link processor 230 can acquire the referenced data file based on the location information. Link processor 230 then associates the data file with file server 160. Specifically, the link processor 230 determines whether the data file exists in the file server 160. If the data file exists in the file server 160, the link address of the data file in the file server 160 is directly obtained; if the data file does not exist in the file server 160, the data file is The file is uploaded to the file server 160 and the link address of the data file in the file server 160 is obtained.
通过上述处理,可以确保在文件服务器160中必然存储有数据文件,从而可以在数据文件和文件服务器160之间建立关联。在获取了数据文件在文件服务器160中的链接地址之后,可以将所缓存的文件内容中,与数据文件相对应的链接替换为到文件服务器160中的链接。由于链接查找器220可以查找到到数据文件的链接,因此可以采用与链接查找器220相类似的方法来将到本地数据文件的链接为到文件服务器160中的链接。Through the above processing, it can be ensured that the data file is necessarily stored in the file server 160, so that an association can be established between the data file and the file server 160. After the link address of the data file in the file server 160 is acquired, the link corresponding to the data file among the cached file contents may be replaced with a link to the file server 160. Since the link finder 220 can find a link to the data file, a link to the local data file can be made to a link to the file server 160 in a similar manner as the link finder 220.
就上面的示例而言,假定文件服务器160的网站为60.img360.cn,而数据文件在该文件服务器160中的链接URL为60.img360.cn/img/a2345690.png。在将到本地数据文件的链接替换为到文件服务器160的URL之后,上面的CSS内容就会修改为:For the above example, assume that the website of the file server 160 is 60.img360.cn, and the link URL of the data file in the file server 160 is 60.img360.cn/img/a2345690.png. After replacing the link to the local data file with the URL to file server 160, the above CSS content will be modified to:
#colorbox{}#colorbox{}
#cboxTopLeft{width:21px;height:21px;background:url(http://60.img360.cn/img/a2345690.png)-100px 0 no-repeat;}#cboxTopLeft{width:21px;height:21px;background:url(http://60.img360.cn/img/a2345690.png)-100px 0 no-repeat;}
#cboxTopRight{width:21px;height:21px;backgroun d:url(http://60.img360.cn/img/a2345690.png)-129px 0 no-repeat;}#cboxTopRight{width:21px;height:21px;backgroun d:url(http://60.img360.cn/img/a2345690.png)-129px 0 no-repeat;}
#cboxBottomLeft{width:21px;height:21px;backgro und:url http://60.img360.cn/img/a2345690.png)-100px-29px no-repeat;}#cboxBottomLeft{width:21px;height:21px;backgro und:url http://60.img360.cn/img/a2345690.png)-100px-29px no-repeat;}
#cboxBottomRight{width:21px;height:21px;backgr ound:url(http://60.img360.cn/img/a2345690.png)-129px-29px no-repeat;}#cboxBottomRight{width:21px;height:21px;backgr ound:url(http://60.img360.cn/img/a2345690.png)-129px-29px no-repeat;}
可以存在有多种判断数据文件是否已经存储在文件服务器160中的方式。根据本发明的一个实施方式,链接处理器230可以计算本地数据文件的散列值,例如MD5值,并将该值传输到文件服务器160。文件服务器160中包括一个存储设备,其中记录了文件服务器160中各个数据文件的散列值以及相对应的存储位置。当文件服务器160接收到链接处理器230发送过来的散列值时,会在存储设备中查找是否存 在相同的散列值,如果存在,则说明在文件服务器160中已经存储有该数据文件,此时可以直接返回该数据文件在文件服务器160中的存储位置信息(即链接信息)。如果不存在,则文件服务器160会返回文件不存在消息给链接处理器230。链接处理器230随后可以将数据文件传输到文件服务器160。文件服务器160可以存储该数据文件,并将该数据文件的散列值和存储位置存储到存储设备中。There may be a plurality of ways to determine if the data file has been stored in the file server 160. In accordance with an embodiment of the present invention, link processor 230 may calculate a hash value of a local data file, such as an MD5 value, and transmit the value to file server 160. The file server 160 includes a storage device in which the hash value of each data file in the file server 160 and the corresponding storage location are recorded. When the file server 160 receives the hash value sent by the link processor 230, it searches for the storage device. The same hash value, if present, indicates that the data file has been stored in the file server 160, at which point the storage location information (i.e., link information) of the data file in the file server 160 can be directly returned. If not, file server 160 returns a file absence message to link processor 230. Link processor 230 can then transfer the data file to file server 160. The file server 160 can store the data file and store the hash value and storage location of the data file in a storage device.
在链接处理器230完成处理之后,输出装置240会读取经过处理的网页相关文件的内容,并输出到文件处理设备200的外部。例如,输出装置240可以直接将经过处理的网页相关文件传输到服务器140中,也可以在计算设备150的本地存储,并等待所有的网页相关文件处理完成之后,统一由计算设备150传输到服务器140并进行存储。After the link processor 230 completes the processing, the output device 240 reads the content of the processed web page related file and outputs it to the outside of the file processing apparatus 200. For example, the output device 240 may directly transfer the processed webpage related file to the server 140, or may be stored locally in the computing device 150, and wait for all webpage related file processing to be completed, and then uniformly transmitted by the computing device 150 to the server 140. And store it.
可选地,文件处理设备200还包括内容压缩装置250。内容压缩装置250可以在输出装置240输出网页相关文件之前,对经过处理的网页相关文件进行压缩处理。由于现在客户端110处的浏览器都支持接收压缩的文件并进行处理,所以,可以将网页相关文件进行压缩并存储到服务器140中,客户端110可以直接获取经过压缩的文件来处理,这样可以进一步节省在客户端和服务器之间的网络带宽消耗。Optionally, the file processing device 200 further includes a content compression device 250. The content compression device 250 may perform compression processing on the processed web page related file before the output device 240 outputs the web page related file. Since the browser at the client 110 supports receiving and processing the compressed file, the webpage related file can be compressed and stored in the server 140, and the client 110 can directly obtain the compressed file for processing. Further saving network bandwidth consumption between the client and the server.
另外,内容压缩装置250还可以进行一些优化处理,例如可以删除网页相关文件中多余的回车、空格等无效字符,使得网页相关文件的大小更小。当客户端110的数量巨大时,网页相关文件尺寸的少许修改就可以节省大量的网络带宽。In addition, the content compression device 250 can also perform some optimization processing, for example, deleting invalid characters such as carriage returns, spaces, and the like in the webpage related files, so that the size of the webpage related files is smaller. When the number of clients 110 is large, a small modification of the file size of the webpage can save a lot of network bandwidth.
利用根据本发明的文件处理设备200,可以一次将网页相关文件以及其引用的数据文件发布到服务器140和/或文件服务器160中,同时还可以保持对数据文件引用的正确性。这样不用在发布时要逐个发布网页相关文件和引用的数据文件,从而简化网页相关文件发布的流程。另外,与现有的发布方式不同,根据本发明的文件处理设备200会判断数据文件是否已经早已存储到文件服务器160中了,因此可以防止一个数据文件的多次存储,则对于保持数据文件的版本一致性而言非常重要。With the file processing apparatus 200 according to the present invention, the web page related file and its referenced data file can be published to the server 140 and/or the file server 160 at one time while maintaining the correctness of the reference to the data file. In this way, it is not necessary to publish webpage related files and referenced data files one by one at the time of publishing, thereby simplifying the process of publishing webpage related files. In addition, unlike the existing distribution method, the file processing apparatus 200 according to the present invention determines whether the data file has already been stored in the file server 160, so that it is possible to prevent multiple storage of one data file, and to maintain the data file. It is very important in terms of version consistency.
图3示出了根据本发明一个实施例的文件处理方法300的流程图。方法适于在图1所示的计算设备150,尤其是图2所示的文件处理设备200中执行,以便将网页相关文件发布到服务器140和/或文件服务器 160中。FIG. 3 shows a flow diagram of a file processing method 300 in accordance with one embodiment of the present invention. The method is adapted to be executed in the computing device 150 shown in FIG. 1, particularly the file processing device 200 shown in FIG. 2, to publish web page related files to the server 140 and/or file server 160.
一般而言,方法300会由计算设备150的用户调用来处理该用户已经准备好的各种网页相关文件。例如计算设备150的用户已经编辑好网页,并准备将这些网页以及相关联的内容发布出去以便由客户端110来从服务器140获取并呈现在客户端110的浏览器上。随后,计算设备150的用户就会调用方法300来对各种网页相关文件进行预处理。用户通常会指定要进行预处理的文件目录。In general, method 300 will be invoked by a user of computing device 150 to process various web page related files that the user has prepared. For example, the user of computing device 150 has edited the web page and is ready to publish the web page and associated content for retrieval by client 110 from server 140 and for presentation on client 110's browser. The user of computing device 150 then invokes method 300 to preprocess various web page related files. The user usually specifies the file directory to be preprocessed.
网页相关文件可以是诸如CSS文件和/或JS脚本之类、会由网页调用来帮助在客户端来呈现网页内容和/或提高与客户端处的用户之间的交互的页面相关文件。这些文件符合HTML标准,并且在HTML中被广泛使用。这些网页相关文件中,还会引用在这些文件之外的图像、音频和/或视频之类的其它文件。The web page related file may be a page related file such as a CSS file and/or a JS script that is invoked by the web page to help present the web content at the client and/or to enhance interaction with the user at the client. These files conform to the HTML standard and are widely used in HTML. In these web page related files, other files such as images, audio and/or video other than these files are also cited.
上面结合图2的描述中已经给出了网页相关文件的具体示例,这里不再赘述。该方法适于逐个地对用户指定目录下的文件进行处理。例如,该方法会查找该该目录下所有文件后缀名为css和/或js的文件,并逐个进行处理。Specific examples of webpage related files have been given in the above description in conjunction with FIG. 2, and are not described herein again. The method is suitable for processing files in a user-specified directory one by one. For example, the method will find all files in the directory with the suffixes named css and/or js and process them one by one.
该方法始于步骤S310。在步骤S310中,读取一个网页相关文件的文件内容。例如,在步骤S310中,可以将网页相关文件的文件内容从诸如硬盘之类的大容量存储器读取到缓存中,以便于后续处理。在一个实施例中,甚至可以例如利用HTML引擎对该文件内容分析,从而得到该文件中内容的组织结构。例如就CSS而言,可以获得每个CSS的标签(tag)和对应的值(value)。当然,根据本发明的另一个实施例,可以直接将内容读取出来并进行缓存即可。The method begins in step S310. In step S310, the file content of a web page related file is read. For example, in step S310, the file content of the webpage related file may be read from the mass storage such as a hard disk into the cache for subsequent processing. In one embodiment, the content of the file may even be analyzed, for example, using an HTML engine to obtain an organizational structure of the content in the file. For example, in the case of CSS, a tag (tag) and a corresponding value (value) of each CSS can be obtained. Of course, according to another embodiment of the present invention, the content can be directly read out and cached.
随后,在步骤S320中,对在步骤S310中读取的文件内容进行分析,以查找出该文件内容中,对计算设备150中的其他数据文件的引用之处,以及所引用文件的文件位置和文件名,即到计算设备150中的其他数据文件的链接。根据本发明的一个实施例,可以通过查找数据文件的后缀名(例如,当数据文件为图像文件时,其后缀名通常是png、jpg等)来确定对数据文件的引用之处。根据本发明的还有一个实施例,在步骤S320中,可以通过确定可能会引用数据文件的CSS标签或者JS脚本单元,随后确定与这些标签或者脚本相对应的值来确定是否存在数据文件,以及数据文件的详细信息。根据本发明的又一个 实施例,当在步骤S310中获得了文件的组织结构时,则在步骤S320中,可以在该组织结构中遍历以查找相应的数据文件信息。应当注意的是,本发明不受限于步骤S320的具体实现方式,所有可以从所读取的文件内容中查找到引用的数据文件的相关信息的方式都在本发明的保护范围之内。Subsequently, in step S320, the content of the file read in step S310 is analyzed to find out the reference to other data files in the computing device 150 in the file content, and the file location of the referenced file and The file name is a link to other data files in computing device 150. In accordance with an embodiment of the present invention, the reference to the data file can be determined by looking up the suffix name of the data file (eg, when the data file is an image file, the suffix name is typically png, jpg, etc.). According to still another embodiment of the present invention, in step S320, it may be determined whether a data file exists by determining a CSS tag or a JS script unit that may reference the data file, and then determining values corresponding to the tags or scripts, and The details of the data file. Yet another according to the invention In the embodiment, when the organization structure of the file is obtained in step S310, then in step S320, it is possible to traverse in the organizational structure to find the corresponding data file information. It should be noted that the present invention is not limited to the specific implementation of step S320, and all manners in which relevant information of the referenced data file can be found from the contents of the read file are within the scope of the present invention.
例如,在上面的示例中,在步骤S320中,可以查找到4个引用的数据文件信息,但是它们的内容是一样的,都是colorbox/themes/1/images/controls.png。For example, in the above example, in step S320, four referenced data file information can be found, but their contents are the same, both are colorbox/themes/1/images/controls.png.
在步骤S320中查找到引用的数据文件信息之后,在步骤S330对所查找到的数据文件信息进行处理。数据文件信息包括所引用的数据文件相对于当前被处理的网页相关文件的位置。在步骤S330中,可以根据该位置信息获取所引用的数据文件。随后,将该数据文件和文件服务器160建立关联。具体而言,在步骤S330中,确定在文件服务器160中是否存在该数据文件。如果在文件服务器160中存在该数据文件,则直接获取数据文件在文件服务器160中的链接地址;如果在文件服务器160中不存在该数据文件,则将该数据文件上传到文件服务器160中,并获取该数据文件在文件服务器160中的链接地址。After the referenced data file information is found in step S320, the found data file information is processed in step S330. The data file information includes the location of the referenced data file relative to the currently processed web page related file. In step S330, the referenced data file may be acquired based on the location information. The data file is then associated with the file server 160. Specifically, in step S330, it is determined whether or not the data file exists in the file server 160. If the data file exists in the file server 160, the link address of the data file in the file server 160 is directly obtained; if the data file does not exist in the file server 160, the data file is uploaded to the file server 160, and The link address of the data file in the file server 160 is obtained.
通过上述处理,可以确保在文件服务器160中必然存储有数据文件,从而可以在数据文件和文件服务器160之间建立关联。在获取了数据文件在文件服务器160中的链接地址之后,在步骤S330中,可以将所缓存的文件内容中,与数据文件相对应的链接替换为到文件服务器160中的链接。由于在步骤S320可以查找到到数据文件的链接,因此可以采用与步骤S320相类似的方法来将到本地数据文件的链接为到文件服务器160中的链接。Through the above processing, it can be ensured that the data file is necessarily stored in the file server 160, so that an association can be established between the data file and the file server 160. After the link address of the data file in the file server 160 is acquired, in step S330, the link corresponding to the data file among the cached file contents may be replaced with the link to the file server 160. Since the link to the data file can be found in step S320, a link to the local data file can be taken as a link to the file server 160 in a similar manner to step S320.
就上面的示例而言,假定文件服务器160的网站为60.img360.cn,而数据文件在该文件服务器160中的链接URL为60.img360.cn/img/a2345690.png。在将到本地数据文件的链接替换为到文件服务器160的URL之后,上面的CSS内容就会修改为:For the above example, assume that the website of the file server 160 is 60.img360.cn, and the link URL of the data file in the file server 160 is 60.img360.cn/img/a2345690.png. After replacing the link to the local data file with the URL to file server 160, the above CSS content will be modified to:
#colorbox{}#colorbox{}
#cboxTopLeft{width:21px;height:21px;background:url(http://60.img360.cn/img/a2345690.png)-100px 0 no-repeat;} #cboxTopLeft{width:21px;height:21px;background:url(http://60.img360.cn/img/a2345690.png)-100px 0 no-repeat;}
#cboxTopRight{width:21px;height:21px;backgroun d:url(http://60.img360.cn/img/a2345690.png)-129px 0 no-repeat;}#cboxTopRight{width:21px;height:21px;backgroun d:url(http://60.img360.cn/img/a2345690.png)-129px 0 no-repeat;}
#cboxBottomLeft{width:21px;height:21px;backgro und:url http://60.img360.cn/img/a2345690.png)-100px-29px no-repeat;}#cboxBottomLeft{width:21px;height:21px;backgro und:url http://60.img360.cn/img/a2345690.png)-100px-29px no-repeat;}
#cboxBottomRight{width:21px;height:21px;backgr ound:url(http://60.img360.cn/img/a2345690.png)-129px-29px no-repeat;}#cboxBottomRight{width:21px;height:21px;backgr ound:url(http://60.img360.cn/img/a2345690.png)-129px-29px no-repeat;}
可以存在有多种判断数据文件是否已经存储在文件服务器160中的方式。根据本发明的一个实施方式,在步骤S330中,可以计算本地数据文件的散列值,例如MD5值,并将该值传输到文件服务器160。文件服务器160中包括一个存储设备,其中记录了文件服务器160中各个数据文件的散列值以及相对应的存储位置。当文件服务器160接收到计算设备150发送过来的散列值时,会在存储设备中查找是否存在相同的散列值,如果存在,则说明在文件服务器160中已经存储有该数据文件,此时可以直接返回该数据文件在文件服务器160中的存储位置信息(即链接信息)。如果不存在,则文件服务器160会返回文件不存在的消息给计算设备150。随后,在步骤S330中,可以将数据文件传输到文件服务器160。文件服务器160可以存储该数据文件,并将该数据文件的散列值和存储位置存储到存储设备中。There may be a plurality of ways to determine if the data file has been stored in the file server 160. According to an embodiment of the present invention, in step S330, a hash value of the local data file, such as an MD5 value, may be calculated and transmitted to the file server 160. The file server 160 includes a storage device in which the hash value of each data file in the file server 160 and the corresponding storage location are recorded. When the file server 160 receives the hash value sent by the computing device 150, it searches for the same hash value in the storage device. If it exists, it indicates that the data file has been stored in the file server 160. The storage location information (i.e., link information) of the data file in the file server 160 can be directly returned. If not, file server 160 returns a message that the file does not exist to computing device 150. Subsequently, in step S330, the data file can be transferred to the file server 160. The file server 160 can store the data file and store the hash value and storage location of the data file in a storage device.
在步骤S330中完成处理之后,在步骤S340中会读取经过处理的网页相关文件的内容,并输出到文件处理设备200的外部。例如,可以直接将经过处理的网页相关文件传输到服务器140中,也可以在计算设备150的本地存储,并等待所有的网页相关文件处理完成之后,统一由计算设备150传输到服务器140并进行存储。After the processing is completed in step S330, the content of the processed web page related file is read in step S340 and output to the outside of the file processing apparatus 200. For example, the processed webpage related files may be directly transferred to the server 140, or may be stored locally in the computing device 150, and wait for all webpage related file processing to be completed, and then uniformly transmitted by the computing device 150 to the server 140 and stored. .
可选地,文件处理方法300还包括步骤S350。步骤S350可以在步骤S340输出网页相关文件之前,对经过处理的网页相关文件进行压缩处理。由于现在客户端110处的浏览器都支持接收压缩的文件并进行处理,所以,可以将网页相关文件进行压缩并存储到服务器140中,客户端110可以直接获取经过压缩的文件来处理,这样可以进一步节省在客户端和服务器之间的网络带宽消耗。 Optionally, the file processing method 300 further includes step S350. Step S350 may perform compression processing on the processed webpage related file before outputting the webpage related file in step S340. Since the browser at the client 110 supports receiving and processing the compressed file, the webpage related file can be compressed and stored in the server 140, and the client 110 can directly obtain the compressed file for processing. Further saving network bandwidth consumption between the client and the server.
另外,在步骤S350中还可以进行一些优化处理,例如可以删除网页相关文件中多余的回车、空格等无效字符,使得网页相关文件的大小更小。当客户端110的数量巨大时,网页相关文件尺寸的少许修改就可以节省大量的网络带宽。In addition, some optimization processing may be performed in step S350. For example, invalid characters such as carriage returns and spaces in the webpage related file may be deleted, so that the size of the webpage related file is smaller. When the number of clients 110 is large, a small modification of the file size of the webpage can save a lot of network bandwidth.
利用根据本发明的文件处理方法300,可以一次将网页相关文件以及其引用的数据文件发布到服务器140和/或文件服务器160中,同时还可以保持对数据文件引用的正确性。这样不用在发布时要逐个发布网页相关文件和引用的数据文件,从而简化网页相关文件发布的流程。另外,与现有的发布方式不同,根据本发明的文件处理方法300会判断数据文件是否已经早已存储到文件服务器160中了,因此可以防止一个数据文件的多次存储,则对于保持数据文件的版本一致性而言非常重要。With the file processing method 300 according to the present invention, the web page related file and its referenced data file can be published to the server 140 and/or the file server 160 at one time while maintaining the correctness of the reference to the data file. In this way, it is not necessary to publish webpage related files and referenced data files one by one at the time of publishing, thereby simplifying the process of publishing webpage related files. In addition, unlike the existing distribution method, the file processing method 300 according to the present invention determines whether the data file has already been stored in the file server 160, so that it is possible to prevent multiple storage of one data file, and to maintain the data file. It is very important in terms of version consistency.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, the various features of the invention are sometimes grouped together into a single embodiment, in the above description of the exemplary embodiments of the invention, Figure, or a description of it. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进 行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the equipment Line combination. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的各设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the various components in accordance with embodiments of the present invention. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图4示出了可以实现根据本发明的文件处理方法的计算设备。该计算设备传统上包括处理器410和以存储器420形式的计算机程序产品或者计算机可读介质。存储器420可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器420具有用于执行上述方法中的任何方法步骤的程序代码431的存储空间430。例如,用于程序代码的存储空间430可以包括分别用于实现上面的方法中的各种步骤的各个程序代码431。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图5所述的便携式或者固定存储单元。该存储单元可以具有与图4的计算设备中的存储器420类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码431’,即可以由例如诸如410之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的 各个步骤。For example, Figure 4 illustrates a computing device that can implement a file processing method in accordance with the present invention. The computing device conventionally includes a processor 410 and a computer program product or computer readable medium in the form of a memory 420. The memory 420 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 420 has a memory space 430 for program code 431 for performing any of the method steps described above. For example, storage space 430 for program code may include various program code 431 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG. The storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 420 in the computing device of FIG. The program code can be compressed, for example, in an appropriate form. Typically, the storage unit includes computer readable code 431', i.e., code readable by a processor, such as 410, that when executed by a computing device causes the computing device to perform the methods described above Each step.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。"an embodiment," or "an embodiment," or "an embodiment," In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。 In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.

Claims (15)

  1. 一种文件处理设备,驻留在计算设备中,该文件处理设备包括:A file processing device resides in a computing device, the file processing device comprising:
    内容读取器,适于读取要处理文件的文件内容;a content reader adapted to read a file content of a file to be processed;
    链接查找器,适于在所读取的文件内容中查找到计算设备中的数据文件的链接;a link finder adapted to find a link to a data file in the computing device in the read file content;
    链接处理器,适于将查找到的计算设备中的数据文件的链接对应的数据文件和与该计算设备通信连接的文件服务器建立关联,获取该计算设备中的数据文件在所述文件服务器上的链接地址,并在所述文件内容中将到外部文件的链接由所述计算设备中的数据文件的链接替换为所获取的、在文件服务器上的链接地址;以及a link processor, configured to associate a data file corresponding to a link of the data file in the found computing device with a file server communicatively coupled to the computing device, and obtain a data file in the computing device on the file server Linking the address and replacing the link to the external file in the file content with a link to the data file in the computing device to the obtained link address on the file server;
    输出装置,适于输出经处理的文件内容。An output device adapted to output the processed file content.
  2. 如权利要求1所述的文件处理设备,其中所述计算设备中的数据文件是图形文件、音频文件和视频文件中的任何一种或者多种。The file processing device of claim 1, wherein the data file in the computing device is any one or more of a graphics file, an audio file, and a video file.
  3. 如权利要求1或2所述的文件处理设备,其中所述链接处理器将查找到的计算设备中的数据文件的链接对应的数据文件和与该计算设备通信连接的文件服务器建立关联包括:A file processing device according to claim 1 or 2, wherein said link processor associating a data file corresponding to a link of a data file in the found computing device with a file server communicatively coupled to the computing device comprises:
    确定所述计算设备中的数据文件是否已经存储于文件服务器中,如果不是,将所述计算设备中的数据文件上传到文件服务器中。Determining whether the data file in the computing device has been stored in the file server, and if not, uploading the data file in the computing device to the file server.
  4. 如权利要求3所述的文件处理设备,其中所述链接处理器将计算设备中的数据文件的散列值发送到文件服务器,以确定所述计算设备中的数据文件是否已经存储于文件服务器中。The file processing device of claim 3 wherein said link processor transmits a hash value of a data file in the computing device to a file server to determine if a data file in said computing device is already stored in said file server .
  5. 如权利要求1-4中任一个所述的文件处理设备,还包括内容压缩装置,适于在所述输出装置输出文件内容之前,对文件内容进行压缩处理。A file processing apparatus according to any one of claims 1 to 4, further comprising content compressing means adapted to perform compression processing on the file contents before said output means outputs the contents of the file.
  6. 如权利要求1-5中任一个所述的文件处理设备,其中所述要处理的文件为级联样式(CSS)文件和/或JavaScript脚本(JS)文件。A file processing device according to any one of claims 1 to 5, wherein the file to be processed is a cascading style (CSS) file and/or a JavaScript script (JS) file.
  7. 一种文件处理方法,该方法适于在计算设备中执行,该方法包括步骤:A file processing method, the method being adapted to be executed in a computing device, the method comprising the steps of:
    读取要处理文件的文件内容;Read the contents of the file to be processed;
    在所读取的文件内容中查找到计算设备中的数据文件的链接;Finding a link to a data file in the computing device in the read file content;
    将查找到的计算设备中的数据文件的链接对应的数据文件和与该 计算设备通信连接的文件服务器建立关联,获取该计算设备中的数据文件在所述文件服务器上的链接地址,并在所述文件内容中将到外部文件的链接由所述计算设备中的数据文件的链接替换为所获取的、在文件服务器上的链接地址;以及The data file corresponding to the link of the data file in the found computing device and A file server of the computing device communication connection establishes an association, obtains a link address of the data file in the computing device on the file server, and links the external file to the data file in the computing device in the file content Replace the link with the obtained link address on the file server;
    输出经处理的文件内容。Output the processed file contents.
  8. 如权利要求7所述的文件处理方法,其中所述计算设备中的数据文件是图形文件、音频文件和视频文件中的任何一种或者多种。The file processing method according to claim 7, wherein the data file in the computing device is any one or more of a graphic file, an audio file, and a video file.
  9. 如权利要求7或8所述的文件处理方法,其中所述将查找到的计算设备中的数据文件的链接对应的数据文件和与该计算设备通信连接的文件服务器建立关联的步骤包括:The file processing method according to claim 7 or 8, wherein the step of associating the data file corresponding to the link of the data file in the found computing device with the file server communicatively connected to the computing device comprises:
    确定所述计算设备中的数据文件是否已经存储于文件服务器中,如果不是,将所述计算设备中的数据文件上传到文件服务器中。Determining whether the data file in the computing device has been stored in the file server, and if not, uploading the data file in the computing device to the file server.
  10. 如权利要求9所述的文件处理方法,其中所述查找到的计算设备中的数据文件的链接对应的数据文件和与该计算设备通信连接的文件服务器建立关联的步骤包括:The file processing method according to claim 9, wherein the step of associating the data file corresponding to the link of the data file in the found computing device with the file server communicatively connected to the computing device comprises:
    将计算设备中的数据文件的散列值发送到文件服务器,以确定所述计算设备中的数据文件是否已经存储于文件服务器中。A hash value of the data file in the computing device is sent to the file server to determine if the data file in the computing device is already stored in the file server.
  11. 如权利要求7-10中任一个所述的文件处理方法,还包括步骤:A file processing method according to any one of claims 7 to 10, further comprising the steps of:
    在输出文件内容之前,对文件内容进行压缩处理。The contents of the file are compressed before the contents of the file are output.
  12. 如权利要求7-11中任一个所述的文件处理方法,其中所述要处理的文件为级联样式(CSS)文件和/或JavaScript脚本(JS)文件。A file processing method according to any one of claims 7 to 11, wherein the file to be processed is a cascading style (CSS) file and/or a JavaScript script (JS) file.
  13. 一种网络系统,包括a network system, including
    服务器;server;
    文件服务器;file server;
    多个客户端,经由网络与服务器以及文件服务器进行通信;以及Multiple clients communicating with servers and file servers via the network;
    计算设备,包括如权利要求1-6中任一个所述的文件处理设备,A computing device, comprising the file processing device of any of claims 1-6,
    其中所述计算设备耦接到服务器和文件服务器,将所述文件处理设备处理后的文件传输到服务器并存储其中,并且将相应的计算设备中的数据文件传输到文件服务器并存储其中,以便由多个客户端中的任一个分别从所述服务器下载该文件以及从所述文件服务器下载相应的数据文件并进行处理。The computing device is coupled to the server and the file server, transmits the file processed by the file processing device to the server and stores therein, and transfers the data file in the corresponding computing device to the file server and stores therein, so as to be Any one of the plurality of clients downloads the file from the server and downloads the corresponding data file from the file server and processes it.
  14. 一种计算机程序,包括计算机可读代码,当所述计算机可读 代码在计算设备上运行时,导致所述计算设备执行根据权利要求7-12中的任一个所述的文件处理方法。A computer program comprising computer readable code when the computer is readable The code, when run on a computing device, causes the computing device to perform the file processing method of any of claims 7-12.
  15. 一种计算机可读介质,其中存储了如权利要求14所述的计算机程序。 A computer readable medium storing the computer program of claim 14.
PCT/CN2015/076110 2014-04-08 2015-04-08 File processing method, device, and network system WO2015154678A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410138455.X 2014-04-08
CN201410138455.XA CN104978339A (en) 2014-04-08 2014-04-08 File processing method and equipment, and network system

Publications (1)

Publication Number Publication Date
WO2015154678A1 true WO2015154678A1 (en) 2015-10-15

Family

ID=54274854

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/076110 WO2015154678A1 (en) 2014-04-08 2015-04-08 File processing method, device, and network system

Country Status (2)

Country Link
CN (1) CN104978339A (en)
WO (1) WO2015154678A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117421A (en) * 2017-06-23 2019-01-01 埃森哲环球解决方案有限公司 Data are handled to improve the quality of data

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108073488A (en) * 2016-11-14 2018-05-25 北京京东尚科信息技术有限公司 Service monitoring method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075569A (en) * 2010-12-15 2011-05-25 北京京东世纪贸易有限公司 Method and device for uploading multi-pictures for releasing contents
CN102929604A (en) * 2012-09-29 2013-02-13 北京奇虎科技有限公司 Screen capturing apparatus and method
US8521849B2 (en) * 2010-07-08 2013-08-27 Panasonic Corporation Transmission control device and computer program controlling transmission of selected content file
CN103678600A (en) * 2013-12-13 2014-03-26 北京奇虎科技有限公司 Webpage data processing method and equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100395711C (en) * 2006-06-01 2008-06-18 无锡永中科技有限公司 Converting method of object linking and embedded object
CN101127038B (en) * 2006-08-18 2012-09-19 鸿富锦精密工业(深圳)有限公司 System and method for downloading website static web page
CN101770488A (en) * 2008-12-27 2010-07-07 鸿富锦精密工业(深圳)有限公司 Web page transition system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8521849B2 (en) * 2010-07-08 2013-08-27 Panasonic Corporation Transmission control device and computer program controlling transmission of selected content file
CN102075569A (en) * 2010-12-15 2011-05-25 北京京东世纪贸易有限公司 Method and device for uploading multi-pictures for releasing contents
CN102929604A (en) * 2012-09-29 2013-02-13 北京奇虎科技有限公司 Screen capturing apparatus and method
CN103678600A (en) * 2013-12-13 2014-03-26 北京奇虎科技有限公司 Webpage data processing method and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117421A (en) * 2017-06-23 2019-01-01 埃森哲环球解决方案有限公司 Data are handled to improve the quality of data

Also Published As

Publication number Publication date
CN104978339A (en) 2015-10-14

Similar Documents

Publication Publication Date Title
US9916390B2 (en) Managing web browser cache for offline browsing
CN106575298B (en) Rapid presentation of web sites containing dynamic content and stale content
US8887039B2 (en) Web page based program versioning
US10191856B2 (en) Method of managing web browser cache size using logical relationships and clustering
US11403262B2 (en) Local networked storage linked to remote networked storage system
US20230127790A1 (en) Techniques for view capture and storage for mobile applications
WO2015196954A1 (en) Webpage element display method and browser device
WO2020199751A1 (en) Method and apparatus for loading page picture, and electronic device
WO2015039586A1 (en) Method, apparatus and browser for webpage loading
WO2015043383A1 (en) Webpage loading method and device and browser
US20140089786A1 (en) Automated Processor For Web Content To Mobile-Optimized Content Transformation
US20170199850A1 (en) Method and system to decrease page load time by leveraging network latency
US20170139813A1 (en) Method and device for checking influence of deleting cache file, and mobile terminal
US9667696B2 (en) Low latency web-based DICOM viewer system
CN104077310A (en) Method, equipment and system for loading resource file
TW201409234A (en) Data analysis system
WO2015154682A1 (en) Network request processing method, network server, and network system
CN113343312A (en) Page tamper-proofing method and system based on front-end point burying technology
US20160315997A1 (en) File transfer method, device, and system
WO2015154678A1 (en) File processing method, device, and network system
WO2015154680A1 (en) File processing method, device, and network system
US9881101B2 (en) Dynamic file retrieving for web page loading
US9253279B2 (en) Preemptive caching of data
CN113297267A (en) Data caching and task processing method, device, equipment and storage medium
CN104956360B (en) Presented using the progressive picture of data URI enhancings

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15777067

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15777067

Country of ref document: EP

Kind code of ref document: A1