CN108347479B - Multi-warehouse static resource uploading method and system based on content distribution network - Google Patents
Multi-warehouse static resource uploading method and system based on content distribution network Download PDFInfo
- Publication number
- CN108347479B CN108347479B CN201810077559.2A CN201810077559A CN108347479B CN 108347479 B CN108347479 B CN 108347479B CN 201810077559 A CN201810077559 A CN 201810077559A CN 108347479 B CN108347479 B CN 108347479B
- Authority
- CN
- China
- Prior art keywords
- parameter
- directory
- uploading
- resource configuration
- resource
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/1824—Distributed file systems implemented using Network-attached Storage [NAS] architecture
- G06F16/183—Provision of network file services by network file servers, e.g. by using NFS, CIFS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1006—Server selection for load balancing with static server selection, e.g. the same server being selected for a specific client
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a multi-warehouse static resource uploading method and a system based on a content distribution network, wherein the method comprises the following steps: judging the acquired resource configuration parameters of each warehouse, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result, and acquiring uploading path information and static resources; and uploading the static resources to the corresponding cloud server through the corresponding SDK technology according to the uploading path information. The invention avoids the complexity of multi-packaging mode modification, and adopts the method of determining the replaced uploading path information according to the resource configuration parameters of each warehouse, thereby meeting the requirements of uploading files under different catalogs to corresponding storage positions by a plurality of warehouses and reducing the requirement of uploading workload.
Description
Technical Field
The invention relates to the technical field of content distribution networks, in particular to a multi-warehouse static resource uploading method and system based on a content distribution network.
Background
On the internet, in order to improve the speed of accessing a website and the user experience of a user, a content delivery network CDN has a relatively wide application. The CDN is called a contentdelivery network, and its basic idea is to avoid bottlenecks and links on the internet that may affect data transmission speed and stability as much as possible, so that content transmission is faster and more stable. By placing node servers at various positions of the network to form a layer of intelligent virtual network on the basis of the existing internet, the CDN system can redirect the request of a user to a service node closest to the user in real time according to network flow, connection of each node, load condition, distance to the user, response time and other comprehensive information. The method aims to enable the user to obtain the required content nearby, solve the problem of congestion of the Internet network and improve the response speed of the user for accessing the website.
At present, in order to allow a plurality of warehouses to upload files in different directories to corresponding storage locations, each warehouse replaces static resources in the warehouse with cdn addresses according to the respective packaging logic, and uploads the static resources. The scheme has the defects that all warehouses are modified according to respective packaging logics, the packaging complexity is increased sharply along with the increase of the number of the warehouses and the built-in data of the warehouses, the modification difficulty is high, and the workload is large.
Disclosure of Invention
The invention aims to provide a multi-warehouse static resource uploading method and system based on a content distribution network, which avoids the complexity of modification in a multi-packaging mode, and adopts resource configuration parameters of various warehouses to determine replaced uploading path information, so that the requirement of uploading files under different catalogs to corresponding storage positions by a plurality of warehouses is met, and the requirement of uploading workload is reduced.
The invention provides a multi-warehouse static resource uploading method based on a content distribution network, which comprises the following steps of;
acquiring resource configuration parameters of each warehouse;
judging the resource configuration parameters, traversing directory files corresponding to local directory parameters a of the resource configuration parameters according to the judgment result, and obtaining uploading path information and static resources;
and uploading the static resources to a corresponding cloud server through a corresponding SDK technology according to the uploading path information.
As an implementable manner, the judging the resource configuration parameter, and traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judging result to obtain the uploading path information and the static resource includes the following steps;
judging whether the resource configuration parameters have uploading parameters j or not;
if the source configuration parameter has an uploading parameter j, traversing a directory file corresponding to a local directory parameter a of the resource configuration parameter to obtain uploading path information and static resources;
if the source configuration parameter does not have the uploading parameter j, screening and judging whether a directory file corresponding to the replacement path parameter p of the source configuration parameter has a corresponding file type according to a preset file type;
and traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result of the file type to obtain the uploading path information and the static resource.
As an implementable manner, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result of the file type to obtain the uploading path information and the static resource, including the following steps;
if the directory file corresponding to the replacement path parameter p does not have the corresponding file type, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain uploading path information and static resources;
if the directory file corresponding to the replacement path parameter p has the corresponding file type, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain original uploading path information;
and replacing the original uploading path information according to a storage address parameter u and a replacement character parameter r in the resource configuration parameters, storing a replacement result into a directory file corresponding to the local directory parameter a, and traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters to obtain the uploading path information and the static resource.
As an implementable manner, the multi-warehouse static resource uploading method based on the content distribution network further comprises the following steps;
judging whether the directory file corresponding to the local directory parameter a storing the replacement result has an error;
if the storage is wrong, generating storage error information and feeding back the storage error information;
and if the storage is correct, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters.
As an implementable manner, the multi-warehouse static resource uploading method based on the content distribution network further comprises the following steps;
and after traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result, judging whether an uploading directory exists in the directory file.
Correspondingly, the invention also provides a multi-warehouse static resource uploading system based on the content distribution network, which comprises a parameter acquisition module, a judgment traversal module and a resource uploading module;
the parameter acquisition module is used for acquiring resource configuration parameters of each warehouse;
the judgment traversal module is used for judging the resource configuration parameters, traversing directory files corresponding to the local directory parameters a of the resource configuration parameters according to the judgment results, and obtaining uploading path information and static resources;
and the resource uploading module is used for uploading the static resources to the corresponding cloud server through the corresponding SDK technology according to the uploading path information.
As an implementation manner, the judgment traversal module includes a first judgment unit, a first traversal unit, a screening unit, and a second traversal unit;
the first judging unit is used for judging whether the resource configuration parameter has an uploading parameter j;
the first traversal unit is configured to traverse a directory file corresponding to a local directory parameter a of the resource configuration parameter to obtain upload path information and a static resource if the source configuration parameter has an upload parameter j;
the screening unit is configured to, if the source configuration parameter does not have the upload parameter j, screen and determine whether a directory file corresponding to the replacement path parameter p of the resource configuration parameter has a corresponding file type according to a preset file type;
and the second traversal unit is used for traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result of the file type to obtain the uploading path information and the static resource.
As an implementation, the second traversal unit includes a first traversal subunit, a second traversal subunit, and a replacement storage subunit;
the first traversal subunit is configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain upload path information and static resources if the directory file corresponding to the replacement path parameter p does not have a corresponding file type;
the second traversal subunit is configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain original upload path information if the directory file corresponding to the replacement path parameter p has a corresponding file type;
and the replacement storage subunit is configured to perform replacement processing on the original upload path information according to a storage address parameter u and a replacement character parameter r in the resource configuration parameter, store a replacement result in a directory file corresponding to the local directory parameter a, and traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain the upload path information and the static resource.
As an implementation manner, the replacement storing subunit is further configured to determine whether storing the replacement result to the directory file corresponding to the local directory parameter a is faulty;
if the storage is wrong, generating storage error information and feeding back the storage error information;
and if the storage is correct, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters.
As an implementation manner, the determination traversing module further includes a second determination unit;
the second judging unit is configured to further judge whether an upload directory exists in the directory file after traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to a judgment result.
Compared with the prior art, the technical scheme has the following advantages:
the invention provides a multi-warehouse static resource uploading method and a system based on a content distribution network, wherein the method comprises the following steps: judging the acquired resource configuration parameters of each warehouse, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result, and acquiring uploading path information and static resources; and uploading the static resources to the corresponding cloud server through the corresponding SDK technology according to the uploading path information. The invention avoids the complexity of multi-packaging mode modification, and adopts the method of determining the replaced uploading path information according to the resource configuration parameters of each warehouse, thereby meeting the requirements of uploading files under different catalogs to corresponding storage positions by a plurality of warehouses and reducing the requirement of uploading workload.
Drawings
Fig. 1 is a schematic flowchart of a multi-warehouse static resource uploading method based on a content distribution network according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a multi-warehouse static resource uploading system based on a content distribution network according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of the determination traversal module in FIG. 2;
fig. 4 is a schematic structural diagram of the second traversal unit in fig. 3.
In the figure: 100. a parameter acquisition module; 200. a judgment traversal module; 210. a first judgment unit; 220. a first traversal unit; 230. a screening unit; 240. a second traversal unit; 241. a first traversal subunit; 242. a second traversal subunit; 243. a replacement storage subunit; 300. and a resource uploading module.
Detailed Description
The above and further features and advantages of the present invention will be apparent from the following, complete description of the invention, taken in conjunction with the accompanying drawings, wherein the described embodiments are merely some, but not all embodiments of the invention.
Referring to fig. 1, a method for uploading multi-warehouse static resources based on a content distribution network according to an embodiment of the present invention includes the following steps;
s100, acquiring resource configuration parameters of each warehouse;
s200, judging the resource configuration parameters, traversing directory files corresponding to local directory parameters a of the resource configuration parameters according to the judgment results, and obtaining uploading path information and static resources;
and S300, uploading the static resources to a corresponding cloud server through a corresponding SDK technology according to the uploading path information.
It should be noted that, in order to satisfy the requirement that multiple warehouses upload files in different directories to corresponding storage locations, resource configuration parameters of each warehouse may be configured in advance according to requirements, where the resource configuration parameters include, but are not limited to, parameter information such as a local directory parameter a, an upload parameter j, a replacement path parameter p, a storage address parameter u, a replacement character parameter r, and the like. Where the local directory parameter a is the local directory of the warehouse node to be uploaded to the content distribution network cdn, and is default to its assets directory. The uploading parameter j is specific parameter information used for judging whether to upload directly or not, and if the uploading parameter j is carried, the uploading parameter j is uploaded directly. The replacement path parameter p is a parameter of a path to be replaced, and the entire system directory file of the current warehouse can be traversed through the replacement path parameter p. The storage address parameter u is a storage object address of the content distribution network cdn, for example, an ariclousbucket, and is used to distinguish a file path of ariclouoss. The character parameter r is replaced, which is typically in the last level file corresponding to the local directory parameter a. The parameters are various kinds of replacement characters of preset points, or may be replacement characters separately generated according to corresponding targets that need to be replaced, which is not limited in this embodiment. Through the configuration of the various resource configuration parameters and the adoption of the uploading path information determined by the resource configuration parameters of the warehouses, the requirement that the warehouses upload files in different catalogs to corresponding storage positions is met.
When the resource configuration parameters are judged, the static resources may be uploaded only by judging some of the resource configuration parameters, or the static resources may be uploaded only by judging all of the resource configuration parameters. For example, only the uploading parameter j of the resource configuration parameter needs to be judged, and if the uploading parameter j exists, the directory file corresponding to the local directory parameter a of the resource configuration parameter can be traversed to obtain the uploading path information and the static resource, so that the static resource is uploaded in the subsequent steps. In other embodiments, the CDN address may be replaced with an address used for referencing the static resource in the upload path information corresponding to the static resource storage location according to the resource configuration parameter.
When the uploading of the static resources is completed, the Node-Js-SDK technology of the Aliyun OSS is preferentially selected by the SDK technology. The technology can use the uploading modes of nodejs uploading local files, streaming uploading, uploading Buffer contents, fragment uploading or breakpoint uploading and the like to realize uploading of static resources. For example, based on streaming upload of an upload file in OSS, to upload contents in one Stream through a putStream interface, a Stream parameter may be any object that implements ReadableStream, including a file Stream, a network Stream, and the like. When using the putStream interface, the SDK will by default initiate a Chunkedenocoding HTTPPUT request. If the contentLength parameter is specified in options, then chunkencoding will not be used. In other embodiments, other SDK technologies may also be used, which is not limited to this.
In order to smoothly complete static resources and avoid resource waste, after traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result, judging whether the directory file has an uploading directory. Specifically, whether an uploading directory exists in a directory file corresponding to a local directory parameter a of the traversal resource configuration parameter is judged; if the uploaded directory does not exist in the directory file corresponding to the local directory parameter a, generating directory error information and feeding back the directory error information; and traversing the uploading directory to obtain uploading path information and static resources if the uploading directory exists in the directory file corresponding to the local directory parameter a.
The multi-warehouse static resource uploading method based on the content distribution network judges the acquired resource configuration parameters of each warehouse, traverses the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result, and obtains uploading path information and static resources; and uploading the static resources to the corresponding cloud server through the corresponding SDK technology according to the uploading path information. The invention avoids the complexity of multi-packaging mode modification, and adopts the method of determining the replaced uploading path information according to the resource configuration parameters of each warehouse, thereby meeting the requirements of uploading files under different catalogs to corresponding storage positions by a plurality of warehouses and reducing the requirement of uploading workload.
When the resource configuration parameters are judged, the judgment sequence of various parameters in the resource configuration parameters has certain requirements. For example, the uploading parameter j in the resource configuration parameters is judged first, and then other parameters are further processed according to the judgment result.
Specifically, step S200 is described in detail below, and includes the following steps;
s210, judging whether the resource configuration parameters have uploading parameters j;
s220, if the resource configuration parameter has an uploading parameter j, traversing a directory file corresponding to a local directory parameter a of the resource configuration parameter to obtain uploading path information and static resources;
s230, if the resource configuration parameter does not have the uploading parameter j, screening and judging whether the directory file corresponding to the replacement path parameter p of the resource configuration parameter has a corresponding file type according to a preset file type;
and S240, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result of the file type to obtain the uploading path information and the static resource.
That is, if the resource configuration parameter has the upload parameter j, no further determination is needed for other parameters of the resource configuration parameter. And the uploading of the static resources is directly completed according to the obtained uploading path information and the static resources. And if the resource configuration parameter does not have the uploading parameter j, further processing other parameters in the resource configuration parameter.
In this embodiment, the predetermined file type screens include files not limited to hbs, html, js, and css types. In the screening judgment process, the screening judgment process is performed on all directory files corresponding to the replacement path parameter p, including the subdirectories thereof. This process can be implemented by the globjs module. The judgment of the screening result is the judgment of the number of the screened files, and if the screening number is 0, the directory file corresponding to the replacement path parameter p does not have the corresponding file type.
Further, step S240 includes the following steps;
s241, if the directory file corresponding to the replacement path parameter p does not have the corresponding file type, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain uploading path information and static resources;
s242, if the directory file corresponding to the replacement path parameter p has the corresponding file type, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain original uploading path information;
and S243, replacing the original uploading path information according to the storage address parameter u and the replacement character parameter r in the resource configuration parameter, storing the replacement result into the directory file corresponding to the local directory parameter a, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter, and obtaining the uploading path information and the static resource.
The above steps are performed on the replacement path parameter p, the storage address parameter u, and the replacement character parameter r, which is the case that the judgment processing on all the resource configuration parameters is completed in this embodiment. The original upload path information may be the last level directory file corresponding to the local directory parameter a because the relative paths all point directly to the assets or similar directories.
After traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters, reading the original uploading path information in each directory file to be replaced, and then replacing the original uploading path information according to the storage address parameter u and the replacement character parameter r. For example, the { character string to be replaced } corresponding to the replacement character parameter r in the original uploading path information is replaced by { cdn address prefix + parameter-u }. And after the replacement is finished, writing the replaced data according to the original path of the original uploading path information.
Further, the multi-warehouse static resource uploading method based on the content distribution network further comprises the following steps; judging whether the directory file corresponding to the local directory parameter a storing the replacement result has an error; if the storage is wrong, generating storage error information and feeding back the storage error information; and if the storage is correct, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter. The running stability is improved, the information can be fed back in time when a mistake is made, and the fed-back storage error information can be verified so as to find and solve the problem in time.
Based on the same inventive concept, the embodiment of the invention also provides a multi-warehouse static resource uploading system based on a content distribution network, and the implementation of the system can be realized by referring to the process of the method, and the repetition part is not described in detail.
As shown in fig. 2, the structural diagram of the multi-warehouse static resource uploading system based on the content distribution network according to the second embodiment of the present invention includes a parameter obtaining module 100, a determining traversal module 200, and a resource uploading module 300; the parameter obtaining module 100 is configured to obtain resource configuration parameters of each warehouse; the judgment traversal module 200 is configured to judge the resource configuration parameter, traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result, and obtain upload path information and static resources; and the resource uploading module 300 is configured to upload the static resources to the corresponding cloud server through the corresponding SDK technology according to the uploading path information.
The invention avoids the complexity of multi-packaging mode modification, and adopts the method of determining the replaced uploading path information according to the resource configuration parameters of each warehouse, thereby meeting the requirements of uploading files under different catalogs to corresponding storage positions by a plurality of warehouses and reducing the requirement of uploading workload.
As shown in fig. 3, the structure of the judgment traversal module 200 is schematically illustrated, and includes a first judgment unit 210, a first traversal unit 220, a screening unit 230, and a second traversal unit 240; the first determining unit 210 is configured to determine whether the resource configuration parameter has an upload parameter j; the first traversal unit 220 is configured to traverse a directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain upload path information and static resources if the resource configuration parameter has an upload parameter j; the screening unit 230 is configured to, if the resource configuration parameter does not have the upload parameter j, screen and determine whether a directory file corresponding to the replacement path parameter p of the resource configuration parameter has a corresponding file type according to a preset file type; the second traversal unit 240 is configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the determination result of the file type, so as to obtain the upload path information and the static resource.
As shown in fig. 4, it is a schematic structural diagram of the second traversal unit 240, which includes a first traversal subunit 241, a second traversal subunit 242, and a replacement storage subunit 243;
the first traversal subunit 241 is configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain upload path information and static resources if the directory file corresponding to the replacement path parameter p does not have the corresponding file type;
a second traversal subunit 242, configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain original upload path information if the directory file corresponding to the replacement path parameter p has the corresponding file type;
and the replacement storage subunit 243 is configured to perform replacement processing on the original upload path information according to the storage address parameter u and the replacement character parameter r in the resource configuration parameter, store the replacement result in the directory file corresponding to the local directory parameter a, and traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain the upload path information and the static resource.
Further, the replacement storing subunit 243 is further configured to determine whether storing the replacement result to the directory file corresponding to the local directory parameter a is incorrect; if the storage is wrong, generating storage error information and feeding back the storage error information; and if the storage is correct, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters.
Further, the traversal judgment module 200 further includes a second judgment unit; and the second judging unit is used for further judging whether the uploading directory exists in the directory file after traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judging result. The specific judgment process of the second judgment unit is to judge whether the uploaded directory exists in the directory file corresponding to the local directory parameter a of the traversal resource configuration parameter; if the uploaded directory does not exist in the directory file corresponding to the local directory parameter a, generating directory error information and feeding back the directory error information; and traversing the uploading directory to obtain uploading path information and static resources if the uploading directory exists in the directory file corresponding to the local directory parameter a.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to limit the present invention, and those skilled in the art can make variations and modifications of the present invention without departing from the spirit and scope of the present invention by using the methods and technical contents disclosed above.
Claims (8)
1. A multi-warehouse static resource uploading method based on a content distribution network is characterized by comprising the following steps;
acquiring resource configuration parameters of each warehouse;
judging the resource configuration parameters, traversing directory files corresponding to local directory parameters a of the resource configuration parameters according to the judgment result, and obtaining uploading path information and static resources;
uploading the static resources to a corresponding cloud server through a corresponding SDK technology according to the uploading path information;
the resource configuration parameter is judged, and a directory file corresponding to a local directory parameter a of the resource configuration parameter is traversed according to a judgment result to obtain uploading path information and static resources, and the method comprises the following steps;
judging whether the resource configuration parameters have uploading parameters j or not;
if the source configuration parameter has an uploading parameter j, traversing a directory file corresponding to a local directory parameter a of the resource configuration parameter to obtain uploading path information and static resources;
if the source configuration parameter does not have the uploading parameter j, screening and judging whether a directory file corresponding to the replacement path parameter p of the source configuration parameter has a corresponding file type according to a preset file type;
and traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters according to the judgment result of the file type to obtain the uploading path information and the static resource.
2. The multi-warehouse static resource uploading method based on the content distribution network as claimed in claim 1, wherein the step of traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result of the file type to obtain the uploading path information and the static resource comprises the following steps;
if the directory file corresponding to the replacement path parameter p does not have the corresponding file type, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain uploading path information and static resources;
if the directory file corresponding to the replacement path parameter p has the corresponding file type, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain original uploading path information;
and replacing the original uploading path information according to a storage address parameter u and a replacement character parameter r in the resource configuration parameters, storing a replacement result into a directory file corresponding to the local directory parameter a, and traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters to obtain the uploading path information and the static resource.
3. The multi-warehouse static resource uploading method based on the content distribution network as claimed in claim 2, further comprising the steps of;
judging whether the directory file corresponding to the local directory parameter a storing the replacement result has an error;
if the storage is wrong, generating storage error information and feeding back the storage error information;
and if the storage is correct, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters.
4. The multi-warehouse static resource uploading method based on the content distribution network, according to claim 1, further comprising the following steps;
and after traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result, judging whether an uploading directory exists in the directory file.
5. A multi-warehouse static resource uploading system based on a content distribution network is characterized by comprising a parameter acquisition module, a judgment traversal module and a resource uploading module;
the parameter acquisition module is used for acquiring resource configuration parameters of each warehouse;
the judgment traversal module is used for judging the resource configuration parameters, traversing directory files corresponding to the local directory parameters a of the resource configuration parameters according to the judgment results, and obtaining uploading path information and static resources;
the resource uploading module is used for uploading the static resources to a corresponding cloud server through a corresponding SDK technology according to the uploading path information;
the judgment traversal module comprises a first judgment unit, a first traversal unit, a screening unit and a second traversal unit;
the first judging unit is used for judging whether the resource configuration parameter has an uploading parameter j;
the first traversal unit is configured to traverse a directory file corresponding to a local directory parameter a of the resource configuration parameter to obtain upload path information and a static resource if the source configuration parameter has an upload parameter j;
the screening unit is configured to, if the source configuration parameter does not have the upload parameter j, screen and determine whether a directory file corresponding to the replacement path parameter p of the resource configuration parameter has a corresponding file type according to a preset file type;
and the second traversal unit is used for traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to the judgment result of the file type to obtain the uploading path information and the static resource.
6. The content distribution network-based multi-bin static resource upload system of claim 5 wherein the second traversal unit comprises a first traversal subunit, a second traversal subunit, and a replacement storage subunit;
the first traversal subunit is configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain upload path information and static resources if the directory file corresponding to the replacement path parameter p does not have a corresponding file type;
the second traversal subunit is configured to traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain original upload path information if the directory file corresponding to the replacement path parameter p has a corresponding file type;
and the replacement storage subunit is configured to perform replacement processing on the original upload path information according to a storage address parameter u and a replacement character parameter r in the resource configuration parameter, store a replacement result in a directory file corresponding to the local directory parameter a, and traverse the directory file corresponding to the local directory parameter a of the resource configuration parameter to obtain the upload path information and the static resource.
7. The multi-warehouse static resource uploading system based on the content distribution network as claimed in claim 6, wherein the replacement storing subunit is further configured to determine whether the storing of the replacement result to the directory file corresponding to the local directory parameter a is faulty;
if the storage is wrong, generating storage error information and feeding back the storage error information;
and if the storage is correct, traversing the directory file corresponding to the local directory parameter a of the resource configuration parameters.
8. The multi-warehouse static resource uploading system based on the content distribution network as claimed in claim 5, wherein the judgment traversal module further comprises a second judgment unit;
the second judging unit is configured to further judge whether an upload directory exists in the directory file after traversing the directory file corresponding to the local directory parameter a of the resource configuration parameter according to a judgment result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810077559.2A CN108347479B (en) | 2018-01-26 | 2018-01-26 | Multi-warehouse static resource uploading method and system based on content distribution network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810077559.2A CN108347479B (en) | 2018-01-26 | 2018-01-26 | Multi-warehouse static resource uploading method and system based on content distribution network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108347479A CN108347479A (en) | 2018-07-31 |
CN108347479B true CN108347479B (en) | 2020-12-18 |
Family
ID=62960629
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810077559.2A Active CN108347479B (en) | 2018-01-26 | 2018-01-26 | Multi-warehouse static resource uploading method and system based on content distribution network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108347479B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112565472B (en) * | 2019-09-10 | 2024-05-17 | 北京京东尚科信息技术有限公司 | Static resource processing method and device |
CN111182081A (en) * | 2020-01-06 | 2020-05-19 | 深圳市随手信科科技有限公司 | Static resource publishing method, device, storage medium and terminal |
CN112149035A (en) * | 2020-09-23 | 2020-12-29 | 网易(杭州)网络有限公司 | Website static resource processing method and device |
CN112835614B (en) * | 2021-01-29 | 2022-08-09 | 宝宝巴士股份有限公司 | Method for optimizing generation of curriculum packets |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103218434A (en) * | 2013-04-15 | 2013-07-24 | 北京小米科技有限责任公司 | Method and device for loading static resource |
CN104714965A (en) * | 2013-12-16 | 2015-06-17 | 阿里巴巴集团控股有限公司 | Static resource weight removing method, and static resource management method and device |
CN105824909A (en) * | 2016-03-15 | 2016-08-03 | 腾讯科技(深圳)有限公司 | Page generation method and device |
CN106021300A (en) * | 2016-05-04 | 2016-10-12 | 北京思特奇信息技术股份有限公司 | Static resource real-time effecting method and system |
CN106372130A (en) * | 2016-08-25 | 2017-02-01 | 厦门易灵网络科技有限公司 | Static resource management method |
CN106980698A (en) * | 2017-04-11 | 2017-07-25 | 钟铮 | Browser static resource loading method, browser program and readable storage medium storing program for executing |
CN107169000A (en) * | 2017-03-31 | 2017-09-15 | 武汉斗鱼网络科技有限公司 | Static resource dissemination method and device |
CN107368484A (en) * | 2016-05-11 | 2017-11-21 | 北京京东尚科信息技术有限公司 | Compression method and device, the acquisition methods and device of the static resource file of webpage |
CN107465707A (en) * | 2016-06-03 | 2017-12-12 | 阿里巴巴集团控股有限公司 | A kind of content refresh method and device of content distributing network |
CN107528718A (en) * | 2016-08-16 | 2017-12-29 | 腾讯科技(深圳)有限公司 | Obtain the methods, devices and systems of resource |
CN107589947A (en) * | 2017-08-02 | 2018-01-16 | 成都极娱网络科技有限公司 | A kind of SDK cut-in methods, client and system |
CN107590145A (en) * | 2016-07-06 | 2018-01-16 | 北京神州泰岳软件股份有限公司 | A kind for the treatment of method and apparatus of page static resource |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9596312B2 (en) * | 2013-01-28 | 2017-03-14 | Facebook, Inc. | Static resource caching |
-
2018
- 2018-01-26 CN CN201810077559.2A patent/CN108347479B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103218434A (en) * | 2013-04-15 | 2013-07-24 | 北京小米科技有限责任公司 | Method and device for loading static resource |
CN104714965A (en) * | 2013-12-16 | 2015-06-17 | 阿里巴巴集团控股有限公司 | Static resource weight removing method, and static resource management method and device |
CN105824909A (en) * | 2016-03-15 | 2016-08-03 | 腾讯科技(深圳)有限公司 | Page generation method and device |
CN106021300A (en) * | 2016-05-04 | 2016-10-12 | 北京思特奇信息技术股份有限公司 | Static resource real-time effecting method and system |
CN107368484A (en) * | 2016-05-11 | 2017-11-21 | 北京京东尚科信息技术有限公司 | Compression method and device, the acquisition methods and device of the static resource file of webpage |
CN107465707A (en) * | 2016-06-03 | 2017-12-12 | 阿里巴巴集团控股有限公司 | A kind of content refresh method and device of content distributing network |
CN107590145A (en) * | 2016-07-06 | 2018-01-16 | 北京神州泰岳软件股份有限公司 | A kind for the treatment of method and apparatus of page static resource |
CN107528718A (en) * | 2016-08-16 | 2017-12-29 | 腾讯科技(深圳)有限公司 | Obtain the methods, devices and systems of resource |
CN106372130A (en) * | 2016-08-25 | 2017-02-01 | 厦门易灵网络科技有限公司 | Static resource management method |
CN107169000A (en) * | 2017-03-31 | 2017-09-15 | 武汉斗鱼网络科技有限公司 | Static resource dissemination method and device |
CN106980698A (en) * | 2017-04-11 | 2017-07-25 | 钟铮 | Browser static resource loading method, browser program and readable storage medium storing program for executing |
CN107589947A (en) * | 2017-08-02 | 2018-01-16 | 成都极娱网络科技有限公司 | A kind of SDK cut-in methods, client and system |
Also Published As
Publication number | Publication date |
---|---|
CN108347479A (en) | 2018-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108347479B (en) | Multi-warehouse static resource uploading method and system based on content distribution network | |
EP3311544B1 (en) | Managing dynamic ip address assignments | |
EP2869537B1 (en) | Using interest messages with payload to configure network nodes in named data networks | |
US9503365B2 (en) | Reputation-based instruction processing over an information centric network | |
EP2869535B1 (en) | Carrying instructions in packets in a named data network | |
US9503308B2 (en) | Method, device and system for processing content | |
CN103475682B (en) | File transfer method and file transfer equipment | |
CN109067930B (en) | Domain name access method, domain name resolution method, server, terminal and storage medium | |
US20090248697A1 (en) | Cache optimization | |
CN103297472A (en) | Redirection method and content distribution node applied to content distribution network | |
CN104219316A (en) | Method and device for processing call request in distributed system | |
US11481441B2 (en) | Graph database query pagination | |
CN112417360B (en) | Webpage rendering method and device | |
US20220345514A1 (en) | Httpdns scheduling method, apparatus, medium and device | |
CN104079623A (en) | Method and system for controlling multilevel cloud storage synchrony | |
CN115622938A (en) | Computing power service processing method, device and system | |
CN114466031B (en) | CDN system node configuration method, device, equipment and storage medium | |
US8566681B1 (en) | Distributed data distribution | |
CN111464624A (en) | Content refreshing method and device for CDN (content delivery network) and electronic equipment | |
WO2022257791A1 (en) | Service code processing method and apparatus based on distributed network, and device and medium | |
CN114124901B (en) | Pod structure modification method, device, computer equipment and storage medium | |
CN111125580B (en) | Network resource acquisition method and device, electronic equipment and storage medium | |
CN112217853B (en) | Resource access method and device | |
WO2021017970A1 (en) | Method and apparatus for scheduling access request, medium, and device | |
CN107517280B (en) | Domain name resolution method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |