CN112565472A - Static resource processing method and device - Google Patents
Static resource processing method and device Download PDFInfo
- Publication number
- CN112565472A CN112565472A CN201910850719.7A CN201910850719A CN112565472A CN 112565472 A CN112565472 A CN 112565472A CN 201910850719 A CN201910850719 A CN 201910850719A CN 112565472 A CN112565472 A CN 112565472A
- Authority
- CN
- China
- Prior art keywords
- target
- cloud
- domain name
- static resource
- server
- 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.)
- Granted
Links
- 230000003068 static effect Effects 0.000 title claims abstract description 203
- 238000003672 processing method Methods 0.000 title claims description 30
- 238000012545 processing Methods 0.000 claims abstract description 49
- 238000000034 method Methods 0.000 claims abstract description 33
- 238000004891 communication Methods 0.000 claims description 12
- 238000007726 management method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 5
- 230000008878 coupling Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1464—Management of the backup or restore process for networked environments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- 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]
-
- 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/50—Network services
- H04L67/56—Provisioning of proxy services
-
- 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/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a method and a device for processing static resources. Therefore, in the embodiment of the invention, when the target static resource is obtained, the target static resource is directly obtained from the cloud server, that is, the storage is performed in a cloud storage mode, because the cloud storage mode generally has a plurality of backups, even if one backup fails, other backups exist, so that the static resource loss caused by the server failure is avoided, and the reliability of obtaining the static resource is improved.
Description
Technical Field
The invention relates to the technical field of cloud computing, in particular to a static resource processing method and device.
Background
In the internet environment, when a new project is released, the front end can release the static resource of the project to the corresponding server, and correspondingly, the back end can also send the code of the project to the server.
In order to release the strong coupling of the front end and the back end, when a new project needs to be issued, the front end applies for a server independently and issues the static resource of the project to the corresponding server, and the issuing in the mode can be operated independently and does not depend on the back end code.
However, with the conventional resource processing method, if a distributed server fails, static resources are lost, and the static resources cannot be acquired from the server.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing static resources, which improve the reliability of obtaining the static resources.
The embodiment of the invention provides a processing method of static resources, which is applied to a server and can comprise the following steps:
receiving an access request sent by terminal equipment, wherein the access request comprises access domain name information;
determining a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links;
acquiring a target static resource from a cloud server according to the target cloud link;
and sending the target static resource to the terminal equipment.
In a possible implementation manner, the determining, among a plurality of pre-stored cloud links, a target cloud link corresponding to the access domain name information includes:
extracting keywords in the access domain name information;
searching cloud links with the same keywords as the keywords in the access domain name information from a plurality of pre-stored cloud links;
and determining the searched cloud links with the same keywords as the target cloud links.
In a possible implementation manner, the acquiring, according to the target cloud link, the target static resource from the cloud server includes:
modifying the domain name in the target cloud link into a target CDN domain name corresponding to the domain name to obtain a target CDN link corresponding to the target cloud link;
and acquiring the target static resource from a CDN server corresponding to the target CDN domain name according to the target CDN link, wherein the target static resource in the CDN server is acquired from the cloud server.
In one possible implementation, the target static resource includes at least one of: a JS file, a cascading style sheet CSS, or a picture.
In a possible implementation manner, the searching for a cloud link having a same keyword as the keyword in the access domain name information among a plurality of cloud links stored in advance includes:
and searching cloud links with the same keywords as the keywords in the access domain name information from a plurality of pre-stored cloud links through the nginx configuration file.
In a second aspect, an embodiment of the present invention further provides a method for processing static resources, which is applied to a terminal device, where the method for processing static resources may include:
sending an access request to a server, wherein the access request comprises access domain name information, the access domain name information is used for indicating the server to determine a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links, and acquiring a target static resource from a cloud server according to the target cloud link;
and receiving the target static resource sent by the server.
In one possible implementation, before sending the access request to the server, the method further includes:
generating a target static resource, wherein the target static resource comprises keywords;
and issuing the target static resource to the cloud server so that the cloud server generates the target cloud link according to the target keyword and sends the target cloud link to the server.
In one possible implementation, the method further includes:
when a rollback instruction is received, determining static resources needing to be rolled back from historical issuing information;
and issuing the static resource needing to be rolled back to the cloud server.
In a third aspect, an embodiment of the present invention further provides a processing apparatus for static resources, where the processing apparatus for static resources is applied to a server, and the processing apparatus for static resources may include:
the receiving module is used for receiving an access request sent by terminal equipment, wherein the access request comprises access domain name information;
the processing module is used for determining a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links; acquiring a target static resource from a cloud server according to the target cloud link;
and the sending module is used for sending the target static resource to the terminal equipment.
In a possible implementation manner, the processing module is specifically configured to extract a keyword in the access domain name information; searching cloud links with the same keywords as the keywords in the access domain name information from a plurality of pre-stored cloud links; and determining the searched cloud links with the same keywords as the target cloud links.
In a possible implementation manner, the processing module is specifically configured to modify a domain name in the target cloud link into a target CDN domain name corresponding to the domain name, so as to obtain a target CDN link corresponding to the target cloud link; and acquiring the target static resource from a CDN server corresponding to the target CDN domain name according to the target CDN link, wherein the target static resource in the CDN server is acquired from the cloud server.
In one possible implementation, the target static resource includes at least one of: a JS file, a cascading style sheet CSS, or a picture.
In a possible implementation manner, the processing module is specifically configured to search, through the nginx configuration file, a cloud link having the same keyword as the keyword in the access domain name information from a plurality of pre-stored cloud links.
In a fourth aspect, an embodiment of the present invention further provides a device for processing static resources, which is applied to a terminal device, where the device for processing static resources may include:
the sending module is used for sending an access request to a server, wherein the access request comprises access domain name information, the access domain name information is used for indicating the server to determine a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links, and target static resources are obtained from a cloud server according to the target cloud link;
and the receiving module is used for receiving the target static resource sent by the server.
In one possible implementation, the apparatus further includes a processing module;
the processing module is used for generating target static resources, and the target static resources comprise keywords;
the sending module is further configured to issue the target static resource to the cloud server, so that the cloud server generates the target cloud link according to the target keyword, and sends the target cloud link to the server.
In a possible implementation manner, the processing module is further configured to determine, when a rollback instruction is received, a static resource that needs to be rolled back from the historical issue information;
the sending module is further configured to issue the static resource that needs to be rolled back to the cloud server.
In a fifth aspect, an embodiment of the present invention further provides a communication apparatus, including a processor and a memory, where,
the memory is to store program instructions;
the processor is configured to read a program instruction in the memory, and execute the processing method for the static resource according to any one of the first aspect, or execute the processing method for the static resource according to any one of the second aspect.
In a sixth aspect, an embodiment of the present invention further provides a computer storage medium, including instructions, which when executed by one or more processors, cause a communication apparatus to execute the method for processing a static resource according to any one of the above first aspects, or when executed by one or more processors, cause the communication apparatus to execute the method for processing a static resource according to any one of the above second aspects.
According to the static resource processing method and device provided by the embodiment of the invention, after receiving an access request including access domain name information sent by a terminal device, a proxy server determines a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links according to the access domain name information, acquires the target static resource from a cloud server, and then sends the target static resource to the terminal device so that the terminal device can acquire the static resource. Therefore, in the embodiment of the invention, when the target static resource is obtained, the target static resource is directly obtained from the cloud server, that is, the storage is performed in a cloud storage mode, because the cloud storage mode generally has a plurality of backups, even if one backup fails, other backups exist, so that the static resource loss caused by the server failure is avoided, and the reliability of obtaining the static resource is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario provided by the present invention;
fig. 2 is a flowchart illustrating a method for processing static resources according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another static resource processing method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for processing static resources according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a static resource processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another static resource processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a communication device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiments of the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. In the description of the present invention, the character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In order to improve the reliability of obtaining static resources, an embodiment of the present invention provides a flow diagram of a static resource processing method, where the static resource processing method may be applied to a static resource processing system, for example, as shown in fig. 1, fig. 1 is an application scenario diagram provided by the present invention, where the static resource processing system may include a terminal device, a proxy server, a Content Delivery Network (CDN) server, and a cloud server, and when obtaining a target static resource, the terminal device may send an access request including domain name information to a corresponding proxy server, so that the proxy server determines a target link corresponding to the domain name information among a plurality of pre-stored cloud links according to the domain name information, obtains the target static resource from the cloud server, and then, and then sending the target static resource to the terminal equipment so that the terminal equipment can acquire the static resource. Therefore, in the embodiment of the invention, when the target static resource is obtained, the target static resource is directly obtained from the cloud server, that is, the storage is performed in a cloud storage mode, because the cloud storage mode generally has a plurality of backups, even if one backup fails, other backups exist, so that the static resource loss caused by the server failure is avoided, and the reliability of obtaining the static resource is improved.
Optionally, the target static resource includes at least one of: js (javascript) files, Cascading Style Sheets (CSS), or pictures. In detail, the target static resource may only include a JS file, a cascading style sheet CSS, or any one of the resources of the picture, or may include a JS file, a cascading style sheet CSS, or any two of the resources of the picture, of course, may also include three resources of a JS file, a cascading style sheet CSS, and a picture, and may be specifically set according to actual needs, and herein, the embodiment of the present invention is not specifically limited.
The JS is an transliterated script language, and is a dynamic type, weak type, prototype-based language and built-in support type. Its interpreter is called JavaScript engine, is a part of browser, is often applied to script Language of client, and is used on hypertext Markup Language (HTML) web page at the earliest, and is mainly used for adding dynamic function to HTML web page.
CSS, also known as a threaded list, cascading style sheets, and cascading style sheets, is a computer language used to add styles (fonts, spaces, colors, etc.) to a structured document (e.g., an HTML document or an XML application).
The CDN is a content delivery network constructed on the network, and by means of edge servers deployed in various places, a user can obtain required content nearby through functional modules of a central platform, such as load balancing, content delivery, scheduling and the like, so that network congestion is reduced, and the access response speed and hit rate of the user are improved.
Cloud storage is a model of online storage over the internet (Cloud storage) that stores data on multiple virtual servers, usually hosted by third parties, rather than on dedicated servers. The data center operator prepares the storage virtualized resources at the back end according to the needs of the customer, and provides the resources in the form of a storage resource pool (storage pool), so that the user can use the storage resource pool to store the files or objects by himself.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a flowchart illustrating a processing method for static resources according to an embodiment of the present invention, where the processing method for static resources may be executed by a processing device for static resources, and the processing device for static resources may be independently configured or may be configured in a proxy server. For example, referring to fig. 2, the method for processing static resources may include:
s201, the terminal sends an access request to the server.
Wherein, the access request includes the access domain name information. For example, the access domain name information may be demo. Com may be understood as a domain name and demo may be understood as a target keyword, which may be a project name.
Optionally, in the embodiment of the present invention, when the terminal device obtains the target static resource required by the terminal device through the access request, the cloud server obtains the target static resource from the cloud server, and therefore, the cloud server obtains and stores the target static server in advance. For example, when the cloud server obtains the target static resource, the resource delivery terminal device may first package the target static resource to be delivered at the front end of the resource delivery terminal device by using a local building tool to form a zip package, and may uniformly configure a CDN prefix for the target static resource when packaging. The CDN prefix includes a CDN domain name and a target keyword. For example, the CDN prefix may be storage.360buyimg.com/demo; com, the CDN domain name may be 360buyimg, and the keyword may be demo. And then, the zip package obtained by packaging is issued to the cloud server, correspondingly, after the cloud server receives the zip package, the zip package is decompressed into a directory of a cloud corresponding project name, so that the target static resource is obtained and stored, when the terminal equipment obtains the target static resource, the target static resource can be directly obtained from the cloud server, namely, the cloud storage mode is adopted for storage, and as the cloud storage mode generally has a plurality of backups, even if one backup fails, other backups are provided, so that the static resource loss caused by the server failure is avoided, and the reliability of obtaining the static resource is improved.
It can be understood that after the cloud server obtains the target static resource, the cloud server also generates a target cloud link according to the target keyword, and backs up the zip file for subsequent downloading, viewing or rollback use. In addition, the cloud server also sends the target cloud link to the proxy server, so that the proxy server stores the target cloud link corresponding to the access domain name information and constructs a mapping relation between the access domain name information and the target cloud link corresponding to the access domain name information.
It should be noted that, in the embodiment of the present invention, the resource issuing terminal device and the terminal device that needs to acquire the target static resource may be the same terminal device, or may be different terminal devices, and may be specifically set according to actual needs, where the embodiment of the present invention is not specifically limited.
Optionally, when the target static resource is issued to the cloud server, the issuing operation may be manually executed, or may be executed by a command line issuing tool. When the issuing operation is executed by the command line issuing tool, the implementation principle is as follows: and simulating and operating the issuing process by calling each interface of the issuing platform. For example, when the issuing operation is executed through the command line issuing tool, the tool may be installed locally, and then the issuing command swmPublish is run, it can be understood that the build command, the system username and password may be queried only when the issuing command swmPublish is run for the first time, and the build command, the system username and password may not be queried again from the second time and every subsequent run, but the swmPublish command may be run directly, so that the issuing efficiency of the target static resource is improved.
After receiving the access request including the access domain name information, the proxy server may determine, according to the access domain name information, a target cloud link corresponding to the access domain name information among a plurality of pre-stored cloud links, that is, execute the following S202:
s202, determining a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links.
In general, the path length of the target cloud link is greater than the path length of the access domain name information. The target cloud link is not directly thrown to the front end, but is thrown to the proxy server, so that the proxy server constructs a mapping relation between the access domain name information and the corresponding target cloud link. Com, when the access domain name information is dec.xx.com, the corresponding target cloud connection may be xx.com/dec/index.html.
The proxy server can pre-store the mapping relation between the access domain name information and the corresponding target cloud link, so that after receiving the access domain name information, the proxy server can search the target cloud link corresponding to the access domain name information in the pre-stored cloud links according to the access domain name information, and accordingly obtain the access domain name information and the corresponding target cloud link.
After the target cloud link corresponding to the access domain name information is obtained in S202, the target static resource may be obtained from the cloud server according to the target cloud link, that is, the following S203 is executed:
s203, obtaining the target static resource from the cloud server according to the target cloud link.
Different from the prior art, in the embodiment of the invention, when the target static resource is acquired according to the target cloud link, the target static resource is directly acquired from the cloud server, namely, the target static resource is stored in a cloud storage mode, so that the static resource loss caused by the failure of the server is avoided, and the reliability of acquiring the static resource is improved.
And S204, sending the target static resource to the terminal equipment.
After the target static resource is acquired, the target static resource can be sent to the terminal device, so that the terminal device can acquire the target static resource, and the target static resource can be displayed at the front end.
Therefore, in the static resource processing method provided by the embodiment of the present invention, after receiving an access request including access domain name information sent by a terminal device, a proxy server determines, according to the access domain name information, a target cloud link corresponding to the access domain name information among a plurality of pre-stored cloud links, acquires a target static resource from a cloud server, and then sends the target static resource to the terminal device, so that the terminal device acquires the static resource. Therefore, in the embodiment of the invention, when the target static resource is obtained, the target static resource is directly obtained from the cloud server, that is, the storage is performed in a cloud storage mode, because the cloud storage mode generally has a plurality of backups, even if one backup fails, other backups exist, so that the static resource loss caused by the server failure is avoided, and the reliability of obtaining the static resource is improved. In addition, by adopting a cloud storage mode, only storage resources (disk resources) are needed, and compared with the prior art, application for separate servers including cpu, internal memory, disk resources and the like is not needed, so that the server resources are saved.
Based on the embodiment shown in fig. 2, to more clearly describe how to determine a target cloud link corresponding to access domain name information in a plurality of cloud links stored in advance in the embodiment of the present invention, for example, please refer to fig. 3, where fig. 3 is a flowchart illustrating another processing method of a static resource provided in the embodiment of the present invention, the processing method of the static resource may include:
s301, extracting keywords in the access domain name information.
For example, when extracting a keyword in access domain name information, the keyword in the access domain name information may be extracted by a keyword extraction technology, and certainly, the keyword in the access domain name information may also be extracted by other technologies, and may be specifically set according to actual needs.
Using the visited domain name information as demo.xx.com as an example, the keyword of the visited domain name information demo.xx.com can be extracted through a keyword extraction technology to obtain the keyword demo.
After the keywords in the access domain name information are extracted, cloud links having the same keywords as the keywords in the access domain name information can be searched for from a plurality of pre-stored cloud links, that is, the following S302 is performed:
s302, cloud links with the same keywords as the keywords in the access domain name information are searched in a plurality of pre-stored cloud links.
Optionally, in a plurality of pre-stored cloud links, cloud links having the same keyword as the keyword in the access domain name information are searched for, and cloud links having the same keyword as the keyword in the access domain name information are searched for in a plurality of pre-stored cloud links through the nginx configuration file. The nginx is a lightweight Web server, a reverse proxy server or an email proxy server, and is characterized by small memory occupation and strong concurrency capability.
With reference to the description in S301, after the keyword demo is obtained, according to the keyword demo, in a plurality of pre-stored cloud links, the keyword is also a cloud connection of the demo, and when searching, if a first cloud link exists in the plurality of pre-stored cloud links, the first cloud link is xx.com/demon/index.html, and because the keyword demo of the first cloud link is different from the keyword demo in the access domain name information, the first cloud link is xx.com/demon/index.html not a cloud link having the same keyword as the keyword demo in the access domain name information; if a second cloud link exists in the plurality of pre-stored cloud links, the second cloud link is xx.com/demo/index.html, the keyword demo of the first cloud link is different from the keyword demo in the access domain name information, and therefore the second cloud link is xx.com/demo/index.html which has the same keyword as the keyword demo in the access domain name information, and the second cloud link can be determined to be xx.com/demo/index.html as a target cloud link with the same keyword.
And S303, determining the searched cloud links with the same keywords as target cloud links.
It can be understood that, after determining that the target cloud link is determined through the above S301 to S303, the target static resource can be obtained from the cloud server according to the target cloud link, so as to send the target static resource to the terminal device. It should be noted that, in order to accelerate the access of the static resource and improve the obtaining efficiency of the target static resource, when obtaining the target static resource, the static resource may be obtained from a CDN server that is closer to the terminal device, and of course, the static resource in the CDN server is obtained from a cloud server, that is, the cloud server may send the static resource to the CDN server in advance. For example, please refer to fig. 4, where fig. 4 is a schematic flowchart of a processing method for a static resource according to another embodiment of the present invention, where the processing method for a static resource may include:
s401, modifying the domain name in the target cloud link into a target CDN domain name corresponding to the domain name to obtain a target CDN link corresponding to the target cloud link.
After receiving each cloud link sent by the cloud server, the proxy server can modify the domain name in the cloud link into a CDN domain name through local construction, so as to obtain a target CDN link corresponding to the cloud link.
Com, or debug, html, the domain name in the target cloud link is xx.com, and the domain name in the target cloud link can be modified to 360buyimg.com, so as to obtain 360buyimg.com, demo, or debug, html, corresponding to the target cloud link xx.com, demo, or index. It should be noted that, when modifying the domain name of the target cloud link, only the domain name character may be modified, for example, only the domain name character xx in the domain name xx.com may be modified to 360buyimg, so as to obtain the target CDN link 360buyimg.com/demo/index.html corresponding to the target cloud link xx.com/demo/index.html.
After the target CDN link corresponding to the target cloud link is obtained in S401, the static resource may be obtained from the CDN server corresponding to the target CDN domain name according to the target CDN link, that is, the following S402 is executed:
s402, obtaining target static resources from a CDN server corresponding to the target CDN domain name according to the target CDN link.
The target static resource in the CDN server is obtained from the cloud server.
After the target CDN link corresponding to the target cloud link is obtained, the target static resource corresponding to the target CDN link can be searched in the CDN server corresponding to the target CDN domain name according to the target CDN link, so that the target static resource is obtained, and the target static resource can be displayed at the front end.
It should be noted that, when a target static resource is obtained from a CDN server corresponding to a target CDN domain name, the target static resource is loaded from a cloud server corresponding to the CDN server if the target static resource is not obtained for the first time, and then the target static resource is cached in a CDN server corresponding to each terminal device, so that when the target static resource is obtained subsequently, the target static resource can be obtained by each CDN server.
Therefore, in the embodiment of the invention, after the proxy server obtains the target cloud link, the domain name in the target cloud link can be modified into the target CDN domain name corresponding to the domain name, the target CDN link corresponding to the target cloud link is obtained, and then the static resource is obtained from the CDN server corresponding to the target CDN domain name according to the target CDN link.
In addition, it should be noted that, for the resource distribution terminal device, the distribution record is stored every time the static resource is distributed. Therefore, when a rollback instruction triggered by a user is received, the static resource needing to be rolled back can be determined from the historical issuing information of the static resource; the static resources needing to be rolled back are issued to a cloud server; correspondingly, after receiving the rolled-back static resource, the cloud server also updates the cloud storage and the CDN resource.
Optionally, the proxy server may further include an authority management function, where the authority management function mainly includes: the system comprises a user management module, a grouping management module, a role management module and a resource management module. The resource management module mainly comprises each detailed function submodule of the platform, such as a menu authority submodule, a button authority submodule and a list authority submodule; the role management module comprises a role containing a plurality of functional sub-modules; the grouping management module is used for realizing data isolation among different groups; the user management module is mainly used for increasing, deleting and modifying users, and can select different groups, different roles and the like. Of course, other functions may also be provided, and the embodiment of the present invention is described only by taking the example that the right management function may be provided, but the embodiment of the present invention is not limited to this.
Fig. 5 is a schematic structural diagram of a static resource processing apparatus 50 according to an embodiment of the present invention, which is applied to a server, for example, please refer to fig. 5, where the static resource processing apparatus 50 may include:
a receiving module 501, configured to receive an access request sent by a terminal device, where the access request includes access domain name information.
A processing module 502, configured to determine a target cloud link corresponding to the access domain name information from a plurality of pre-stored cloud links; and acquiring the target static resource from the cloud server according to the target cloud link.
A sending module 503, configured to send the target static resource to the terminal device.
Optionally, the processing module 502 is specifically configured to extract keywords in the access domain name information; searching cloud links with the same keywords as the keywords in the access domain name information from a plurality of pre-stored cloud links; and determining the searched cloud links with the same keywords as target cloud links.
Optionally, the processing module 502 is specifically configured to modify a domain name in the target cloud link into a target CDN domain name corresponding to the domain name, so as to obtain a target CDN link corresponding to the target cloud link; and acquiring a target static resource from a CDN server corresponding to the target CDN domain name according to the target CDN link, wherein the target static resource in the CDN server is acquired from a cloud server.
Optionally, the target static resource includes at least one of: a JS file, a cascading style sheet CSS, or a picture.
Optionally, the processing module 502 is specifically configured to search, through the nginx configuration file, cloud links having the same keyword as the keyword in the access domain name information among a plurality of cloud links stored in advance.
The static resource processing apparatus 50 shown in the embodiment of the present invention may execute the technical solution of the static resource processing method shown in any one of the embodiments shown in fig. 2 to fig. 4, and the implementation principle and the beneficial effects thereof are similar to those of the static resource processing method, and are not described herein again.
Fig. 6 is a schematic structural diagram of another static resource processing apparatus 60 according to an embodiment of the present invention, which is applied to a terminal device, for example, as shown in fig. 6, the static resource processing apparatus 60 may include:
the sending module 601 is configured to send an access request to a server, where the access request includes access domain name information, and the access domain name information is used to indicate that the server determines a target cloud link corresponding to the access domain name information among a plurality of pre-stored cloud links, and obtains a target static resource from a cloud server according to the target cloud link.
A receiving module 602, configured to receive a target static resource sent by a server.
Optionally, the processing apparatus 60 for static resources further includes a processing module 603.
The processing module 603 is configured to generate a target static resource, where the target static resource includes a keyword.
The sending module 601 is further configured to issue the target static resource to the cloud server, so that the cloud server generates a target cloud link according to the target keyword, and sends the target cloud link to the server.
Optionally, the processing module 603 is further configured to determine, when a rollback instruction is received, a static resource that needs to be rolled back from the historical issue information.
The sending module 601 is further configured to issue the static resource that needs to be rolled back to the cloud server.
The static resource processing apparatus 60 shown in the embodiment of the present invention may execute the technical solution of the static resource processing method shown in any one of the embodiments shown in fig. 2 to fig. 4, and the implementation principle and the beneficial effects thereof are similar to those of the static resource processing method, and are not described herein again.
Fig. 7 is a schematic structural diagram of a communication device 70 according to an embodiment of the present invention, please refer to fig. 7, where the communication device 70 may include a processor 701 and a memory 702, where:
the memory 702 is used for storing program instructions;
the processor 701 is configured to read the program instruction in the memory 702, and execute the technical solution of the processing method of the static resource in any one of the embodiments shown in fig. 2 to fig. 4 according to the program instruction in the memory 702, and the implementation principle and the beneficial effect of the technical solution are similar to those of the processing method of the static resource, and details are not repeated here.
An embodiment of the present invention further provides a computer storage medium, which includes instructions, and when the instructions are executed by one or more processors, the communication device executes the technical solution of the processing method for static resources in any one of the embodiments shown in fig. 2 to 4, and the implementation principle and the beneficial effects of the technical solution are similar to those of the processing method for static resources, and details are not repeated here.
An embodiment of the present invention further provides a chip, where a computer program is stored on the chip, and when the computer program is executed by a processor, the technical solution of the processing method for static resources in any of the embodiments shown in fig. 2 to 4 is executed, and an implementation principle and beneficial effects of the technical solution are similar to those of the processing method for static resources, and are not described herein again.
The processor in the above embodiments may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off the shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a Random Access Memory (RAM), a flash memory, a read-only memory (ROM), a programmable ROM, an electrically erasable programmable memory, a register, or other storage media that are well known in the art. The storage medium is located in a memory, and a processor reads instructions in the memory and combines hardware thereof to complete the steps of the method.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (12)
1. A method for processing static resources is applied to a server, and the method comprises the following steps:
receiving an access request sent by terminal equipment, wherein the access request comprises access domain name information;
determining a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links;
acquiring a target static resource from a cloud server according to the target cloud link;
and sending the target static resource to the terminal equipment.
2. The method of claim 1, wherein determining a target cloud link corresponding to the access domain name information among a plurality of pre-stored cloud links comprises:
extracting keywords in the access domain name information;
searching cloud links with the same keywords as the keywords in the access domain name information from a plurality of pre-stored cloud links;
and determining the searched cloud links with the same keywords as the target cloud links.
3. The method of claim 1, wherein obtaining the target static resource from a cloud server according to the target cloud link comprises:
modifying the domain name in the target cloud link into a target CDN domain name corresponding to the domain name to obtain a target CDN link corresponding to the target cloud link;
and acquiring the target static resource from a CDN server corresponding to the target CDN domain name according to the target CDN link, wherein the target static resource in the CDN server is acquired from the cloud server.
4. The method of any of claims 1-3, wherein the target static resource comprises at least one of: a JS file, a cascading style sheet CSS, or a picture.
5. The method of claim 2, wherein the searching for a cloud link having a same keyword as the keyword in the access domain name information among a plurality of cloud links stored in advance comprises:
and searching cloud links with the same keywords as the keywords in the access domain name information from a plurality of pre-stored cloud links through the nginx configuration file.
6. A method for processing static resources is applied to a terminal device, and the method comprises the following steps:
sending an access request to a server, wherein the access request comprises access domain name information, the access domain name information is used for indicating the server to determine a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links, and acquiring a target static resource from a cloud server according to the target cloud link;
and receiving the target static resource sent by the server.
7. The method of claim 6, wherein prior to sending the access request to the server, the method further comprises:
generating a target static resource, wherein the target static resource comprises keywords;
and issuing the target static resource to the cloud server so that the cloud server generates the target cloud link according to the target keyword and sends the target cloud link to the server.
8. The method according to claim 6 or 7, characterized in that the method further comprises:
when a rollback instruction is received, determining static resources needing to be rolled back from historical issuing information;
and issuing the static resource needing to be rolled back to the cloud server.
9. An apparatus for processing static resources, applied to a server, the apparatus comprising:
the receiving module is used for receiving an access request sent by terminal equipment, wherein the access request comprises access domain name information;
the processing module is used for determining a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links; acquiring a target static resource from a cloud server according to the target cloud link;
and the sending module is used for sending the target static resource to the terminal equipment.
10. An apparatus for processing static resources, applied to a terminal device, the apparatus comprising:
the sending module is used for sending an access request to a server, wherein the access request comprises access domain name information, the access domain name information is used for indicating the server to determine a target cloud link corresponding to the access domain name information in a plurality of pre-stored cloud links, and target static resources are obtained from a cloud server according to the target cloud link;
and the receiving module is used for receiving the target static resource sent by the server.
11. A communication device comprising a processor and a memory, wherein,
the memory is to store program instructions;
the processor is configured to read the program instructions in the memory and execute the processing method of the static resource according to any one of claims 1 to 5, or execute the processing method of the static resource according to any one of claims 6 to 8.
12. A computer storage medium comprising instructions that, when executed,
the instructions, when executed by one or more processors, cause a communication device to perform the method of processing static resources of any of claims 1-5 above, or, when executed by one or more processors, cause a communication device to perform the method of processing static resources of any of claims 6-8 above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910850719.7A CN112565472B (en) | 2019-09-10 | 2019-09-10 | Static resource processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910850719.7A CN112565472B (en) | 2019-09-10 | 2019-09-10 | Static resource processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112565472A true CN112565472A (en) | 2021-03-26 |
CN112565472B CN112565472B (en) | 2024-05-17 |
Family
ID=75028714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910850719.7A Active CN112565472B (en) | 2019-09-10 | 2019-09-10 | Static resource processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112565472B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114363155A (en) * | 2022-01-05 | 2022-04-15 | 北京爱学习博乐教育科技有限公司 | Backup recovery method and system for CDN resources |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107734022A (en) * | 2017-09-30 | 2018-02-23 | 努比亚技术有限公司 | Static resource document down loading method, mobile terminal and computer-readable recording medium |
CN108156013A (en) * | 2016-12-02 | 2018-06-12 | 阿里巴巴集团控股有限公司 | A kind of Page Service disaster recovery method, device and electronic equipment |
CN108347479A (en) * | 2018-01-26 | 2018-07-31 | 政采云有限公司 | More warehouse static resource method for uploading based on content distributing network and system |
CN108989362A (en) * | 2017-05-31 | 2018-12-11 | 北京京东尚科信息技术有限公司 | A kind for the treatment of method and apparatus of static resource |
-
2019
- 2019-09-10 CN CN201910850719.7A patent/CN112565472B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108156013A (en) * | 2016-12-02 | 2018-06-12 | 阿里巴巴集团控股有限公司 | A kind of Page Service disaster recovery method, device and electronic equipment |
CN108989362A (en) * | 2017-05-31 | 2018-12-11 | 北京京东尚科信息技术有限公司 | A kind for the treatment of method and apparatus of static resource |
CN107734022A (en) * | 2017-09-30 | 2018-02-23 | 努比亚技术有限公司 | Static resource document down loading method, mobile terminal and computer-readable recording medium |
CN108347479A (en) * | 2018-01-26 | 2018-07-31 | 政采云有限公司 | More warehouse static resource method for uploading based on content distributing network and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114363155A (en) * | 2022-01-05 | 2022-04-15 | 北京爱学习博乐教育科技有限公司 | Backup recovery method and system for CDN resources |
Also Published As
Publication number | Publication date |
---|---|
CN112565472B (en) | 2024-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110263275B (en) | Method and device for accessing webpage, mobile terminal and storage medium | |
CN107948314B (en) | Business processing method and device based on rule file and server | |
US8527862B2 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
US11418575B2 (en) | Optimizing service deployment in a distributed computing environment | |
CN110262807B (en) | Cluster creation progress log acquisition system, method and device | |
CN107463563B (en) | Information service processing method and device of browser | |
CN107528718B (en) | Method, device and system for acquiring resources | |
US11252148B2 (en) | Secure web application delivery platform | |
US9590859B2 (en) | Discovering resources of a distributed computing environment | |
US10382313B2 (en) | Test building for testing server operation | |
CN109150929B (en) | Data request processing method and device under high concurrency scene | |
CN113094612A (en) | Method and device for loading webpage at client, electronic equipment and medium | |
US9448780B1 (en) | Package manager verifier | |
US9521087B1 (en) | Servicing requests using multiple data release cycles | |
CN113536168B (en) | Component processing method and device | |
CN110647327A (en) | Method and device for dynamic control of user interface based on card | |
CN112565472B (en) | Static resource processing method and device | |
WO2015003570A1 (en) | Data downloading method,device and system thereof | |
CN113132400A (en) | Business processing method, device, computer system and storage medium | |
CN113010149A (en) | Application loading method and device, user terminal and server | |
CN104539450A (en) | Website operation activity processing system, method and device | |
US10990750B2 (en) | Dynamically bundling web page resources | |
CN108551484B (en) | User information synchronization method, device, computer device and storage medium | |
CN115373831A (en) | Data processing method, device and computer readable storage medium | |
CN113760274A (en) | Front-end component logic injection 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 |