CN112153095A - CDN function module operation method, operation device, electronic equipment and storage medium - Google Patents

CDN function module operation method, operation device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112153095A
CN112153095A CN201910579778.5A CN201910579778A CN112153095A CN 112153095 A CN112153095 A CN 112153095A CN 201910579778 A CN201910579778 A CN 201910579778A CN 112153095 A CN112153095 A CN 112153095A
Authority
CN
China
Prior art keywords
domain name
function
module
operated
configuration information
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
CN201910579778.5A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201910579778.5A priority Critical patent/CN112153095A/en
Priority to PCT/CN2020/098178 priority patent/WO2020259608A1/en
Publication of CN112153095A publication Critical patent/CN112153095A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • H04L67/303Terminal profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Abstract

The embodiment of the invention provides a CDN function module operation method, an operation device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a request message sent by a client; acquiring pre-stored functional modules to be operated corresponding to the domain name and the operation sequence of each functional module to be operated; acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name; and operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated. The embodiment of the invention can reduce the calculation amount of the edge node when the functional module is operated, thereby optimizing the processing performance of the edge node.

Description

CDN function module operation method, operation device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a CDN function module operation method, an operation apparatus, an electronic device, and a storage medium.
Background
A CDN (Content Delivery Network) is a novel Network architecture, as shown in fig. 1, a user terminal sends an access request to a central server, the central server sends an IP address of an edge node closest to the user terminal after receiving the access request, the user terminal sends a data acquisition request (for example, an HTTP request) to an edge node corresponding to the IP address, and the edge node returns response Content to the user terminal after receiving the data acquisition request.
After an edge node in the existing CDN receives an HTTP request, traversing and judging the switch identification of each functional module in a full configuration file according to the operation sequence of each functional module on the edge node, if the judgment is passed, operating the functional module, and if the judgment is not passed, judging the switch identification of the next functional module until the judgment is finished; wherein, the full configuration file comprises: switch identification of each functional module and configuration parameters of each functional module.
Since the function configured for each domain name is different, in the prior art, all functional modules on the edge node are traversed for each http request, for example: the total number of the functional modules on the edge node is 300, 300 are the sum of the functions of all domain names, and the a domain name may only use 10, in this case, for the a domain name, 300 functional modules need to be traversed, 290 functional modules all need to detect a switch identifier, and execute the next functional module after the judgment fails, which inevitably causes the waste of computing resources and the increase of the processing time of the edge node, and along with the increase of the functional modules in the edge node, the functional modules that need to be traversed also increase, and further causes the waste of computing resources and the increase of the processing time of the edge node.
Disclosure of Invention
Embodiments of the present invention provide a CDN function module operating method, an operating apparatus, an electronic device, and a storage medium, so as to reduce computation resource waste and processing time of an edge node. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a CDN function module operating method, which is applied to an edge node in a content delivery network CDN, and includes:
acquiring a request message sent by a client, wherein the request message comprises domain name information;
acquiring a pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and operating each functional module to be operated according to the operation sequence and the configuration information of each functional module to be operated.
Optionally, the step of obtaining a pre-stored operation sequence of each function module to be operated corresponding to the domain name includes:
according to the domain names, acquiring function linked lists corresponding to the domain names from pre-stored preset function linked lists corresponding to the domain names; and the function linked list is used for describing the operation sequence of each functional module to be operated corresponding to the domain name.
Optionally, before obtaining the request packet sent by the client, the method further includes:
generating a second configuration file corresponding to the domain name and a function linked list corresponding to the domain name based on the first configuration file corresponding to the edge node; the first configuration file comprises configuration information of each functional module in the edge node;
and storing the generated second configuration file corresponding to the domain name and the function linked list in a shared memory.
Optionally, the step of generating a second configuration file corresponding to the domain name based on the first configuration file corresponding to the edge node includes:
traversing the configuration information in the first configuration file, and dividing the configuration information belonging to different domain names;
and generating a second configuration file corresponding to the domain name based on the divided configuration information.
Optionally, the step of generating the function linked list corresponding to the domain name includes:
searching preset identifications in a second configuration file corresponding to the domain name, wherein one preset identification corresponds to one functional module;
determining the name of the Lua file corresponding to the searched preset identifier in a preset function mapping table, wherein the mapping relation between the preset identifier and the Lua file is stored in the function mapping table;
and writing the determined names of the Lua files into a function linked list corresponding to the domain name according to the operation sequence of the function modules corresponding to the Lua files to obtain the function linked list corresponding to the domain name.
Optionally, the step of obtaining pre-stored configuration information of each function module to be operated corresponding to the domain name includes:
and acquiring configuration information of each functional module to be operated corresponding to the domain name from the second configuration file stored in the shared memory.
In a second aspect, an embodiment of the present invention provides a CDN function module operating apparatus, which is applied to an edge node in a content delivery network CDN, and includes:
the first acquisition module is used for acquiring a request message sent by a client, wherein the request message comprises domain name information;
the second acquisition module is used for acquiring the pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
the third acquisition module is used for acquiring the pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and the operation module is used for operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
Optionally, the second obtaining module is specifically configured to:
according to the domain names, acquiring function linked lists corresponding to the domain names from pre-stored preset function linked lists corresponding to the domain names; and the function linked list is used for describing the operation sequence of each functional module to be operated corresponding to the domain name.
Optionally, the apparatus further comprises:
a generating module, configured to generate a second configuration file corresponding to the domain name based on the first configuration file corresponding to the edge node, and generate a function linked list corresponding to the domain name; the first configuration file comprises configuration information of each functional module in the edge node;
and the storage module is used for storing the generated second configuration file corresponding to the domain name and the function linked list in a shared memory.
Optionally, the generating module includes a second configuration file generating sub-module, and the second configuration file generating sub-module includes:
the dividing unit is used for traversing the configuration information in the first configuration file and dividing the configuration information belonging to different domain names;
and the generating unit is used for generating a second configuration file corresponding to the domain name based on the divided configuration information.
Optionally, the generating module includes a function chain table generating sub-module, and the function chain table generating sub-module includes:
the searching unit is used for searching preset identifications in a second configuration file corresponding to the domain name, wherein one preset identification corresponds to one functional module;
the determining unit is used for determining the name of the searched Lua file corresponding to the preset identifier in a preset function mapping table, wherein the mapping relation between the preset identifier and the Lua file is stored in the function mapping table;
and the writing unit is used for writing the determined names of the Lua files into the function linked list corresponding to the domain name according to the operation sequence of the function modules corresponding to the Lua files to obtain the function linked list corresponding to the domain name.
Optionally, the second obtaining module is specifically configured to:
and acquiring configuration information of each functional module to be operated corresponding to the domain name from the second configuration file stored in the shared memory.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the method steps of the CDN function module running method provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of the CDN function module operating method provided in the first aspect are implemented.
In a fifth aspect, an embodiment of the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the method steps of the CDN function module running method provided in the first aspect.
In a sixth aspect, an embodiment of the present invention further provides a computer program, which when running on a computer, causes the computer to execute the method steps of the CDN function module running method provided in the first aspect.
After the request message sent by the client is obtained, the edge node can obtain the pre-stored function module to be operated corresponding to the domain name and the operation sequence of each function module to be operated, and obtain the pre-stored configuration information of each function module to be operated corresponding to the domain name, and then operate each function module to be operated according to the operation sequence and the configuration information of each function module to be operated, and because the switch identifiers of each function module in the full configuration file are not required to be subjected to traversal judgment when the function module to be operated of the domain name is determined, the waste of computing resources of the edge node can be reduced, the processing time is shortened, and the processing performance of the edge node is optimized. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of information interaction between a user terminal and an edge node in a CDN;
fig. 2 is a schematic diagram illustrating a process of traversing a function module by a conventional CDN function module operation method;
fig. 3 is a first flowchart of a CDN function module operation method according to an embodiment of the present invention;
fig. 4 is a second flowchart of a CDN function module operation method according to an embodiment of the present invention;
fig. 5 is a third flowchart illustrating an operation method of a CDN function module according to an embodiment of the present invention;
FIG. 6 is a flow chart illustrating a process of establishing a function linked list according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a CDN function module operating device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a CDN function module operating device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a second configuration file generation submodule in the CDN function module operating apparatus according to the embodiment of the present invention;
fig. 10 is a schematic structural diagram of a function chain table generation submodule in the CDN function module operating apparatus according to the embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the existing CDN function module operation method, as shown in fig. 2, after receiving a request packet for a certain domain name, an edge node needs to traverse all switch identifiers of function modules in a full configuration file, for example, switch identifiers of 12 function modules in fig. 2 need to be traversed, and for the domain name a, all the function modules 1, 3, 4, 6, 7, 8, 9, 11, and 12 are skipped when only detecting a switch identifier, and only the function modules 2, 5, and 10 actually need to be operated, and these computations are actually computing resources of a processor in the edge node that are consumed without end.
In view of this, as shown in fig. 3, an embodiment of the present invention provides a CDN function module operation method, which is applied to an edge node in a CDN, and the method may include the following steps:
s101, acquiring a request message sent by a client.
The edge node in the embodiment of the present invention may be one of nodes in a CDN network, and it can be understood that the edge node may obtain request messages sent by different clients, and the request messages sent by different clients may include different domain name information, for example, the request message sent by the client 1 carries information that a domain name is ksyun.
Specifically, the request packet may be a segment of request packet beginning with http or https and carrying information of the domain name.
In the embodiment of the invention, the edge node can be operated by adopting a Nginx-Lua system based on the OpenResty technology, wherein Nginx is a high-performance HTTP server and a reverse proxy server, Lua is a lightweight and embeddable script language, and the Lua is embedded into Nginx, so that a script program can be written by using Lua, and the technology is the OpenResty technology. In an edge node operated based on the nginnx-Lua system, when a certain function is implemented, it is usually implemented by operating a script program code, that is, the functional module in the embodiment of the present invention, and by executing the functional module, a corresponding service function is implemented.
S102, obtaining the pre-stored operation sequence of each functional module to be operated corresponding to the domain name.
After the edge node obtains the request packet sent by the client, a plurality of function modules to be operated stored in the edge node can be operated to realize different functions, and the edge node usually operates in units of domain names (host) when operating the function modules. The functional module to be operated may refer to a functional module that needs to be operated to implement a function corresponding to the domain name.
For example, if a total number of 300 functional modules are stored in one edge node, 10 functional modules may be operated for the domain name corresponding to the request packet to implement 10 functions, where the 10 functional modules are to-be-operated functional modules.
It can be understood that one edge node may receive a request packet containing information of different domain names to implement functions corresponding to the different domain names.
For example, if the domain name is ksyun.com, the request packet may be a segment of request packet beginning with http or https and carrying the domain name ksyun.com, and for the domain name ksyun.com, 10 functional modules of 300 functional modules may be operated, thereby implementing 10 functions; com, 5 of the 300 function modules may be run to implement 5 functions.
As can be seen from the above examples, the embodiments of the present invention may implement multiple functions of a domain name, for example, for a domain name ksyun.
However, before operating each functional module for the domain name, the edge node needs to determine which of all the functional modules stored therein are to-be-operated functional modules corresponding to the domain name, and an operation sequence of the to-be-operated functional modules.
For example, there are 300 functional modules stored in the edge node, where the 300 functional modules are the sum of the functional modules of all domain names, and only 10 of the domain names a may need to be run, so that only the 10 functional modules to be run need to be confirmed, and since the functional modules to be run are run according to a certain sequence, the running sequence of the functional modules to be run needs to be determined. Of course, the operating sequence may be preset.
If the existing functional module operation method is adopted, the above 300 functional modules need to be traversed and judged one by one, and these calculations are actually computing resources of processors in endless consuming edge nodes, so that the processing time of the whole CDN network is increased, which may cause delay of response content returned to the user terminal.
According to the foregoing embodiment, it can be known that different functions implemented for one domain name may correspond to different function modules, and in the embodiment of the present invention, names of function modules to be operated corresponding to the domain names and operation sequences of the function modules to be operated may be stored in advance, so that after a request packet sent by a client is acquired, the function modules to be operated of the domain name and the operation sequences of the function modules to be operated are determined directly through prestored information, without traversing switch identifiers of the function modules.
Referring to fig. 3, in S103, pre-stored configuration information of each functional module to be operated corresponding to the domain name is obtained.
In the embodiment of the present invention, the configuration information of each to-be-operated function module corresponding to the domain name may be pre-stored, for example, the edge node may read the configuration information of each to-be-operated function module corresponding to the domain name from a pre-stored second configuration file.
It can be understood that after determining the function module to be operated corresponding to the domain name, the configuration information of each function module to be operated corresponding to the domain name, which is pre-stored, may be obtained, for example, the configuration information of the network speed limit value is obtained: 100 kb/S.
And S104, operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
After determining the functional modules to be operated of the domain name and the operation sequence thereof and acquiring the configuration information thereof, each functional module to be operated can be operated, thereby realizing each function of the domain name.
For example, when one of the to-be-operated function modules of the domain name is a network speed limit function module, the configuration parameters stored in the configuration file may be: the network speed limit value can be used for operating the network speed limit function module.
For example, when another functional module to be operated of the domain name is an add-response head module (the response header is a part of the header field in an http request, and the operation sequence of the module is located behind the network speed limiting functional module), then the configuration parameters saved in the configuration file may be: the name of the response head and the key value are required to be added, and the response head module can be added by using the parameter operation.
As an optional implementation manner of the embodiment of the present invention, on the basis of the flow shown in fig. 3, as shown in fig. 4, the step S102 may specifically be:
s102', according to the domain names, acquiring the function linked list corresponding to the domain names from a plurality of preset function linked lists corresponding to the pre-stored domain names.
In the embodiment of the invention, the function linked lists corresponding to the domain names can be preset aiming at the domain names, and the function linked lists are prestored, so that the function linked lists corresponding to the domain names can be obtained from the prestored preset function linked lists corresponding to the domain names.
The function linked list describes an operation sequence of each function module to be operated corresponding to the domain name, wherein one function linked list may include names of Lua files corresponding to each function module to be operated, the names may be names of storage paths of the Lua files corresponding to the function modules, and the names of the Lua files corresponding to each function module to be operated may be written in according to a preset operation sequence of each function module to be operated, that is, the names of the Lua files corresponding to each function module may correspond to the preset operation sequence of each function module to be operated.
As an optional implementation manner in the embodiment of the present invention, on the basis of the flow shown in fig. 4, as shown in fig. 5, the CDN function module operation method in the embodiment of the present invention may further include:
s201, generating a second configuration file corresponding to the domain name based on the first configuration file corresponding to the edge node, and generating a function linked list corresponding to the domain name.
The edge node may have a preset first configuration file, and the configuration information in the first configuration file may be stored as a basic unit according to a domain name (host), that is, the first configuration file may store an operation sequence and configuration parameters of all the function modules, and the configuration information corresponding to different domain names may include a switch identifier for calling each function module.
It should be noted that the switch identifier may be considered as an attribute value corresponding to a function module, for example, a function module is a function module for adding a header, and the attribute may include: attribute 1 is add header; attribute 2 is the name of the header, and attribute 3 is the value of the header; attribute 1 adds a header to be considered as a switch identification for the function module.
As an optional implementation manner of the embodiment of the present invention, the configuration information belonging to different domain names may be divided by traversing the configuration information in the first configuration file, and then a second configuration file corresponding to each domain name is generated based on the divided configuration information.
And S202, storing the generated second configuration file corresponding to the domain name and the function linked list in a shared memory.
The second configuration file and the function linked list corresponding to the domain name can be stored in the shared memory, so that when a Nginx process of the edge node is started or reloaded (reloaded), the second configuration file and the function linked list which are previously stored in the shared memory cannot be deleted along with restarting or reloading, the edge node can use the second configuration file and the function linked list which are previously stored to operate the function module to be operated until the function linked list in the shared memory is updated, the situation that the configuration file and the function linked list cannot be read when the Nginx process of the edge node is started or reloaded can be avoided, and the operation stability of the edge node is improved.
Optionally, when the function linked list corresponding to the domain name is obtained from a plurality of function linked lists stored in the shared memory, the function linked list can be obtained by traversing each function linked list in the shared memory, and the speed of traversing the function linked list is faster because the number of the traversed function linked lists is less than that of traversing the switch identifiers; the domain name may also be searched from the shared memory by using the domain name as a keyword, to obtain a function linked list corresponding to the domain name, but the invention is not limited thereto.
After acquiring the function linked list corresponding to the domain name from the shared memory, the edge node can acquire the name of the Lua file of each functional module to be operated stored in the function linked list by reading the function linked list, thereby determining each functional module to be operated of the domain name.
In the embodiment of the present invention, as shown in fig. 6, the step of generating the function linked list specifically includes:
s2011, searches for a preset identifier in a second configuration file corresponding to the domain name.
In the embodiment of the present invention, an identifier may be added to each functional module in advance in the second configuration file, for example: the identifier may be a key attribute value of the function module, and the key attribute value may be considered as a switch for calling the function module, for example, in an attribute corresponding to one function module, attribute 1 is to add a header to the function module; attribute 2 is the name of the header, and attribute 3 is the value of the header; and adding a header as the key attribute value of the functional module, so that after the edge node finds the identifier (key attribute value) in the second configuration file corresponding to the domain name, the functional module corresponding to the edge node can be determined to be to-be-operated.
And S2012, determining the name of the Lua file corresponding to the searched preset identifier in a preset function mapping table.
Because the corresponding relationship between the preset identifier and the Lua file can be stored in the preset function mapping table, after the preset identifier is found in the above step, the name of the Lua file corresponding to the preset identifier can be further found in the function mapping table.
And S2013, writing the determined names of the Lua files into the function linked list corresponding to the domain name according to the operation sequence of the function modules corresponding to the Lua files to obtain the function linked list corresponding to the domain name.
After the operation sequence of the function modules corresponding to the Lua files is determined, the names of the Lua files of the function modules corresponding to the domain name can be written into the function linked list corresponding to the domain name based on the determined operation sequence, that is, the function linked list corresponding to the current domain name has recorded therein: the names of the Lua files of the functional modules corresponding to the domain name and the recorded names of the Lua files carry the running sequence information of the functional modules, that is, the functional modules to be run corresponding to the domain name and the running sequence of the functional modules to be run can be determined according to the names of the Lua files and the positions of the names of the Lua files in the function linked list.
As an optional implementation manner in the embodiment of the present invention, when the function linked list is established, names of the function linked lists may be named as the same as domain names, for example, the function linked list corresponding to the domain name a may be directly named as the function linked list a, so that a corresponding relationship between the function linked list and the domain names is established. Of course, in addition to the implementation manners shown in the illustrated examples, the manners of implementing the features of establishing the correspondence between the function linked list and the domain name are all within the protection scope of the embodiment of the present application.
As an optional implementation manner of the embodiment of the present invention, the establishing process of the function mapping table may be:
when the Nginx process of the edge node is started or reloaded, the identifiers (key attribute values) of all the functional modules are obtained from the second configuration file, the corresponding relation is established between each identifier and the Lua file name of each functional module, and the established corresponding relation is stored in a form of a table 1.
Table 1 contents of function mapping table
Figure BDA0002112836700000121
As an optional implementation manner of the embodiment of the present invention, a second configuration file corresponding to a domain name may be obtained from second configuration files of the domain names stored in a shared memory, and configuration information of each function module to be operated corresponding to the domain name is read, so that the reading speed of the configuration information is increased by using the characteristic of high memory read-write performance.
In the CDN function module operation method provided in the embodiment of the present invention, after obtaining the request packet sent by the client, the edge node can obtain the pre-stored function modules to be operated corresponding to the domain name and the operation order of each function module to be operated, and obtain the pre-stored configuration information of each function module to be operated corresponding to the domain name, and then operate each function module to be operated according to the operation order and the configuration information of each function module to be operated.
Corresponding to the above method embodiment, the embodiment of the present invention also provides a corresponding device embodiment.
As shown in fig. 7, an embodiment of the present invention provides a CDN function module operating device, which corresponds to the flow shown in fig. 3, and includes:
the first obtaining module 301 is configured to obtain a request packet sent by a client, where the request packet includes information of a domain name.
A second obtaining module 302, configured to obtain a pre-stored operation sequence of each function module to be operated corresponding to the domain name.
A third obtaining module 303, configured to obtain pre-stored configuration information of each function module to be operated, where the configuration information corresponds to a domain name.
And the operation module 304 is configured to operate each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
The second obtaining module is specifically configured to:
according to the domain names, acquiring a function linked list corresponding to the domain names from a preset function linked list corresponding to each pre-stored domain name; the function linked list is used for describing the operation sequence of each functional module to be operated corresponding to the domain name.
As an optional implementation manner of the embodiment of the present invention, on the basis of the device structure shown in fig. 7, as shown in fig. 8, the CDN function module operating device according to the embodiment of the present invention further includes:
a generating module 401, configured to generate a second configuration file corresponding to the domain name based on the first configuration file corresponding to the edge node, and generate a function linked list corresponding to the domain name; the first configuration file includes configuration information of each functional module in the edge node.
A storage module 402, configured to store the generated second configuration file corresponding to the domain name and the function linked list in the shared memory.
Wherein, the generating module comprises: a second configuration file generation submodule and a function chain table generation submodule, as shown in fig. 9, where the second configuration file generation submodule includes:
the dividing unit 4011 is configured to traverse the configuration information in the first configuration file, and divide the configuration information belonging to different domain names.
The generating unit 4012 is configured to generate a second configuration file corresponding to the domain name based on the divided configuration information.
As shown in fig. 10, the function chain table generation submodule includes:
the searching unit 4013 is configured to search preset identifiers in a second configuration file corresponding to the domain name, where one preset identifier corresponds to one function module.
The determining unit 4014 is configured to determine, in a preset function mapping table, a name of the Lua file corresponding to the found preset identifier, where a mapping relationship between the preset identifier and the Lua file is stored in the function mapping table.
And the writing unit 4015 is configured to write the determined names of the Lua files into the function linked list corresponding to the domain name according to the operation sequence of the function modules corresponding to the Lua files, so as to obtain the function linked list corresponding to the domain name.
The second obtaining module is specifically configured to:
and acquiring the configuration information of each functional module to be operated corresponding to the domain name from a second configuration file stored in the shared memory.
According to the CDN function module operation device provided by the embodiment of the invention, after the request message sent by the client is obtained, the edge node can obtain the pre-stored function modules to be operated corresponding to the domain name and the operation sequence of each function module to be operated, and obtain the pre-stored configuration information of each function module to be operated corresponding to the domain name, so that each function module to be operated is operated according to the operation sequence and the configuration information of each function module to be operated.
It should be noted that the CDN function module running device may be located in an edge node of the CDN, but is not limited to this.
An embodiment of the present invention further provides an electronic device, which may be specifically a server, as shown in fig. 11, where the device 500 includes a processor 501 and a machine-readable storage medium 502, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the following steps:
acquiring a request message sent by a client, wherein the request message comprises domain name information;
acquiring a pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
The machine-readable storage medium may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
According to the electronic device provided by the embodiment of the invention, after the request message sent by the client is acquired, the edge node can acquire the pre-stored function modules to be operated corresponding to the domain name and the operation sequence of each function module to be operated, and the pre-stored configuration information of each function module to be operated corresponding to the domain name, so that each function module to be operated is operated according to the operation sequence and the configuration information of each function module to be operated.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program is configured to perform the following steps:
acquiring a request message sent by a client, wherein the request message comprises domain name information;
acquiring a pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
According to the computer-readable storage medium provided by the embodiment of the invention, after the request message sent by the client is acquired, the edge node can acquire the pre-stored function modules to be operated corresponding to the domain name and the operation sequence of each function module to be operated, and acquire the pre-stored configuration information of each function module to be operated corresponding to the domain name, and then operate each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
Embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of:
acquiring a request message sent by a client, wherein the request message comprises domain name information;
acquiring a pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
According to the computer program product containing the instructions, after the request message sent by the client is obtained, the edge node can obtain the pre-stored function modules to be operated corresponding to the domain name and the operation sequence of each function module to be operated, and obtain the pre-stored configuration information of each function module to be operated corresponding to the domain name, and then operate each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
Embodiments of the present invention further provide a computer program, which when running on a computer, causes the computer to execute the following steps:
acquiring a request message sent by a client, wherein the request message comprises domain name information;
acquiring a pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
According to the computer program containing the instructions, after the request message sent by the client is obtained, the edge node can obtain the pre-stored function modules to be operated corresponding to the domain name and the operation sequence of each function module to be operated, and obtain the pre-stored configuration information of each function module to be operated corresponding to the domain name, and then operate each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
For the apparatus/electronic device/storage medium embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to part of the description of the method embodiment.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (14)

1. A CDN function module operation method is applied to an edge node in a Content Delivery Network (CDN), and comprises the following steps:
acquiring a request message sent by a client, wherein the request message comprises domain name information;
acquiring a pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
acquiring pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and operating each functional module to be operated according to the operation sequence and the configuration information of each functional module to be operated.
2. The method according to claim 1, wherein the step of obtaining the pre-stored operation sequence of each functional module to be operated corresponding to the domain name comprises:
according to the domain names, acquiring function linked lists corresponding to the domain names from pre-stored preset function linked lists corresponding to the domain names; and the function linked list is used for describing the operation sequence of each functional module to be operated corresponding to the domain name.
3. The method of claim 2, wherein prior to obtaining the request message sent by the client, the method further comprises:
generating a second configuration file corresponding to the domain name and a function linked list corresponding to the domain name based on the first configuration file corresponding to the edge node; the first configuration file comprises configuration information of each functional module in the edge node;
and storing the generated second configuration file corresponding to the domain name and the function linked list in a shared memory.
4. The method according to claim 3, wherein the step of generating a second profile corresponding to the domain name based on the first profile corresponding to the edge node comprises:
traversing the configuration information in the first configuration file, and dividing the configuration information belonging to different domain names;
and generating a second configuration file corresponding to the domain name based on the divided configuration information.
5. The method according to claim 3, wherein the step of generating the function linked list corresponding to the domain name comprises:
searching preset identifications in a second configuration file corresponding to the domain name, wherein one preset identification corresponds to one functional module;
determining the name of the Lua file corresponding to the searched preset identifier in a preset function mapping table, wherein the mapping relation between the preset identifier and the Lua file is stored in the function mapping table;
and writing the determined names of the Lua files into a function linked list corresponding to the domain name according to the operation sequence of the function modules corresponding to the Lua files to obtain the function linked list corresponding to the domain name.
6. The method according to claim 3, wherein the step of obtaining pre-stored configuration information of each functional module to be operated corresponding to the domain name comprises:
and acquiring configuration information of each functional module to be operated corresponding to the domain name from the second configuration file stored in the shared memory.
7. A CDN function module operating device, configured to be applied to an edge node in a content delivery network CDN, the device including:
the first acquisition module is used for acquiring a request message sent by a client, wherein the request message comprises domain name information;
the second acquisition module is used for acquiring the pre-stored operation sequence of each functional module to be operated corresponding to the domain name;
the third acquisition module is used for acquiring the pre-stored configuration information of each functional module to be operated corresponding to the domain name;
and the operation module is used for operating each function module to be operated according to the operation sequence and the configuration information of each function module to be operated.
8. The apparatus of claim 7, wherein the second obtaining module is specifically configured to:
according to the domain names, acquiring function linked lists corresponding to the domain names from pre-stored preset function linked lists corresponding to the domain names; and the function linked list is used for describing the operation sequence of each functional module to be operated corresponding to the domain name.
9. The apparatus of claim 8, further comprising:
a generating module, configured to generate a second configuration file corresponding to the domain name based on the first configuration file corresponding to the edge node, and generate a function linked list corresponding to the domain name; the first configuration file comprises configuration information of each functional module in the edge node;
and the storage module is used for storing the generated second configuration file corresponding to the domain name and the function linked list in a shared memory.
10. The apparatus of claim 9, wherein the generating module comprises a second configuration file generating sub-module, and wherein the second configuration file generating sub-module comprises:
the dividing unit is used for traversing the configuration information in the first configuration file and dividing the configuration information belonging to different domain names;
and the generating unit is used for generating a second configuration file corresponding to the domain name based on the divided configuration information.
11. The apparatus of claim 9, wherein the generating module comprises a function chain table generating submodule, and wherein the function chain table generating submodule comprises:
the searching unit is used for searching preset identifications in a second configuration file corresponding to the domain name, wherein one preset identification corresponds to one functional module;
the determining unit is used for determining the name of the searched Lua file corresponding to the preset identifier in a preset function mapping table, wherein the mapping relation between the preset identifier and the Lua file is stored in the function mapping table;
and the writing unit is used for writing the determined names of the Lua files into the function linked list corresponding to the domain name according to the operation sequence of the function modules corresponding to the Lua files to obtain the function linked list corresponding to the domain name.
12. The apparatus of claim 9, wherein the second obtaining module is specifically configured to:
and acquiring configuration information of each functional module to be operated corresponding to the domain name from the second configuration file stored in the shared memory.
13. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to perform method steps of the CDN functional module execution method of any one of claims 1-6.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of the CDN function module execution method of any one of claims 1-6.
CN201910579778.5A 2019-06-28 2019-06-28 CDN function module operation method, operation device, electronic equipment and storage medium Pending CN112153095A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910579778.5A CN112153095A (en) 2019-06-28 2019-06-28 CDN function module operation method, operation device, electronic equipment and storage medium
PCT/CN2020/098178 WO2020259608A1 (en) 2019-06-28 2020-06-24 Cdn functional module running method and running apparatus, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910579778.5A CN112153095A (en) 2019-06-28 2019-06-28 CDN function module operation method, operation device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112153095A true CN112153095A (en) 2020-12-29

Family

ID=73891562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910579778.5A Pending CN112153095A (en) 2019-06-28 2019-06-28 CDN function module operation method, operation device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112153095A (en)
WO (1) WO2020259608A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112995348A (en) * 2021-05-12 2021-06-18 北京金山云网络技术有限公司 Control method, device and system of Internet of things equipment
CN114244714A (en) * 2021-12-14 2022-03-25 北京金山云网络技术有限公司 Domain name configuration management method, device and system and computer readable storage medium
CN114461296A (en) * 2021-12-29 2022-05-10 天翼云科技有限公司 OpenResty-based service platform development and access method

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113300936B (en) * 2021-02-01 2023-04-14 阿里巴巴集团控股有限公司 CDN node, edge node signaling adaptation method, device and storage medium
CN113286014B (en) * 2021-05-24 2022-07-08 平安普惠企业管理有限公司 Dynamic configuration method and device of basic domain name and related equipment
CN114020346B (en) * 2021-09-29 2023-07-18 苏州浪潮智能科技有限公司 Configuration file processing method and device, electronic equipment and storage medium
CN114257503A (en) * 2021-11-19 2022-03-29 网宿科技股份有限公司 Method, server, system and storage medium for accelerating domain name deployment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377059A (en) * 2012-04-23 2013-10-30 阿里巴巴集团控股有限公司 Function module dynamic loading method and device based on jQuery framework
EP3190776A4 (en) * 2015-11-11 2017-07-12 LE Holdings (Beijing) Co., Ltd. Method for selecting content delivery network (cdn) node, and apparatus thereof
CN108769743A (en) * 2018-05-11 2018-11-06 中兴通讯股份有限公司 A kind of video playing control method, system, node and computer storage media
CN109150930A (en) * 2017-06-15 2019-01-04 北京金山云网络技术有限公司 Configuration information loading method and device, method for processing business and device
CN109582301A (en) * 2018-12-03 2019-04-05 深圳前海微众银行股份有限公司 Method for processing business, device, equipment and the medium of task based access control scheduling system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392008B (en) * 2014-12-19 2017-12-05 北京奇虎科技有限公司 Web data acquisition methods, browser client and CDN server
US20160380975A1 (en) * 2015-06-24 2016-12-29 Cisco Technology, Inc. Domain Name Service Redirection for a Content Delivery Network with Security as a Service
CN110968356B (en) * 2018-09-29 2023-09-29 北京金山云网络技术有限公司 Method and device for acquiring configuration information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377059A (en) * 2012-04-23 2013-10-30 阿里巴巴集团控股有限公司 Function module dynamic loading method and device based on jQuery framework
EP3190776A4 (en) * 2015-11-11 2017-07-12 LE Holdings (Beijing) Co., Ltd. Method for selecting content delivery network (cdn) node, and apparatus thereof
CN109150930A (en) * 2017-06-15 2019-01-04 北京金山云网络技术有限公司 Configuration information loading method and device, method for processing business and device
CN108769743A (en) * 2018-05-11 2018-11-06 中兴通讯股份有限公司 A kind of video playing control method, system, node and computer storage media
CN109582301A (en) * 2018-12-03 2019-04-05 深圳前海微众银行股份有限公司 Method for processing business, device, equipment and the medium of task based access control scheduling system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112995348A (en) * 2021-05-12 2021-06-18 北京金山云网络技术有限公司 Control method, device and system of Internet of things equipment
CN112995348B (en) * 2021-05-12 2021-09-07 北京金山云网络技术有限公司 Control method, device and system of Internet of things equipment
CN114244714A (en) * 2021-12-14 2022-03-25 北京金山云网络技术有限公司 Domain name configuration management method, device and system and computer readable storage medium
CN114244714B (en) * 2021-12-14 2024-04-09 北京金山云网络技术有限公司 Domain name configuration management method, device and system and computer readable storage medium
CN114461296A (en) * 2021-12-29 2022-05-10 天翼云科技有限公司 OpenResty-based service platform development and access method
CN114461296B (en) * 2021-12-29 2024-01-02 天翼云科技有限公司 Openresty-based service platform development and access method

Also Published As

Publication number Publication date
WO2020259608A1 (en) 2020-12-30

Similar Documents

Publication Publication Date Title
CN112153095A (en) CDN function module operation method, operation device, electronic equipment and storage medium
US10250526B2 (en) Method and apparatus for increasing subresource loading speed
US7496566B2 (en) Priority based LDAP service publication mechanism
CN113132443B (en) Resource acquisition method and device and node equipment in CDN (content delivery network)
JP6215850B2 (en) Method and apparatus for user recognition and information distribution
CN109951323B (en) Log analysis method and system
US10474185B2 (en) Timestamp alignment across a plurality of computing devices
CN108491715B (en) Terminal fingerprint database generation method and device and server
CN109951393B (en) Network segment searching method and device
US20170339252A1 (en) Generating a response to a client device in an internet of things domain
WO2017166524A1 (en) Domain name parsing method and apparatus
CN110955460B (en) Service process starting method and device, electronic equipment and storage medium
CN112182328A (en) Method and device for expanding search engine, electronic equipment and storage medium
CN115714775A (en) Load balancing method and device
CN112131435B (en) Super node determining method, device, electronic equipment and storage medium
US8732320B2 (en) Fast content-based routing
CN112532414B (en) Method, device, equipment and computer storage medium for determining ISP attribution
CN113411364B (en) Resource acquisition method and device and server
CN107229699B (en) System and method for improving search experience of mobile terminal user
CN105978865B (en) application package name verification method and device
JP6429755B2 (en) Correlated event extraction program, apparatus and method
CN106686156B (en) Internet audio and video domain name resolution method and device
CN116701410B (en) Method and system for storing memory state data for data language of digital networking
CN112395521B (en) Page processing method, page processing device, electronic equipment and computer readable storage medium
JP2005071115A (en) Registration/retrieval method for object in p2p environment and program therefor

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20201229

RJ01 Rejection of invention patent application after publication