CN113872809A - Access method, device, electronic equipment and storage medium - Google Patents

Access method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113872809A
CN113872809A CN202111140477.6A CN202111140477A CN113872809A CN 113872809 A CN113872809 A CN 113872809A CN 202111140477 A CN202111140477 A CN 202111140477A CN 113872809 A CN113872809 A CN 113872809A
Authority
CN
China
Prior art keywords
site
local folder
static
identification information
local
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111140477.6A
Other languages
Chinese (zh)
Inventor
叶兵
黄瑶
杜文强
凌杰
张晓峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhou Lvmeng Chengdu Technology Co ltd
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Original Assignee
Shenzhou Lvmeng Chengdu Technology Co ltd
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhou Lvmeng Chengdu Technology Co ltd, Nsfocus Technologies Inc, Nsfocus Technologies Group Co Ltd filed Critical Shenzhou Lvmeng Chengdu Technology Co ltd
Priority to CN202111140477.6A priority Critical patent/CN113872809A/en
Publication of CN113872809A publication Critical patent/CN113872809A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • H04L41/0661Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses an access method, an access device, electronic equipment and a storage medium. For enabling permanent access to the site. In the embodiment of the application, if the fact that the site to which the network resource currently accessed by the terminal belongs is determined to have a fault is determined; searching a local folder corresponding to the site from the local folder set; then according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder; and finally, determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to the terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file. In the embodiment of the application, the static resources of the site are stored in the local folder by setting the local folder, so that the site is permanently accessed.

Description

Access method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer network technologies, and in particular, to an access method, an access device, an electronic device, and a storage medium.
Background
In the related art, a cloud proxy server is usually adopted to access a site, and when the site has a fault and needs to be subjected to shutdown maintenance or the site server is down, the cloud proxy server can provide a corresponding access function only when the site server can normally operate, so that it is necessary to realize permanent access of the site.
Disclosure of Invention
The application aims to provide an access method, an access device, an electronic device and a storage medium, which are used for realizing permanent access of a site.
In a first aspect, an embodiment of the present application provides an access method, which is applied to a network device, and the method includes:
determining that a site to which a network resource currently accessed by a terminal belongs has a fault;
searching a local folder corresponding to the site from a local folder set according to the first identification information of the site;
according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder; the local folder corresponding to the site is established before the site fails, and the static resources in the local folder corresponding to the site are acquired from the site;
and determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to a terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file.
In the embodiment of the application, before the site fails, the static resources of the site are stored in the local folder, and when the currently accessed site fails, the site is accessed according to the static resources stored in the local folder in advance, so that the site is permanently online, and the problem that the static resources cannot be accessed when the site fails is avoided.
In some possible embodiments, before determining that a site to which a network resource currently accessed by the terminal belongs has a fault, the method further includes:
carrying out mirror image processing on each site to obtain static resources of each site, and storing the static resources into corresponding local folders;
and modifying the configuration files corresponding to the static resources in the sites from default types to types corresponding to the static resources, wherein each site corresponds to one configuration file of a default type, and rendering modes corresponding to different types of static resources are different.
In the embodiment of the application, the configuration file is modified into the type corresponding to the static resource according to different static resources, so that the static resource can be rendered normally during rendering.
In some possible embodiments, the mirroring processing on each site to obtain the static resource of each site, and storing the static resource in the corresponding local folder includes:
aiming at any site, periodically carrying out mirror image processing on the any site to obtain static resources of the any site;
if the local folder set does not contain the local folder corresponding to any site, establishing a local folder with second identification information of any site as a file name, wherein the second identification information comprises an address and a port;
storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site;
if the local folder set comprises a local folder corresponding to any site;
modifying the naming of the local file into second identification information of the site, wherein the second identification information comprises an address and a port;
and storing the static resources to a corresponding local folder according to the second identifier, and modifying the name of the local folder into the first identifier information of the site.
In the application embodiment, the local folders are established by the second identification information when being established, so that the local folders corresponding to all websites can be known more obviously, and the local folders are named and modified into the first identification information after being stored, so that a later manager can maintain the local files conveniently; by periodically acquiring the static resources of the site, the local folder and the static resources of the site can be kept synchronous, and a user can conveniently acquire the latest static resources of the site in real time.
In some possible embodiments, the mirroring process performed on each of the sites to obtain the static resource of each of the sites includes:
establishing a cache task for each site, and adding the cache task into a cache queue;
and determining the sequence of the cache tasks in the cache queue through a monitoring process, and performing mirror image processing on each site to obtain the static resource of each site.
In the embodiment of the application, the cache queue is monitored in real time through the monitoring process, so that the timeliness of the local folder can be ensured.
In some possible embodiments, the first identification information comprises any one or a combination of:
site name, colon, site access port.
In the embodiment of the application, the type of the first identification information is not limited, and the user can set the first identification information according to the requirement, so that the application has universality even if a later-stage manager maintains the local folder.
Second aspect the present application also provides an access device, the device comprising:
the fault determination module is configured to determine that a site to which a network resource currently accessed by the terminal belongs has a fault;
the searching module is configured to search a local folder corresponding to the site from a local folder set according to the first identification information of the site;
the acquisition module is configured to search static resources related to the currently accessed network resources from the searched local folder according to the currently accessed network resources; the local folder corresponding to the site is established before the site fails, and the static resources in the local folder corresponding to the site are acquired from the site;
and the sending module is configured to determine a configuration file of the static resource associated with the currently accessed network resource, and send the configuration file and the static resource to a terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file.
In some possible embodiments, before the failure determination module is configured to perform determining that a station to which a network resource currently accessed by a terminal belongs fails, the apparatus further includes:
the system comprises a mirror image processing module, a local file folder and a data processing module, wherein the mirror image processing module is configured to perform mirror image processing on each site to obtain static resources of each site and store the static resources into the corresponding local file folder;
the configuration file modification module is configured to modify the configuration files corresponding to the static resources in the sites from default types to types corresponding to the static resources, wherein each site corresponds to one configuration file of a default type, and rendering modes corresponding to different types of static resources are different.
In some possible embodiments, the mirroring module performs mirroring on each site to obtain a static resource of each site, and when storing the static resource in a corresponding local folder, is configured to:
aiming at any site, periodically carrying out mirror image processing on the any site to obtain static resources of the any site;
if the local folder set does not contain the local folder corresponding to any site, establishing a local folder with second identification information of any site as a file name, wherein the second identification information comprises an address and a port;
storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site;
if the local folder set comprises a local folder corresponding to any site;
modifying the naming of the local file into second identification information of the site, wherein the second identification information comprises an address and a port;
and storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
In some possible embodiments, the mirroring module performs mirroring on each site, and when obtaining the static resource of each site, is configured to:
establishing a cache task for each site, and adding the cache task into a cache queue;
and determining the sequence of the cache tasks in the cache queue through a monitoring process, and performing mirror image processing on each site to obtain the static resource of each site.
In some possible embodiments, the first identification information comprises any one or a combination of:
site name, colon, site access port.
In a third aspect, another embodiment of the present application further provides an electronic device, including at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods provided by the embodiments of the first aspect of the present application.
In a fourth aspect, another embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is configured to cause a computer to execute any one of the methods provided in the first aspect of the present application.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is an application scenario diagram of an access method provided in an embodiment of the present application;
fig. 2 is a flowchart of an access method provided in an embodiment of the present application;
fig. 3 is a flowchart of obtaining static resources in an access method according to an embodiment of the present application;
fig. 4 is a flowchart of first establishing a local folder in an access method according to an embodiment of the present application;
fig. 5 is a flowchart of an existing local folder when a static resource is periodically acquired in an access method according to an embodiment of the present application;
fig. 6 is a flowchart illustrating that no local folder exists when static resources are periodically obtained according to an access method provided in an embodiment of the present application;
fig. 7A is an overall flowchart of a site failure during access in an access method according to an embodiment of the present application;
fig. 7B is an overall flowchart of establishing a local folder in an access method according to an embodiment of the present application;
fig. 8 is a schematic device diagram of an access method according to an embodiment of the present application;
fig. 9 is a schematic view of an electronic device of an access method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
It is noted that the terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
For convenience of understanding, terms used in the embodiments of the present application are explained below:
permanent online: the website is always in an accessible state, and for a client directly accessing the website, even if the source station is powered off, the client can access the resources of the website.
Content Delivery Network (CDN): the CDN is an intelligent virtual network constructed on the basis of the existing network, and by means of edge servers deployed in various places and functional modules of load balancing, content distribution, scheduling and the like of a central platform, a user can obtain required content nearby, network congestion is reduced, and response speed and hit rate of user access are improved. The key technology of the CDN is mainly content storage and distribution technology.
OpenResty: the OpenResty (also called ngx _ OpenResty) is a scalable World Wide Web (Web) platform based on Nginx (enginex), and is a powerful Web application server, Web developers can use the Lua scripting language to invoke various C and Lua modules supported by the Nginx, and more importantly, in terms of performance, the OpenResty can quickly construct an ultrahigh-performance Web application system capable of enduring more than 10 giga of concurrent connection response.
Nginx: is a high-performance hypertext Transfer Protocol (HTTP) and reverse proxy web server.
Lua is a lightweight and compact scripting language, written in a standard C language and opened in source code form, and is designed to be embedded in an application program, so that flexible extension and customized functions are provided for the application program.
default _ type (default type): the browser can distinguish different files according to the field, and further carry out different operations and processing.
text/Cascading Style Sheets (css): one of default _ type.
application/x-javascript: one of default _ type.
cs: the computer Language is used for expressing file styles such as hypertext Markup Language (HTML) or Extensible Markup Language (XML). The css can not only statically modify the web page, but also dynamically format each element of the web page in cooperation with various scripting languages.
Interpreted or just-in-time programming language (JavaScript, JS): is a lightweight, interpreted or just-in-time programming language with function precedence. Although it is named as a scripting language for developing Web pages, it is also used in many non-browser environments, JavaScript is based on prototypical programming, multi-modal dynamic scripting languages, and supports object-oriented, imperative, declarative, functional programming paradigms.
HTML: a markup language. The document format on the network can be unified through the labels, so that the scattered network resources are connected into a logic whole. HTML text is descriptive text consisting of HTML commands that can specify words, graphics, animations, sounds, tables, links, etc.
The agent: the proxy server implements various data transmission behaviors which are directly communicated with a third-party server (also called an opposite server) in proxy authority on the behalf of a proxy server (namely, an original server).
Static resources: the general client sends a request to the web server, the web server fetches the corresponding file from the internal memory and returns the file to the client, and the client analyzes, renders and displays the file.
Same resource location system (uniform resource locator, Url): the source stations visited by the visitor are linked.
The inventor researches and discovers that in the related art, a cloud proxy server is usually adopted to access a site, and when the site fails and needs shutdown maintenance and the like, the cloud proxy server can provide a corresponding access function only when the site can normally operate, so that it is necessary to realize permanent access of the site.
In view of the above, the present application provides an access method, an access apparatus, an electronic device, and a storage medium, which are used to solve the above problems. The inventive concept of the present application can be summarized as follows: if the fact that the site to which the network resource currently accessed by the terminal belongs is determined to have a fault is determined; searching a local folder corresponding to the site from the local folder set; then according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder; and finally, determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to the terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file.
Fig. 1 is a diagram of an application scenario of an access method in the embodiment of the present application. The figure includes: network 10, server 20, terminal 30; wherein:
the server 20 determines that a site to which the network resource currently accessed by the terminal 30 belongs has a fault; searching a local folder corresponding to the site from the local folder set according to the first identification information of the site; wherein the first identification information is stored in a memory, the memory being provided in the server; or may be a separate memory; then according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder; and finally, determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to the terminal so that the terminal 30 displays the static resource according to a rendering mode corresponding to the configuration file.
The description in this application is detailed with respect to only a single server or terminal, but it should be understood by those skilled in the art that the illustrated terminals 30, 20 are intended to represent the operations of the terminal devices, servers involved in the technical solutions of the present application. The detailed description of a single server is at least for convenience of description and does not imply a limitation on the number, type, or location of terminal devices and servers. It should be noted that the underlying concepts of the example embodiments of the present application may not be altered if additional modules are added or removed from the illustrated environments. In addition, those skilled in the art will appreciate that the above data transmission and reception also need to be implemented through the network 10.
It should be noted that, in the embodiment of the present application, the storage provided in the server may be, for example, a cache system, or may also be a hard disk storage, a memory storage, and the like. In addition, the access method provided by the application is not only suitable for the application scenario shown in fig. 1, but also suitable for any device with access requirements.
For the convenience of understanding, the access method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings.
As shown in fig. 2, an overall flowchart of an access method provided in the embodiment of the present application is shown, where:
in step 201: determining that a site to which a network resource currently accessed by a terminal belongs has a fault;
in step 202: searching a local folder corresponding to the site from the local folder set according to the first identification information of the site;
in step 203: according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder; the method comprises the steps that a local folder corresponding to a site is established before the site fails, and static resources in the local folder corresponding to the site are obtained from the site;
in step 204: and determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to the terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file.
In some embodiments, the established local folders have static resources stored hierarchically, such as: b and C are stored under the local folder AAA corresponding to the site a, D is stored in B, and E is stored in D. And if the network resource currently accessed by the user is https:// www.A.com/B/D/E.html, the E which the user wants to access can be found in the local folder according to the network resource currently accessed by the user.
In some embodiments, a site may fail due to a downtime of a server or an upgrade of the server, and thus the site cannot be accessed, in the present application, a local folder set is set, a local folder corresponding to each site is stored in the local folder set, and in order to obviously know the local folder corresponding to each website, in the present application, first identification information is set, and the local folder is named by the first identification information. Wherein, the first identification information may be any one or a combination of the following: site name, colon, site access port. Naming folders with first identifying information may also facilitate later maintenance of local folders by those skilled in the art. For example: if the name of the site a is AAA and the name of the site B is BBB, the local folder corresponding to the site a may be named AAA, and the local folder corresponding to the site B may be named BBB.
In this embodiment of the present application, in order to ensure that when a currently visited site fails, a static resource of the site can still continue to be visited, before determining that a site to which a network resource currently visited by a terminal belongs fails, steps shown in fig. 3 are implemented:
in step 301: performing mirror image processing on each site to obtain static resources of each site, and storing the static resources into corresponding local folders;
in the embodiment of the application, the static resources of each site are obtained by adopting a free tool wget for automatically downloading files from a network, and the wgt is selected to obtain and store the static resources because the wegt has a short development period, is low in development cost, is easy to implement, and is safer compared with other caching tools. And when the wget obtains the static resource, performing mirror image processing on the site to further obtain the static resource of the site. It is of course to be understood that, for example: an openness self-contained plug-in; other downloading technologies such as a crawler technology and the like realized by python or java can also achieve the purpose of mirroring a website, but the information after login can be cached by the plug-in of the openness, so that the information is leaked; the crawler technology is high in development cost, and the profit is not larger than wget, so that the method is not adopted in the application. When other downloading tools are adopted to acquire and store the static resources, the naming mode of the local folder can be adaptively adjusted according to the requirements of the downloading tools.
The configuration file of the static resource stored in the local folder is initially of a default type, and since the rendering modes of different static resources are different, in step 302: the configuration files corresponding to the static resources in the sites are modified from default types to types corresponding to the static resources (namely different types are set according to suffix of the static resources by utilizing the characteristics of the site server), wherein each site corresponds to one configuration file of a default type, and rendering modes corresponding to different types of static resources are different.
For example: if the default type (default _ type) is application/json and the corresponding configuration file of the static resource A is text/css, modifying the configuration file of the static resource A from the default _ type to the text/css; and if the configuration file corresponding to the static resource B is js, modifying the configuration file of the static resource B from default _ type to application/javascript, so that the terminal can identify the type of the static resource and further select a corresponding rendering mode.
In some embodiments, since openness is more powerful and easier to expand and develop than other servers, the application takes a server as openness for illustration; when the configuration of openness is updated, the configuration needs to be restarted to be effective. Therefore, the static resources that are to be stored in the local folder need to be validated and restarted after the configuration file is modified, so that the local folder can be normally accessed when the currently accessed site fails. It is of course to be understood that other servers are suitable for use in the present application, and those skilled in the art can adapt the embodiments of the present application according to the characteristics of the servers. Namely: when other servers are adopted, the agent of url level can be realized on the server, and the default-type of the modified file is supported; on a host machine of the proxy server, the web resource can be cached by using wget.
For ease of understanding, the access method provided in the embodiments of the present application is described in detail in the following cases.
1. Initial creation of local folder
In the embodiment of the application, when a local folder is established for the first time, first, second information identifiers corresponding to all sites are acquired from a memory, wherein the second information identifiers comprise interfaces and addresses (for example, 10.10.1.1: 80); for any one station, the steps shown in fig. 4 are performed:
step 401: carrying out mirror image processing on any site to obtain static resources of any site;
in some embodiments, this may be implemented as: establishing a cache task for each site, and adding the cache task into a cache queue; and when the work process monitors that the tasks exist in the cache queue, the tasks are taken out for operation, and the mirror image processing is carried out on each site to obtain the static resources of each site.
For example: a monitoring process worker is established in the background, the worker can monitor the cache queue all the time, the cache task corresponding to the site A is added into the cache queue, then the cache task corresponding to the site B is added into the cache queue, the worker can process the cache task corresponding to the site A firstly, and then the cache task corresponding to the site B is processed.
Since the wget needs to store the static resource according to the address and interface of the site when caching the static resource, in step 402: and establishing a local folder with second identification information of any site as a file name, wherein the second identification information comprises an address and a port.
In the embodiment of the present application, in order to facilitate the maintenance of the local folder in the later period, in step 403: and storing the static resources to the corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
In some embodiments, it may be that the current station is in a failure state, which may result in failure to acquire the static resource of the station, and thus may result in failure to acquire the static resource; in the embodiment of the application, when the static resource acquisition fails, prompt information of the acquisition failure is sent to remind technicians of the failure of the static resource acquisition.
2. Periodically acquiring static resources
In the embodiment of the present application, in order to ensure consistency between the static resources in the local folder and the static resources of the site, an obtaining period of the static resources is set, and the server obtains the static resources periodically according to the period.
When the static resource is acquired periodically, the following two cases can be implemented:
1) local folders corresponding to the site in the local folder set
If a local folder corresponding to the site exists in the local folder set, as shown in fig. 5:
in step 501: aiming at any site, periodically carrying out mirror image processing on any site to obtain static resources of any site;
in step 502: modifying the name of the local file into second identification information of the site, wherein the second identification information comprises an address and a port;
because the woget is used for mirroring the site, the woget needs to store the static resource into the local folder according to the address and the port of the site after mirroring the site to obtain the static resource of the site. Therefore, the naming of the local folder needs to be changed from the naming in the form of the first identification information to the naming in the form of the second identification information.
In step 503: and storing the static resources to the corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
After the static resources are stored in the local folder, in order to more obviously know which website the static resources are, and to conveniently perform inspection and other later maintenance, the name of the local folder needs to be modified into the first identification information of the site.
For example: when the static resources of the site A are periodically acquired, a local folder corresponding to the site A in a local folder set is determined, at the moment, the local folder is named by the name AAA of the site A, the name of the local folder is changed from the AAA to the port and address 101010:80 of the site A, the static resources are stored in the local folder, and then the name of the local folder is changed from 101010:80 to AAA.
2) The local folder set does not have a local folder corresponding to the site
If there is no local folder corresponding to the site in the local folder set, that is, when the static resource is periodically acquired this time, a newly added site is found, then the steps shown in fig. 6 are executed:
in step 601: acquiring a second information identifier and first identifier information corresponding to the site from a memory;
step 602: carrying out mirror image processing on the site to obtain static resources of the site;
step 603: establishing a local folder with second identification information of the site as a file name;
step 604: and storing the static resource to the local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
For example: when the static resources are periodically acquired, a new site B is found, at the moment, no local folder corresponding to the site B exists in the local folder set, the address and the port of the site B are 101010:70, a local folder with the name of 101010:70 is established according to the address and the port of the site B, and after the static resources are stored in the local folder, the name of the local folder is modified from 101010:70 to the name of the site B BBB.
By the method, the newly added site can be found in real time, the local folder can be established in time to store the static resource of the site, and the permanent online of the site is further realized.
In some embodiments, the static resources that need to be stored, i.e. all static resources in the local folder that do not necessarily have to store a site, may be specified by the user, for example: if a user wants to realize the url of https:// www.liziyi.com/lizier. html to be permanently online, all static resources of the url of/lizier. html should be stored in the local folder, the rest urls still access from the site, and all static resources of the site can be directly cached in the local folder.
For convenience of understanding, the following detailed descriptions are respectively made on the overall processes of the user access failure and the local folder establishment of the access method provided in the embodiment of the present application, as shown in fig. 7A:
in step 701: determining that a site to which a network resource currently accessed by a terminal belongs has a fault;
in step 702: searching a local folder corresponding to the site from a local folder set according to the first identification information of the site;
in step 703: according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder;
in step 704: and determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to the terminal.
As shown in fig. 7B:
in step 711: determining whether a local folder corresponding to the site exists in the local folder set, if so, entering step 712, and if not, entering step 715;
in step 712: modifying the name of the local file into second identification information of the site;
in step 713: carrying out mirror image processing on the site to obtain static resources of the site;
in step 714: storing the static resources to the corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site; modifying the configuration file corresponding to the static resource from a default type to a type corresponding to the static resource;
in step 715: acquiring second identification information of the station from a memory;
in step 716: and establishing a local folder with the second identification information of any site as a file name.
As shown in fig. 8, based on the same inventive concept, an embodiment of the present application further provides an access apparatus 800, including:
the fault determining module 8001 is configured to determine that a site to which a network resource currently accessed by the terminal belongs has a fault;
the searching module 8002 is configured to search, according to the first identification information of the site, a local folder corresponding to the site from a local folder set;
an obtaining module 8003, configured to search, according to the currently accessed network resource, a static resource associated with the currently accessed network resource from the searched local folder; the local folder corresponding to the site is established before the site fails, and the static resources in the local folder corresponding to the site are acquired from the site;
the sending module 8004 is configured to determine a configuration file of a static resource associated with the currently accessed network resource, and send the configuration file and the static resource to a terminal, so that the terminal displays the static resource according to a rendering manner corresponding to the configuration file.
In some possible embodiments, before the failure determination module is configured to perform determining that a station to which a network resource currently accessed by a terminal belongs fails, the apparatus further includes:
the system comprises a mirror image processing module, a local file folder and a data processing module, wherein the mirror image processing module is configured to perform mirror image processing on each site to obtain static resources of each site and store the static resources into the corresponding local file folder;
the configuration file modification module is configured to modify the configuration files corresponding to the static resources in the sites from default types to types corresponding to the static resources, wherein each site corresponds to one configuration file of a default type, and rendering modes corresponding to different types of static resources are different.
In some possible embodiments, the mirroring module performs mirroring on each site to obtain a static resource of each site, and when storing the static resource in a corresponding local folder, is configured to:
aiming at any site, periodically carrying out mirror image processing on the any site to obtain static resources of the any site;
if the local folder set does not contain the local folder corresponding to any site, establishing a local folder with second identification information of any site as a file name, wherein the second identification information comprises an address and a port;
storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site;
if the local folder set comprises a local folder corresponding to any site;
modifying the naming of the local file into second identification information of the site, wherein the second identification information comprises an address and a port;
and storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
In some possible embodiments, the mirroring module performs mirroring on each site, and when obtaining the static resource of each site, is configured to:
establishing a cache task for each site, and adding the cache task into a cache queue;
and determining the sequence of the cache tasks in the cache queue through a monitoring process, and performing mirror image processing on each site to obtain the static resource of each site.
In some possible embodiments, the first identification information comprises any one or a combination of:
site name, colon, site access port.
Having described the access method and apparatus of the exemplary embodiments of the present application, an electronic device according to another exemplary embodiment of the present application is next described.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible implementations, an electronic device according to the present application may include at least one processor, and at least one memory. Wherein the memory stores program code which, when executed by the processor, causes the processor to perform the steps of the access method according to various exemplary embodiments of the present application described above in the present specification.
The electronic device 130 according to this embodiment of the present application is described below with reference to fig. 9. The electronic device 130 shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 9, the electronic device 130 is represented in the form of a general electronic device. The components of the electronic device 130 may include, but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 that connects the various system components (including the memory 132 and the processor 131).
Bus 133 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
The memory 132 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)1321 and/or cache memory 1322, and may further include Read Only Memory (ROM) 1323.
Memory 132 may also include a program/utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with the electronic device 130, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 130 to communicate with one or more other electronic devices. Such communication may occur via input/output (I/O) interfaces 135. Also, the electronic device 130 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 136. As shown, network adapter 136 communicates with other modules for electronic device 130 over bus 133. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
In some possible embodiments, aspects of an access method provided herein may also be implemented in the form of a program product comprising program code for causing a computer device to perform the steps of an access method according to various exemplary embodiments of the present application described above in this specification when the program product is run on the computer device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for accessing of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on the consumer electronic device, as a stand-alone software package, partly on the consumer electronic device and partly on a remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic devices may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An access method applied to a network device, the method comprising:
determining that a site to which a network resource currently accessed by a terminal belongs has a fault;
searching a local folder corresponding to the site from a local folder set according to the first identification information of the site;
according to the currently accessed network resource, searching a static resource associated with the currently accessed network resource from the searched local folder; the local folder corresponding to the site is established before the site fails, and the static resources in the local folder corresponding to the site are acquired from the site;
and determining a configuration file of the static resource associated with the currently accessed network resource, and sending the configuration file and the static resource to a terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file.
2. The method according to claim 1, wherein before determining that the station to which the network resource currently accessed by the terminal belongs has a fault, the method further comprises:
carrying out mirror image processing on each site to obtain static resources of each site, and storing the static resources into corresponding local folders;
and modifying the configuration files corresponding to the static resources in the sites from default types to types corresponding to the static resources, wherein each site corresponds to one configuration file of a default type, and rendering modes corresponding to different types of static resources are different.
3. The method according to claim 2, wherein the mirroring processing is performed on each site to obtain static resources of each site, and the static resources are stored in a corresponding local folder, and the mirroring processing comprises:
aiming at any site, periodically carrying out mirror image processing on the any site to obtain static resources of the any site;
if the local folder set does not contain the local folder corresponding to any site, establishing a local folder with second identification information of any site as a file name, wherein the second identification information comprises an address and a port;
storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site;
if the local folder set comprises a local folder corresponding to any site;
modifying the naming of the local file into second identification information of the site, wherein the second identification information comprises an address and a port;
and storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
4. The method according to any one of claims 2 to 3, wherein the mirroring for each site to obtain the static resource of each site comprises:
establishing a cache task for each site, and adding the cache task into a cache queue;
and determining the sequence of the cache tasks in the cache queue through a monitoring process, and performing mirror image processing on each site to obtain the static resource of each site.
5. The method according to any one of claims 1 to 3, wherein the first identification information comprises any one or a combination of:
site name, colon, site access port.
6. An access apparatus, applied in a network device, the apparatus comprising:
the fault determination module is configured to determine that a site to which a network resource currently accessed by the terminal belongs has a fault;
the searching module is configured to search a local folder corresponding to the site from a local folder set according to the first identification information of the site;
the acquisition module is configured to search static resources related to the currently accessed network resources from the searched local folder according to the currently accessed network resources; the local folder corresponding to the site is established before the site fails, and the static resources in the local folder corresponding to the site are acquired from the site;
and the sending module is configured to determine a configuration file of the static resource associated with the currently accessed network resource, and send the configuration file and the static resource to a terminal so that the terminal displays the static resource according to a rendering mode corresponding to the configuration file.
7. The apparatus according to claim 6, wherein the failure determination module is configured to perform, before determining that the station to which the network resource currently accessed by the terminal belongs fails, the apparatus further comprises:
the system comprises a mirror image processing module, a local file folder and a data processing module, wherein the mirror image processing module is configured to perform mirror image processing on each site to obtain static resources of each site and store the static resources into the corresponding local file folder;
the configuration file modification module is configured to modify the configuration files corresponding to the static resources in the sites from default types to types corresponding to the static resources, wherein each site corresponds to one default type of configuration file, and rendering modes corresponding to different types of static files are different.
8. The apparatus according to claim 7, wherein the mirroring module performs mirroring on each site to obtain static resources of each site, and when storing the static resources in a corresponding local folder, is configured to:
aiming at any site, periodically carrying out mirror image processing on the any site to obtain static resources of the any site;
if the local folder set does not contain the local folder corresponding to any site, establishing a local folder with second identification information of any site as a file name, wherein the second identification information comprises an address and a port;
storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site;
if the local folder set comprises a local folder corresponding to any site;
modifying the naming of the local file into second identification information of the site, wherein the second identification information comprises an address and a port;
and storing the static resources to a corresponding local folder according to the second identification information, and modifying the name of the local folder into the first identification information of the site.
9. An electronic device comprising at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
10. A computer storage medium, characterized in that the computer storage medium stores a computer program for causing a computer to execute the method of any one of claims 1-5.
CN202111140477.6A 2021-09-28 2021-09-28 Access method, device, electronic equipment and storage medium Pending CN113872809A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111140477.6A CN113872809A (en) 2021-09-28 2021-09-28 Access method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111140477.6A CN113872809A (en) 2021-09-28 2021-09-28 Access method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113872809A true CN113872809A (en) 2021-12-31

Family

ID=78991576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111140477.6A Pending CN113872809A (en) 2021-09-28 2021-09-28 Access method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113872809A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1172734A1 (en) * 2000-07-12 2002-01-16 eGrail Method and system for web management
US20060015573A1 (en) * 2004-06-30 2006-01-19 Microsoft Corporation System and method for automatic redirection to stored web resources upon access failure
CN102364461A (en) * 2011-06-30 2012-02-29 广州市动景计算机科技有限公司 Page content data acquisition method and server
US20120079224A1 (en) * 2010-09-29 2012-03-29 International Business Machines Corporation Maintaining mirror and storage system copies of volumes at multiple remote sites
US20120173830A1 (en) * 2011-01-04 2012-07-05 International Business Machines Corporation Synchronization of logical copy relationships
US20130227078A1 (en) * 2012-02-23 2013-08-29 Coach Wei System and method for context specific website optimization
CN106919478A (en) * 2017-03-07 2017-07-04 中国建设银行股份有限公司 A kind of Website page element backup method and system
CN107071066A (en) * 2017-06-07 2017-08-18 北京潘达互娱科技有限公司 page access method and device
CN107277055A (en) * 2017-08-03 2017-10-20 杭州安恒信息技术有限公司 A kind of website guard technology based on offline cache
CN108846087A (en) * 2018-06-12 2018-11-20 恒生电子股份有限公司 A kind of page rendering method, apparatus, terminal and server
CN109902247A (en) * 2019-02-14 2019-06-18 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment of page rendering
CN110795195A (en) * 2019-10-31 2020-02-14 百度在线网络技术(北京)有限公司 Webpage rendering method and device, electronic equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1172734A1 (en) * 2000-07-12 2002-01-16 eGrail Method and system for web management
US20060015573A1 (en) * 2004-06-30 2006-01-19 Microsoft Corporation System and method for automatic redirection to stored web resources upon access failure
US20120079224A1 (en) * 2010-09-29 2012-03-29 International Business Machines Corporation Maintaining mirror and storage system copies of volumes at multiple remote sites
US20120173830A1 (en) * 2011-01-04 2012-07-05 International Business Machines Corporation Synchronization of logical copy relationships
CN102364461A (en) * 2011-06-30 2012-02-29 广州市动景计算机科技有限公司 Page content data acquisition method and server
US20170264701A1 (en) * 2012-02-23 2017-09-14 Yottaa Inc. System and method for context specific website optimization
US20130227078A1 (en) * 2012-02-23 2013-08-29 Coach Wei System and method for context specific website optimization
CN106919478A (en) * 2017-03-07 2017-07-04 中国建设银行股份有限公司 A kind of Website page element backup method and system
CN107071066A (en) * 2017-06-07 2017-08-18 北京潘达互娱科技有限公司 page access method and device
CN107277055A (en) * 2017-08-03 2017-10-20 杭州安恒信息技术有限公司 A kind of website guard technology based on offline cache
CN108846087A (en) * 2018-06-12 2018-11-20 恒生电子股份有限公司 A kind of page rendering method, apparatus, terminal and server
CN109902247A (en) * 2019-02-14 2019-06-18 北京奇艺世纪科技有限公司 A kind of method, apparatus and electronic equipment of page rendering
CN110795195A (en) * 2019-10-31 2020-02-14 百度在线网络技术(北京)有限公司 Webpage rendering method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10412176B2 (en) Website access method, apparatus, and website system
CN110120917B (en) Routing method and device based on content
RU2589306C2 (en) Remote viewing session control
KR102294326B1 (en) Prefetching application data for periods of disconnectivity
US8543713B2 (en) Computing environment arranged to support predetermined URL patterns
US20150128121A1 (en) Dynamic application version selection
JP2019032883A (en) Method, apparatus, server and system for implementing web application
CN110489192B (en) Remote communication method and device and electronic equipment
US20160344832A1 (en) Dynamic bundling of web components for asynchronous delivery
CN109413140B (en) Remote automatic upgrading method for PACS server
CN110784528B (en) File downloading method and device and storage medium
US11023558B1 (en) Executing functions on-demand on a server utilizing web browsers
CN108256014B (en) Page display method and device
CN110830374A (en) Method and device for gray level release based on SDK
US20120054327A1 (en) Site redirection
US20130151595A1 (en) Deployment and hosting of platform independent applications
CN111767089A (en) Method, device and equipment for loading file and storage medium
US9998559B2 (en) Preemptive caching of data
CN113806008A (en) Cluster access method and device, electronic equipment and readable storage medium
CN113760278A (en) Page management method and device
CN112988569A (en) Method and system for viewing micro-service request response based on nginx
JP5541160B2 (en) Program acquisition / execution client, program acquisition / execution method and program
CN113872809A (en) Access method, device, electronic equipment and storage medium
CN114915565A (en) Method and system for debugging network
KR20060079648A (en) Integrated browsing system and method thereof

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