CN108200132B - Resource acquisition method, device, equipment and computer readable storage medium - Google Patents
Resource acquisition method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN108200132B CN108200132B CN201711415213.0A CN201711415213A CN108200132B CN 108200132 B CN108200132 B CN 108200132B CN 201711415213 A CN201711415213 A CN 201711415213A CN 108200132 B CN108200132 B CN 108200132B
- Authority
- CN
- China
- Prior art keywords
- resource
- server
- source station
- cdn server
- station 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000012544 monitoring process Methods 0.000 claims abstract description 16
- 238000004891 communication Methods 0.000 description 8
- 238000012795 verification Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004904 shortening Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance 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
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a resource acquisition method, which comprises the following steps: sending a resource acquisition request to a CDN server, and monitoring whether a resource is acquired; when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server; and when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server. The invention also discloses a resource acquisition device, equipment and a computer readable storage medium. The invention can improve the reliability of acquiring the resources and solve the problem that the CDN service cannot update the resources in real time.
Description
Technical Field
The present invention relates to the field of internet application technologies, and in particular, to a resource acquisition method, device, and apparatus, and a computer-readable storage medium.
Background
In the current Network service, for example, for a navigation station, if all foreign users access servers in the site of a website, the speed is relatively slow, and if users in various places can access servers in various places, the speed is relatively fast, and the problem can be effectively solved through a Content Delivery Network (CDN).
The CDN forms a layer of intelligent virtual network superimposed on the existing internet by placing node servers at various places in the network, and can redirect a user's request to a service node closest to the user in real time according to comprehensive information such as network traffic, connection and load conditions of each node, a distance to the user, and response time. When a user accesses, the access can be guided to a CDN server node instead of a server for website navigation, and the acceleration of a local Cache (Cache) improves the access speed of an enterprise owner occupation site (particularly a site containing a large number of pictures and static pages), and greatly improves the stability of the site.
However, when the CDN server has a problem, for example, when the CDN server is repaired or fails, the CDN server cannot respond to the request of the client, so that the client cannot obtain the requested resource and cannot perform subsequent actions, and the resource cannot be obtained by a new request only after the CDN server is normally operated, which causes a serious delay and low reliability.
Disclosure of Invention
The invention mainly aims to provide a resource acquisition method, a resource acquisition device, a resource acquisition equipment and a computer readable storage medium, and aims to solve the technical problems that when a CDN server has a problem, a client cannot acquire a requested resource and cannot perform subsequent behaviors.
In order to achieve the above object, the present invention provides a resource acquisition method, including:
sending a resource acquisition request to a CDN server, and monitoring whether a resource is acquired;
when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server;
and when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server.
Optionally, the step of sending the resource obtaining request to the CDN server includes:
integrating resources to be acquired to obtain a resource list;
and generating a resource acquisition request through the resource list, and sending the resource acquisition request to a CDN server.
Optionally, after the step of sending, when it is monitored that the resource is not obtained, information for verifying the state of the CDN server to the CDN server, the method further includes:
when the state information fed back by the CDN server is that the CDN server normally operates, the resource obtaining request is sent to the CDN server again;
and receiving the resources sent by the CDN server.
Optionally, after the step of sending the information for verifying the state of the CDN server to the CDN server, the method further includes:
when the state information fed back by the CDN server is received and is normally operated, the state of the CDN server is determined to be normally operated, and when the state information fed back by the CDN server is that the CDN server cannot normally operate or the feedback information of the CDN server is not received, the state of the CDN server is determined to be abnormally operated.
Optionally, the step of sending the resource obtaining request to a source station server includes:
acquiring a source station server address corresponding to the relevant resource according to the resource acquisition request;
and sending the resource acquisition request to the source station server according to the acquired source station server address.
Optionally, after the step of obtaining the address of the source station server corresponding to the relevant resource according to the resource obtaining request, the method further includes:
judging whether a plurality of acquired source station server addresses exist or not;
and when a plurality of the acquired source station server addresses exist, selecting the source station server sending the resource acquisition request according to a preset rule.
Optionally, the step of selecting a source station server sending the resource acquisition request according to a preset rule includes:
acquiring the resource types and the quantity stored by each source station server according to the source station server address;
comparing the resource type to be acquired in the resource acquisition request with the resource type stored by each source station server;
and selecting the source station server with the maximum quantity as the source station server sending the resource acquisition request from the resource types which are consistent with the resource types to be acquired.
In addition, to achieve the above object, the present invention further provides a resource acquisition apparatus, including:
the monitoring module is used for sending the resource acquisition request to the CDN server and monitoring whether the resource is acquired or not;
the sending module is used for sending information for verifying the state of the CDN server to the CDN server when monitoring that the resources are not obtained; and when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server.
In addition, to achieve the above object, the present invention also provides a resource acquisition device, including a resource acquisition program, which when executed by the resource acquisition device, implements the steps of the resource acquisition method as described above.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a resource acquisition program which, when executed by a processor, implements the steps of the resource acquisition method as described above.
According to the resource acquisition method, the resource acquisition device, the resource acquisition equipment and the computer readable storage medium, the resource acquisition request is sent to the CDN server, and whether the resource is acquired or not is monitored; when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server; when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to the source station server, and the resource is obtained through the source station server, so that the problem that the CDN server cannot respond to the request of the client when the CDN server is repaired or fails, the client cannot obtain the requested resource, and meanwhile, the resource can be obtained only by carrying out the resource obtaining request again after the CDN server normally operates is avoided, and therefore the efficiency of obtaining the resource by a user is improved.
Drawings
FIG. 1 is a flowchart illustrating a resource obtaining method according to a first embodiment of the present invention;
fig. 2 is a detailed flowchart of a step of sending a resource acquisition request to a CDN server in a second embodiment of the resource acquisition method according to the present invention;
FIG. 3 is a flowchart illustrating a resource obtaining method according to a third embodiment of the present invention;
fig. 4 is a detailed flowchart of a step of sending the resource acquisition request to a source station server in a fifth embodiment of the resource acquisition method according to the present invention;
FIG. 5 is a flowchart illustrating a sixth embodiment of a resource obtaining method according to the present invention;
fig. 6 is a detailed flowchart illustrating steps of selecting a source station server for sending a resource acquisition request according to a predetermined rule in a seventh embodiment of the resource acquisition method according to the present invention;
fig. 7 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: sending a resource acquisition request to a CDN server, and monitoring whether a resource is acquired or not; when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server; when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to the source station server, and the resource is obtained through the source station server, so that the problem that the CDN server cannot respond to the request of the client when the CDN server is repaired or fails, the client cannot obtain the requested resource, and meanwhile, the resource can be obtained only by carrying out the resource obtaining request again after the CDN server normally operates is avoided, and therefore the efficiency of obtaining the resource by a user is improved.
In the embodiment of the invention, it is considered that, in the prior art, when a problem occurs in the CDN server, for example, when the CDN server is repaired or fails, the CDN server cannot respond to a request of the client, so that the client cannot obtain a requested resource and cannot perform subsequent actions, and only after the CDN server operates normally, a resource can be obtained by a re-request, which causes a serious delay and low reliability.
Therefore, the embodiment of the invention provides a resource acquisition method, which is characterized in that a resource acquisition request is sent to a CDN server, and whether a resource is acquired or not is monitored; when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server; when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to the source station server, and the resource is obtained through the source station server, so that the problem that the CDN server cannot respond to the request of the client when the CDN server is repaired or fails, the client cannot obtain the requested resource, and meanwhile, the resource can be obtained only by carrying out the resource obtaining request again after the CDN server normally operates is avoided, and therefore the efficiency of obtaining the resource by a user is improved.
The invention provides a resource acquisition method.
Referring to fig. 1, fig. 1 is a flowchart illustrating a resource obtaining method according to a first embodiment of the present invention.
In this embodiment, the method includes:
step S100, sending a resource acquisition request to a CDN server, and monitoring whether a resource is acquired;
in this embodiment, when a client needs to acquire a network resource, for example, when the client needs to open a web page, download an APP, download a picture, or download a file, the client generates a resource acquisition request from a list of resources (web page, APP, picture, file, etc.) that the client needs to acquire, and sends the resource acquisition request to the CDN server. Meanwhile, whether the Client acquires the resource corresponding to the resource acquisition request fed back from the CDN server is monitored, where a Client (Client) or called a user refers to a program corresponding to the server and providing local service to the Client. Except for some application programs which only run locally, the application programs are generally installed on common clients and need to be operated together with a server. For this kind of application, a corresponding server and a corresponding service program are required in the network to provide corresponding services, such as database services, e-mail services, etc., so that a specific communication connection needs to be established between the client and the server to ensure the normal operation of the application program. After the internet has developed, the more common clients include web browsers used on the world wide web, email clients for receiving and sending emails, and client software for instant messaging.
Step S200, when it is monitored that the resource is not obtained, information for verifying the state of the CDN server is sent to the CDN server;
after the client sends out the resource acquisition request, there are two cases: firstly, when the CDN server normally operates, the CDN server receives a resource acquisition request of the client, and feeds back corresponding resources to the client according to the resource acquisition request. And after the client acquires the resources required to be acquired, carrying out a subsequent processing process. Secondly, when the CDN server fails to operate normally due to a fault, maintenance, or upgrade, the CDN server may not receive the resource acquisition request of the client, or the CDN server receives the resource acquisition request of the client but cannot feed back the resource corresponding to the resource acquisition request to the client. The client cannot acquire the resources required to be acquired, and cannot perform subsequent processing. Therefore, when the client monitors that the resource required to be obtained fed back from the CDN server is not received, the client may further send verification information to the CDN server to confirm whether the CDN server is in a normal operating state.
Step 300, when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, sending the resource acquisition request to a source station server, and acquiring a resource by the source station server.
When the client receives the reply of the CDN server to the verification information and the replied state information is that the state of the CDN server is normal, namely the client confirms that the CDN server normally operates, at the moment, the client can send a resource acquisition request to the CDN server again and monitor the resource acquisition condition; when the client does not receive the reply of the CDN server to the verification information, or the state information replied is that the state of the CDN server is abnormal, the client confirms that the CDN server does not normally operate. When the client confirms that the CDN server cannot normally operate, the client can send a resource acquisition request to the corresponding source station server according to the source station server address corresponding to the relevant resource in the generated resource acquisition request, so that the resource can be acquired through the source station server, the client can still quickly acquire the requested resource when the CDN server cannot normally operate, the problem that the client cannot acquire the requested resource due to the fact that the CDN server cannot respond to the request of the client when the CDN server is repaired or in fault is avoided, the efficiency of acquiring the resource is improved, and the reliability of acquiring the resource is improved.
In the resource acquisition method provided by this embodiment, a resource acquisition request is sent to a CDN server, and whether a resource is acquired is monitored; when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server; when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to the source station server, and the resource is obtained through the source station server, so that the problem that the CDN server cannot respond to the request of the client when the CDN server is repaired or fails, the client cannot obtain the requested resource, and meanwhile, the resource can be obtained only by carrying out the resource obtaining request again after the CDN server normally operates is avoided, and therefore the efficiency of obtaining the resource by a user is improved.
Further, referring to fig. 2, a second embodiment of the resource obtaining method of the present invention is provided based on the first embodiment of the resource obtaining method of the present invention.
In this embodiment, the step S100 includes:
step S110, integrating resources to be acquired to obtain a resource list;
in this embodiment, when a client needs to open a web page, download an APP, download a picture, or download a file, resources (the web page, the APP, the picture, the file, etc.) that the client needs to acquire are integrated, for example, the resources that need to acquire are classified and arranged, for example, resources of the same class are arranged together, for example, a video and a video that are to be acquired are arranged together, and a picture that are to be acquired are arranged together, so that when a CDN server searches for the resources that need to acquire, the CDN server directly searches according to the class, thereby shortening the search time, thereby shortening the time for the client to acquire the resources, or the resources that need to acquire are arranged according to the size of the resources that need to acquire, for example, a resource that needs to acquire with a smaller data volume is searched first, and then the searched resource that needs to be acquired is sent to the client for the client to acquire, the waiting time of the client is shortened; after the resources are classified and arranged, a resource list can be obtained;
step S120, generating a resource obtaining request through the resource list, and sending the resource obtaining request to a CDN server.
Then, a resource obtaining request is generated according to the resource list so as to send the resource obtaining request to the CDN server, and of course, the resource obtaining request may further include other content, such as an address and a path of the client, so that the CDN server returns the found resource to the client, such as a data obtaining permission, so as to obtain a right of data obtaining.
Further, referring to fig. 3, a third embodiment of the resource obtaining method of the present invention is provided based on the first embodiment of the resource obtaining method of the present invention.
In this embodiment, the steps after step S200 further include:
step S400, when the state information fed back by the CDN server is that the CDN server normally operates, the resource obtaining request is sent to the CDN server again;
in this embodiment, when it is monitored that resources are not obtained, verification information may be further sent to the CDN server to determine whether the CDN server is in a normal operation state, the information for verifying the state of the CDN server is sent to the CDN server, and when the state information fed back by the CDN server is that the CDN server is operating normally, the resource obtaining request is sent to the CDN server again, specifically, when the client receives a reply to the verification information from the CDN server, that is, the client determines that the CDN server is operating normally, at this time, the resource obtaining request may be sent to the CDN server again, and after receiving the resource obtaining request sent by the client, the CDN server searches for a corresponding resource according to the resource obtaining request, and feeds back the found resource to the client;
step S500, receiving the resource sent by the CDN server.
The client can receive the resources fed back by the CDN. The method comprises the steps that when a client sends a resource obtaining request for the first time, the client possibly has reasons of unsuccessful sending or busy CDN server, and the CDN server does not receive the resource obtaining request sent by the client, and the resource obtaining speed of the CDN server is higher than that of a source station server, so that when the resource obtaining request is sent for the first time and the CDN server does not return the resource, whether the CDN server is in a normal running state or not can be verified by sending verification information, if the CDN server is in the running state, the resource can be obtained through the CDN server, and the resource obtaining speed is improved.
Further, a fourth embodiment of the resource acquisition method of the present invention is provided based on the first embodiment of the resource acquisition method of the present invention.
In this embodiment, the steps after step S200 further include:
when the state information fed back by the CDN server is received and is normally operated, the state of the CDN server is determined to be normally operated, and when the state information fed back by the CDN server is that the CDN server cannot normally operate or the feedback information of the CDN server is not received, the state of the CDN server is determined to be abnormally operated.
In this embodiment, it can be specifically determined whether the CDN server is in a normal operating state through CDN server feedback information; specifically, when the state information fed back by the CDN server is received and is normally operated, it is determined that the state of the CDN server is normally operated, and when the state information fed back by the CDN server is that the CDN server cannot normally operate or the CDN server feedback information is not received, it is determined that the state of the CDN server is abnormally operated.
Further, referring to fig. 4, a fifth embodiment of the resource obtaining method of the present invention is provided based on the first embodiment of the resource obtaining method of the present invention.
In this embodiment, the step S300 includes:
step S310, obtaining the address of the source station server corresponding to the relevant resource according to the resource obtaining request;
in this embodiment, when the resource is not obtained through the CDN, the resource may be further obtained through the source station server, and the resource is obtained through the source station server, where an address of the source station server needs to be obtained; specifically, the corresponding address of the source station server may be obtained according to the related resource requested to be obtained in the generated resource obtaining request, for example, if the related resource requested to be obtained in the resource obtaining request is a picture of a product a, the product a may be analyzed to obtain the corresponding address of the source station server;
step S320, sending the resource obtaining request to the source station server according to the obtained source station server address.
And then the resource acquisition request is sent to the acquired source station server, so that the resource is acquired through the source station server, the situation that the client cannot acquire the requested resource because the CDN server cannot respond to the request of the client when the CDN server is repaired or fails is avoided, and the resource can be acquired without carrying out the resource acquisition request again after the CDN server normally operates, and the efficiency of acquiring the resource by a user is improved.
Further, referring to fig. 5, a sixth embodiment of the resource obtaining method of the present invention is provided based on the fifth embodiment of the resource obtaining method of the present invention.
In this embodiment, the steps after step S310 further include:
step S330, judging whether a plurality of acquired source station server addresses are available;
in this embodiment, after the address of the corresponding source station server is acquired through the resource acquisition request, since there may be a plurality of requested resources in the resource acquisition request, there may also be a plurality of acquired source station servers; therefore, after the address of the source station server is acquired, whether one or more acquired source station servers are acquired is judged;
step S340, when there are a plurality of acquired source station server addresses, selecting a source station server that sends a resource acquisition request according to a preset rule.
When the number of the acquired source station server addresses is multiple, selecting the source station server sending the resource acquisition request according to a preset rule, where the preset rule may specifically be a type of the resource stored in the source station server, a resource number, and the like.
Further, referring to fig. 6, a seventh embodiment of the resource obtaining method of the present invention is proposed based on the sixth embodiment of the resource obtaining method of the present invention.
In this embodiment, the step S340 includes:
step S341, obtaining the resource type and amount stored in each source station server according to the source station server address;
in this embodiment, when there are a plurality of source station server addresses, the source station server that sends the resource obtaining request may be first obtained according to the resource types and the number stored in each source station server; specifically, each source station server is accessed according to the address of the source station server, or a request for acquiring the resource types and the quantities stored by the source station server is sent to the source station server, so that the resource types and the quantities stored by each source station server are acquired.
Step 342, comparing the resource type to be acquired in the resource acquisition request with the resource types stored by each source station server;
step S343, the source station server with the largest number in the resource types consistent with the resource types to be acquired is selected as the source station server that sends the resource acquisition request.
After the resource types and the number stored in each source station server are obtained, the source station server sending the resource obtaining request is selected according to the resource types and the number stored in each source station server, specifically, the resource types to be obtained in the resource obtaining request and the resource types stored in each source station server are compared at first, then the resource types which are consistent with the resource types to be obtained are compared, the source station server with the largest number is selected as the source station server sending the resource obtaining request, the resource types which do not exist in the source station server in the resource obtaining request are compared with the resource types in other source station servers, and the source station server which is compared to the consistent type is used as the source station server sending the remaining resource obtaining request. Or directly using the source station server with the maximum resource quantity as the source station server for sending the resource acquisition request. Therefore, the frequency of sending the resource acquisition request is reduced, and the efficiency of acquiring the resource is improved.
The present invention further provides a resource acquisition apparatus, the apparatus comprising:
the monitoring module is used for sending the resource acquisition request to the CDN server and monitoring whether the resource is acquired or not;
the sending module is used for sending information for verifying the state of the CDN server to the CDN server when monitoring that the resources are not obtained; and when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server.
The specific embodiment of the resource obtaining apparatus of the present invention is basically the same as the embodiments of the resource obtaining method described above, and will not be described herein again.
The invention further provides a resource acquisition device.
Referring to fig. 7, fig. 7 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 7, the resource acquisition device may include: a processor 1001, such as a CPU, a network interface 1002, a user interface 1003, and a memory 1004. Connection communication between these components may be realized by a communication bus. The network interface 1002 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (e.g., a WI-FI interface, a bluetooth interface, an infrared interface, etc., for connecting to a wireless network). The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface (e.g., for connecting a wired Keyboard, a wired mouse, etc.) and/or a wireless interface (e.g., for connecting a wireless Keyboard, a wireless mouse). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1004 may alternatively be a storage device separate from the processor 1001.
Optionally, the resource acquisition device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like.
Those skilled in the art will appreciate that the resource acquisition device configurations shown in the figures are not meant to be limiting of the resource acquisition device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 7, the memory 1004, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a resource acquisition program. The operating system is a program for managing and controlling hardware and software resources of the resource acquisition equipment, and supports the operation of the network communication module, the user interface module, the resource acquisition program and other programs or software; the network communication module is used for managing and controlling the network interface 1002; the user interface module is used to manage and control the user interface 1003.
In the resource acquiring apparatus shown in fig. 7, the network interface 1002 is mainly used for connecting to a database and performing data communication with the database; the user interface 1003 is mainly used to connect a client (which may be understood as a user side) and perform data communication with the client, for example, display information to the client through a window or receive operation information sent by the client; and the processor 1001 may be configured to execute the resource acquisition program stored in the memory 1004 to implement the following steps:
sending a resource acquisition request to a CDN server, and monitoring whether a resource is acquired;
when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server;
and when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server.
Further, the processor 1001 is further configured to execute the resource obtaining program stored in the memory 1004 to implement the following steps:
integrating resources to be acquired to obtain a resource list;
and generating a resource acquisition request through the resource list, and sending the resource acquisition request to a CDN server.
Further, the processor 1001 is further configured to execute the resource obtaining program stored in the memory 1004 to implement the following steps:
when the state information fed back by the CDN server is that the CDN server normally operates, the resource obtaining request is sent to the CDN server again;
and receiving the resources sent by the CDN server.
Further, the processor 1001 is further configured to execute the resource obtaining program stored in the memory 1004 to implement the following steps:
when the state information fed back by the CDN server is received and is normally operated, the state of the CDN server is determined to be normally operated, and when the state information fed back by the CDN server is that the CDN server cannot normally operate or the feedback information of the CDN server is not received, the state of the CDN server is determined to be abnormally operated.
Further, the processor 1001 is further configured to execute the resource obtaining program stored in the memory 1004 to implement the following steps:
acquiring a source station server address corresponding to the relevant resource according to the resource acquisition request;
and sending the resource acquisition request to the source station server according to the acquired source station server address.
Further, the processor 1001 is further configured to execute the resource obtaining program stored in the memory 1004 to implement the following steps:
judging whether a plurality of acquired source station server addresses exist or not;
and when a plurality of the acquired source station server addresses exist, selecting the source station server sending the resource acquisition request according to a preset rule.
Further, the processor 1001 is further configured to execute the resource obtaining program stored in the memory 1004 to implement the following steps:
acquiring the resource types and the quantity stored by each source station server according to the source station server address;
comparing the resource type to be acquired in the resource acquisition request with the resource type stored by each source station server;
and selecting the source station server with the maximum quantity as the source station server sending the resource acquisition request from the resource types which are consistent with the resource types to be acquired.
The specific embodiment of the resource obtaining apparatus of the present invention is basically the same as the embodiments of the resource obtaining method and the resource obtaining device, and is not described herein again.
The present invention also provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of:
sending a resource acquisition request to a CDN server, and monitoring whether a resource is acquired;
when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server;
and when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server.
Further, the one or more programs are executable by the one or more processors to also implement the steps of:
integrating resources to be acquired to obtain a resource list;
and generating a resource acquisition request through the resource list, and sending the resource acquisition request to a CDN server.
Further, the one or more programs are executable by the one or more processors to also implement the steps of:
when the state information fed back by the CDN server is that the CDN server normally operates, the resource obtaining request is sent to the CDN server again;
and receiving the resources sent by the CDN server.
Further, the one or more programs are executable by the one or more processors to also implement the steps of:
when the state information fed back by the CDN server is received and is normally operated, the state of the CDN server is determined to be normally operated, and when the state information fed back by the CDN server is that the CDN server cannot normally operate or the feedback information of the CDN server is not received, the state of the CDN server is determined to be abnormally operated.
Further, the one or more programs are executable by the one or more processors to also implement the steps of:
acquiring a source station server address corresponding to the relevant resource according to the resource acquisition request;
and sending the resource acquisition request to the source station server according to the acquired source station server address.
Further, the one or more programs are executable by the one or more processors to also implement the steps of:
judging whether a plurality of acquired source station server addresses exist or not;
and when a plurality of the acquired source station server addresses exist, selecting the source station server sending the resource acquisition request according to a preset rule.
Further, the one or more programs are executable by the one or more processors to also implement the steps of:
acquiring the resource types and the quantity stored by each source station server according to the source station server address;
comparing the resource type to be acquired in the resource acquisition request with the resource type stored by each source station server;
and selecting the source station server with the maximum quantity as the source station server sending the resource acquisition request from the resource types which are consistent with the resource types to be acquired.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the resource obtaining method, the resource obtaining apparatus, and the resource obtaining device, and is not described herein again.
It should also be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (7)
1. A method for resource acquisition, the method comprising the steps of:
integrating resources to be acquired to obtain a resource list;
generating a resource acquisition request through the resource list, sending the resource acquisition request to a CDN server, and monitoring whether a resource is acquired, wherein the resource acquisition request also comprises data acquisition permission;
when it is monitored that the resources are not obtained, information for verifying the state of the CDN server is sent to the CDN server;
when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server;
the sending the resource obtaining request to a source station server, and obtaining resources through the source station server include:
acquiring a source station server address corresponding to the relevant resource according to the resource acquisition request;
judging whether a plurality of acquired source station server addresses exist or not;
when a plurality of the acquired source station server addresses are available, selecting the source station server sending the resource acquisition request according to a preset rule, wherein the preset rule is the type and the quantity of the resources stored by the source station server;
and sending the resource acquisition request to the source station server according to the acquired source station server address.
2. The method for acquiring resources according to claim 1, wherein after the step of sending information for verifying the state of the CDN server to the CDN server when it is monitored that resources are not acquired, the method further comprises:
when the state information fed back by the CDN server is that the CDN server normally operates, the resource obtaining request is sent to the CDN server again;
and receiving the resources sent by the CDN server.
3. The method for acquiring resources of claim 1, wherein after the step of sending the information for verifying the state of the CDN server to the CDN server, the method further comprises:
when the state information fed back by the CDN server is received and is normally operated, the state of the CDN server is determined to be normally operated, and when the state information fed back by the CDN server is that the CDN server cannot normally operate or the feedback information of the CDN server is not received, the state of the CDN server is determined to be abnormally operated.
4. The resource acquisition method of claim 1, wherein the step of selecting the source station server sending the resource acquisition request according to a preset rule comprises:
acquiring the resource types and the quantity stored by each source station server according to the source station server address;
comparing the resource type to be acquired in the resource acquisition request with the resource type stored by each source station server;
and selecting the source station server with the maximum quantity as the source station server sending the resource acquisition request from the resource types which are consistent with the resource types to be acquired.
5. An apparatus for resource acquisition, the apparatus comprising:
the monitoring module is used for integrating the resources to be acquired to obtain a resource list; generating a resource acquisition request through the resource list, sending the resource acquisition request to a CDN server, and monitoring whether a resource is acquired, wherein the resource acquisition request also comprises data acquisition permission;
the sending module is used for sending information for verifying the state of the CDN server to the CDN server when monitoring that the resources are not obtained; when the state information fed back by the CDN server indicates that the CDN server cannot normally operate, the resource obtaining request is sent to a source station server, and resources are obtained through the source station server;
the sending the resource obtaining request to a source station server, and obtaining resources through the source station server include:
acquiring a source station server address corresponding to the relevant resource according to the resource acquisition request;
judging whether a plurality of acquired source station server addresses exist or not;
when a plurality of the acquired source station server addresses are available, selecting the source station server sending the resource acquisition request according to a preset rule, wherein the preset rule is the type and the quantity of the resources stored by the source station server;
and sending the resource acquisition request to the source station server according to the acquired source station server address.
6. A resource acquisition device characterized in that the resource acquisition device comprises a resource acquisition program which, when executed by the resource acquisition device, implements the steps of the resource acquisition method according to any one of claims 1 to 4.
7. A computer-readable storage medium, having stored thereon a resource acquisition program which, when executed by a processor, implements the steps of the resource acquisition method according to any one of claims 1 to 4.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711415213.0A CN108200132B (en) | 2017-12-21 | 2017-12-21 | Resource acquisition method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711415213.0A CN108200132B (en) | 2017-12-21 | 2017-12-21 | Resource acquisition method, device, equipment and computer readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108200132A CN108200132A (en) | 2018-06-22 |
| CN108200132B true CN108200132B (en) | 2021-06-04 |
Family
ID=62583815
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711415213.0A Active CN108200132B (en) | 2017-12-21 | 2017-12-21 | Resource acquisition method, device, equipment and computer readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108200132B (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109769023B (en) * | 2019-01-16 | 2021-11-19 | 网宿科技股份有限公司 | Data transmission method, related server and storage medium |
| CN113014443B (en) * | 2019-12-19 | 2022-07-05 | 福建天泉教育科技有限公司 | Method and system for testing whether CDN (content delivery network) resources hit cache |
| CN112202631A (en) * | 2020-09-17 | 2021-01-08 | 北京金山云网络技术有限公司 | Resource access method, device and system, electronic equipment and storage medium |
| CN112217672B (en) * | 2020-09-30 | 2022-10-21 | 安徽极玩云科技有限公司 | Service processing system for CDN platform |
| CN114398659A (en) * | 2021-10-28 | 2022-04-26 | 上海哔哩哔哩科技有限公司 | A resource verification method, device, device and storage medium |
| CN117176553A (en) * | 2022-05-27 | 2023-12-05 | 华为技术有限公司 | Business disaster recovery methods, terminal equipment, software development kit servers and communication systems |
| CN116939039B (en) * | 2023-07-04 | 2025-11-21 | 亿点云计算(珠海)有限公司 | Cloud service providing method, device and storage medium |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101540775A (en) * | 2009-04-30 | 2009-09-23 | 华为技术有限公司 | Method and device for distributing contents and network system for distributing contents |
| CN104333584A (en) * | 2014-10-27 | 2015-02-04 | 深圳市东信时代信息技术有限公司 | CDN (Content Delivery Network) file delivery system and method |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170180470A1 (en) * | 2015-12-21 | 2017-06-22 | Le Holdings (Beijing) Co., Ltd. | Method and electronic device for sending CDN address |
-
2017
- 2017-12-21 CN CN201711415213.0A patent/CN108200132B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101540775A (en) * | 2009-04-30 | 2009-09-23 | 华为技术有限公司 | Method and device for distributing contents and network system for distributing contents |
| CN104333584A (en) * | 2014-10-27 | 2015-02-04 | 深圳市东信时代信息技术有限公司 | CDN (Content Delivery Network) file delivery system and method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108200132A (en) | 2018-06-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108200132B (en) | Resource acquisition method, device, equipment and computer readable storage medium | |
| CN111314141B (en) | Route updating method and device | |
| CN108881396B (en) | Network data loading method, device, equipment and computer storage medium | |
| CN109688280B (en) | Request processing method, request processing device, browser and storage medium | |
| CN110020367B (en) | Page rendering method and device | |
| EP3002927B1 (en) | Page redirection method, routing device, terminal device and system | |
| CN101071438A (en) | Capture server, distribution server, method and system for generating webpage capture | |
| CN106059825A (en) | Distributed system and configuration method | |
| CN104754073A (en) | Resource access method and device | |
| CN113900834B (en) | Data processing method, device, equipment and storage medium based on Internet of things technology | |
| CN108683668A (en) | Resource checksum method, apparatus, storage medium and equipment in content distributing network | |
| CN114039961A (en) | Message pushing method, device, server and storage medium based on WebSocket | |
| CN110795650A (en) | Webpage opening method and device and computer readable storage medium | |
| CN110674435A (en) | Page access method, server, terminal, electronic equipment and readable storage medium | |
| EP3528474B1 (en) | Webpage advertisement anti-shielding methods and content distribution network | |
| CN109086158B (en) | Abnormal cause analysis method and device and server | |
| US9059959B2 (en) | Client side management of HTTP sessions | |
| US7925934B2 (en) | Information providing system, information providing device, appropriateness judgment information generation method and appropriateness judgment information generation process program | |
| CN109977677A (en) | Vulnerability information collection method, device, equipment and readable storage medium storing program for executing | |
| CN112104703A (en) | Cookie management method, intermediate node and webvpn system | |
| CN113190228B (en) | Script file generation method and device and computer storage medium | |
| CN109391658B (en) | Account data synchronization method and equipment, storage medium and terminal thereof | |
| CN106941509B (en) | User information flow request method and device | |
| CN112637619A (en) | Live broadcast room set-top message determining method, device, equipment and storage medium | |
| CN104809122A (en) | Method and device for visiting web pages |
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 |