Static resource backup method and device
By obtaining the file path information of the static resource file and storing it into the backup file, and obtaining the static resource file from the static resource server and backing it up, the problems of low efficiency and high cost of static resource backup in the existing technology are solved, and efficient and low-cost static resource backup are achieved.
Patent Information
- Application Number
- CN202110092754.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-22
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2041-01-22
AI Technical Summary
In the prior art, when backing up static resources, backup consumption is high and backup efficiency is low.
By determining the target domain name of the static resource server to be backed up, obtain the file path information of the static resource file under the target domain name, and store it in the backup file built based on the target domain name. Obtain static resource files from static resource servers based on file path information and store them in backup files.
It effectively improves the efficiency of static resource backup, reduces backup cost consumption, and solves the problems of low backup efficiency and high cost.
Smart Images

Figure CN113760603B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and more specifically, to a static resource backup method, a static resource backup device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Web page display is inseparable from the display of static resources such as pictures and documents in the front-end page. Static resources can be referenced from the static resource server according to the network address. When the domain name of the static resource server is no longer allowed for some reason, in order to achieve normal reference of static resources, it is necessary to back up the static resources in the abnormal server.
[0003] In the process of implementing the technical concept of the present disclosure, the inventor discovered that when backing up static resources in the related technology, files that reference static resources of the abnormal server are determined in the local project file and backed up. This method has the problems of high backup consumption and low backup efficiency. Summary of the invention
[0004] In view of this, the present disclosure provides a static resource backup method and device with low backup consumption and effectively improved backup efficiency.
[0005] One aspect of the present disclosure provides a static resource backup method, including: determining a target domain name of a static resource server to be backed up; obtaining file path information of a static resource file under the target domain name; storing the file path information in a backup file constructed based on the target domain name; obtaining the static resource file from the static resource server according to the file path information; and storing the obtained static resource file in the backup file.
[0006] Optionally, obtaining the file path information of the static resource file under the target domain name includes: obtaining a uniform resource locator URL of the static resource file under the target domain name; and determining the file path information of the static resource file based on the URL.
[0007] Optionally, obtaining the URL of the static resource file under the target domain name includes: traversing all local static resource files according to the file path to capture the URL of each static resource file in all the static resource files; based on the URL of each static resource file, using the URL pointing to the target domain name as the URL of the static resource file under the target domain name.
[0008] Optionally, the backup file includes a first backup sub-file for storing the file path information, and a second backup sub-file for storing the static resource file. Storing the file path information in a backup file constructed based on the target domain name includes: storing the URL of the static resource file in the first backup sub-file; storing the acquired static resource file in the backup file includes: storing the acquired static resource file in the second backup sub-file.
[0009] Optionally, when storing the URL of the static resource file into the first backup subfile, it includes: determining whether the first backup subfile contains other URLs that are the same as the URL to be stored; if so, stopping the storage process for the URL to be stored.
[0010] Optionally, storing the acquired static resource file into the second backup sub-file includes: determining the file name and file directory information of the static resource file based on the URL; and storing the static resource file into a sub-file associated with the file name in the second backup sub-file based on the file directory information.
[0011] Optionally, the method further includes: uploading the acquired static resource file to a backup static resource server according to the file path information.
[0012] Another aspect of the present disclosure provides a static resource backup device, including: a first processing module, used to determine a target domain name of a static resource server to be backed up; a first acquisition module, used to obtain file path information of static resource files under the target domain name; a second processing module, used to store the file path information in a backup file constructed based on the target domain name; a second acquisition module, used to obtain the static resource file from the static resource server according to the file path information; and a third processing module, used to store the obtained static resource file in the backup file.
[0013] Optionally, the first acquisition module includes: an acquisition submodule, used to obtain a uniform resource locator URL of a static resource file under the target domain name; and a first processing submodule, used to determine the file path information of the static resource file based on the URL.
[0014] Optionally, the acquisition submodule includes: an acquisition unit, used to traverse all local static resource files according to the file path to capture the URL of each static resource file in all the static resource files; a first processing unit, used to use the URL pointing to the target domain name as the URL of the static resource file under the target domain name based on the URL of each static resource file.
[0015] Optionally, the backup file includes a first backup sub-file for storing the file path information, and a second backup sub-file for storing the static resource file, and the second processing module includes: a second processing sub-module for storing the URL of the static resource file in the first backup sub-file; the third processing module includes: a third processing sub-module for storing the acquired static resource file in the second backup sub-file.
[0016] Optionally, the second processing submodule includes a second processing unit, which is used to determine whether the first backup subfile contains other URLs that are the same as the URL to be stored when storing the URL of the static resource file into the first backup subfile; if so, stop the storage processing for the URL to be stored.
[0017] Optionally, the third processing sub-module includes: a third processing unit, used to determine the file name and file directory information of the static resource file based on the URL; and a fourth processing unit, used to store the static resource file in a sub-file associated with the file name in the second backup sub-file based on the file directory information.
[0018] Optionally, the device further includes a fourth processing module, configured to upload the acquired static resource file to a backup static resource server according to the file path information.
[0019] Another aspect of the present disclosure provides an electronic device. The electronic device includes at least one processor and a memory connected to the at least one processor. The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor implements the method of the embodiment of the present disclosure.
[0020] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method of the embodiment of the present disclosure when executed.
[0021] Another aspect of the present disclosure provides a computer program, wherein the computer program includes computer executable instructions, and the instructions are used to implement the method of the embodiment of the present disclosure when executed.
[0022] Another aspect of the present disclosure provides a computer program product, comprising computer-readable instructions, wherein the computer-readable instructions are used to perform the method of the embodiment of the present disclosure when executed.
[0023] Through the embodiments of the present disclosure, because a technical solution is adopted, which includes determining a target domain name of a static resource server to be backed up; obtaining file path information of static resource files under the target domain name; storing the file path information in a backup file constructed based on the target domain name; obtaining static resource files from a static resource server according to the file path information; and storing the obtained static resource files in a backup file, the technical problems of low backup efficiency and high backup cost of static resource data existing in related technologies are at least partially overcome, thereby achieving the technical effect of effectively improving the backup efficiency of static resources and effectively reducing the backup cost of static resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:
[0025] Figure 1 The static resource backup system architecture according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 2 A flowchart of a static resource backup method according to an embodiment of the present disclosure is schematically shown;
[0027] Figure 3 A flowchart of another static resource backup method according to an embodiment of the present disclosure is schematically shown;
[0028] Figure 4 A schematic diagram of a process of traversing local static resource files according to an embodiment of the present disclosure is schematically shown;
[0029] Figure 5 A schematic diagram of a page for storing file path information according to an embodiment of the present disclosure is schematically shown;
[0030] Figure 6 A schematic diagram of a page storing static resource files according to an embodiment of the present disclosure is schematically shown;
[0031] Figure 7 A block diagram of a static resource backup device according to an embodiment of the present disclosure is schematically shown;
[0032] Figure 8 A block diagram of an electronic device suitable for implementing a static resource backup method and apparatus according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0033] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0034] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0035] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0036] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0037] Various embodiments of the present disclosure provide a static resource backup method and a backup device capable of applying the method. The method may include: first, determining a target domain name of a static resource server to be backed up, obtaining file path information of a static resource file under the target domain name, and storing the file path information in a backup file constructed based on the target domain name, then obtaining a static resource file from the static resource server according to the file path information, and storing the obtained static resource file in the backup file.
[0038] like Figure 1As shown, the system architecture 100 includes at least one terminal (multiple terminals are shown in the figure, such as terminals 101, 102, and 103) and a server (multiple terminals are shown in the figure, such as servers 104, 105, and 106). In the system architecture 100, the terminal can be used to execute the static resource backup method of this embodiment, which can specifically be a static resource publishing terminal for project development or a static resource reference terminal on the user side. The server is a static resource server for storing static resource data. The static resource server allows different user terminals to reference static resource data to implement business applications such as web page display and software interface. Exemplarily, server 104 is a static resource server to be backed up with an abnormal domain name.
[0039] The terminal (such as terminals 101, 102, 103) determines the target domain name of the static resource server (such as server 104) to be backed up, obtains the file path information of the static resource files under the target domain name, and stores the file path information in a backup file constructed based on the target domain name. At the same time, the static resource files are obtained from the static resource server (such as server 104) according to the file path information, and the obtained static resource files are stored in the backup file.
[0040] The present disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] Figure 2 The flowchart of a static resource backup method according to an embodiment of the present disclosure is schematically shown.
[0042] like Figure 2 As shown, the method 200 may include, for example, operations S210 to S250.
[0043] In operation S210, a target domain name of a static resource server to be backed up is determined.
[0044] In this embodiment, specifically, the static resource server to be backed up may be a resource server with an abnormal domain name. The abnormal domain name may include, for example, resolution setting problems, website space factors, virus attacks, domain name provider server errors, etc. A large number of static resource files for reference are stored in the static resource server. Static resource files refer to files referenced in a page that do not need to interact logically with a database. Static resource files may include at least one of front-end page code, image files, and documents. The front-end page code may include, for example, HTML (Hyper Text Markup Language), XML (Extensible Markup Language), JS (JavaScript, a literal scripting language), CSS (Cascading Style Sheets), and other format files. Image files may include, for example, static images, dynamic images, videos, and other files. Documents may include, for example, doc, docx, PDF, and other format files.
[0045] Static resource files do not need to be compiled by the server, but can be directly loaded into the terminal for display. Static resource files have a clear correspondence with page content. Since they do not require script calculation and reading of the backend database, static resource files have the advantage of fast response speed. The page content displayed based on static resource files can include, for example, the homepage of the web page, the configuration page, the fixed list page, etc.
[0046] Determine the target domain name of the static resource server to be backed up, exemplarily, the target domain name to be backed up is https: / / commonst.360buying.com. At the same time, build a backup file based on the target domain name, the backup file includes a first backup sub-file for storing file path information of static resource files, and a second backup sub-file for storing static resource files.
[0047] Next, in operation S220, file path information of the static resource file under the target domain name is obtained.
[0048] In this embodiment, specifically, the file path information of the static resource file pointing to the target domain name is obtained, and the file path information describes the storage location of the static resource file in the static resource server, and specifically describes the file directory information of the static resource file in the static resource server. When the terminal executing the method of this embodiment is a static resource data publishing terminal for project development, the disk data of the local project file of the terminal contains a list of original static resource files under multiple page paths, and the page path information associated with the static resource file is determined through the disk data path, and the page path information is used as the file path information of the static resource file.
[0049] Compared with the related art of determining the static resource files of the static resource server to be backed up in the project file, this embodiment traverses all the static resource files in the project file, determines the file path information pointing to the target domain name according to the file contents of all the static resource files, and thereby obtains the file path information of the static resource files to be backed up. This method is conducive to solving the problems of large time and energy consumption, high error rate, and easy omission of confirmation of files to be backed up in the related art when directly determining the static resource files to be backed up.
[0050] Next, in operation S230, the file path information is stored in a backup file constructed based on the target domain name.
[0051] In this embodiment, specifically, the aforementioned static resource file is a resource file published in the static resource server to be backed up and can be referenced by different terminals, and its file path information points to the target domain name of the static resource server. The file path information of the static resource file is stored in the backup file constructed based on the target domain name, and the file path information of different static resource files can be classified based on the server domain name. When the project file references static resource files of multiple static resource servers, a corresponding backup file can be constructed for the domain name of each static resource server.
[0052] The file path information of the static resource file can specifically be the page path information. Since an access link for the static resource file can be generated based on the page path information, the access link is a reference link in the page code corresponding to the page path. Therefore, after determining the file path information of the static resource file, an access link for the static resource file can be generated according to the file path information, thereby realizing fast access and downloading of the static resource file.
[0053] The file name of a static resource file includes a main file name and a file extension, the main file name indicates the file name of the static resource file, and the file extension indicates the file type of the static resource file. Exemplarily, for a static resource file arrow.png, arrow is the main file name and .png is the file extension. Again exemplarily, the page path corresponding to the static resource file is https: / / commonst.360buying.com / common / wx-image, and the access link for it is https: / / commonst.360buymg.com / common / wx-image / arrow.png.
[0054] By building a backup file based on the domain name of the static resource server and storing the file path information of the static resource file pointing to the static resource server domain name in the backup file, this design is conducive to efficiently and conveniently obtaining the storage information of static resource files under different static resource server domain names. When the static resource server domain name is abnormal and cannot be used anymore, this design is conducive to improving the backup efficiency of static resource backup.
[0055] Next, in operation S240, a static resource file is obtained from a static resource server according to the file path information.
[0056] In this embodiment, specifically, according to the acquired file path information, the static resource file is downloaded from the static resource server to be backed up. The file path information describes the file directory information where the static resource file is located, and describes the file name of the static resource file. According to the file directory information and the file name, the static resource file is downloaded from the static resource server to the local. Exemplarily, the URL (Uniform Resource Locator) hhtp: / / commonst.360buying.com / common / wx-image / arrow.png is entered in the browser, and "hhtp: / / " indicates the page path requested to be accessed. According to the file directory information and the file name in the URL, the static resource file "arrow.png" is downloaded from the static resource server.
[0057] Next, in operation S250, the acquired static resource file is stored in a backup file.
[0058] In the disclosed embodiment, specifically, the static resource files downloaded from the static resource server are stored in a backup file constructed based on the target domain name. Optionally, the developer can upload the acquired static resource files to the backup static resource server according to the file path information of the static resource files to ensure that different users can normally reference the static resource files. Then, the static resource domain names are globally searched and replaced in batches in the project file to change the static resource files from being stored in the static resource server to be updated to being stored in the backup static resource server.
[0059] Optionally, the method of this embodiment can be developed into a toolkit containing code files. The user executes the toolkit in the terminal to configure the configuration information required for script execution. The configuration information may specifically include the target domain name of the static resource server to be backed up, the local path of the project file, and the save location of the backup file built based on the target domain name. After the above information is configured, the method of this embodiment can be implemented by executing the toolkit.
[0060] In the disclosed embodiment, the target domain name of the static resource server to be backed up is determined; the file path information of the static resource files under the target domain name is obtained; the file path information is stored in a backup file constructed based on the target domain name; the static resource files are obtained from the static resource server according to the file path information; and the obtained static resource files are stored in the backup file. The file path information of the static resource files under the target domain name is obtained and backed up, and the static resource files are obtained from the static resource server according to the file path information and backed up. This design is conducive to quickly determining the static resource files pointing to the target domain name, and is conducive to efficiently downloading static resource files from the static resource server to be backed up, realizing a more convenient static resource backup method, effectively improving the backup efficiency of static resource backup, and effectively reducing the cost consumption of static resource backup.
[0061] Figure 3 The flowchart of another static resource backup method according to an embodiment of the present disclosure is schematically shown.
[0062] like Figure 3 As shown, the method 300 may include, for example, operations S210, S310-S320, S240, and S330.
[0063] In operation S210, a target domain name of a static resource server to be backed up is determined.
[0064] Next, in operation S310, the URL of the static resource file under the target domain name is obtained, and the file path information of the static resource file is determined based on the URL.
[0065] In the disclosed embodiment, specifically, all local static resource files are traversed according to the file path to capture the URL of each static resource file in all static resource files, and then based on the URL of each static resource file, the URL pointing to the target domain name is used as the URL of the static resource file under the target domain name. According to the local path of the development project, the content of each static resource file is obtained in sequence according to the file path traversal. The URL of each static resource file is captured in a regularized manner, and the URL pointing to the target domain name is screened out as the URL of the static resource file to be backed up. The URL indicates the file directory information and file name of the static resource file, and the file directory information is the page path information for storing the static resource file.
[0066] Figure 4 The following schematically shows a flow chart of traversing local static resource files according to an embodiment of the present disclosure. Figure 4 As shown, the process 400 includes operations S401 to S408. Specifically,
[0067] In operation S401, a file directory to be traversed is obtained;
[0068] In operation S402, traverse the files in the specified directory according to the file path;
[0069] In operation S403, it is determined whether the currently traversed content is a file type, if yes, operation S405 is executed, otherwise operation S404 is executed, wherein if yes, it indicates that the currently traversed content is a static resource file, otherwise, it indicates that the currently traversed content is a subfolder;
[0070] In operation S404, the files in the subfolder are traversed, and after the operation S404 is completed, the operation returns to the execution of operation S403;
[0071] In operation S405, the traversed file content is obtained;
[0072] In operation S406, based on the contents of all the traversed files, a set of URLs pointing to the target domain name to be backed up is screened;
[0073] In operation S407, the URL set pointing to the target domain name is stored in a backup file constructed based on the target domain name;
[0074] In operation S408, it is determined whether all files have been traversed. If yes, the process ends; otherwise, the process returns to execute operation S402.
[0075] Optionally, a hash value can be generated based on the content of the static resource file, and the hash value can be used as the file name or part of the file name of the static resource file. The file name consisting of the hash value is included in the URL of the static resource file. This design is conducive to ensuring the uniqueness of the URL of the static resource file and ensuring that the static resource file is uniquely identified based on the URL.
[0076] Next, in operation S320, the file path information is stored in a first backup sub-file constructed based on the target domain name.
[0077] In the disclosed embodiment, specifically, the URL of the static resource file is stored in a first backup subfile for storing file path information, and the first backup subfile is a subfile of a backup file constructed based on the target domain name. Optionally, when storing the URL of the static resource file in the first backup subfile, it is determined whether the first backup subfile contains other URLs that are the same as the URL to be stored. If so, the storage process for the URL to be stored is stopped, so as to ensure that the URL in the first backup subfile will not be added repeatedly.
[0078] Figure 5 A schematic diagram of a page for storing file path information according to an embodiment of the present disclosure is shown schematically. Figure 5As shown, in page 500, the URL set of different static resource files to be backed up is stored in the first backup sub-file under the storage path of download / exports / urlList / commonst.360buying.com.
[0079] Next, in operation S240, a static resource file is obtained from a static resource server according to the file path information.
[0080] Next, in operation S330, the acquired static resource file is stored in a second backup sub-file constructed based on the target domain name.
[0081] In the embodiment of the present disclosure, the static resource file to be backed up obtained from the static resource server is stored in a second backup sub-file for storing static resource files, and the second backup sub-file is a sub-file of the backup file constructed based on the target domain name. The URL of the static resource file may include a multi-level file directory. In the second backup sub-file, a sub-file is constructed based on each level of the file directory associated with the static resource file, and the static resource file is stored in a sub-file associated with the minimum level file directory according to the file directory information in the URL of the static resource file.
[0082] The file name in the URL of the static resource file can also represent the file type of the static resource file. Optionally, in the sub-file associated with the minimum-level file directory, the sub-files divided by the file name are further constructed according to the file name of the static resource file, and the static resource file is stored in the sub-file associated with the file name. The local backup path of the static resource file is the same as its storage path in the static resource server. This design is conducive to achieving efficient and comprehensive synchronization of static resource files, which can effectively avoid the loss of static resource file backups and effectively improve the efficiency of static resource file backups.
[0083] Figure 6 A schematic diagram of a page for storing static resource files according to an embodiment of the present disclosure is shown schematically. Figure 6As shown, in page 600, the static resource files to be backed up are stored in the second backup subfile under the storage path of download / exports / commonst.360buying.co / common. Specifically, the image files in the static resource files are stored in the subfile " / wx-images" associated with the minimum-level file directory in the second backup subfile. Further, in the subfile " / wx-images" associated with the minimum-level file directory, subfiles divided according to the file names of the static resource files are continued to be constructed. Specifically, four subfiles of addressul, item, order, and personal are constructed in the subfile " / wx-images", and the static resource files are stored in the subfiles associated with the file names. For example, the picture fact-tip-icon.png is stored in the personal subfile.
[0084] Figure 7 A block diagram of a static resource backup device according to an embodiment of the present disclosure is schematically shown.
[0085] like Figure 7 As shown, the device 700 may include a first processing module 701 , a first acquisition module 702 , a second processing module 703 , a second acquisition module 704 and a third processing module 705 .
[0086] Specifically, the first processing module 701 is used to determine the target domain name of the static resource server to be backed up; the first acquisition module 702 is used to obtain the file path information of the static resource files under the target domain name; the second processing module 703 is used to store the file path information in a backup file constructed based on the target domain name; the second acquisition module 704 is used to obtain the static resource files from the static resource server according to the file path information; the third processing module 705 is used to store the obtained static resource files in the backup file.
[0087] In the disclosed embodiment, the target domain name of the static resource server to be backed up is determined; the file path information of the static resource files under the target domain name is obtained; the file path information is stored in a backup file constructed based on the target domain name; the static resource files are obtained from the static resource server according to the file path information; and the obtained static resource files are stored in the backup file. The file path information of the static resource files under the target domain name is obtained and backed up, and the static resource files are obtained from the static resource server according to the file path information and backed up. This design is conducive to quickly determining the static resource files pointing to the target domain name, and is conducive to efficiently downloading static resource files from the static resource server to be backed up, realizing a more convenient static resource backup method, effectively improving the backup efficiency of static resource backup, and effectively reducing the cost consumption of static resource backup.
[0088] As an optional embodiment, the first acquisition module includes: an acquisition submodule, used to obtain the uniform resource locator URL of the static resource file under the target domain name; and a first processing submodule, used to determine the file path information of the static resource file based on the URL.
[0089] As an optional embodiment, the acquisition submodule includes: an acquisition unit, used to traverse all local static resource files according to the file path to capture the URL of each static resource file in all static resource files; a first processing unit, used to use the URL pointing to the target domain name as the URL of the static resource file under the target domain name based on the URL of each static resource file.
[0090] As an optional embodiment, the backup file includes a first backup sub-file for storing file path information, and a second backup sub-file for storing static resource files. The second processing module includes: a second processing sub-module, used to store the URL of the static resource file in the first backup sub-file; the third processing module includes: a third processing sub-module, used to store the acquired static resource file in the second backup sub-file.
[0091] As an optional embodiment, the second processing submodule includes a second processing unit, which is used to determine whether the first backup subfile contains other URLs that are the same as the URL to be stored when storing the URL of the static resource file into the first backup subfile; if so, stop the storage processing for the URL to be stored.
[0092] As an optional embodiment, the third processing sub-module includes: a third processing unit, used to determine the file name and file directory information of the static resource file based on the URL; a fourth processing unit, used to store the static resource file in a sub-file associated with the file name in the second backup sub-file based on the file directory information.
[0093] As an optional embodiment, the device further includes a fourth processing module, which is used to upload the acquired static resource file to a backup static resource server according to the file path information.
[0094] Optionally, any one of the modules, submodules, or at least part of the functions of any one of the modules, submodules, or ...
[0095] For example, any multiple of the first processing module 701, the first acquisition module 702, the second processing module 703, the second acquisition module 704, and the third processing module 705 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. Optionally, at least one of the first processing module 701, the first acquisition module 702, the second processing module 703, the second acquisition module 704, and the third processing module 705 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the first processing module 701, the first acquisition module 702, the second processing module 703, the second acquisition module 704 and the third processing module 705 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0096] Figure 8 A block diagram of an electronic device suitable for implementing a static resource backup method and apparatus according to an embodiment of the present disclosure is schematically shown. Figure 8 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0097] like Figure 8 As shown, the computer system 800 according to the embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0098] In RAM 803, various programs and data required for the operation of system 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other through bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0099] Optionally, the system 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The system 800 may further include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 806 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0100] Optionally, the method flow according to the embodiment of the present disclosure can be implemented as a computer software program. For example, the embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. Optionally, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0101] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0102] Alternatively, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device. For example, optionally, the computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0103] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0104] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0105] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A static resource backup method, comprising: Determine the target domain name of the static resource server to be backed up; Obtain the uniform resource locator of the static resource file under the target domain name; Determine the file path information of the static resource file based on the uniform resource locator; Storing the file path information in a backup file constructed based on the target domain name; Acquire the static resource file from the static resource server according to the file path information; Storing the acquired static resource file in the backup file; The backup file includes a first backup sub-file for storing the file path information and a second backup sub-file for storing the static resource file. The storing the file path information into a backup file constructed based on the target domain name includes: Storing the uniform resource locator of the static resource file in the first backup subfile; The step of storing the acquired static resource file into the backup file includes: The obtained static resource file is stored in the second backup sub-file.
2. The method according to claim 1, wherein: The step of obtaining the uniform resource locator of the static resource file under the target domain name includes: Traversing all local static resource files according to the file path to capture the uniform resource locator of each static resource file in all the static resource files; Based on the uniform resource locators of the static resource files, the uniform resource locator pointing to the target domain name is used as the uniform resource locator of the static resource files under the target domain name.
3. The method according to claim 1, wherein: When storing the uniform resource locator of the static resource file into the first backup subfile, it includes: Determining whether the first backup subfile contains other uniform resource locators that are the same as the uniform resource locator to be stored; and If so, stop the storage process for the uniform resource locator to be stored.
4. The method according to claim 1, wherein: The step of storing the acquired static resource file into the second backup sub-file includes: Determine the file name and file directory information of the static resource file based on the uniform resource locator; Based on the file directory information, the static resource file is stored in a subfile associated with the file name in the second backup subfile.
5. The method according to any one of claims 1 to 4, further comprising: According to the file path information, the obtained static resource file is uploaded to the backup static resource server.
6. A static resource backup device, comprising: A first processing module, used to determine a target domain name of a static resource server to be backed up; A first acquisition module is used to obtain file path information of static resource files under the target domain name; A second processing module, used for storing the file path information into a backup file constructed based on the target domain name; A second acquisition module, used to acquire the static resource file from the static resource server according to the file path information; A third processing module, used for storing the acquired static resource file into the backup file; The first acquisition module includes: An acquisition submodule, used to acquire the uniform resource locator of the static resource file under the target domain name; A first processing submodule, configured to determine the file path information of the static resource file based on the uniform resource locator; The backup file includes a first backup sub-file for storing the file path information and a second backup sub-file for storing the static resource file. The second processing module comprises: A second processing submodule, used for storing the uniform resource locator of the static resource file into the first backup subfile; The third processing module comprises: The third processing submodule is used to store the obtained static resource file into the second backup subfile.
7. An electronic device comprising: one or more processors; as well as a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Static resource updating method and device, storage medium and computer equipment
CN107992557A