WO2020259608A1 - Cdn functional module running method and running apparatus, and electronic device and storage medium - Google Patents

Cdn functional module running method and running apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2020259608A1
WO2020259608A1 PCT/CN2020/098178 CN2020098178W WO2020259608A1 WO 2020259608 A1 WO2020259608 A1 WO 2020259608A1 CN 2020098178 W CN2020098178 W CN 2020098178W WO 2020259608 A1 WO2020259608 A1 WO 2020259608A1
Authority
WO
WIPO (PCT)
Prior art keywords
domain name
module
run
function
functional module
Prior art date
Application number
PCT/CN2020/098178
Other languages
French (fr)
Chinese (zh)
Inventor
王永强
Original Assignee
北京金山云网络技术有限公司
北京金山云科技有限公司
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 北京金山云网络技术有限公司, 北京金山云科技有限公司 filed Critical 北京金山云网络技术有限公司
Publication of WO2020259608A1 publication Critical patent/WO2020259608A1/en

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

Definitions

  • This application relates to the field of data communication technology, and in particular to a CDN function module operating method, operating device, electronic equipment, and storage medium.
  • CDN Content Delivery Network
  • the user terminal sends an access request to the central server. After receiving the access request, the central server sends the user terminal the closest distance to the user terminal.
  • the user terminal sends a data acquisition request (such as an HTTP request) to the edge node corresponding to the IP address, and the edge node returns the response content to the user terminal after receiving the data acquisition request.
  • a data acquisition request such as an HTTP request
  • the edge node in the existing CDN realizes the functions configured in advance for the domain name carried in the HTTP request by running one or more functional modules.
  • Each functional module can be implemented through a script file. Implementation, running any functional module specifically refers to executing a script file used to implement the functional module.
  • the edge node After receiving the HTTP request, the edge node obtains the full configuration file, and traverses the switch identification of each functional module in the full configuration file according to the running sequence of the functional modules on the edge node. If the judgment is passed, that is If the switch flag is an open flag, the function module is run. If the judgment is not passed, that is, the switch flag is an off flag, then the switch flag of the next functional module is judged until the judgment ends.
  • the obtained full configuration file includes: for each domain name, the switch identification of each functional module and the configuration parameters of each functional module, the configuration parameters of each functional module are required by the functional module at runtime The parameters, that is, the parameters that need to be configured to the script file.
  • the purpose of the embodiments of the present application is to provide a CDN function module operating method, operating device, electronic equipment, and storage medium, so as to reduce the waste of computing resources and processing time of edge nodes.
  • the specific technical solutions are as follows:
  • the embodiment of the present application provides a CDN function module operation method, which is applied to an edge node in a content distribution network CDN, including: obtaining a request message sent by a client, the request message including the target domain name Information; obtain the pre-stored operating sequence of each functional module to be run corresponding to the target domain name; obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name; according to the obtained operation of each functional module to be run Sequence and configuration information, run each functional module to be run corresponding to the target domain name.
  • an embodiment of the present application provides a CDN function module operation device, which is applied to an edge node in a content distribution network CDN, and includes: a first acquisition module for acquiring a request message sent by a client.
  • the message includes the information of the target domain name;
  • the second acquisition module is used to acquire the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
  • the third acquisition module is used to acquire the pre-stored information corresponding to the target domain name Configuration information of each functional module to be run;
  • the running module is used to run each functional module to be run corresponding to the target domain name in accordance with the acquired running sequence and configuration information of each functional module to be run.
  • an embodiment of the present application provides an electronic device including a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor executes The machine can execute instructions to implement the method steps of the CDN function module operation method provided in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium that stores a computer program in the computer-readable storage medium.
  • the computer program is executed by a processor, the CDN function module provided in the first aspect is executed. Method steps of the method.
  • the embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method steps of the CDN function module operating method provided in the first aspect.
  • the embodiments of the present application also provide a computer program that, when running on a computer, causes the computer to execute the method steps of the CDN function module operating method provided in the first aspect.
  • the edge node After obtaining the request message sent by the client, the edge node can obtain the pre-stored functions to be run corresponding to the target domain name Module operation sequence, and obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name, and then run each to-be-run corresponding to the target domain name according to the obtained operation sequence and configuration information of each functional module to be run functional module. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • Figure 1 is a schematic diagram of information interaction between user terminals and edge nodes in CDN;
  • Figure 2 is a schematic diagram of the process of traversing the functional modules by the existing CDN functional module operating method
  • FIG. 3 is a schematic diagram of the first flow of the CDN function module operation method provided by an embodiment of the application
  • FIG. 4 is a schematic diagram of the second flow of the CDN function module operating method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of the third process of the CDN function module operation method provided by the embodiment of the application.
  • FIG. 6 is a schematic flowchart of a process of establishing a function link list in an embodiment of the application
  • FIG. 7 is a schematic diagram of the first structure of a CDN function module operating device provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of the second structure of the CDN function module operating device provided by an embodiment of the application.
  • FIG. 9 is a schematic structural diagram of a second configuration file generating submodule in the CDN function module operating device provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of a structure of a function link list generating submodule in the CDN function module operation device provided by an embodiment of the application;
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • the existing CDN function module operation method after receiving a request message for a certain domain name, the edge node needs to traverse the switch identifiers of all function modules in the full configuration file. For example, The switch identifications of the 12 functional modules in Figure 2 are traversed, and for domain name A, the functional modules 1, 3, 4, 6, 7, 8, 9, 11, 12 are skipped only by checking the switch identification The only functional modules that really need to run are functional modules 2, 5, and 10. These calculations actually consume the computing resources of the processor in the edge node for no reason.
  • an embodiment of the present application provides a CDN function module operation method, which is applied to edge nodes in the CDN, and the method may include the following steps:
  • the edge node in the embodiment of the present application may be one of the nodes in the CDN network. It can be understood that the edge node can obtain request messages sent by different clients, and the request messages sent by different clients may contain different For example, the request message sent by client 1 carries the information that the domain name is ksyun.com, and the request message sent by the client 2 carries the information that the domain name is sogou.com.
  • the request message obtained by the edge node may be a request message beginning with http or https and carrying information of the target domain name.
  • the domain name in the request message obtained in S101 is named the target domain name.
  • the Nginx-Lua system based on Openresty technology can be run in the edge node.
  • Nginx is a high-performance HTTP server and reverse proxy server
  • Lua is a lightweight, embeddable scripting language. By embedding Lua into Nginx, Lua can be used to write script programs.
  • This technology is Openresty technology.
  • the edge node running the Nginx-Lua system when a certain function is realized, it is usually realized by running a script file, that is, the function module mentioned in the embodiment of this application. By executing the function module, the corresponding business function is realized. .
  • a function module can be realized by a Lua file.
  • the edge node After the edge node obtains the request message sent by the client, it can run multiple functional modules to be run corresponding to the target domain name stored in the edge node to implement each function pre-configured for the target domain name.
  • the edge node When running a functional module, it usually runs in a unit of domain name (host). Any functional module to be run corresponding to the target domain name may refer to a functional module that needs to be run in order to realize the function corresponding to the target domain name.
  • the identification information corresponding to the functional module to be run in the acquired running sequence of each functional module to be run corresponding to the target domain name, for each functional module to be run, it is characterized by the identification information corresponding to the functional module to be run.
  • each functional module to be run corresponding to the target domain name can be learned.
  • the identification information corresponding to the functional module to be run may include the file name or path name of the script file required to realize the functional module to be run.
  • the edge node For example, if there are a total of 300 functional modules stored on the edge node, for the target domain name corresponding to the request message, 10 of the functional modules can be run to achieve 10 functions, and these 10 functional modules are the corresponding target domain names.
  • the script files corresponding to the 10 functional modules of the multiple functional modules to be run the functions preset for the target domain name can be realized.
  • the edge node can receive request messages containing different domain name information to implement functions corresponding to different domain names.
  • the domain name is ksyun.com
  • the above request message can start with http or https and carry a request message of the target domain name ksyun.com.
  • 300 functions can be run There are 10 functional modules of the module, so as to realize 10 functions; if the target domain name is sogou.com, 5 of the 300 functional modules can be run to realize 5 functions.
  • the embodiments of this application can implement multiple functions of a domain name.
  • the speed limit function module and the response header function module can be added to realize the network speed limit function of the domain name and increase Response header function.
  • the functions set for each domain name can be limited according to the actual situation, which is not limited in this application.
  • the edge node needs to determine the function modules to be run corresponding to each domain name among all the function modules stored therein, and the running sequence.
  • different functions implemented by a domain name can correspond to different function modules.
  • the embodiment of the present application can store the names of the function modules to be run corresponding to each domain name and the running sequence of each function module to be run in advance. , So that after obtaining the request message containing the target domain name sent by the client, directly use the pre-stored information to determine the function module to be run for the target domain name and the running sequence of each function module to be run, without the need to traverse each The switch ID of the function module.
  • the configuration information of each functional module to be run corresponding to the target domain name may be pre-stored.
  • the edge node may read the configuration information of each functional module to be run corresponding to the target domain name from a second configuration file corresponding to the target domain name stored in advance.
  • the configuration information of any function module includes the configuration parameters required to run the function module, that is, the configuration parameters required to run the script file, and for the Lua file, it is the configuration parameter required to run the Lua file.
  • the pre-stored configuration information of each functional module to be run corresponding to the target domain name can be obtained.
  • the configuration information of the above-mentioned network speed limit value can be obtained: 100kb/S .
  • each function module to be run corresponding to the target domain name can be run, thereby realizing the functions of the target domain name.
  • the configuration parameter saved in the second configuration file may be: the network speed limit value, which can be used to run the network speed limit function Module.
  • the configuration parameters saved in the second configuration file may be: the name and key value of the response header that needs to be added, and the parameter can be used to run the add response header module.
  • step S102 may specifically be:
  • S102' Obtain a function linked list corresponding to the target domain name from a plurality of preset function linked lists corresponding to each domain name.
  • the function linked list corresponding to each domain name can be preset, and these function linked lists can be pre-stored, so that the preset function linked list corresponding to each domain name can be obtained from the preset function linked list corresponding to the target domain name.
  • Linked list of functions for each domain name, can be preset, and these function linked lists can be pre-stored, so that the preset function linked list corresponding to each domain name can be obtained from the preset function linked list corresponding to the target domain name.
  • the function linked list corresponding to each domain name is used to describe the running sequence of each function module to be run corresponding to the domain name.
  • the function linked list corresponding to each domain name may include: the name of the Lua file corresponding to each function module to be run corresponding to the domain name, and the above name may be the function module corresponding to the Lua file Storage path name or file name, and the name of the Lua file corresponding to each functional module to be run can be written in the preset running order of each functional module to be run, that is, the name of the Lua file corresponding to each functional module to be run It can correspond to the preset running sequence of each functional module to be run.
  • the CDN function module operation method of the embodiment of the present application may further include:
  • S201 Based on the first configuration file corresponding to the edge node, generate a second configuration file corresponding to each domain name, and generate a function linked list corresponding to each domain name.
  • the edge node may have a preset first configuration file, and the configuration information in the first configuration file may be stored in the basic unit of a domain name (host), that is, the first configuration file may save the running sequence of all functional modules and each
  • the configuration information corresponding to the domain names respectively, and the configuration information corresponding to different domain names may include the switch identification and configuration parameters for invoking each function module. Therefore, based on the first configuration file, the edge node can correspondingly generate a second configuration file corresponding to each domain name with configuration information belonging to different domain names, and generate a function linked list corresponding to each domain name.
  • each domain name corresponds to a second configuration file
  • the second configuration file corresponding to each domain name may include configuration information of all functional modules in the edge node
  • the configuration information may include switch identifiers and configuration parameters.
  • the switch identifier can be considered as an attribute value corresponding to a function module.
  • a function module is a function module used to add a header, and its attributes can include: attribute 1 is to add header; attribute 2 is the name of header , Attribute 3 is the value of the header; attribute 1 adding header can be considered as the switch identifier of the function module, and the switch identifier can be used to know whether the function module is executed when the function corresponding to the domain name is implemented.
  • the configuration information belonging to different domain names can be divided by traversing the configuration information in the first configuration file, and then based on the configuration information of each domain name after the division, a connection with each domain name can be generated. Corresponding to the second configuration file.
  • S202 Store the generated second configuration file and function linked list corresponding to each domain name in the shared memory.
  • the second configuration file and function linked list corresponding to each domain name can be stored in the shared memory.
  • the edge node when the Nginx process of the edge node is started or reloaded, the second configuration file and function linked list previously stored in the shared memory will not be restarted or reloaded.
  • the edge node can use the previously stored second configuration file and function linked list to run the function module to be run until the function linked list in the shared memory is updated, which can avoid being unable to read when the Nginx process of the edge node is started or reloaded Fetch configuration files and function linked lists to improve the operating stability of edge nodes.
  • the function linked list corresponding to the target domain name when obtaining the function linked list corresponding to the target domain name from the multiple function linked lists stored in the shared memory, it can be obtained by traversing each function linked list in the shared memory, since the number of traversal function linked lists is more than that of the traversal switch identification. Therefore, the speed of traversing the function linked list is faster; the domain name can also be used as a key to search from the shared memory to obtain the function linked list corresponding to the target domain name, but it is not limited to this.
  • the edge node After obtaining the function linked list corresponding to the target domain name from the shared memory, the edge node can obtain the name of the Lua file of each function module to be run stored in the function linked list by reading the function linked list, thereby determining each pending run of the domain name Function modules and the running sequence of each function module to be run.
  • S2011 For each domain name in each domain name, search for a preset identifier in a second configuration file corresponding to the domain name.
  • the functional module whose switch flag is on is set with a preset flag, that is, the functional module to be run corresponding to the domain name is set with a preset flag.
  • the functional modules to be run corresponding to each domain name can be known.
  • a preset identifier may be added in advance for each functional module required to realize the function of the domain name in the second configuration file corresponding to the domain name.
  • the preset identifier can be the key attribute value of the function module, and the key attribute value can be considered as a switch to call the 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; add header as the key attribute value of the function module, so that the edge node finds the preset identifier (key attribute value) in the second configuration file corresponding to the domain name ), it can be determined that the corresponding functional module is to be run.
  • the preset identifier can be further found in the function mapping table.
  • the name of the Lua file of each function module corresponding to the domain name can be written into the function linked list corresponding to the domain name, that is, The function linked list corresponding to the current domain name records: the name of the Lua file of each function module corresponding to the domain name, and the recorded name of the Lua file carries the running sequence information of each function module, that is, through the names of these Lua files And the position of the name of the Lua file in the function linked list can determine each function module to be run corresponding to the domain name, and the running sequence of each function module to be run.
  • the name of each script file determined can be written in the order of the function modules corresponding to each script file.
  • the function linked list corresponding to the domain name is obtained.
  • the name of each function linked list may be named the same as the domain name.
  • the function linked list corresponding to domain name A may be directly named as the function linked list. A.
  • the corresponding relationship between the function list and the domain name is established.
  • the manners for realizing the feature of establishing the correspondence relationship between the function linked list and the domain name all fall within the protection scope of the embodiments of the present application.
  • the establishment process of the above-mentioned function mapping table may be:
  • the preset identifiers (key attribute values) of all function modules are obtained from the second configuration file, and the corresponding relationship between each preset identifier and the Lua file name of each function module is established. And save the established correspondence in the form of Table 1.
  • Table 1 Contents of function mapping table
  • the second configuration file corresponding to a domain name can be obtained from the second configuration file of each domain name stored in the shared memory, and each functional module to be run corresponding to the domain name can be read
  • the configuration information of the memory using the characteristics of high memory read and write performance to improve the reading speed of the configuration information, edge nodes usually use multi-process technology, multiple processes share a memory, so through the second configuration file stored in the shared memory Obtaining the configuration information of each functional module to be run corresponding to the domain name can enable multiple processes to be processed at the same time and improve the processing speed.
  • the edge node after obtaining the request message sent by the client, the edge node can obtain the pre-stored function modules to be run corresponding to the target domain name and the running sequence of each function module to be run , And obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name, and then run each functional module to be run corresponding to the target domain name according to the obtained running sequence and configuration information of each functional module to be run. Since it is no longer necessary to traverse and judge the switch identification of each function module in the full configuration file when determining the functional module to be run in the domain name, it can reduce the waste of computing resources at the edge node, shorten the processing time, and optimize the processing performance of the edge node .
  • each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • the embodiments of the present application also provide corresponding device embodiments.
  • an embodiment of the present application provides a CDN function module running device, which corresponds to the process shown in Figure 3, including: a first acquisition module 301, a second acquisition module 302, a third acquisition module 303, and an operation module 304. among them:
  • the first obtaining module 301 is configured to obtain a request message sent by the client, and the request message includes information of the target domain name;
  • the second obtaining module 302 is configured to obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
  • the third obtaining module 303 is configured to obtain pre-stored configuration information of each functional module to be run corresponding to the target domain name;
  • the running module 304 is configured to run each function module to be run corresponding to the target domain name according to the acquired running sequence and configuration information of the function module to be run.
  • the second acquisition module is specifically set as:
  • the function linked list corresponding to the target domain name is obtained; the function linked list corresponding to each domain name is used to describe the running sequence of each function module to be run corresponding to the target domain name.
  • the CDN function module operation device of the embodiment of this application further includes:
  • the generating module 401 is configured to generate a second configuration file corresponding to each domain name based on the first configuration file corresponding to the edge node before the first obtaining module 301 obtains the request message sent by the client, and to generate a second configuration file corresponding to each domain name. Respectively corresponding function linked lists; the first configuration file contains configuration information of each function module in the edge node;
  • the storage module 402 is configured to store the generated second configuration file and the function linked list corresponding to each domain name in the shared memory.
  • the foregoing generating module includes: a second configuration file generating submodule and a function linked list generating submodule. As shown in FIG. 9, the foregoing second configuration file generating 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 each domain name based on the divided configuration information of each domain name.
  • the generating module includes a function linked list generating submodule; the function linked list generating submodule includes:
  • the searching unit 4013 is configured to, for each domain name in each domain name, search for a preset identifier in the second configuration file corresponding to the domain name, where one preset identifier corresponds to one functional module;
  • the determining unit 4014 is configured to determine the name of the Lua file corresponding to the found preset identifier in the preset function mapping table, and the function mapping table stores the mapping relationship between the preset identifier and the Lua file;
  • the writing unit 4015 is configured to write the name of the determined Lua file in the function linked list corresponding to the domain name according to the running sequence of the function modules corresponding to each Lua file to obtain the function linked list corresponding to the domain name.
  • the second acquisition module is specifically used for:
  • the configuration information of each functional module to be run corresponding to the target domain name is obtained.
  • the edge node after obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each function module to be run corresponding to the target domain name, and obtain the pre-stored The configuration information of each functional module to be run corresponding to the target domain name, and then according to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • CDN function module operation device may be located in the edge node of the CDN, but is not limited to this.
  • the embodiment of the present application also provides an electronic device, which may specifically be a server.
  • the device 500 includes a processor 501 and a machine-readable storage medium 502.
  • the machine-readable storage medium stores data that can be executed by the processor.
  • the machine executable instructions of the processor execute the machine executable instructions to implement the following steps:
  • Get the request message sent by the client the request message includes the information of the target domain name
  • each functional module to be run corresponding to the target domain name is run.
  • the machine-readable storage medium may include random access memory (Random Access Memory, RAM for short), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • non-volatile memory such as at least one disk memory.
  • the memory may also be at least one storage device located far away from the foregoing processor.
  • the aforementioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP for short) , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the edge node after obtaining the request message sent by the client, can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored and target domain name Corresponding to the configuration information of each functional module to be run, and then run each functional module to be run corresponding to the target domain name according to the acquired running sequence and configuration information of each functional module to be run. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • the embodiment of the present application also provides a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium.
  • Get the request message sent by the client the request message includes the information of the target domain name
  • each functional module to be run corresponding to the target domain name is run.
  • the edge node After obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored The configuration information of each functional module to be run corresponding to the target domain name, and then according to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • the embodiment of the application also provides a computer program product containing instructions, which when running on a computer, causes the computer to perform the following steps:
  • Get the request message sent by the client the request message includes the information of the target domain name
  • each functional module to be run corresponding to the target domain name is run.
  • the embodiment of the application provides a computer program product containing instructions.
  • the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored According to the obtained configuration information of each functional module to be run corresponding to the target domain name, and then execute each functional module to be run corresponding to the target domain name according to the acquired running sequence and configuration information of each functional module to be run. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • the embodiment of the application also provides a computer program, which when it runs on a computer, causes the computer to perform the following steps: obtain a request message sent by a client, the request message includes information about the target domain name; and obtain a pre-stored and The running sequence of each functional module to be run corresponding to the target domain name; to obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name; to run the target domain name according to the obtained running sequence and configuration information of each functional module to be run The corresponding functional modules to be run.
  • the embodiment of the application provides a computer program containing instructions.
  • the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored The configuration information of each functional module to be run corresponding to the target domain name, and then according to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
  • the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment.
  • the CDN function module operating method, operating device, electronic equipment, and storage medium provided by the embodiments of the present application, after obtaining the operating sequence and configuration information of each module to be run corresponding to the target domain name, it can run For each module to be run, it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, 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.

Abstract

A CDN functional module running method and running apparatus, and an electronic device and a storage medium. The method comprises: acquiring a request message sent by a client, wherein the request message comprises information of a target domain name; acquiring a pre-stored running sequence of each functional module to be run corresponding to the target domain name; acquiring pre-stored configuration information of said functional module corresponding to the target domain name; and running, according to the acquired running sequence and configuration information of said functional module, said functional module corresponding to the target domain name. The embodiments of the present application can reduce the amount of calculation needed when an edge node runs a functional module, thereby optimizing the processing performance of the edge node.

Description

CDN功能模块运行方法、运行装置、电子设备及存储介质CDN function module operating method, operating device, electronic equipment and storage medium
本申请要求于2019年06月28日提交中国专利局、申请号为201910579778.5发明名称为“CDN功能模块运行方法、运行装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 28, 2019 with the application number 201910579778.5 and the invention titled "CDN functional module operation method, operation device, electronic equipment and storage medium". The reference is incorporated in this application.
技术领域Technical field
本申请涉及数据通信技术领域,特别是涉及一种CDN功能模块运行方法、运行装置、电子设备及存储介质。This application relates to the field of data communication technology, and in particular to a CDN function module operating method, operating device, electronic equipment, and storage medium.
背景技术Background technique
CDN(Content Delivery Network,内容分发网络)是一种新型的网络构架,如图1所示,用户终端向中心服务器发送访问请求,中心服务器接收访问请求后,向用户终端发送与该用户终端距离最近的边缘节点的IP地址,用户终端向IP地址对应的边缘节点发送数据获取请求(例如HTTP请求),边缘节点接收数据获取请求后,向用户终端返回响应内容。CDN (Content Delivery Network) is a new type of network architecture. As shown in Figure 1, the user terminal sends an access request to the central server. After receiving the access request, the central server sends the user terminal the closest distance to the user terminal. The user terminal sends a data acquisition request (such as an HTTP request) to the edge node corresponding to the IP address, and the edge node returns the response content to the user terminal after receiving the data acquisition request.
现有CDN中的边缘节点接收到HTTP请求后,通过运行一个或多个功能模块的方式,来实现预先为与HTTP请求所携带的域名所配置的功能,每一功能模块可以通过一个脚本文件来实现,运行任一功能模块具体指执行用于实现该功能模块的脚本文件。具体而言:边缘节点在接收到HTTP请求后,获取全量配置文件,按照边缘节点上的各功能模块的运行顺序,对全量配置文件中各功能模块的开关标识进行遍历判断,如果判断通过,即开关标识为开标识,则运行该功能模块,如果判断未通过,即该开关标识为关标识,则接着判断下一功能模块的开关标识,直到判断结束。其中,所获取到的全量配置文件中包含:针对每个域名而言,每个功能模块的开关标识以及各功能模块的配置参数,每一功能模块的配置参数为该功能模块在运行时所需的参数,也就是,需要配置到脚本文件的参数。After receiving the HTTP request, the edge node in the existing CDN realizes the functions configured in advance for the domain name carried in the HTTP request by running one or more functional modules. Each functional module can be implemented through a script file. Implementation, running any functional module specifically refers to executing a script file used to implement the functional module. Specifically: After receiving the HTTP request, the edge node obtains the full configuration file, and traverses the switch identification of each functional module in the full configuration file according to the running sequence of the functional modules on the edge node. If the judgment is passed, that is If the switch flag is an open flag, the function module is run. If the judgment is not passed, that is, the switch flag is an off flag, then the switch flag of the next functional module is judged until the judgment ends. Among them, the obtained full configuration file includes: for each domain name, the switch identification of each functional module and the configuration parameters of each functional module, the configuration parameters of each functional module are required by the functional module at runtime The parameters, that is, the parameters that need to be configured to the script file.
由于为每个域名配置的功能不同,而现有技术中针对每一条http请求都要遍历边缘节点上所有的功能模块,因此,这样势必造成计算资源的浪费和边缘节点处理时间的增加,并且随着边缘节点中功能模块的增加,则需要遍 历的功能模块也随之增加,进而,进一步导致计算资源的浪费和边缘节点处理时间的增加。例如:边缘节点上的功能模块一共300个,这300个功能模块是为所有域名配置的功能的总和,而对于A域名可能只用到了10个,那么在这种情况下,对于A域名,需要遍历300个功能模块,有290个功能模块都是需要检测一下开关标识,判断失败后执行下一个功能模块,这样势必造成计算资源的浪费和边缘节点处理时间的增加。Since the functions configured for each domain name are different, and in the prior art, all the functional modules on the edge node must be traversed for each http request. Therefore, this will inevitably lead to a waste of computing resources and an increase in the processing time of the edge node, and will increase with With the increase of the function modules in the edge node, the function modules that need to be traversed also increase, which in turn leads to a waste of computing resources and an increase in the processing time of the edge node. For example: there are a total of 300 functional modules on the edge node. These 300 functional modules are the sum of the functions configured for all domain names. For the A domain name, only 10 may be used. In this case, for the A domain name, you need Traverse 300 functional modules, and there are 290 functional modules that need to check the switch identification, and execute the next functional module after the judgment fails. This will inevitably cause a waste of computing resources and an increase in edge node processing time.
发明内容Summary of the invention
本申请实施例的目的在于提供一种CDN功能模块运行方法、运行装置、电子设备及存储介质,以减少边缘节点的计算资源浪费和处理时间。具体技术方案如下:The purpose of the embodiments of the present application is to provide a CDN function module operating method, operating device, electronic equipment, and storage medium, so as to reduce the waste of computing resources and processing time of edge nodes. The specific technical solutions are as follows:
第一方面,本申请实施例提供了一种CDN功能模块运行方法,应用于内容分发网络CDN中的边缘节点,包括:获取由客户端发送的请求报文,该请求报文中包括目标域名的信息;获取预存的与该目标域名对应的各个待运行功能模块的运行顺序;获取预存的与该目标域名对应的各个待运行功能模块的配置信息;按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。In the first aspect, the embodiment of the present application provides a CDN function module operation method, which is applied to an edge node in a content distribution network CDN, including: obtaining a request message sent by a client, the request message including the target domain name Information; obtain the pre-stored operating sequence of each functional module to be run corresponding to the target domain name; obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name; according to the obtained operation of each functional module to be run Sequence and configuration information, run each functional module to be run corresponding to the target domain name.
第二方面,本申请实施例提供了一种CDN功能模块运行装置,应用于内容分发网络CDN中的边缘节点,包括:第一获取模块,用于获取由客户端发送的请求报文,该请求报文中包括目标域名的信息;第二获取模块,用于获取预存的与该目标域名对应的各个待运行功能模块的运行顺序;第三获取模块,用于获取预存的与该目标域名对应的各个待运行功能模块的配置信息;运行模块,用于按照所获取的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。In the second aspect, an embodiment of the present application provides a CDN function module operation device, which is applied to an edge node in a content distribution network CDN, and includes: a first acquisition module for acquiring a request message sent by a client. The message includes the information of the target domain name; the second acquisition module is used to acquire the pre-stored running sequence of each functional module to be run corresponding to the target domain name; the third acquisition module is used to acquire the pre-stored information corresponding to the target domain name Configuration information of each functional module to be run; the running module is used to run each functional module to be run corresponding to the target domain name in accordance with the acquired running sequence and configuration information of each functional module to be run.
第三方面,本申请实施例提供了一种电子设备,包括处理器和机器可读存储介质,该机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,该处理器执行该机器可执行指令以实现上述第一方面提供的CDN功能模块运行方法的方法步骤。In a third aspect, an embodiment of the present application provides an electronic device including a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor executes The machine can execute instructions to implement the method steps of the CDN function module operation method provided in the first aspect.
第四方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时,实现上述 第一方面提供的CDN功能模块运行方法的方法步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium that stores a computer program in the computer-readable storage medium. When the computer program is executed by a processor, the CDN function module provided in the first aspect is executed. Method steps of the method.
第五方面,本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面提供的CDN功能模块运行方法的方法步骤。In the fifth aspect, the embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method steps of the CDN function module operating method provided in the first aspect.
第六方面,本申请实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面提供的CDN功能模块运行方法的方法步骤。In a sixth aspect, the embodiments of the present application also provide a computer program that, when running on a computer, causes the computer to execute the method steps of the CDN function module operating method provided in the first aspect.
本申请实施例提供的一种CDN功能模块运行方法、运行装置、电子设备及存储介质,在获取由客户端发送的请求报文后,边缘节点能够获取预存的与目标域名对应的各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。The CDN function module operating method, operating device, electronic equipment and storage medium provided by the embodiments of the application. After obtaining the request message sent by the client, the edge node can obtain the pre-stored functions to be run corresponding to the target domain name Module operation sequence, and obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name, and then run each to-be-run corresponding to the target domain name according to the obtained operation sequence and configuration information of each functional module to be run functional module. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
当然,实施本申请的任一产品或方法必不一定需要同时达到以上所述的所有优点。Of course, implementing any product or method of the present application does not necessarily need to achieve all the advantages described above at the same time.
附图说明Description of the drawings
为了更清楚地说明本发明实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present invention and the technical solutions of the prior art more clearly, the following briefly introduces the drawings that need to be used in the embodiments and the prior art. Obviously, the drawings in the following description are merely present For some of the embodiments of the invention, for those of ordinary skill in the art, other embodiments can be obtained based on the drawings without creative work.
图1为CDN中用户终端与边缘节点的信息交互示意图;Figure 1 is a schematic diagram of information interaction between user terminals and edge nodes in CDN;
图2为现有CDN功能模块运行方法对功能模块进行遍历的过程示意图;Figure 2 is a schematic diagram of the process of traversing the functional modules by the existing CDN functional module operating method;
图3为本申请实施例提供的CDN功能模块运行方法的第一种流程示意图;FIG. 3 is a schematic diagram of the first flow of the CDN function module operation method provided by an embodiment of the application;
图4为本申请实施例提供的CDN功能模块运行方法的第二种流程示意 图;FIG. 4 is a schematic diagram of the second flow of the CDN function module operating method provided by an embodiment of the application;
图5为本申请实施例提供的CDN功能模块运行方法的第三种流程示意图;FIG. 5 is a schematic diagram of the third process of the CDN function module operation method provided by the embodiment of the application;
图6为本申请实施例中功能链表建立过程的一种流程示意图;FIG. 6 is a schematic flowchart of a process of establishing a function link list in an embodiment of the application;
图7为本申请实施例提供的CDN功能模块运行装置的第一种结构示意图;FIG. 7 is a schematic diagram of the first structure of a CDN function module operating device provided by an embodiment of the application;
图8为本申请实施例提供的CDN功能模块运行装置的第二种结构示意图;FIG. 8 is a schematic diagram of the second structure of the CDN function module operating device provided by an embodiment of the application;
图9为本申请实施例提供的CDN功能模块运行装置中,第二配置文件生成子模块的一种结构示意图;FIG. 9 is a schematic structural diagram of a second configuration file generating submodule in the CDN function module operating device provided by an embodiment of the application;
图10为本申请实施例提供的CDN功能模块运行装置中,功能链表生成子模块的一种结构示意图;FIG. 10 is a schematic diagram of a structure of a function link list generating submodule in the CDN function module operation device provided by an embodiment of the application;
图11为本申请实施例提供的一种电子设备的结构示意图。FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
具体实施方式Detailed ways
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions, and advantages of the present application clearer, the following further describes the present application in detail with reference to the drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of this application.
现有的CDN功能模块运行方法,如图2所示,边缘节点在接收针对某一域名的请求报文后,都需要对全量配置文件中所有功能模块的开关标识进行遍历判断,例如,需要对图2中的12个功能模块的开关标识进行遍历,而对于域名A,其中的功能模块1、3、4、6、7、8、9、11、12都是只检测一下开关标识便跳过,真正需要运行的功能模块只有功能模块2、5、10,这些计算实际上是在无端的消耗边缘节点中处理器的计算资源。The existing CDN function module operation method, as shown in Figure 2, after receiving a request message for a certain domain name, the edge node needs to traverse the switch identifiers of all function modules in the full configuration file. For example, The switch identifications of the 12 functional modules in Figure 2 are traversed, and for domain name A, the functional modules 1, 3, 4, 6, 7, 8, 9, 11, 12 are skipped only by checking the switch identification The only functional modules that really need to run are functional modules 2, 5, and 10. These calculations actually consume the computing resources of the processor in the edge node for no reason.
有鉴于此,如图3所示,本申请实施例提供了一种CDN功能模块运行方法,应用于CDN中的边缘节点,该方法可以包括以下步骤:In view of this, as shown in FIG. 3, an embodiment of the present application provides a CDN function module operation method, which is applied to edge nodes in the CDN, and the method may include the following steps:
S101,获取由客户端发送的请求报文。S101. Obtain a request message sent by a client.
本申请实施例中的边缘节点,可以是CDN网络的其中一个节点,可以理解,边缘节点可以获取不同客户端发送的请求报文,并且,不同的客户端所发送的请求报文中可以包含不同的域名信息,例如,客户端1发送的请求报文中携带有域名为ksyun.com的信息,客户端2发送的请求报文中携带有域名为sogou.com的信息。The edge node in the embodiment of the present application may be one of the nodes in the CDN network. It can be understood that the edge node can obtain request messages sent by different clients, and the request messages sent by different clients may contain different For example, the request message sent by client 1 carries the information that the domain name is ksyun.com, and the request message sent by the client 2 carries the information that the domain name is sogou.com.
具体地,边缘节点所获取的上述请求报文可以是以http或者https开头,且携带有目标域名的信息的一段请求报文。为了引用清楚,本申请中,将S101中所获取到的请求报文中的域名,命名为目标域名。Specifically, the request message obtained by the edge node may be a request message beginning with http or https and carrying information of the target domain name. For clarity of reference, in this application, the domain name in the request message obtained in S101 is named the target domain name.
本申请实施例中,边缘节点中可以运行基于Openresty技术的Nginx-Lua系统。其中,Nginx是一种高性能的HTTP服务器和反向代理服务器,而Lua是一种轻量级、可嵌入式的脚本语言,通过将Lua嵌入到Nginx中,从而可以使用Lua编写脚本程序,这种技术即为Openresty技术。在运行Nginx-Lua系统的边缘节点中,当实现某个功能时,通常通过运行一个脚本文件实现,即本申请实施例中所说的功能模块,通过执行该功能模块,从而实现相应的业务功能。其中,针对Openresty技术而言,一个功能模块可以通过一个Lua文件来实现。In the embodiment of the present application, the Nginx-Lua system based on Openresty technology can be run in the edge node. Among them, Nginx is a high-performance HTTP server and reverse proxy server, while Lua is a lightweight, embeddable scripting language. By embedding Lua into Nginx, Lua can be used to write script programs. This technology is Openresty technology. In the edge node running the Nginx-Lua system, when a certain function is realized, it is usually realized by running a script file, that is, the function module mentioned in the embodiment of this application. By executing the function module, the corresponding business function is realized. . Among them, for the Openresty technology, a function module can be realized by a Lua file.
S102,获取预存的与目标域名对应的各个待运行功能模块的运行顺序。S102: Obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name.
边缘节点获取由客户端发送的请求报文后,可以运行保存于边缘节点中的该目标域名对应的多个待运行功能模块,以实现为该目标域名预先配置的各个功能,其中,边缘节点在运行功能模块时,通常以域名(host)为单位运行。该目标域名对应的任一待运行功能模块,可以指为了实现与该目标域名对应的功能而需要运行的功能模块。其中,所获取到的与目标域名对应的各个待运行功能模块的运行顺序中,针对每一待运行功能模块,通过该待运行功能模块对应的标识信息来表征。这样,在获取到运行顺序后,由于运行顺序中记录有各个待运行模块对应的标识信息,因此,便可以获知到与目标域名对应的各个待运行功能模块。其中,待运行功能模块对应的标识信息可以包括实现该待运行功能模块所需的脚本文件的文件名称或路径名称。After the edge node obtains the request message sent by the client, it can run multiple functional modules to be run corresponding to the target domain name stored in the edge node to implement each function pre-configured for the target domain name. The edge node When running a functional module, it usually runs in a unit of domain name (host). Any functional module to be run corresponding to the target domain name may refer to a functional module that needs to be run in order to realize the function corresponding to the target domain name. Among them, in the acquired running sequence of each functional module to be run corresponding to the target domain name, for each functional module to be run, it is characterized by the identification information corresponding to the functional module to be run. In this way, after the running sequence is obtained, since the identification information corresponding to each module to be run is recorded in the running sequence, each functional module to be run corresponding to the target domain name can be learned. Wherein, the identification information corresponding to the functional module to be run may include the file name or path name of the script file required to realize the functional module to be run.
例如,该边缘节点上总共保存有300个功能模块,则针对请求报文对应的 目标域名,可以运行其中的10个功能模块,以实现10个功能,这10个功能模块便是该目标域名对应的多个待运行功能模块,通过运行该10个功能模块所对应的脚本文件,即可实现为该目标域名预先设置的功能。For example, if there are a total of 300 functional modules stored on the edge node, for the target domain name corresponding to the request message, 10 of the functional modules can be run to achieve 10 functions, and these 10 functional modules are the corresponding target domain names. By running the script files corresponding to the 10 functional modules of the multiple functional modules to be run, the functions preset for the target domain name can be realized.
可以理解,该边缘节点可以接收包含不同域名信息的请求报文,以实现不同域名所对应的功能。例如,如果域名为ksyun.com,则上述请求报文可以是以http或者https开头,且携带有目标域名ksyun.com的一段请求报文,针对ksyun.com这一目标域名,可以运行300个功能模块的其中10个功能模块,从而实现10个功能;如果目标域名为sogou.com,可以运行300个功能模块的其中5个功能模块,从而实现5个功能。It can be understood that the edge node can receive request messages containing different domain name information to implement functions corresponding to different domain names. For example, if the domain name is ksyun.com, the above request message can start with http or https and carry a request message of the target domain name ksyun.com. For the target domain name of ksyun.com, 300 functions can be run There are 10 functional modules of the module, so as to realize 10 functions; if the target domain name is sogou.com, 5 of the 300 functional modules can be run to realize 5 functions.
通过上述示例可知,本申请实施例可以实现一个域名的多个功能,例如,针对域名ksyun.com,可以通过运行限速功能模块和增加响应头功能模块,从而实现域名的网络限速功能以及增加响应头功能。其中,为各个域名所设置的功能可以根据实际情况限定,本申请不做限定。It can be seen from the above examples that the embodiments of this application can implement multiple functions of a domain name. For example, for the domain name ksyun.com, the speed limit function module and the response header function module can be added to realize the network speed limit function of the domain name and increase Response header function. Among them, the functions set for each domain name can be limited according to the actual situation, which is not limited in this application.
另外,为了解决现有技术问题,在获取客户端发送的请求报文之前,边缘节点需要确定其中所保存的所有功能模块中,各个域名分别对应的待运行功能模块有哪些,以及运行顺序。In addition, in order to solve the problem of the prior art, before obtaining the request message sent by the client, the edge node needs to determine the function modules to be run corresponding to each domain name among all the function modules stored therein, and the running sequence.
例如,边缘节点中保存的所有功能模块有300个,这300个功能模块是所有域名的功能模块的总和,对于域名A可能只需运行其中的10个,因此只需确认这10个待运行功能模块,由于各待运行功能模块是按照一定的顺序运行的,因此还可以确定它们的运行顺序。当然,该运行顺序可以是预设的。For example, there are 300 functional modules saved in the edge node, and these 300 functional modules are the sum of the functional modules of all domain names. For domain name A, you may only need to run 10 of them, so you only need to confirm these 10 functions to be run Modules, because the functional modules to be run are run in a certain order, their running order can also be determined. Of course, the running sequence can be preset.
如果按照现有的功能模块运行方法,则需要对上述300个功能模块逐个遍历判断,这些计算实际上是在无端的消耗边缘节点中处理器的计算资源,从而增加整个CDN网络的处理时间,可能导致向用户终端返回的响应内容出现延迟,发明人正是基于所发现的问题,才想到通过本申请实施例提供的技术方案解决目前存在的问题。If you follow the existing function module operation method, you need to traverse the above 300 function modules one by one. These calculations actually consume the computing resources of the processor in the edge node for no reason, thereby increasing the processing time of the entire CDN network. As a result, the response content returned to the user terminal is delayed. Based on the problems discovered, the inventor thinks of solving the current problems through the technical solutions provided by the embodiments of the present application.
根据前述实施例可知,针对一个域名所实现的不同功能可以对应不同的功能模块,本申请实施例可以预先将各域名分别对应的待运行功能模块的名称及各个待运行功能模块的运行顺序进行存储,以便在获取由客户端发送的 包含目标域名的请求报文后,直接通过预存的信息,确定该目标域名的待运行功能模块,以及各个待运行功能模块的运行顺序,而不需要再遍历各功能模块的开关标识。According to the foregoing embodiment, different functions implemented by a domain name can correspond to different function modules. The embodiment of the present application can store the names of the function modules to be run corresponding to each domain name and the running sequence of each function module to be run in advance. , So that after obtaining the request message containing the target domain name sent by the client, directly use the pre-stored information to determine the function module to be run for the target domain name and the running sequence of each function module to be run, without the need to traverse each The switch ID of the function module.
S103,获取预存的与目标域名对应的各个待运行功能模块的配置信息。S103: Obtain pre-stored configuration information of each functional module to be run corresponding to the target domain name.
本申请实施例中,与目标域名对应的各个待运行功能模块的配置信息可以是预先存储好的。例如,边缘节点可以从预先存储的该目标域名对应的第二配置文件中,读取与该目标域名对应的各个待运行功能模块的配置信息。其中,任一功能模块的配置信息包括运行该功能模块所需的配置参数,也就是,运行脚本文件所需传递的配置参数,针对Lua文件而言,即是运行Lua文件所需的配置参数。In the embodiment of the present application, the configuration information of each functional module to be run corresponding to the target domain name may be pre-stored. For example, the edge node may read the configuration information of each functional module to be run corresponding to the target domain name from a second configuration file corresponding to the target domain name stored in advance. Wherein, the configuration information of any function module includes the configuration parameters required to run the function module, that is, the configuration parameters required to run the script file, and for the Lua file, it is the configuration parameter required to run the Lua file.
可以理解,在确定与目标域名对应的待运行功能模块后,便可以获取预存的与目标域名对应的各个待运行功能模块的配置信息,例如,获取上述网络限速值的配置信息:100kb/S。It can be understood that after determining the functional module to be run corresponding to the target domain name, the pre-stored configuration information of each functional module to be run corresponding to the target domain name can be obtained. For example, the configuration information of the above-mentioned network speed limit value can be obtained: 100kb/S .
S104,按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行与该目标域名对应的各个待运行功能模块。S104: According to the acquired running sequence and configuration information of each function module to be run, run each function module to be run corresponding to the target domain name.
在获取目标域名对应的待运行功能模块的运行顺序,以及获取它们的配置信息后,便可以运行该目标域名对应的各个待运行功能模块,从而实现该目标域名的各个功能。After obtaining the running sequence of the function modules to be run corresponding to the target domain name and obtaining their configuration information, each function module to be run corresponding to the target domain name can be run, thereby realizing the functions of the target domain name.
示例性地,当目标域名的其中一个待运行功能模块为网络限速功能模块时,则在第二配置文件中保存的配置参数可以为:网络限速值,可以利用该参数运行网络限速功能模块。Exemplarily, when one of the functional modules to be run of the target domain name is a network speed limit function module, the configuration parameter saved in the second configuration file may be: the network speed limit value, which can be used to run the network speed limit function Module.
示例性地,当目标域名的另一个待运行功能模块为增加响应头模块(响应头为一个http请求中头域的一部分,且该模块的运行顺序位于网络限速功能模块后)时,则在第二配置文件中保存的配置参数可以为:需要增加的响应头的名称以及键值,可以利用该参数运行增加响应头模块。Exemplarily, when another function module to be run of the target domain name is a response header module (the response header is a part of the header field in an http request, and the running sequence of this module is located after the network speed limit function module), then The configuration parameters saved in the second configuration file may be: the name and key value of the response header that needs to be added, and the parameter can be used to run the add response header module.
作为本申请实施例一种可选的实施方式,在图3所示流程的基础上,如图4所示,上述步骤S102具体可以为:As an optional implementation manner of the embodiment of the present application, on the basis of the process shown in FIG. 3, as shown in FIG. 4, the foregoing step S102 may specifically be:
S102’,从预存的各个域名对应的多个预设功能链表中,获取与目标域名对应的功能链表。S102': Obtain a function linked list corresponding to the target domain name from a plurality of preset function linked lists corresponding to each domain name.
本申请实施例中,针对各个域名,可以预设与各域名分别对应的功能链表,并预存这些功能链表,这样便可以从预存的各个域名对应的预设功能链表中,获取与该目标域名对应的功能链表。In the embodiments of this application, for each domain name, the function linked list corresponding to each domain name can be preset, and these function linked lists can be pre-stored, so that the preset function linked list corresponding to each domain name can be obtained from the preset function linked list corresponding to the target domain name. Linked list of functions.
每一域名对应的功能链表用于描述与该域名对应的各个待运行功能模块的运行顺序。示例性的,针对脚本文件为Lua文件而言,每一域名对应的功能链表中可以包含:该域名对应的各个待运行功能模块所对应Lua文件的名称,上述名称可以是功能模块对应Lua文件的存储路径名称或文件名称,并且,各个待运行功能模块所对应Lua文件的名称可以是按各个待运行功能模块的预设运行顺序写入的,即,各个待运行功能模块所对应Lua文件的名称可以与各个待运行功能模块的预设运行顺序对应。The function linked list corresponding to each domain name is used to describe the running sequence of each function module to be run corresponding to the domain name. Exemplarily, for the script file being a Lua file, the function linked list corresponding to each domain name may include: the name of the Lua file corresponding to each function module to be run corresponding to the domain name, and the above name may be the function module corresponding to the Lua file Storage path name or file name, and the name of the Lua file corresponding to each functional module to be run can be written in the preset running order of each functional module to be run, that is, the name of the Lua file corresponding to each functional module to be run It can correspond to the preset running sequence of each functional module to be run.
作为本申请实施例一种可选的实施方式,在图4所示流程的基础上,如图5所示,本申请实施例的CDN功能模块运行方法还可以包括:As an optional implementation manner of the embodiment of the present application, based on the process shown in FIG. 4, as shown in FIG. 5, the CDN function module operation method of the embodiment of the present application may further include:
S201,基于边缘节点对应的第一配置文件,生成与各个域名分别对应的第二配置文件,以及生成与各个域名分别对应的功能链表。S201: Based on the first configuration file corresponding to the edge node, generate a second configuration file corresponding to each domain name, and generate a function linked list corresponding to each domain name.
边缘节点可以具有一个预设的第一配置文件,该第一配置文件中的配置信息可以按照域名(host)为基本单位保存,即,第一配置文件中可以保存所有功能模块的运行顺序以及各个域名分别对应的配置信息,且不同域名对应的配置信息中可以包含调用各个功能模块的开关标识和配置参数。因此,基于第一配置文件,边缘节点可以将属于不同域名的配置信息,对应生成与各个域名分别对应的第二配置文件,并生成与各个域名分别对应的功能链表。其中,每一域名对应有一个第二配置文件,且每一域名对应的第二配置文件中可以包括该边缘节点中所有功能模块的配置信息,该配置信息中可以包括开关标识和配置参数。The edge node may have a preset first configuration file, and the configuration information in the first configuration file may be stored in the basic unit of a domain name (host), that is, the first configuration file may save the running sequence of all functional modules and each The configuration information corresponding to the domain names respectively, and the configuration information corresponding to different domain names may include the switch identification and configuration parameters for invoking each function module. Therefore, based on the first configuration file, the edge node can correspondingly generate a second configuration file corresponding to each domain name with configuration information belonging to different domain names, and generate a function linked list corresponding to each domain name. Wherein, each domain name corresponds to a second configuration file, and the second configuration file corresponding to each domain name may include configuration information of all functional modules in the edge node, and the configuration information may include switch identifiers and configuration parameters.
需要说明的是,开关标识可以认为是一个功能模块对应的一个属性值,比如,一个功能模块是用于添加header的功能模块,其属性可以包括:属性1是添加header;属性2是header的名字,属性3是header的值;属性1添加header 就可以认为是该功能模块的开关标识,通过该开关标识可以获知在实现域名对应的功能时是否执行该功能模块。It should be noted that the switch identifier can be considered as an attribute value corresponding to a function module. For example, a function module is a function module used to add a header, and its attributes can include: attribute 1 is to add header; attribute 2 is the name of header , Attribute 3 is the value of the header; attribute 1 adding header can be considered as the switch identifier of the function module, and the switch identifier can be used to know whether the function module is executed when the function corresponding to the domain name is implemented.
作为本申请实施例一种可选的实施方式,可以通过遍历第一配置文件中的配置信息,将属于不同域名的配置信息进行划分,然后基于划分后的各个域名的配置信息,生成与各域名分别对应的第二配置文件。As an optional implementation manner of the embodiment of the present application, the configuration information belonging to different domain names can be divided by traversing the configuration information in the first configuration file, and then based on the configuration information of each domain name after the division, a connection with each domain name can be generated. Corresponding to the second configuration file.
S202,将生成的与各个域名分别对应的第二配置文件以及功能链表存储在共享内存中。S202: Store the generated second configuration file and function linked list corresponding to each domain name in the shared memory.
可以将与各个域名分别对应的第二配置文件以及功能链表存储在共享内存中。这样,针对运行Nginx-Lua系统的边缘节点,在边缘节点的Nginx进程启动或重新加载(reload)时,对于先前存储于共享内存中的第二配置文件和功能链表,不会随着重启或重新加载而被删除,边缘节点可以利用先前存储的第二配置文件和功能链表运行待运行功能模块,直至共享内存中的功能链表被更新,可以避免在边缘节点的Nginx进程启动或重新加载时无法读取配置文件和功能链表,提高边缘节点的运行稳定性。The second configuration file and function linked list corresponding to each domain name can be stored in the shared memory. In this way, for the edge node running the Nginx-Lua system, when the Nginx process of the edge node is started or reloaded, the second configuration file and function linked list previously stored in the shared memory will not be restarted or reloaded. When loaded and deleted, the edge node can use the previously stored second configuration file and function linked list to run the function module to be run until the function linked list in the shared memory is updated, which can avoid being unable to read when the Nginx process of the edge node is started or reloaded Fetch configuration files and function linked lists to improve the operating stability of edge nodes.
可选的,在从共享内存中存储的多个功能链表中获取与目标域名对应的功能链表时,可以通过遍历共享内存中的各个功能链表得到,由于遍历功能链表的数量相对于遍历开关标识更少,因此遍历功能链表的速度更快;也可以从共享内存中以域名作为关键字进行查找,得到与该目标域名对应的功能链表,但并不限于此。Optionally, when obtaining the function linked list corresponding to the target domain name from the multiple function linked lists stored in the shared memory, it can be obtained by traversing each function linked list in the shared memory, since the number of traversal function linked lists is more than that of the traversal switch identification. Therefore, the speed of traversing the function linked list is faster; the domain name can also be used as a key to search from the shared memory to obtain the function linked list corresponding to the target domain name, but it is not limited to this.
从共享内存中获取目标域名对应的功能链表后,边缘节点通过读取该功能链表,便可以获取功能链表中所保存的各个待运行功能模块的Lua文件的名称,从而确定该域名的各个待运行功能模块以及各个待运行功能模块的运行顺序。After obtaining the function linked list corresponding to the target domain name from the shared memory, the edge node can obtain the name of the Lua file of each function module to be run stored in the function linked list by reading the function linked list, thereby determining each pending run of the domain name Function modules and the running sequence of each function module to be run.
本申请实施例中,如图6所示,各个域名对应的功能链表的生成步骤具体为:In the embodiment of the present application, as shown in FIG. 6, the steps of generating the function linked list corresponding to each domain name are specifically as follows:
S2011,针对各个域名中的每一域名,在与该域名对应的第二配置文件中,查找预设标识。S2011: For each domain name in each domain name, search for a preset identifier in a second configuration file corresponding to the domain name.
其中,每一域名对应的第二配置文件中,开关标识为开的功能模块设置 有预设标识,也就是,该域名对应的待运行功能模块设置有预设标识。这样,通过查找预设标识的方式,可以获知到各个域名所对应的待运行功能模块。Among them, in the second configuration file corresponding to each domain name, the functional module whose switch flag is on is set with a preset flag, that is, the functional module to be run corresponding to the domain name is set with a preset flag. In this way, by looking up the preset identifier, the functional modules to be run corresponding to each domain name can be known.
本申请实施例中,针对每一域名,可以在该域名对应的第二配置文件中,预先为实现该域名的功能所需的每一个功能模块,都添加一个预设标识。比如:该预设标识可以是功能模块的key属性值,key属性值可以认为是调用该功能模块的开关,例如,在一个功能模块所对应的属性中,属性1是为该功能模块添加header;属性2是header的名字,属性3是header的值;添加header为该功能模块的key属性值,这样,边缘节点在与该域名对应的第二配置文件中查找到该预设标识(key属性值)后,便可以确定与之对应的功能模块是待运行的。In the embodiment of the present application, for each domain name, a preset identifier may be added in advance for each functional module required to realize the function of the domain name in the second configuration file corresponding to the domain name. For example, the preset identifier can be the key attribute value of the function module, and the key attribute value can be considered as a switch to call the function module. For example, among the attributes corresponding to a 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; add header as the key attribute value of the function module, so that the edge node finds the preset identifier (key attribute value) in the second configuration file corresponding to the domain name ), it can be determined that the corresponding functional module is to be run.
S2012,在预设的功能映射表中,确定查找到的预设标识所对应的Lua文件的名称。S2012: Determine the name of the Lua file corresponding to the found preset identifier in the preset function mapping table.
由于上述预设的功能映射表中,可以保存有预设标识与Lua文件之间的对应关系,因此,在上述步骤查找到预设标识后,便可以在功能映射表中,进一步查找到该预设标识所对应的Lua文件的名称。可以理解的是,针对当脚本文件为Lua文件以外的任一种脚本文件而言,预设的功能映射表中,可以保存有预设标识与该种脚本文件之间的对应关系,进而在预设的功能映射表中,确定查找到的预设标识所对应的脚本文件的名称。Since the corresponding relationship between the preset identifier and the Lua file can be stored in the above-mentioned preset function mapping table, after the preset identifier is found in the above steps, the preset identifier can be further found in the function mapping table. Set the name of the Lua file corresponding to the logo. It is understandable that when the script file is any type of script file other than the Lua file, the preset function mapping table can store the corresponding relationship between the preset identifier and the script file, and then the In the function mapping table set, determine the name of the script file corresponding to the found preset identifier.
S2013,按照与各Lua文件对应的功能模块的运行顺序,将所确定的Lua文件的名称写入与该域名对应的功能链表中,得到与该域名对应的功能链表。In S2013, according to the running sequence of the function modules corresponding to each Lua file, write the name of the determined Lua file into the function linked list corresponding to the domain name to obtain the function linked list corresponding to the domain name.
在确定与各Lua文件对应的功能模块的运行顺序后,便可以基于所确定的运行顺序,将该域名对应的各个功能模块的Lua文件的名称写入与该域名对应的功能链表中,即,当前域名对应的功能链表中记录有:该域名对应的各个功能模块的Lua文件的名称,且所记录的Lua文件的名称携带有各个功能模块的运行顺序信息,也即,通过这些Lua文件的名称以及该Lua文件的名称在该功能链表中所处的位置,可以确定域名对应的各个待运行功能模块,以及各个待运行功能模块的运行顺序。可以理解的是,针对当脚本文件为Lua文件以外的任一种脚本文件而言,相应的,可以按照与各脚本文件对应的功能模块的运行顺序,将所确定的各脚本文件的名称写入与该域名对应的功能链表中,得到与该域名对应的功能链表。After determining the running sequence of the function modules corresponding to each Lua file, based on the determined running sequence, the name of the Lua file of each function module corresponding to the domain name can be written into the function linked list corresponding to the domain name, that is, The function linked list corresponding to the current domain name records: the name of the Lua file of each function module corresponding to the domain name, and the recorded name of the Lua file carries the running sequence information of each function module, that is, through the names of these Lua files And the position of the name of the Lua file in the function linked list can determine each function module to be run corresponding to the domain name, and the running sequence of each function module to be run. It is understandable that when the script file is any script file other than the Lua file, correspondingly, the name of each script file determined can be written in the order of the function modules corresponding to each script file. In the function linked list corresponding to the domain name, the function linked list corresponding to the domain name is obtained.
作为本申请实施例一种可选的实施方式,在建立上述功能链表时,可以将各功能链表的名称命名为与域名相同,例如,可以将与域名A对应的功能链表,直接命名为功能链表A,这样便建立了功能链表与域名的对应关系。当然,除所举的例子所示的实现方式以外,实现建立功能链表与域名的对应关系的特征的方式,均属于本申请实施例的保护范围。As an optional implementation of the embodiment of this application, when the above-mentioned function linked list is established, the name of each function linked list may be named the same as the domain name. For example, the function linked list corresponding to domain name A may be directly named as the function linked list. A. In this way, the corresponding relationship between the function list and the domain name is established. Of course, in addition to the implementation manners shown in the examples cited, the manners for realizing the feature of establishing the correspondence relationship between the function linked list and the domain name all fall within the protection scope of the embodiments of the present application.
作为本申请实施例一种可选的实施方式,上述功能映射表的建立过程可以为:As an optional implementation manner of the embodiment of this application, the establishment process of the above-mentioned function mapping table may be:
在边缘节点的Nginx进程启动或重新加载时,从第二配置文件中,获取所有功能模块的预设标识(key属性值),将各预设标识与各功能模块的Lua文件名称建立对应关系,并将所建立的对应关系以表1的形式保存。When the Nginx process of the edge node is started or reloaded, the preset identifiers (key attribute values) of all function modules are obtained from the second configuration file, and the corresponding relationship between each preset identifier and the Lua file name of each function module is established. And save the established correspondence in the form of Table 1.
表1功能映射表的内容Table 1 Contents of function mapping table
Figure PCTCN2020098178-appb-000001
Figure PCTCN2020098178-appb-000001
作为本申请实施例一种可选的实施方式,可以从共享内存中存储的各个域名的第二配置文件中,获取一个域名对应的第二配置文件,读取与域名对应的各个待运行功能模块的配置信息,利用内存读写性能高的特点,提高配置信息的读取速度,边缘节点通常采用多进程技术,多个进程共享一个内存,因此通过从共享内存中所存储的第二配置文件中获取与域名对应的各个待运行功能模块的配置信息,能够使多个进程可以同时处理,提高处理速度。As an optional implementation of the embodiment of this application, the second configuration file corresponding to a domain name can be obtained from the second configuration file of each domain name stored in the shared memory, and each functional module to be run corresponding to the domain name can be read The configuration information of the memory, using the characteristics of high memory read and write performance to improve the reading speed of the configuration information, edge nodes usually use multi-process technology, multiple processes share a memory, so through the second configuration file stored in the shared memory Obtaining the configuration information of each functional module to be run corresponding to the domain name can enable multiple processes to be processed at the same time and improve the processing speed.
本申请实施例提供的一种CDN功能模块运行方法,在获取由客户端发送的请求报文后,边缘节点能够获取预存的与目标域名对应的待运行功能模块及各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名所对应的各个待运行功能模块。由于在 确定域名的待运行功能模块时,不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。In the CDN function module operation method provided by the embodiment of the application, after obtaining the request message sent by the client, the edge node can obtain the pre-stored function modules to be run corresponding to the target domain name and the running sequence of each function module to be run , And obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name, and then run each functional module to be run corresponding to the target domain name according to the obtained running sequence and configuration information of each functional module to be run. Since it is no longer necessary to traverse and judge the switch identification of each function module in the full configuration file when determining the functional module to be run in the domain name, it can reduce the waste of computing resources at the edge node, shorten the processing time, and optimize the processing performance of the edge node . Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
相应于上面的方法实施例,本申请实施例还提供了相应的装置实施例。Corresponding to the above method embodiments, the embodiments of the present application also provide corresponding device embodiments.
如图7所示,本申请实施例提供了一种CDN功能模块运行装置,与图3所示流程对应,包括:第一获取模块301、第二获取模块302、第三获取模块303和运行模块304。其中:As shown in Figure 7, an embodiment of the present application provides a CDN function module running device, which corresponds to the process shown in Figure 3, including: a first acquisition module 301, a second acquisition module 302, a third acquisition module 303, and an operation module 304. among them:
第一获取模块301,设置为获取由客户端发送的请求报文,请求报文中包括目标域名的信息;The first obtaining module 301 is configured to obtain a request message sent by the client, and the request message includes information of the target domain name;
第二获取模块302,设置为获取预存的与目标域名对应的各个待运行功能模块的运行顺序;The second obtaining module 302 is configured to obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
第三获取模块303,设置为获取预存的与目标域名对应的各个待运行功能模块的配置信息;The third obtaining module 303 is configured to obtain pre-stored configuration information of each functional module to be run corresponding to the target domain name;
运行模块304,设置为按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行与该目标域名对应的各个待运行功能模块。The running module 304 is configured to run each function module to be run corresponding to the target domain name according to the acquired running sequence and configuration information of the function module to be run.
其中,第二获取模块,具体设置为:Among them, the second acquisition module is specifically set as:
从预存的各个域名对应的预设功能链表中,获取与目标域名对应的功能链表;每一域名对应的功能链表用于描述与该目标域名对应的各个待运行功能模块的运行顺序。From the pre-stored preset function linked lists corresponding to each domain name, the function linked list corresponding to the target domain name is obtained; the function linked list corresponding to each domain name is used to describe the running sequence of each function module to be run corresponding to the target domain name.
作为本申请实施例一种可选的实施方式,在图7所示装置结构的基础上,如图8所示,本申请实施例的CDN功能模块运行装置还包括:As an optional implementation manner of the embodiment of this application, based on the device structure shown in FIG. 7, as shown in FIG. 8, the CDN function module operation device of the embodiment of this application further includes:
生成模块401,设置为在第一获取模块301获取由客户端发送的请求报文之前,基于边缘节点对应的第一配置文件,生成与各个域名分别对应的第二 配置文件,以及生成与各个域名分别对应的功能链表;第一配置文件中包含边缘节点中的各功能模块的配置信息;The generating module 401 is configured to generate a second configuration file corresponding to each domain name based on the first configuration file corresponding to the edge node before the first obtaining module 301 obtains the request message sent by the client, and to generate a second configuration file corresponding to each domain name. Respectively corresponding function linked lists; the first configuration file contains configuration information of each function module in the edge node;
存储模块402,设置为将生成的与各个域名分别对应的第二配置文件以及功能链表存储在共享内存中。The storage module 402 is configured to store the generated second configuration file and the function linked list corresponding to each domain name in the shared memory.
其中,上述生成模块包括:第二配置文件生成子模块和功能链表生成子模块,如图9所示,上述第二配置文件生成子模块包括:Wherein, the foregoing generating module includes: a second configuration file generating submodule and a function linked list generating submodule. As shown in FIG. 9, the foregoing second configuration file generating submodule includes:
划分单元4011,设置为遍历第一配置文件中的配置信息,将属于不同域名的配置信息进行划分;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;
生成单元4012,设置为基于划分后的各个域名的配置信息,生成与各个域名分别对应的第二配置文件。The generating unit 4012 is configured to generate a second configuration file corresponding to each domain name based on the divided configuration information of each domain name.
如图10所示,生成模块包括功能链表生成子模块;该功能链表生成子模块包括:As shown in Figure 10, the generating module includes a function linked list generating submodule; the function linked list generating submodule includes:
查找单元4013,设置为针对各个域名中的每一域名,在与该域名对应的第二配置文件中,查找预设标识,其中,一个预设标识对应一个功能模块;The searching unit 4013 is configured to, for each domain name in each domain name, search for a preset identifier in the second configuration file corresponding to the domain name, where one preset identifier corresponds to one functional module;
确定单元4014,设置为在预设的功能映射表中,确定查找到的预设标识所对应的Lua文件的名称,功能映射表中保存有预设标识与Lua文件之间的映射关系;The determining unit 4014 is configured to determine the name of the Lua file corresponding to the found preset identifier in the preset function mapping table, and the function mapping table stores the mapping relationship between the preset identifier and the Lua file;
写入单元4015,设置为按照与各Lua文件对应的功能模块的运行顺序,将所确定的Lua文件的名称写入与该域名对应的功能链表中,得到与该域名对应的功能链表。The writing unit 4015 is configured to write the name of the determined Lua file in the function linked list corresponding to the domain name according to the running sequence of the function modules corresponding to each Lua file to obtain the function linked list corresponding to the domain name.
其中,第二获取模块,具体用于:Among them, the second acquisition module is specifically used for:
从共享内存中所存储目标域名对应的第二配置文件中,获取与目标域名对应的各个待运行功能模块的配置信息。From the second configuration file corresponding to the target domain name stored in the shared memory, the configuration information of each functional module to be run corresponding to the target domain name is obtained.
本申请实施例提供的一种CDN功能模块运行装置,在获取由客户端发送的请求报文后,边缘节点能够获取预存的与目标域名对应的各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息, 运行该目标域名对应的各个待运行功能模块。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。In the CDN function module running device provided by the embodiment of the present application, after obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each function module to be run corresponding to the target domain name, and obtain the pre-stored The configuration information of each functional module to be run corresponding to the target domain name, and then according to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
需要说明的是,上述CDN功能模块运行装置可以位于CDN的边缘节点中,但并不限于此。It should be noted that the above-mentioned CDN function module operation device may be located in the edge node of the CDN, but is not limited to this.
本申请实施例还提供了一种电子设备,具体可以为服务器,如图11所示,该设备500包括处理器501和机器可读存储介质502,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器执行机器可执行指令实现以下步骤:The embodiment of the present application also provides an electronic device, which may specifically be a server. As shown in FIG. 11, the device 500 includes a processor 501 and a machine-readable storage medium 502. The machine-readable storage medium stores data that can be executed by the processor. The machine executable instructions of the processor execute the machine executable instructions to implement the following steps:
获取由客户端发送的请求报文,请求报文中包括目标域名的信息;Get the request message sent by the client, the request message includes the information of the target domain name;
获取预存的与目标域名对应的各个待运行功能模块的运行顺序;Obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
获取预存的与目标域名对应的各个待运行功能模块的配置信息;Obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name;
按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行目标域名对应的各个待运行功能模块。According to the acquired running sequence and configuration information of each functional module to be run, each functional module to be run corresponding to the target domain name is run.
机器可读存储介质可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The machine-readable storage medium may include random access memory (Random Access Memory, RAM for short), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far away from the foregoing processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The aforementioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP for short) , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
本申请实施例提供的一种电子设备,在获取由客户端发送的请求报文后, 边缘节点能够获取预存的与目标域名对应的各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。In the electronic device provided by the embodiment of the present application, after obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored and target domain name Corresponding to the configuration information of each functional module to be run, and then run each functional module to be run corresponding to the target domain name according to the acquired running sequence and configuration information of each functional module to be run. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时,用以执行如下步骤:The embodiment of the present application also provides a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the following steps are performed:
获取由客户端发送的请求报文,请求报文中包括目标域名的信息;Get the request message sent by the client, the request message includes the information of the target domain name;
获取预存的与目标域名对应的各个待运行功能模块的运行顺序;Obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
获取预存的与目标域名对应的各个待运行功能模块的配置信息;Obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name;
按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行目标域名对应的各个待运行功能模块。According to the acquired running sequence and configuration information of each functional module to be run, each functional module to be run corresponding to the target domain name is run.
本申请实施例提供的一种计算机可读存储介质,在获取由客户端发送的请求报文后,边缘节点能够获取预存的与目标域名对应的各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。A computer-readable storage medium provided by an embodiment of the present application. After obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored The configuration information of each functional module to be run corresponding to the target domain name, and then according to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行以下步骤:The embodiment of the application also provides a computer program product containing instructions, which when running on a computer, causes the computer to perform the following steps:
获取由客户端发送的请求报文,请求报文中包括目标域名的信息;Get the request message sent by the client, the request message includes the information of the target domain name;
获取预存的与目标域名对应的各个待运行功能模块的运行顺序;Obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
获取预存的与目标域名对应的各个待运行功能模块的配置信息;Obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name;
按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行目标域名对应的各个待运行功能模块。According to the acquired running sequence and configuration information of each functional module to be run, each functional module to be run corresponding to the target domain name is run.
本申请实施例提供的一种包含指令的计算机程序产品,在获取由客户端发送的请求报文后,边缘节点能够获取预存的与目标域名对应的各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。The embodiment of the application provides a computer program product containing instructions. After obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored According to the obtained configuration information of each functional module to be run corresponding to the target domain name, and then execute each functional module to be run corresponding to the target domain name according to the acquired running sequence and configuration information of each functional module to be run. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
本申请实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行以下步骤:获取由客户端发送的请求报文,请求报文中包括目标域名的信息;获取预存的与目标域名对应的各个待运行功能模块的运行顺序;获取预存的与目标域名对应的各个待运行功能模块的配置信息;按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行目标域名对应的各个待运行功能模块。The embodiment of the application also provides a computer program, which when it runs on a computer, causes the computer to perform the following steps: obtain a request message sent by a client, the request message includes information about the target domain name; and obtain a pre-stored and The running sequence of each functional module to be run corresponding to the target domain name; to obtain the pre-stored configuration information of each functional module to be run corresponding to the target domain name; to run the target domain name according to the obtained running sequence and configuration information of each functional module to be run The corresponding functional modules to be run.
本申请实施例提供的一种包含指令的计算机程序,在获取由客户端发送的请求报文后,边缘节点能够获取预存的与目标域名对应的各个待运行功能模块的运行顺序,以及获取预存的与目标域名对应的各个待运行功能模块的配置信息,进而按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行该目标域名对应的各个待运行功能模块。由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。The embodiment of the application provides a computer program containing instructions. After obtaining the request message sent by the client, the edge node can obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name, and obtain the pre-stored The configuration information of each functional module to be run corresponding to the target domain name, and then according to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name. Since the running sequence and configuration information of each module to be run corresponding to the target domain name are obtained, each module to be run corresponding to the target domain name can be run, and it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, the waste of computing resources of the edge node can be reduced, the processing time can be shortened, and the processing performance of the edge node can be optimized.
对于装置/电子设备/存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Regarding the device/electronic device/storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply one of these entities or operations. There is any such actual relationship or order between. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also includes Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other same elements in the process, method, article, or equipment including the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above are only preferred embodiments of the present application, and are not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of this application are all included in the protection scope of this application.
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above descriptions are only preferred embodiments of this application and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection of this application. Within the range.
工业实用性Industrial applicability
基于本申请实施例提供的一种CDN功能模块运行方法、运行装置、电子设备及存储介质,由于获取到目标域名对应的各个待运行模块的运行顺序以及配置信息后,便可以运行目标域名对应的各个待运行模块,而不再需要对全量配置文件中各功能模块的开关标识进行遍历判断,因此,能够减少边缘节点的计算资源浪费,缩短处理时间,从而优化边缘节点的处理性能。Based on the CDN function module operating method, operating device, electronic equipment, and storage medium provided by the embodiments of the present application, after obtaining the operating sequence and configuration information of each module to be run corresponding to the target domain name, it can run For each module to be run, it is no longer necessary to traverse and judge the switch identification of each functional module in the full configuration file. Therefore, 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.

Claims (16)

  1. 一种CDN功能模块运行方法,应用于内容分发网络CDN中的边缘节点,所述方法包括:A CDN function module operation method, applied to an edge node in a content distribution network CDN, the method includes:
    获取由客户端发送的请求报文,所述请求报文中包括目标域名的信息;Acquiring a request message sent by the client, the request message including the information of the target domain name;
    获取预存的与所述目标域名对应的各个待运行功能模块的运行顺序;Acquiring the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
    获取预存的与所述目标域名对应的各个待运行功能模块的配置信息;Acquiring pre-stored configuration information of each functional module to be run corresponding to the target domain name;
    按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行与所述目标域名对应的各个待运行功能模块。According to the acquired running sequence and configuration information of each functional module to be run, run each functional module to be run corresponding to the target domain name.
  2. 根据权利要求1所述的方法,其中,所述获取预存的与所述域名对应的各个待运行功能模块的运行顺序的步骤,包括:The method according to claim 1, wherein the step of obtaining the pre-stored running sequence of each functional module to be run corresponding to the domain name comprises:
    从预存的各个域名对应的预设功能链表中,获取与所述目标域名对应的功能链表;每一域名对应的功能链表用于描述与该域名对应的各个待运行功能模块的运行顺序。The function linked list corresponding to the target domain name is obtained from the pre-stored preset function linked list corresponding to each domain name; the function linked list corresponding to each domain name is used to describe the running sequence of each function module to be run corresponding to the domain name.
  3. 根据权利要求2所述的方法,其中,在获取由客户端发送的请求报文之前,所述方法还包括:The method according to claim 2, wherein, before obtaining the request message sent by the client, the method further comprises:
    基于所述边缘节点对应的第一配置文件,生成与各个域名分别对应的第二配置文件,以及生成与各个域名分别对应的功能链表;所述第一配置文件中包含所述边缘节点中的各功能模块的配置信息;将生成的与各个域名分别对应的第二配置文件以及功能链表存储在共享内存中。Based on the first configuration file corresponding to the edge node, a second configuration file corresponding to each domain name is generated, and a function linked list corresponding to each domain name is generated; the first configuration file contains each of the edge nodes Configuration information of the functional module; the generated second configuration file and function linked list corresponding to each domain name are stored in the shared memory.
  4. 根据权利要求3所述的方法,其中,所述基于所述边缘节点对应的第一配置文件,生成与各个域名对应的第二配置文件的步骤,包括:The method according to claim 3, wherein the step of generating a second configuration file corresponding to each domain name based on the first configuration file corresponding to the edge node comprises:
    遍历所述第一配置文件中的配置信息,将属于不同域名的配置信息进行划分;基于划分后的各个域名的配置信息,生成与各个域名分别对应的第二配置文件。Traverse the configuration information in the first configuration file to divide the configuration information belonging to different domain names; based on the divided configuration information of each domain name, generate a second configuration file corresponding to each domain name.
  5. 根据权利要求3所述的方法,其中,所述生成与各个域名对应的功能链表的步骤,包括:3. The method according to claim 3, wherein the step of generating a function linked list corresponding to each domain name comprises:
    针对各个域名中的每一域名,在与该域名对应的第二配置文件中,查找预设标识,其中,一个预设标识对应一个功能模块;For each domain name in each domain name, search for a preset identifier in the second configuration file corresponding to the domain name, where one preset identifier corresponds to one functional module;
    在预设的功能映射表中,确定查找到的预设标识所对应的Lua文件的名 称,所述功能映射表中保存有预设标识与Lua文件之间的映射关系;In the preset function mapping table, determine the name of the Lua file corresponding to the found preset identifier, and the function mapping table stores the mapping relationship between the preset identifier and the Lua file;
    按照与各Lua文件对应的功能模块的运行顺序,将所确定的所述Lua文件的名称写入与该域名对应的功能链表中,得到与该域名对应的功能链表。According to the running sequence of the function modules corresponding to each Lua file, the determined name of the Lua file is written into the function linked list corresponding to the domain name to obtain the function linked list corresponding to the domain name.
  6. 根据权利要求3所述的方法,其中,所述获取预存的与所述目标域名对应的各个待运行功能模块的配置信息的步骤,包括:The method according to claim 3, wherein the step of obtaining the pre-stored configuration information of each functional module to be run corresponding to the target domain name comprises:
    从共享内存中所存储的所述目标域名对应的第二配置文件中,获取与所述目标域名对应的各个待运行功能模块的配置信息。From the second configuration file corresponding to the target domain name stored in the shared memory, the configuration information of each functional module to be run corresponding to the target domain name is obtained.
  7. 一种CDN功能模块运行装置,应用于内容分发网络CDN中的边缘节点,所述装置包括:A CDN function module operating device, applied to an edge node in a content distribution network CDN, and the device includes:
    第一获取模块,设置为获取由客户端发送的请求报文,所述请求报文中包括目标域名的信息;The first obtaining module is configured to obtain a request message sent by the client, and the request message includes information of the target domain name;
    第二获取模块,设置为获取预存的与所述目标域名对应的各个待运行功能模块的运行顺序;The second obtaining module is configured to obtain the pre-stored running sequence of each functional module to be run corresponding to the target domain name;
    第三获取模块,设置为获取预存的与所述目标域名对应的各个待运行功能模块的配置信息;The third obtaining module is configured to obtain pre-stored configuration information of each functional module to be run corresponding to the target domain name;
    运行模块,设置为按照所获取到的各个待运行功能模块的运行顺序和配置信息,运行与所述目标域名对应的各个待运行功能模块。The running module is set to run each function module to be run corresponding to the target domain name according to the obtained running sequence and configuration information of the function module to be run.
  8. 根据权利要求7所述的装置,其中,所述第二获取模块,具体设置为:The device according to claim 7, wherein the second acquiring module is specifically configured as:
    从预存的各个域名对应的预设功能链表中,获取与所述目标域名对应的功能链表;每一域名对应的功能链表用于描述与该域名对应的各个待运行功能模块的运行顺序。The function linked list corresponding to the target domain name is obtained from the pre-stored preset function linked list corresponding to each domain name; the function linked list corresponding to each domain name is used to describe the running sequence of each function module to be run corresponding to the domain name.
  9. 根据权利要求8所述的装置,其中,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    生成模块,设置为在所述第一获取模块获取由客户端发送的请求报文之前,基于所述边缘节点对应的第一配置文件,生成与各个域名分别对应的第二配置文件,以及生成与各个域名分别对应的功能链表;所述第一配置文件中包含所述边缘节点中的各功能模块的配置信息;The generating module is configured to generate a second configuration file corresponding to each domain name based on the first configuration file corresponding to the edge node before the first obtaining module obtains the request message sent by the client, and generate and A functional linked list corresponding to each domain name; the first configuration file contains configuration information of each functional module in the edge node;
    存储模块,设置为将生成的与各个域名分别对应的第二配置文件以及功能链表存储在共享内存中。The storage module is configured to store the generated second configuration file and the function linked list corresponding to each domain name in the shared memory.
  10. 根据权利要求9所述的装置,其中,所述生成模块包括第二配置文件 生成子模块,所述第二配置文件生成子模块包括:The apparatus according to claim 9, wherein the generating module includes a second configuration file generating sub-module, and the second configuration file generating sub-module includes:
    划分单元,设置为遍历所述第一配置文件中的配置信息,将属于不同域名的配置信息进行划分;The dividing unit 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 is configured to generate a second configuration file corresponding to each domain name based on the divided configuration information of each domain name.
  11. 根据权利要求9所述的装置,其中,所述生成模块包括功能链表生成子模块,所述功能链表生成子模块包括:The apparatus according to claim 9, wherein the generating module comprises a function linked list generating sub-module, and the function linked list generating sub-module comprises:
    查找单元,设置为针对各个域名中的每一域名,在与该域名对应的第二配置文件中,查找预设标识,其中,一个预设标识对应一个功能模块;The search unit is set to search for a preset identifier in a second configuration file corresponding to the domain name for each domain name in each domain name, where one preset identifier corresponds to one functional module;
    确定单元,设置为在预设的功能映射表中,确定查找到的预设标识所对应的Lua文件的名称,所述功能映射表中保存有预设标识与Lua文件之间的映射关系;The determining unit is configured to determine the name of the Lua file corresponding to the found preset identifier in the preset function mapping table, where the mapping relationship between the preset identifier and the Lua file is stored in the function mapping table;
    写入单元,设置为按照与各Lua文件对应的功能模块的运行顺序,将所确定的所述Lua文件的名称写入与该域名对应的功能链表中,得到与该域名对应的功能链表。The writing unit is configured to write the determined name of the Lua file into the function linked list corresponding to the domain name according to the running sequence of the function modules corresponding to each Lua file, to obtain the function linked list corresponding to the domain name.
  12. 根据权利要求9所述的装置,其中,所述第二获取模块,具体设置为:The device according to claim 9, wherein the second acquiring module is specifically configured to:
    从共享内存中所存储的所述目标域名对应的第二配置文件中,获取与所述目标域名对应的各个待运行功能模块的配置信息。From the second configuration file corresponding to the target domain name stored in the shared memory, the configuration information of each functional module to be run corresponding to the target domain name is obtained.
  13. 一种电子设备,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现权利要求1-6任一项所述的CDN功能模块运行方法的方法步骤。An electronic device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement The method steps of the CDN function module operation method according to any one of claims 1-6.
  14. 一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-6任一项所述的CDN功能模块运行方法的方法步骤。A computer-readable storage medium in which a computer program is stored, and when the computer program is executed by a processor, the method steps of the CDN function module operating method according to any one of claims 1 to 6 are realized .
  15. 一种包含指令的计算机程序产品,所述包含指令的计算机程序产品在计算机上运行时,使得计算机执行权利要求1-6任一所述的方法步骤。A computer program product containing instructions, which when running on a computer, causes the computer to execute the method steps of any one of claims 1-6.
  16. 一种计算机程序,所述计算机程序在计算机上运行时,使得计算机执行权利要求1-6任一所述的方法步骤。A computer program that, when run on a computer, causes the computer to execute the method steps of any one of claims 1-6.
PCT/CN2020/098178 2019-06-28 2020-06-24 Cdn functional module running method and running apparatus, and electronic device and storage medium WO2020259608A1 (en)

Applications Claiming Priority (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
CN201910579778.5 2019-06-28

Publications (1)

Publication Number Publication Date
WO2020259608A1 true WO2020259608A1 (en) 2020-12-30

Family

ID=73891562

Family Applications (1)

Application Number Title Priority Date Filing Date
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

Country Status (2)

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

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113286014A (en) * 2021-05-24 2021-08-20 平安普惠企业管理有限公司 Dynamic configuration method and device of basic domain name and related equipment
CN113300936A (en) * 2021-02-01 2021-08-24 阿里巴巴集团控股有限公司 CDN node, edge node signaling adaptation method, device and storage medium
CN114020346A (en) * 2021-09-29 2022-02-08 苏州浪潮智能科技有限公司 Configuration file processing method and device, electronic equipment and storage medium
CN114244714A (en) * 2021-12-14 2022-03-25 北京金山云网络技术有限公司 Domain name configuration management method, device and system and computer readable storage medium
CN114257503A (en) * 2021-11-19 2022-03-29 网宿科技股份有限公司 Method, server, system and storage medium for accelerating domain name deployment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112995348B (en) * 2021-05-12 2021-09-07 北京金山云网络技术有限公司 Control method, device and system of Internet of things equipment
CN114461296B (en) * 2021-12-29 2024-01-02 天翼云科技有限公司 Openresty-based service platform development and access method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392008A (en) * 2014-12-19 2015-03-04 北京奇虎科技有限公司 Webpage data acquisition method, browser client end and CDN (content distribution network) 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
CN108769743A (en) * 2018-05-11 2018-11-06 中兴通讯股份有限公司 A kind of video playing control method, system, node and computer storage media
CN110968356A (en) * 2018-09-29 2020-04-07 北京金山云网络技术有限公司 Method and device for acquiring configuration information

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103377059B (en) * 2012-04-23 2016-09-28 阿里巴巴集团控股有限公司 Functional module dynamic loading method based on jQuery framework and device
CN105897822B (en) * 2015-11-11 2019-07-26 法法汽车(中国)有限公司 A kind of content distributing network CDN node selection method and its device
CN109150930B (en) * 2017-06-15 2020-12-18 北京金山云网络技术有限公司 Configuration information loading method and device and service processing method and device
CN109582301B (en) * 2018-12-03 2022-01-28 深圳前海微众银行股份有限公司 Service processing method, device, equipment and medium based on task scheduling system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392008A (en) * 2014-12-19 2015-03-04 北京奇虎科技有限公司 Webpage data acquisition method, browser client end and CDN (content distribution network) 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
CN108769743A (en) * 2018-05-11 2018-11-06 中兴通讯股份有限公司 A kind of video playing control method, system, node and computer storage media
CN110968356A (en) * 2018-09-29 2020-04-07 北京金山云网络技术有限公司 Method and device for acquiring configuration information

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113300936A (en) * 2021-02-01 2021-08-24 阿里巴巴集团控股有限公司 CDN node, edge node signaling adaptation method, device and storage medium
CN113300936B (en) * 2021-02-01 2023-04-14 阿里巴巴集团控股有限公司 CDN node, edge node signaling adaptation method, device and storage medium
CN113286014A (en) * 2021-05-24 2021-08-20 平安普惠企业管理有限公司 Dynamic configuration method and device of basic domain name and related equipment
CN114020346A (en) * 2021-09-29 2022-02-08 苏州浪潮智能科技有限公司 Configuration file processing method and device, electronic equipment and storage medium
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
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

Also Published As

Publication number Publication date
CN112153095A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
WO2020259608A1 (en) Cdn functional module running method and running apparatus, and electronic device and storage medium
US10838769B2 (en) Application program interface based service lookup in a service architecture
US20140122572A1 (en) Enterprise service bus routing system
US11824787B2 (en) Method and apparatus for node speed limiting, electronic device and storage medium
CN109660578B (en) CDN back-to-source processing method, device and system
US10509843B2 (en) Systems and methods for managing tabs in web applications
CN113315706B (en) Private cloud flow control method, device and system
CN112513830A (en) Back-source method and related device in content distribution network
WO2018192403A1 (en) Method and apparatus for loading and optimizing bind configuration, medium, and computer device
CN113141405A (en) Service access method, middleware system, electronic device, and storage medium
CN111225018A (en) Request message processing method and device and electronic equipment
WO2024021493A1 (en) Data packet decapsulation and unloading method and apparatus, electronic device, and storage medium
CN111694639A (en) Method and device for updating address of process container and electronic equipment
US9736082B2 (en) Intelligent high-volume cloud application programming interface request caching
US8166200B2 (en) Smart routing
US9639381B2 (en) Sharing applications in a java virtual machine
US20170155587A1 (en) Forwarding table compression
US20160314155A1 (en) Data integration pipeline
CN110764930B (en) Request or response processing method and device based on message mode
CN116962348A (en) Domain name resolution-based video flow processing method, system and electronic equipment
CN109450798B (en) Method for managing routing table information and computer-readable storage medium
WO2022078001A1 (en) Method and apparatus for managing static rule, and electronic device and storage medium
CN113961522A (en) Method, device, equipment and storage medium for partitioning pcap data packet
US11140183B2 (en) Determining criticality of identified enterprise assets using network session information
CN116600031B (en) Message processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20832038

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07/06/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20832038

Country of ref document: EP

Kind code of ref document: A1