A gateway configuration loading and obtaining method, device and computer equipment

By updating the configuration information in the service process and shared memory in the CDN gateway, the problem in the existing technology that configuration files need to be restarted to load is solved, real-time configuration updates and efficient loading of the CDN gateway are realized, and operation and maintenance efficiency and business support are improved. ability.

CN114465882BActive Publication Date: 2024-10-01CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111608437.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-10-01
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Loading existing CDN gateway configuration files requires restarting the service, resulting in low configuration loading efficiency and heavy operation and maintenance workload, making it impossible to load updated configuration rules in real time.

Method used

By obtaining the configuration loading instructions, parsing the instructions to obtain the objects and operations to be loaded, updating the configuration information in the service process cache, and updating the configuration information in the shared memory when necessary, ensuring that all processes can access the updated configuration without restarting. The updated configuration is loaded.

Benefits of technology

It improves the efficiency and speed of configuration loading, reduces the operation and maintenance workload, realizes real-time configuration updates of CDN gateways, and supports business volume growth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114465882B_ABST
    Figure CN114465882B_ABST
Patent Text Reader

Abstract

This invention discloses a gateway configuration loading and acquisition method, apparatus, and computer device. The method includes: acquiring a configuration loading instruction; parsing the configuration loading instruction to obtain the object to be loaded and configuration operations; updating configuration information in the service process cache based on the object to be loaded and configuration operations; if the service process is a preset external process, updating the configuration information in shared memory based on the object to be loaded and configuration operations, where shared memory is a storage space accessible to all processes; and sending the configuration loading instruction to processes other than the preset external process through the preset external process, so that processes other than the preset external process can acquire and load the updated configuration information in the shared file. Acquiring the configuration loading instruction through the external process allows for real-time configuration updates, and the use of multiple service processes improves operational efficiency and speed. The shared memory configuration enables loading of updated configurations without a restart.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a gateway configuration loading and acquisition method, device and computer equipment. Background Art

[0002] CDN (Content Delivery Network, referred to as CDN) is an intelligent virtual network added between the user and the request server. The main principle is to cache content copies to the cache server at the edge of the network, and redirect the original user request to the cache server closest to the user and in the best state according to the request content and real-time network conditions, so that users can obtain the required content nearby, thereby effectively shortening the delay of users viewing content and alleviating the backbone network traffic congestion caused by a large number of remote access. CDN is an overall system involving technologies such as request redirection, load balancing, content distribution, and content caching, which realizes centralized scheduling of traffic and distribution of content. First, the Uniform Resource Locator (URL) requested by the user enters the CDN system, and then the scheduling center in the CDN selects the best cache server to provide services for the user based on the user terminal information, cache server information, and request resource information. Finally, the cache server returns the user's requested content to the user.

[0003] As part of the entire system, the CDN gateway is responsible for processing requests entering the CDN and forwarding the processed requests to the cache server or restricting the access of the requests. At present, the gateway's processing rules for user requests are usually stored in the form of configuration files, which specify the processing rules for various request URLs. When the gateway service starts, the configuration file is directly loaded. When the configuration of the configuration file changes, you need to restart the gateway service or reload the configuration so that the gateway reinitializes the configuration before the updated configuration takes effect. For example, Nginx, one of the most commonly used frameworks, will load the configuration at startup, and you cannot add, delete or modify the configuration during the execution process. If you want to load and use the newly added, deleted or modified configuration in real time, you need to restart Nginx, and then the Nginx framework will reload the newly added, deleted or modified configuration. This service restart configuration loading method increases the execution burden of the gateway service, reduces the configuration loading efficiency, and increases the workload of the gateway operation and maintenance personnel, which is not conducive to the growth of CDN business volume.

[0004] Therefore, a configuration loading method suitable for a CDN gateway without restarting is needed to load configuration rules in real time. Summary of the invention

[0005] Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that the configuration file needs to be restarted when loading, thereby providing a gateway configuration loading and acquisition method, device and computer equipment.

[0006] According to a first aspect, an embodiment of the present invention discloses a gateway configuration loading method, including: obtaining a configuration loading instruction; parsing the configuration loading instruction to obtain an object to be loaded and a configuration operation; updating the configuration information in a service process cache based on the object to be loaded and the configuration operation; if the service process is a preset external process, updating the configuration information in a shared memory based on the object to be loaded and the configuration operation, the shared memory being a storage space accessible to all processes; sending the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process obtains the updated configuration information in the shared file for loading.

[0007] Optionally, the method further includes: if the service process is not a preset external process, the cache configuration loading is completed.

[0008] Optionally, if the service process is a preset external process, before sending the configuration loading instruction to a process other than the preset external process through the preset external process, the method further includes: updating the configuration file based on the operation type of the object to be loaded; if the configuration information corresponding to the configuration loading instruction is not found in the service process cache and shared memory, reading the updated configuration file to obtain the configuration information; and caching the obtained configuration information in the shared memory.

[0009] Optionally, updating the configuration information in the service process cache based on the object to be loaded and the configuration operation includes: updating the value of the corresponding flag key in the service process cache based on the object to be loaded and the configuration operation; and obtaining the updated configuration information in the service process cache based on the updated flag key and the value corresponding to the flag key.

[0010] Optionally, updating the configuration information in the shared memory based on the object to be loaded and the configuration operation includes: updating the value of the corresponding flag key in the shared cache based on the object to be loaded and the configuration operation; and updating the configuration information in the shared cache based on the updated flag key and the value corresponding to the flag key.

[0011] According to the second aspect, an embodiment of the present invention further discloses a gateway configuration acquisition method, comprising: acquiring a configuration loading instruction; judging whether there is a cache configuration corresponding to the configuration loading instruction in the current service process based on the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the current service process; if there is no cache configuration corresponding to the configuration loading instruction, judging whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the shared memory; if there is no cache configuration corresponding to the configuration loading instruction, judging whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the configuration file; if there is no cache configuration corresponding to the configuration loading instruction, returning an error prompt; wherein, the cache configuration in the current service process, shared memory and configuration file is generated by loading using the gateway configuration loading method described in the first aspect or any optional real-time method of the first aspect.

[0012] According to the third aspect, an embodiment of the present invention also discloses a gateway configuration loading device, including: a first acquisition module, used to acquire a configuration loading instruction; a parsing module, used to parse the configuration loading instruction to obtain an object to be loaded and a configuration operation; a first update module, used to update the configuration information in the service process cache based on the object to be loaded and the configuration operation; a second update module, used to update the configuration information in the shared memory based on the object to be loaded and the configuration operation if the service process is a preset external process, and the shared memory is a storage space accessible to all processes; a sending module, used to send the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process obtains the updated configuration information in the shared file for loading.

[0013] According to the fourth aspect, an embodiment of the present invention further discloses a gateway configuration acquisition device, comprising: a second acquisition module, used to acquire a configuration loading instruction; a first judgment module, used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the current service process based on the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the current service process; a second judgment module, used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the shared memory; a third judgment module, used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the configuration file; an error prompt module, used to return an error prompt if there is no cache configuration corresponding to the configuration loading instruction.

[0014] According to the fifth aspect, an embodiment of the present invention also discloses a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the gateway configuration loading method described in the first aspect or any optional embodiment of the first aspect or the gateway configuration acquisition method described in the second aspect or any optional embodiment of the second aspect.

[0015] According to the fourth aspect, an embodiment of the present invention further discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the gateway configuration loading method described in the first aspect or any optional embodiment of the first aspect or the gateway configuration acquisition method described in the second aspect or any optional embodiment of the second aspect are implemented.

[0016] The technical solution of the present invention has the following advantages:

[0017] The gateway configuration loading and acquisition method, device and computer equipment provided by the present invention include: obtaining a configuration loading instruction; parsing the configuration loading instruction to obtain an object to be loaded and a configuration operation; updating the configuration information in the service process cache based on the object to be loaded and the configuration operation; if the service process is a preset external process, then updating the configuration information in the shared memory based on the object to be loaded and the configuration operation, the shared memory being a storage space accessible to all processes; sending the configuration loading instruction to processes other than the preset external process through the preset external process, so that the processes other than the preset external process obtain the updated configuration information in the shared file for loading. By obtaining the configuration loading instruction through the external process, the configuration can be updated in real time, the operation efficiency and speed are improved through multiple service processes, and the setting of the shared memory enables the updated configuration to be loaded without restarting. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flowchart of a specific example of a gateway configuration loading method in an embodiment of the present invention;

[0020] Figure 2 A flowchart of a specific example of a method for obtaining a gateway configuration in an embodiment of the present invention;

[0021] Figure 3 A principle block diagram of a specific example of a gateway configuration loading device in an embodiment of the present invention;

[0022] Figure 4 A principle block diagram of a specific example of a gateway configuration acquisition device in an embodiment of the present invention;

[0023] Figure 5 A specific example diagram of a computer device in an embodiment of the present invention;

[0024] Figure 6 A schematic diagram of a specific example of a gateway configuration loading method in an embodiment of the present invention;

[0025] Figure 7 A schematic diagram of a specific example of a gateway configuration loading method in an embodiment of the present invention;

[0026] Figure 8The present invention is a flow chart of a specific example of a gateway configuration loading method in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0029] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0030] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0031] The embodiment of the present invention discloses a gateway configuration loading method. When a CDN gateway loads a configuration file, a multi-level storage method is used to update the configuration file. The first level is a process cache that is only accessible to the current process; the second level is a shared memory that is accessible to all gateway processes; the third level is a configuration file that is accessible to all gateway processes. The relationship diagram of the three levels is shown in FIG. Figure 6 As shown, the first level, the second level, and the third level described in this embodiment are not used to limit the priority order between the levels, but are only used to indicate that the storage method includes multi-level storage.

[0032] like Figure 1 As shown, the gateway configuration loading method of this embodiment includes the following steps:

[0033] Step 101: Obtain a configuration loading instruction. Exemplarily, the configuration loading instruction includes an object to be loaded and a corresponding configuration operation of the object to be loaded. The embodiment of the present invention does not limit the specific form of the configuration loading instruction, and those skilled in the art can determine it according to actual needs.

[0034] Step 102: Parse the configuration loading instruction to obtain the object to be loaded and the configuration operation. Exemplarily, the configuration operation can be to add, delete or modify. In the embodiment of the present invention, the preset configuration operation is an enumeration class, in which the specific enumeration values ​​include update and delete, and the update includes adding or modifying the configuration. Determine the operation enumeration value of the object to be loaded from the preset enumeration class, and then determine the operation type of the configuration. The embodiment of the present invention does not limit the specific content of the configuration operation, and those skilled in the art can determine it according to actual needs.

[0035] Step 103: Update the configuration information in the service process cache based on the object to be loaded and the configuration operation. Exemplarily, the parsed corresponding object to be loaded and the corresponding configuration operation are updated to the service process, where the service process is the corresponding process in the third layer.

[0036] Step 104: If the service process is a preset external process, then based on the object to be loaded and the configuration operation, the configuration information in the shared memory is updated, and the shared memory is a storage space accessible to all processes.

[0037] Exemplarily, whether it is an external process can be determined based on the port number corresponding to the service process number. Different service processes have different configuration loading interfaces. This embodiment uses different ports to distinguish different service process interfaces. For example, the port number of the external process is 10000, and the port numbers of other service processes increase in sequence. The relationship diagram of the external process and other service processes is shown in FIG. Figure 7 As shown, the external process obtains the configuration loading instruction, and then the external process sends the corresponding configuration loading instruction to others.

[0038] Step 105: Send the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process obtains the updated configuration information in the shared file for loading.

[0039] Exemplarily, the external process is to set one of the cache processes in the first layer as an external process, and the external process receives the configuration loading instruction sent from the outside to the gateway. After completing the update of the configuration loading instruction, the external process sends the configuration loading instruction to the service process other than the external process, wherein the configuration loading instruction is obtained by the external process, and other service processes update the loading configuration after receiving the notification. The specific update loading method is that the external process updates the object to be loaded and the configuration operation obtained by parsing the configuration loading instruction to the shared memory of the second layer, and other service processes can obtain the corresponding configuration loading instruction in the shared memory and cache it in the corresponding service process.

[0040] The gateway configuration loading method provided by the present invention includes: obtaining a configuration loading instruction; parsing the configuration loading instruction to obtain an object to be loaded and a configuration operation; updating the configuration information in the service process cache based on the object to be loaded and the configuration operation; if the service process is a preset external process, then updating the configuration information in the shared memory based on the object to be loaded and the configuration operation, the shared memory being a storage space accessible to all processes; sending the configuration loading instruction to processes other than the preset external process through the preset external process, so that the processes other than the preset external process obtain the updated configuration information in the shared file for loading. By obtaining the configuration loading instruction through the external process, the configuration can be updated in real time, the operation efficiency and speed are improved through multiple service processes, and the setting of the shared memory enables the updated configuration to be loaded without restarting.

[0041] As an optional implementation of the present invention, the method further includes: if the service process is not a preset external process, the cache configuration loading is completed. Exemplarily, after completing the parsing of the configuration loading instruction, if the current service process is not an external process, the cache configuration loading is completed, and the reception of the configuration loading instruction sent from the outside to the gateway is completed. The service process is directly loaded, avoiding direct operation of the configuration file, thereby avoiding restarting the gateway, achieving real-time acquisition of the configuration loading instruction, and improving the speed of configuration loading.

[0042] As an optional embodiment of the present invention, after step 104 and before step 105, as Figure 8 The method also includes step 106: updating the configuration file based on the operation type of the object to be loaded; if the configuration information corresponding to the configuration loading instruction is not found in the service process cache and the shared memory, reading the updated configuration file to obtain the configuration information; and caching the obtained configuration information in the shared memory.

[0043] Exemplarily, when the service process determines that it is an external process, after updating the parsed operation type of the object to be loaded to the shared memory, it is necessary to update the operation type of the object to be loaded to the third-layer configuration file. The name of the configuration file is an identification value of the object to be loaded, which is the same as the identification value used by the process cache. Operations on the configuration file include rewriting or creating a new file or deleting an existing file.

[0044] As an optional implementation of the present invention, step 103 includes: updating the value of the corresponding flag key in the service process cache based on the object to be loaded and the configuration operation; and obtaining the configuration information in the updated service process cache based on the updated flag key and the value corresponding to the flag key.

[0045] Exemplarily, the object to be loaded and the configuration operation are cached in the corresponding service process in the form of a key-value pair, where the key is an identification value of the object to be loaded and the value is the configuration to be loaded. If it is an update operation, the value corresponding to the configuration identification key is modified to the new configuration; if it is a delete operation, the corresponding key value is deleted.

[0046] As an optional embodiment of the present invention, in step 104, the configuration information in the shared memory is updated based on the object to be loaded and the configuration operation, including: updating the value of the corresponding flag key in the shared cache based on the object to be loaded and the configuration operation; updating the configuration information in the shared cache based on the updated flag key and the value corresponding to the flag key.

[0047] Exemplarily, the object to be loaded and the configuration operation are cached in the shared memory, which is also stored in the form of a key-value pair, where the key is an identification value of the object to be loaded, which is the same as the identification value in the process cache, and the value is the configuration to be loaded. If it is an update operation, the value corresponding to the configuration identification key is modified to the new configuration; if it is a delete operation, the corresponding key value is deleted.

[0048] The embodiment of the present invention also discloses a gateway configuration acquisition method. In the gateway configuration acquisition method, the cache configuration in the current service process, shared memory and configuration file is generated by loading using the gateway configuration loading method described in any of the above embodiments, such as Figure 2 As shown, the method includes:

[0049] Step 201: Obtain a configuration loading instruction. Exemplarily, the configuration loading instruction includes an object to be loaded and a corresponding configuration operation of the object to be loaded. The embodiment of the present invention does not limit the specific form of the configuration loading instruction, and those skilled in the art can determine it according to actual needs.

[0050] Step 202: Based on the configuration loading instruction, determine whether there is a cache configuration corresponding to the configuration loading instruction in the current service process; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the current service process.

[0051] Exemplarily, to determine whether the corresponding cache configuration is stored in the preset service process cache, it is first necessary to obtain the identification key value of the cache configuration stored in the process cache, and then retrieve the cache in the service process. If the required key value is retrieved in the service process cache, the corresponding cache configuration is obtained.

[0052] Step 203: If there is no cache configuration corresponding to the configuration loading instruction, determine whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the shared memory.

[0053] Exemplarily, when there is no corresponding identification key value in the service process, it is determined whether the corresponding cache configuration is stored in the shared memory cache. First, it is necessary to obtain the identification key value of the cache configuration stored in the shared memory, and then retrieve the cache in the shared memory. If the required key value is retrieved in the shared memory cache, the corresponding cache configuration is extracted from the shared memory.

[0054] Step 204: If there is no cache configuration corresponding to the configuration loading instruction, determine whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the configuration file.

[0055] Exemplarily, when there is no corresponding identification key value in the shared memory, it is determined whether the corresponding cache configuration is stored in the locally stored configuration file. First, it is necessary to obtain the identification key value of the cache configuration stored in the configuration file, and then retrieve the cache in the configuration file. If the required key value is retrieved in the configuration file cache, the corresponding cache configuration is extracted from the configuration file.

[0056] Step 205: If there is no cache configuration corresponding to the configuration loading instruction, an error message is returned. For example, if the corresponding cache configuration cannot be obtained in the configuration file, there is no corresponding cache configuration in the gateway, and an error message is returned.

[0057] The gateway configuration acquisition method disclosed in the embodiment of the present invention includes: acquiring a configuration loading instruction; judging whether there is a cache configuration corresponding to the configuration loading instruction in the current service process based on the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the current service process; if there is no cache configuration corresponding to the configuration loading instruction, judging whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the shared memory; if there is no cache configuration corresponding to the configuration loading instruction, judging whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the configuration file; if there is no cache configuration corresponding to the configuration loading instruction, returning an error prompt. The service process can update the configuration in real time by retrieving the three-level storage of the local service process, shared memory and configuration file, thereby improving the operation efficiency and speed, and setting the shared memory realizes that the updated configuration can be loaded without restarting.

[0058] The embodiment of the present invention also discloses a gateway configuration loading device, such as Figure 3 As shown, the device comprises:

[0059] The first acquisition module 301 is used to acquire a configuration loading instruction. For example, the details are shown in step 101 of the gateway configuration loading method in the above embodiment, which will not be described here.

[0060] The parsing module 302 is used to parse the configuration loading instruction to obtain the object to be loaded and the configuration operation. For example, the details are shown in step 102 of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0061] The first updating module 303 is used to update the configuration information in the service process cache based on the object to be loaded and the configuration operation. For example, the details are shown in step 103 of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0062] The second update module 304 is used to update the configuration information in the shared memory based on the object to be loaded and the configuration operation if the service process is a preset external process. The shared memory is a storage space accessible to all processes. For example, the details are shown in step 104 of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0063] The sending module 305 is used to send the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process obtains the updated configuration information in the shared file for loading. For example, the details are shown in step 105 of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0064] The gateway configuration loading device provided by the present invention includes: a first acquisition module 301, which is used to acquire a configuration loading instruction; a parsing module 302, which is used to parse the configuration loading instruction to obtain an object to be loaded and a configuration operation; a first update module 303, which is used to update the configuration information in the service process cache based on the object to be loaded and the configuration operation; a second update module 304, which is used to update the configuration information in the shared memory based on the object to be loaded and the configuration operation if the service process is a preset external process, and the shared memory is a storage space accessible to all processes; a sending module 305, which is used to send the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process acquires the updated configuration information in the shared file for loading. By acquiring the configuration loading instruction through the external process, the configuration can be updated in real time, the operation efficiency and speed are improved through multiple service processes, and the setting of the shared memory realizes that the updated configuration can be loaded without restarting.

[0065] As an optional implementation of the present invention, the device further includes: a completion module, which is used to complete the cache configuration loading if the service process is not a preset external process. For example, the details are shown in the content of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0066] As an optional implementation of the present invention, after the first update module 303 and before the sending module 305, the device further includes: an update submodule for updating the configuration file based on the operation type of the object to be loaded; a reading submodule for reading the updated configuration file to obtain the configuration information if the configuration information corresponding to the configuration loading instruction is not found in the service process cache and shared memory; and a cache module for caching the obtained configuration information into the shared memory. For example, the details are shown in the content of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0067] As an optional implementation of the present invention, the first update module 303 includes: a first flag key module, which is used to update the value of the corresponding flag key in the service process cache based on the object to be loaded and the configuration operation; a first key value module, which is used to obtain the configuration information in the updated service process cache based on the updated flag key and the value corresponding to the flag key. For example, the details are shown in step 103 of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0068] As an optional implementation of the present invention, in the second update module 304, the configuration information in the shared memory is updated based on the object to be loaded and the configuration operation, including: a second flag key module, used to update the value of the corresponding flag key in the shared cache based on the object to be loaded and the configuration operation; a second key value module, used to update the configuration information in the shared cache based on the updated flag key and the value corresponding to the flag key. For example, the details are shown in step 104 of the gateway configuration loading method in the above embodiment, which will not be repeated here.

[0069] The embodiment of the present invention also discloses a gateway configuration acquisition device, such as Figure 4 As shown, the device comprises:

[0070] The second acquisition module 401 is used to acquire a configuration loading instruction. For example, the details are shown in step 201 in the above-mentioned gateway configuration acquisition method embodiment, which will not be described in detail here.

[0071] The first judgment module 402 is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the current service process based on the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, the cache configuration is extracted from the current service process. For example, the details are shown in step 202 in the above-mentioned gateway configuration acquisition method embodiment, which will not be repeated here.

[0072] The second judgment module 403 is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the shared memory. For example, the details are shown in step 203 in the above-mentioned gateway configuration acquisition method embodiment, which will not be repeated here.

[0073] The third judgment module 404 is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the configuration file. For example, the details are shown in step 204 in the above-mentioned gateway configuration acquisition method embodiment, which will not be repeated here.

[0074] The error prompt module 405 is used to return an error prompt if there is no cache configuration corresponding to the configuration loading instruction. For example, the details are shown in step 205 in the above-mentioned gateway configuration acquisition method embodiment, which will not be repeated here.

[0075] The gateway configuration loading device provided by the present invention includes a second acquisition module 401, which is used to acquire a configuration loading instruction; a first judgment module 402, which is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the current service process based on the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, the cache configuration is extracted from the current service process; a second judgment module 403, which is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, the cache configuration is extracted from the shared memory; a third judgment module 404, which is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, the cache configuration is extracted from the configuration file; an error prompt module 405, which is used to return an error prompt if there is no cache configuration corresponding to the configuration loading instruction. The service process can update the configuration in real time by retrieving the local service process, shared memory, and three-level storage of configuration files, which improves operation efficiency and speed. Setting up shared memory enables loading of updated configurations without restarting.

[0076] The embodiment of the present invention also provides a computer device, such as Figure 5 As shown, the computer device may include a processor 501 and a memory 502, wherein the processor 501 and the memory 502 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0077] The processor 501 may be a central processing unit (CPU). The processor 501 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0078] The memory 502 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the gateway configuration loading method or the gateway configuration acquisition method in the embodiment of the present invention. The processor 501 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 502, that is, implementing the gateway configuration loading method or the gateway configuration acquisition method in the above method embodiment.

[0079] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 501, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to the processor 501 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0080] The one or more modules are stored in the memory 502, and when executed by the processor 501, the following is performed: Figure 1 or Figure 2 The gateway configuration loading method or gateway configuration obtaining method in the illustrated embodiment.

[0081] For details of the above computer equipment, please refer to Figure 1 or Figure 2 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.

[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0083] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A gateway configuration loading method, It is characterized in that include: Get configuration loading instructions; Parsing the configuration loading instruction to obtain the object to be loaded and the configuration operation; Update the configuration information in the service process cache based on the object to be loaded and the configuration operation; If the service process is a preset external process, then the configuration information in the shared memory is updated based on the object to be loaded and the configuration operation, and the shared memory is a storage space accessible to all processes; Update the configuration file based on the operation type of the object to be loaded; If the configuration information corresponding to the configuration loading instruction is not found in the service process cache and the shared memory, the updated configuration file is read to obtain the configuration information; Cache the acquired configuration information into the shared memory; Sending the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process obtains the updated configuration information in the shared memory for loading; Among them, the external process is to set one of the cache processes in the first layer as an external process, and the external process receives the configuration loading instruction sent from the outside to the gateway. After completing the update of the configuration loading instruction, the external process sends the configuration loading instruction to the service process other than the external process, wherein the configuration loading instruction is obtained by the external process, and other service processes update the loading configuration after receiving the notification; the specific update loading method is that the external process updates the object to be loaded and the configuration operation obtained by parsing the configuration loading instruction to the shared memory of the second layer, and other service processes can obtain the corresponding configuration loading instruction in the shared memory and cache it in the corresponding service process; after updating the operation type of the parsed object to be loaded to the shared memory, the operation type of the object to be loaded is updated to the configuration file of the third layer.

2. The method according to claim 1, It is characterized in that The method further comprises: If the service process is not a preset external process, the cache configuration loading is completed.

3. The method according to claim 1, It is characterized in that The updating of the configuration information in the service process cache based on the object to be loaded and the configuration operation includes: Update the value of the corresponding flag key in the service process cache based on the object to be loaded and the configuration operation; The updated configuration information in the service process cache is obtained based on the updated flag key and the value corresponding to the flag key.

4. The method according to claim 1, It is characterized in that Updating configuration information in the shared memory based on the object to be loaded and the configuration operation includes: Update the value of the corresponding flag key in the shared memory based on the object to be loaded and the configuration operation; The configuration information in the shared memory is updated based on the updated flag key and the value corresponding to the flag key.

5. A gateway configuration acquisition method, It is characterized in that include: Get configuration loading instructions; Based on the configuration loading instruction, determining whether there is a cache configuration corresponding to the configuration loading instruction in the current service process; If there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the current service process; If there is no cache configuration corresponding to the configuration loading instruction, determining whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the shared memory; If there is no cache configuration corresponding to the configuration loading instruction, determining whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file; if there is a cache configuration corresponding to the configuration loading instruction, extracting the cache configuration from the configuration file; If there is no cache configuration corresponding to the configuration loading instruction, an error prompt is returned; The cache configuration in the current service process, shared memory and configuration file is generated by loading using the gateway configuration loading method according to any one of claims 1 to 4.

6. A gateway configuration loading device, It is characterized in that include: A first acquisition module, used to acquire a configuration loading instruction; A parsing module, used to parse the configuration loading instruction to obtain the object to be loaded and the configuration operation; A first updating module, configured to update the configuration information in the service process cache based on the object to be loaded and the configuration operation; A second updating module is used to update the configuration information in the shared memory based on the object to be loaded and the configuration operation if the service process is a preset external process, where the shared memory is a storage space accessible to all processes; A third updating module, used to update the configuration file based on the operation type of the object to be loaded; A reading module, configured to read an updated configuration file to obtain configuration information if configuration information corresponding to the configuration loading instruction is not found in the service process cache and the shared memory; A cache module, used for caching the acquired configuration information into the shared memory; A sending module, used to send the configuration loading instruction to a process other than the preset external process through the preset external process, so that the process other than the preset external process obtains the updated configuration information in the shared memory for loading; Among them, the external process is to set one of the cache processes in the first layer as an external process, and the external process receives the configuration loading instruction sent from the outside to the gateway. After completing the update of the configuration loading instruction, the external process sends the configuration loading instruction to the service process other than the external process, wherein the configuration loading instruction is obtained by the external process, and other service processes update the loading configuration after receiving the notification; the specific update loading method is that the external process updates the object to be loaded and the configuration operation obtained by parsing the configuration loading instruction to the shared memory of the second layer, and other service processes can obtain the corresponding configuration loading instruction in the shared memory and cache it in the corresponding service process; after updating the operation type of the parsed object to be loaded to the shared memory, the operation type of the object to be loaded is updated to the configuration file of the third layer.

7. A gateway configuration acquisition device, It is characterized in that include: The second acquisition module is used to acquire the configuration loading instruction; A first judgment module is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the current service process based on the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the current service process; A second judgment module is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the shared memory if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the shared memory; A third judgment module is used to judge whether there is a cache configuration corresponding to the configuration loading instruction in the configuration file if there is no cache configuration corresponding to the configuration loading instruction; if there is a cache configuration corresponding to the configuration loading instruction, extract the cache configuration from the configuration file; An error prompt module, used for returning an error prompt if there is no cache configuration corresponding to the configuration loading instruction; The cache configuration in the current service process, shared memory and configuration file is generated by loading using the gateway configuration loading method according to any one of claims 1 to 4.

8. A computer device, It is characterized in that include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the steps of the gateway configuration loading method as described in any one of claims 1 to 4 or the gateway configuration acquisition method as described in claim 5.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the gateway configuration loading method according to any one of claims 1 to 4 or the gateway configuration obtaining method according to claim 5 are implemented.