Service update method, device, computer equipment and storage medium

By configuring the plug-in manager and business flow plug-in at the CDN edge node, detecting and loading the updated business flow plug-in, the problems of high complexity of CDN service updates and waste of resources are solved, and unaware efficient updates are achieved, improving user experience and service performance.

CN120281649BActive Publication Date: 2025-09-05CHINA TELECOM CLOUD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510742949.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-05
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

The existing CDN service update mechanism has problems such as high complexity, high risk of service interruption, and serious resource waste and performance impact.

Method used

By configuring the plug-in manager and business flow plug-in at the edge node, using the plug-in manager to detect the update of the business flow plug-in, and loading the updated business flow plug-in when an update is detected, an unaware service update is achieved.

Benefits of technology

It realizes efficient and reliable CDN service updates, narrows the update scope, reduces resource usage, improves update speed and user experience, avoids long connection interrupts, and ensures service processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281649B_ABST
    Figure CN120281649B_ABST
Patent Text Reader

Abstract

The present application relates to a service update method, device, computer equipment and storage medium, and relates to the field of cloud computing technology. The method is applied to an edge node in a content distribution network, and the edge node is configured with at least a plug-in manager and at least one business flow plug-in; the method includes: detecting the business flow plug-in through the plug-in manager and obtaining the detection result; the business flow plug-in is used to provide content distribution network services; if the detection result is that there is an update, the updated business flow plug-in is loaded through the plug-in manager; the updated business flow plug-in is used to provide the updated content distribution network service. The use of this method will not affect the online business in use, will not affect user perception, and will not cause performance impact on the host where the service is located. It is efficient, reliable, business-lossless and resource-friendly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a service update method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the development of Internet technology, users' demand for fast and stable access to website content continues to grow, and website operators have an urgent need to reduce server load, save bandwidth costs and improve user experience. CDN (Content Delivery Network) has been widely used.

[0003] As a bridge between users and websites, CDN is shouldering more and more demands, such as user access authentication, IP blocking, and response content modification.

[0004] When customers request new features, CDN services must be upgraded or updated, significantly increasing the complexity of CDN operations and maintenance and the risk of service interruptions. However, current CDN service update mechanisms have limitations, making efficient and reliable CDN service updates a pressing issue. Summary of the Invention

[0005] Based on this, it is necessary to provide an efficient and reliable service update method, device, computer equipment and storage medium to address the above technical problems.

[0006] The present application provides a service update method, which is applied to an edge node in a content distribution network, wherein the edge node is configured with at least a plug-in manager and at least one service flow plug-in; the method comprises:

[0007] Detecting the service flow plug-in through the plug-in manager and obtaining a detection result; the service flow plug-in is used to provide a content distribution network service;

[0008] When the detection result indicates that an update exists, the updated service flow plug-in is loaded through the plug-in manager; the updated service flow plug-in is used to provide an updated content distribution network service.

[0009] In one embodiment, the edge node is further configured with a coroutine manager, which is used to create a coroutine in the user space of the edge node; wherein the detecting the business flow plug-in by the plug-in manager and obtaining the detection result includes:

[0010] In the case where the coroutine calls the plug-in manager, the plug-in manager detects the business flow plug-in and obtains the detection result; and / or,

[0011] The plug-in manager detects the service flow plug-in according to a preset period and obtains the detection result.

[0012] In one embodiment, the edge node stores a plug-in library, which is used to store the service flow plug-in; wherein the detecting the service flow plug-in and obtaining the detection result includes:

[0013] Obtain the latest version information of the business flow plug-in from the plug-in library;

[0014] If the latest version information is different from the version information stored in the plug-in manager, determining that the detection result is that an update exists;

[0015] When the latest version information is identical to the version information stored in the plug-in manager, it is determined that the detection result is that no update exists.

[0016] In one embodiment, the edge node is further configured with an event scheduler; wherein, before the coroutine calls the plug-in manager, the method further includes:

[0017] Receive a network request sent by a client through the event scheduler;

[0018] Calling the client's coroutine through the coroutine manager;

[0019] A task entity is created according to the network request by the client's coroutine, so as to call the plug-in manager in the task entity.

[0020] In one embodiment, the edge node is further configured with an event scheduler, and the event scheduler is used to receive a network request sent by a client; after loading the updated business flow plug-in through the plug-in manager, the method further includes:

[0021] Creating a service flow according to the network request through the updated service flow plug-in, performing service processing within the service flow and generating a response result;

[0022] The response result is sent to the client through the event scheduler.

[0023] In one embodiment, the method further comprises:

[0024] In the case where the service flow is created by the updated service flow plug-in, increasing the service flow count value of the updated service flow plug-in by one;

[0025] When the service flow processing is completed and the client is disconnected from the edge node, the service flow count value of the updated service flow plug-in is reduced by one; wherein,

[0026] When the service flow count value of the service flow plug-in is 0, the service flow plug-in is recycled.

[0027] In one embodiment, the edge node is further configured with a network communication agent, and the performing of service processing within the service flow and generating a response result includes:

[0028] In a case where the service flow interacts with the content distribution network, sending the network request to the event scheduler through the network communication agent;

[0029] The network request is sent to the content distribution network through the event scheduler, and a response result sent by the content distribution network is received.

[0030] The present application provides a service update device, which is applied to an edge node in a content distribution network. The edge node is configured with at least a plug-in manager and at least one service flow plug-in. The device includes:

[0031] A detection module, configured to detect the service flow plug-in through the plug-in manager and obtain a detection result; the service flow plug-in is configured to provide a content distribution network service;

[0032] The loading module is used to load the updated service flow plug-in through the plug-in manager when the detection result shows that there is an update; the updated service flow plug-in is used to provide the updated content distribution network service.

[0033] The present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0034] The present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method when executed by a processor.

[0035] The above-mentioned service update method, device, computer equipment and storage medium are applied to the edge node in the content distribution network. By configuring at least a plug-in manager and at least one business flow plug-in on the edge node, the edge node detects the business flow plug-in through the plug-in manager and obtains the detection result. When the detection result is that there is an update, the updated business flow plug-in is loaded through the plug-in manager. This method encapsulates the business functions associated with the service separately in the business flow plug-in, and encapsulates other functions outside the business flow plug-in. Based on this, in the scenario where the content distribution network service is updated or upgraded, by building and deploying the updated business flow plug-in, and loading the updated business flow plug-in through the plug-in manager, the content distribution network is updated. Since other functions such as data transmission and reception and coroutine scheduling are relatively fixed and do not require frequent upgrades, updating the business flow plug-in means realizing service updates, which greatly narrows the update scope, reduces resource usage, and does not require the introduction of additional backup resources, thereby improving the service update speed and not affecting the service processing performance. In addition, the method detects the business flow plug-in through the plug-in manager to realize the update detection of the business flow plug-in, and when it is detected that there is an update to the business flow plug-in, the updated business flow plug-in is loaded through the plug-in manager. In this way, when the service is updated, the newly created connection will use the updated business flow plug-in, and the existing long connection request will still use the previous business flow plug-in, so that the existing connection will not be affected by the service update, so that the client will not perceive the service update, realizing a senseless update and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A diagram of an application environment using backup resources for service updates;

[0037] Figure 2 This is another application environment diagram that uses backup resources for service updates;

[0038] Figure 3 This is another application environment diagram that uses backup resources for service updates;

[0039] Figure 4 This is a diagram of an application environment that uses master-slave processes for service updates;

[0040] Figure 5 This is an application environment diagram of a service update method in one embodiment;

[0041] Figure 6 Schematic diagram of a flow chart of a service updating method in one embodiment;

[0042] Figure 7 A diagram illustrating an application environment of a service updating method according to another embodiment;

[0043] Figure 8 A flowchart of a service updating method according to another embodiment;

[0044] Figure 9 1 is a flow chart of a service updating method in another embodiment;

[0045] Figure 10 It is a structural block diagram of a service updating device in one embodiment;

[0046] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0048] As internet users demand faster and more stable access to website content, and website operators strive to reduce server pressure, save bandwidth costs, and improve user experience, more and more websites are turning to CDN acceleration. As a bridge between users and websites, CDNs are shouldering a growing number of demands, such as user access authentication, IP blocking, and responding to content modifications. As customers submit new requirements, new features must be added to the CDN, leading to frequent CDN service upgrades. To prevent frequent service updates from impacting user access, related technologies primarily utilize the following three methods to update content delivery network services.

[0049] Method 1: Introduce backup resources, such as Figures 1 to 3 As shown, when updating the CDN service, the original request is transferred to the CDN backup service node or other service nodes in the cluster through the CDN service proxy. After the service update is completed, the CDN service proxy switches the user request back from the CDN backup service node. This approach has the following disadvantages: If a dedicated backup server is used to take over the service when the online server is upgraded, there will be a waste of resources, and most of the time it will be idle. If a cluster is built without a backup server to handle requests, when one server in the cluster is upgraded, other servers will share the requests, which will increase the service pressure on other servers. These servers may not have a local cache of the requested resources, and the pressure on the origin server will also increase. If there is a persistent connection between the user and the CDN service, the upgrade will cause the persistent connection to be interrupted; for example, if the user is watching a live broadcast, this will affect the viewing experience and service experience.

[0050] Method 2: CDN service process adopts master-slave mode, such as Figure 4As shown in the figure, the master process creates multiple slave processes to receive user requests. When a service is upgraded, the master process loads the latest service content and creates a new slave process to inherit the master process. The new slave process receives new requests, while the old slave process stops accepting new requests. When the old slave process finishes processing requests, the system resources occupied by the old slave process are reclaimed. This approach avoids the aforementioned resource waste because it updates a single process without requiring a backup server. It also eliminates the issue of increased pressure on the origin server due to local cache invalidation during service updates. However, it does have the following disadvantages: When both new and old slave processes coexist, memory usage doubles, and CPU utilization increases. In extreme cases, this can lead to CPU (Central Processing Unit) surges and insufficient system memory, resulting in an out-of-memory (OOM) event. The operating system may mistakenly terminate the highest-memory-consuming process, impacting other processes. If users have persistent connections to the CDN service, the old slave process cannot be terminated, consuming system resources for a long time. Forcing a slave process to terminate will cause user connections to be disconnected, impacting active services.

[0051] Method 3: The CDN service process uses a combination of statically compiled and scripting languages, implementing business logic in the scripting language. Since the scripting language is an interpreted language and works out-of-the-box, service updates can simply load new script files. While this method avoids the upgrade issues encountered in Methods 1 and 2 above, it also has the following disadvantages: Because scripting languages ​​are interpreted, their execution efficiency is far lower than that of statically compiled languages. The upper limit of requests they can process is limited. For example, both nginx and openresty are network proxy programs used by CDNs. Nginx is implemented purely in the C programming language, while openresty is implemented in C and the Lua scripting language, with business logic implemented in Lua scripts. Openresty's processing performance is several times slower than nginx. Consequently, to process the same number of requests, a scripting language implementation requires more host resources than a static language implementation.

[0052] In response to the limitations of the above-mentioned service upgrades, this application proposes a service update method, device, computer equipment and storage medium, which can achieve rapid updates of CDN services without affecting business and user perception, occupying very small resources, and is efficient, reliable, lossless and resource-saving.

[0053] The service update method provided in the embodiment of the present application can be applied to Figure 5In the application environment shown, the client can communicate with the content delivery network (CDN) via the network. A content delivery network (CDN) is a distributed network service architecture consisting of multiple edge nodes distributed across data centers around the world. The primary purpose of a CDN is to accelerate the delivery of static and dynamic content to users worldwide, improving user experience while reducing the load and bandwidth consumption on origin servers. When a user requests a resource located on a CDN, the CDN routes the request to the nearest edge node based on the user's geographic location. This node caches and serves the requested content. If the edge node does not cache the requested content, it requests it from the origin server, caches the content, and serves it to the user, while also updating its cache for subsequent requests. In embodiments of the present application, content delivery network services can be provided to users via edge nodes. Furthermore, the client can be, but is not limited to, a terminal device. Terminal devices can include various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices can include smart watches, smart bracelets, and head-mounted devices.

[0054] In some embodiments, a service update method is provided, which is applied to Figure 5 The edge node of the content delivery network shown in the figure is used as an example. The edge node is configured with at least a plug-in manager and at least one service flow plug-in. Exemplarily, the plug-in manager and service flow plug-in are implemented using statically compiled languages, including but not limited to C and C++. This reduces host resources and improves processing performance compared to using interpreted languages.

[0055] The following combination Figure 5 and Figure 6 , the service update method is introduced, and the method includes the following steps.

[0056] S602: Detect the service flow plug-in through the plug-in manager and obtain the detection result.

[0057] S604: If the detection result indicates that an update exists, the updated service flow plug-in is loaded through the plug-in manager.

[0058] The service flow plug-in is used to provide content delivery network services. The updated service flow plug-in is used to provide updated content delivery network services.

[0059] A service flow plug-in can be understood as the primary vehicle for CDNs to provide external services. In this application, the frequently changing business components of a function can be abstracted into a service flow plug-in, allowing the business process to be implemented within the plug-in. When a service is updated, only the service flow plug-in needs to be updated. In other words, a new service flow plug-in can be created based on service upgrade requirements and deployed on edge nodes, without requiring an update to the plug-in manager.

[0060] In applications, corresponding service flow plug-ins can be created based on the type of content distribution network service and deployed on each edge node. For example, different service flow plug-ins are used to provide different types of content distribution network services. These services include, but are not limited to, access authentication, frequency verification, and any other services, which are not specifically defined here.

[0061] The plugin manager manages service flow plugins. It forwards tasks to service flow plugins for processing. It serves as a bridge between tasks and service flow plugins. Tasks are determined based on network requests sent by clients. Within applications, the plugin manager can invoke the corresponding service flow plugin based on tasks and provide content delivery network services through the service flow plugins.

[0062] The detection result indicates whether the business flow plug-in has been updated. The detection results include "yes" and "no." If the detection result indicates "yes," it indicates that the business flow plug-in has been updated or upgraded. This means that an updated business flow plug-in has been newly deployed in the edge node. In this case, the updated business flow plug-in can be loaded through the plug-in manager, allowing the plug-in manager to call the updated business flow plug-in. If the detection result indicates "no update," it indicates that the business flow plug-in has not been updated or upgraded.

[0063] In an application, a plugin manager and a service flow plugin can be deployed on edge nodes based on service proxy requirements. The service flow plugin can then be loaded through the plugin manager. When an edge node receives a network request from a client, it creates a corresponding task, and the plugin manager invokes the corresponding service flow plugin based on the task to provide the client with the corresponding content delivery network service. If a service upgrade is required, an updated service flow plugin can be built and deployed on the edge node. The plugin manager can check the service flow plugin on the edge node to see if it has been updated. If so, the plugin manager loads the updated service flow plugin. Based on this, when the edge node receives a new network request from a client, the plugin manager invokes the updated service flow plugin to provide the client with the updated content delivery network service, thus satisfying the service upgrade requirement. Furthermore, the edge node continues to execute the corresponding business logic for the created task (or established persistent connection) through the service flow plugin, ensuring that the client's persistent connection is not disconnected due to the service update. This ensures that the client is unaware of the service update, achieving a seamless update and improving the user experience. If the detection result shows that there is no update, when the edge node receives a new network request sent by the client, the plug-in manager calls the service flow plug-in to provide the client with a content distribution network.

[0064] The service update method provided in the above embodiment is applied to the edge node in the content distribution network. By configuring at least a plug-in manager and at least one business flow plug-in for the edge node, the edge node detects the business flow plug-in through the plug-in manager and obtains the detection result. When the detection result is that there is an update, the updated business flow plug-in is loaded through the plug-in manager. This method encapsulates the business functions associated with the service in the business flow plug-in separately, and encapsulates other functions outside the business flow plug-in. Based on this, in the scenario where the content distribution network service is updated or upgraded, by building and deploying the updated business flow plug-in, and loading the updated business flow plug-in through the plug-in manager, the content distribution network is updated. Since other functions such as data transmission and reception and coroutine scheduling are relatively fixed and do not require frequent upgrades, updating the business flow plug-in means realizing service updates, which greatly narrows the update scope, reduces resource usage, and does not require the introduction of additional backup resources, thereby improving the service update speed and not affecting the service processing performance. Furthermore, this method detects updates to business flow plug-ins through the plug-in manager, enabling update detection. If an update is detected, the plug-in manager loads the updated plug-in. Consequently, when a service is updated, newly created connections use the updated plug-in, while existing persistent connection requests continue to use the previous plug-in (i.e., the old plug-in). This prevents existing connections from being affected by the service update, preventing clients from noticing the service update. This seamless update improves the user experience. This method does not impact ongoing online services or user perception, and does not impact the performance of the host hosting the service. It is highly efficient, reliable, service-friendly, and resource-friendly.

[0065] In some embodiments, as Figure 7 As shown, the edge node is also equipped with a coroutine manager. Exemplarily, the coroutine manager is built based on a statically compiled language, including but not limited to C and C++. This reduces host resources and improves processing performance compared to using an interpreted language.

[0066] The coroutine manager is used to create coroutines in user space on edge nodes. Different coroutines are independent of each other, and each coroutine corresponds to a client that establishes a persistent connection with the content distribution network. Multiple network requests sent by the same client during the same persistent connection can share the same coroutine. If a client loses connection with the content distribution network, the coroutine manager can be used to deregister the client's corresponding coroutine.

[0067] Coroutines, also known as microthreads or fibers, have lower context switching overhead than processes or threads because they are scheduled in user space (or user mode), without requiring intervention from the operating system kernel. A process is a running execution unit in a computer. It contains all the resources and state information required to run a program, such as memory, file descriptors, and open network connections. Each process has a unique process identifier (PID) and exists as an independent execution environment in the operating system. In an application, the coroutine manager can create a coroutine in the user space of an edge node when it receives a connection request from a client.

[0068] It should be noted that this application uses the coroutine scheduler to create coroutines rather than threads. The main reason is that threads are created and destroyed by the operating system kernel. If a thread is created for each request, a large number of requests will exhaust the host's resources. Coroutines, on the other hand, are created and destroyed in user space, without the involvement of the operating system kernel. This avoids frequent context switching between kernel and user space, and overall consumes very few resources.

[0069] In the application, the coroutine can encapsulate the connection request as a task entity and call the plug-in manager to execute the task to enable the client to establish a connection with the content distribution network (such as a long connection); after the connection is established, the client can send a network request to the edge node, and the edge node can call the coroutine to call the plug-in manager, and the plug-in manager calls the corresponding business flow plug-in to provide content distribution network services to the client.

[0070] Among them, S602, detecting the business flow plug-in through the plug-in manager and obtaining the detection results, includes the following steps: when the coroutine calls the plug-in manager, detecting the business flow plug-in through the plug-in manager and obtaining the detection results; and / or, detecting the business flow plug-in through the plug-in manager according to a preset period and obtaining the detection results.

[0071] Based on the above, when the coroutine calls the plug-in manager, it indicates that the edge node has received a network request (including a connection request) sent by the client. That is, the plug-in manager needs to call the business flow plug-in to provide content distribution network services for the client. Therefore, before calling the business flow plug-in, the plug-in manager can detect the business flow plug-in to determine whether there is an update to the business flow plug-in.

[0072] In addition, you can pre-register periodic tasks and periodically check the update status of the business flow plug-in through the plug-in manager. The preset period is pre-set and can be set according to the actual scenario and business needs, and is not limited here.

[0073] It should be noted that in actual applications, the plug-in manager can detect the update status of the business flow plug-in when called by the coroutine, and the plug-in manager can also detect the update status of the business flow plug-in at fixed intervals. At least one of these two methods can be selected according to the specific scenario to trigger the plug-in manager to detect the business flow plug-in.

[0074] In the service update method provided by the above embodiment, the plug-in manager can dynamically judge and instantly load the updated business flow plug-in in the created coroutine content part, so that the edge node can complete the update of the business flow plug-in in a timely manner, and provide the user with an updated content distribution network service through the updated business flow plug-in; in addition, the plug-in manager can periodically detect the business flow plug-in, so that the plug-in manager can actively detect whether the business flow plug-in has been updated, and load the updated business flow plug-in in time when an update is detected, so as to provide the user with an updated content distribution network service through the updated business flow plug-in, thereby improving the user experience.

[0075] In some embodiments, the edge node stores a plug-in library (such as a lib library), which is used to store business flow plug-ins. The plug-in library can be built based on a static compiled language. In the application, the business functions can be encapsulated in the business flow plug-in according to the service proxy requirements or service update requirements provided by the content distribution network, and stored in the plug-in library. The plug-in manager can open the plug-in library by calling a function (such as dlopen) to load the business flow plug-in. In the application, when the service is updated, a new plug-in library can be deployed on the edge node. The new plug-in library can be used to store the updated business flow plug-in; or the updated business flow plug-in can be directly deployed directly to the existing plug-in library. The use of a plug-in library can greatly improve development efficiency, reduce development time and workload, and help maintain code consistency and reliability. It also has fast read and write speeds and occupies little resource space.

[0076] Based on the above, S202, detecting the business flow plug-in and obtaining the detection result may include the following steps: obtaining the latest version information of the business flow plug-in from the plug-in library; when the latest version information is different from the version information stored by the plug-in manager, determining that the detection result is that there is an update; when the latest version information is the same as the version information stored by the plug-in manager, determining that the detection result is that there is no update.

[0077] Version information can be used to identify the development iteration status, feature set, compatibility, and fixed issues of a business flow plug-in. Exemplarily, the version information may include a version number identifier that uniquely identifies the version of the business flow plug-in. In an application, when building or updating a business flow plug-in, the plug-in library can correspondingly update or record the version information of the business flow plug-in in the plug-in library on the edge node. Correspondingly, the plug-in manager can store the version information of loaded business flow plug-ins. Based on this, the plug-in manager can obtain the latest version information of the business flow plug-in from the plug-in library and compare it with the internally stored version information. If the latest version information differs from the version information stored by the plug-in manager, it indicates that the business flow plug-in in the plug-in library has changed. In this case, the detection result is determined to be an update. If the latest version information is the same as the version information stored by the plug-in manager, it indicates that the business flow plug-in in the plug-in library has not changed. In this case, the detection result is determined to be an update. In this way, by detecting the version information of the business flow plug-in, the update status of the business flow plug-in is detected.

[0078] Please continue reading Figure 7 In some embodiments, the edge node is also configured with an event scheduler. Exemplarily, the coroutine manager is constructed using a statically compiled language, including but not limited to C and C++. This reduces host resources and improves processing performance compared to using interpreted languages. The event scheduler is the data flow processing center, responsible for collecting and scheduling network events, and for transmitting and receiving data to and from the client.

[0079] Network events can be obtained based on network requests sent by clients. Network events refer to notifications of state changes or operation completions on a network connection in an asynchronous programming model. These events include, but are not limited to, connection establishment, network data being readable, data being written to the network, and connection closure.

[0080] Based on the above, before the coroutine calls the plugin manager, the service update method also includes the following steps: receiving the network request sent by the client through the event scheduler; calling the client's coroutine through the coroutine manager; and creating a task entity based on the network request through the client's coroutine, which then calls the plugin manager within the task entity. This allows service updates to be processed within the existing coroutine without creating new processes or threads, which in turn prevents a surge in local resource usage, thus saving resources and improving service processing performance.

[0081] In the application, the edge node can receive network requests sent by the client, convert the network requests into network events, collect the network events corresponding to the network requests through the event scheduler, and schedule and process the network events. When the edge node receives a connection request from the client, the event scheduler creates a coroutine by calling the coroutine scheduler, and the coroutine encapsulates the connection request as a task entity, and calls the plug-in manager to execute the task to connect the client to the content distribution network; after the client establishes a connection with the content distribution network, when the edge node receives a network request from the client, the event scheduler calls the client's coroutine and calls the plug-in manager within the coroutine to provide the client with content distribution network services.

[0082] Please continue reading Figure 7 In some embodiments, the edge node is further configured with an event scheduler, which is used to receive network requests sent by the client. For an introduction to the event scheduler, please refer to the relevant content above and will not be repeated here. Based on this, after loading the updated business flow plug-in through the plug-in manager, the service update method further includes the following steps: using the updated business flow plug-in, creating a business flow based on the network request, performing business processing within the business flow, and generating a response result; and sending the response result to the client via the event scheduler.

[0083] The business flow plug-in can be used to create a business flow based on the received network request, and complete the complete business logic within the business flow, such as access authentication, frequency verification, etc., and generate a response result corresponding to the network request, so as to forward the response result to the client through the event scheduler, thereby providing the client with the corresponding content distribution network service. Among them, one network request can correspond to one business flow. In this way, the event scheduler interacts with the client, and the event scheduler calls the coroutine, which calls the plug-in manager, and the plug-in manager calls the corresponding business flow plug-in, so that the business flow plug-in creates a business flow and performs business processing according to the network request, thereby providing content distribution network services.

[0084] In some embodiments, the service update method also includes the following steps: when a business flow is created, the business flow count value of the updated business flow plug-in is increased by one; when the business flow processing is completed and the client is disconnected from the edge node, the business flow count value of the updated business flow plug-in is reduced by one; wherein, when the business flow count value of the business flow plug-in is 0, the business flow plug-in is recycled.

[0085] In the application, each service flow plug-in can increment its service flow count when creating a service flow. Once the service flow is processed and the corresponding client is disconnected from the edge node or content delivery network, the service flow count is decremented. This allows the service flow count to dynamically record the number of service flows currently being processed by each service flow plug-in, enabling real-time monitoring of the services being processed by each service flow plug-in.

[0086] If the service flow count of a service flow plug-in is 0, it indicates that the service flow plug-in is old compared to the updated service flow plug-in. In this case, there are no persistent connections using the old service flow plug-in. Therefore, the service flow plug-in can be recycled or cleared. In subsequent applications, the updated content delivery network service can be provided to the client directly through the updated service flow plug-in. This not only ensures that the user experience is not affected during the service update process, but also improves resource utilization and helps improve processing performance.

[0087] Please continue reading Figure 7 In some embodiments, the edge node is also configured with a network communication agent. Exemplarily, the coroutine manager is constructed using a statically compiled language, including but not limited to C and C++. This reduces host resources and improves processing performance compared to using interpreted languages. The network communication agent is responsible for the interaction between the business flow and the content distribution network, proxying business flow network requests and forwarding them to the event scheduler, which then exchanges data with the client.

[0088] Based on the above, the above steps, performing business processing within the business flow and generating a response result, include the following steps: when the business flow interacts with the content distribution network, sending a network request to the event scheduler through the network communication agent; sending a network request to the content distribution network through the event scheduler, and receiving a response result sent by the content distribution network.

[0089] In the application, complete business logic processing is implemented within the business flow, and a response result is generated, which is then forwarded to the client by the event scheduler. When network interaction is involved within the business flow, the network request can be forwarded to the event scheduler through the network communication agent. When the event scheduler pauses interacting with the network data (no data can be read or the network is blocked and data cannot be written), the current coroutine processing is paused, and the coroutine saves the context information being executed at that time. At the same time, the business flow within the coroutine is also paused. When the network interaction data is restored (the network is readable or writable), the event scheduler resumes the coroutine processing, and the interrupted context information is restored within the coroutine, and the business process processing continues until it is completed. In this way, the business flow plug-in interacts with the content distribution network through the network communication agent, providing technical support for providing content distribution network services to the client, which helps to improve service processing performance.

[0090] In some embodiments, as Figure 8 and Figure 9 As shown, a service update method is provided, which is applied to Figure 7 Taking the application environment shown in the figure as an example, the service update method is introduced.

[0091] like Figure 7 As shown in Figure 1, the edge node is configured with an event scheduler, a coroutine manager, a plug-in manager, a business flow plug-in, and a network communication agent. Among them, the event scheduler, the coroutine manager, the plug-in manager, the business flow plug-in, and the network communication agent are built based on statically compiled languages.

[0092] The event dispatcher is the data flow processing center, responsible for collecting and dispatching network events. Upon receiving a client connection request, it creates a coroutine, which encapsulates the connection request as a task entity and calls the plugin manager to execute the task. The event dispatcher also handles data transmission and reception with the client.

[0093] The coroutine manager is used to manage business flow plug-ins and create a coroutine corresponding to the client when receiving a connection request from the client.

[0094] The plug-in manager is used to forward tasks to the business flow plug-in for processing. It is a bridge for interaction between tasks and business flow plug-ins. It is also used to automatically detect whether the business flow plug-in has been updated internally and automatically load the new version, as well as to recycle old business flow plug-in resources that are no longer in use.

[0095] Service flow plug-ins are the primary vehicle for CDNs to provide external services. CDN service updates primarily involve updating service flow plug-ins. Upon receiving an injection request, service flow plug-ins create independent service flows and implement complete business logic within those flows, such as access authentication and frequency verification. Service flow plug-ins can exist as operating system dynamic library files. Edge nodes can be configured with a plug-in library containing at least one service flow plug-in. When services are updated, edge nodes can be configured with a new version of the plug-in library, which includes at least one new service flow plug-in.

[0096] The network communication agent is responsible for the interaction between the business flow and the network, proxying the business flow network requests and forwarding them to the event scheduler, which then interacts with the client to send and receive data.

[0097] Based on the above, the embodiments of the present application, through appropriate functional division, abstract the most frequently changing business functions into business flow plug-ins. Business processes are implemented in the business flow plug-ins. When the service is updated, only the business flow plug-ins need to be updated. Other modules not related to the business focus on the data flow and scheduling level and do not need to be updated. This minimizes the scope of service updates from an architectural perspective.

[0098] Combine Figures 7 to 9 , the service update method includes the following steps.

[0099] S902: Initialize loading of the service flow plug-in.

[0100] When the CDN service process is initialized, the plug-in manager performs the service flow plug-in initialization.

[0101] S904: Initialize the plug-in library version information.

[0102] The plug-in manager records the plug-in version identifier of each business flow plug-in in the plug-in library. Periodic detection tasks are registered during initialization. After the CDN service process is initialized, it provides external services.

[0103] S906: Send request.

[0104] When a client requests CDN services, each request corresponds to a network event at the underlying operating system level. The event dispatcher then collects these network events. If the connection is new, the event dispatcher creates a new coroutine specifically to handle subsequent requests related to the new connection. Within the coroutine, the connection is encapsulated as a request task entity. Subsequent requests initiated on this connection are mapped to the same request task entity, which internally calls the plugin manager.

[0105] S908: Search for the service flow plug-in corresponding to the request.

[0106] S910: Injection request.

[0107] The plug-in manager determines the corresponding service flow plug-in according to the network request sent by the client and the pre-stored plug-in version number identifier, and injects the request into the service flow plug-in.

[0108] S912: Process the request.

[0109] The business flow plug-in creates a business flow based on the injected request, executes the business logic within the business flow, and obtains the corresponding response result. At the same time, the number of business flows created by the business flow plug-in of this version is recorded plus 1.

[0110] S914: Send response result.

[0111] The event scheduler forwards the response result sent by the business flow plug-in to the client to provide content distribution network services for the client.

[0112] S916: Timing trigger.

[0113] The timer in the edge node triggers the plug-in manager according to a preset period. The plug-in manager scans the update status of the business flow plug-in at regular intervals under the triggering of the timer.

[0114] S918: Detect whether there is a new version of the plug-in library. If not, wait for the next trigger. Otherwise, execute S920.

[0115] S920: Load the new version of the plug-in library.

[0116] A change in the service flow plug-in version indicates an update to the CDN service. You should load the new service flow plug-in version. Since service flow plug-ins typically exist as libraries, opening them with dlopen is very fast and takes up very little resource space. After loading, update the plug-in version identifier to point to the new service flow plug-in.

[0117] S922: Update the plug-in library version information.

[0118] After the plug-in manager loads the new version of the plug-in library, it updates the version information of the business flow plug-in accordingly.

[0119] S924: Search for the new version of the service flow plug-in corresponding to the request.

[0120] S926: Injection request.

[0121] S928: Process the request.

[0122] S930: Send response result.

[0123] After the plug-in manager updates the business flow plug-in version information, if it receives a request sent by the client, i.e. S906, and matches the corresponding new version of the business flow plug-in according to the request, it injects the request into the new version of the business flow plug-in, and the new version of the business flow plug-in processes the request, and the event scheduler sends the corresponding response result to the client to provide the client with the updated content distribution network service.

[0124] It's important to note that complete business logic processing is implemented within a business flow. When network interaction is involved within the business flow, network requests are forwarded to the event scheduler via a network communication proxy. When the event scheduler's interaction with the network is suspended (no data can be read or the network is blocked and data cannot be written), the current coroutine is paused, and the coroutine retains the context information currently executing. The business flow within the coroutine is also paused. When network interaction resumes (network readability or writability), the event scheduler resumes the coroutine, restores the interrupted context information within the coroutine, and resumes the business flow.

[0125] After the business process is processed, if the client closes the connection, the number of business flows created by the business flow plug-in of the corresponding version will be reduced by 1. If the version is not equal to the plug-in version identifier, it means it is a historical version. When the historical version no longer processes requests (the corresponding number of business flows is 0), the resources occupied by the historical version plug-in are reclaimed.

[0126] As can be seen above, during a service upgrade, no additional system resources are allocated, and no additional processes or threads are created. Instead, the new version of the business flow plugin is dynamically determined and instantly loaded within the already created coroutine, resulting in negligible resource consumption. Client persistent connections are not disconnected during the upgrade; they continue to use the previous version of the plugin. This makes the service upgrade completely invisible to clients, and does not impact their user experience.

[0127] The service update method provided in the embodiments of the present application configures an event scheduler, a coroutine manager, a plug-in manager, a business flow plug-in, and a network communication agent on the edge node. This division clearly defines the responsibilities of each module. Modules other than the business flow plug-in, including the event scheduler, coroutine manager, plug-in manager, and network communication agent, focus on network data transmission and reception and coroutine scheduling. These functions are relatively fixed and do not require frequent upgrades. Given the frequent updates to CDN services online, service-related business functions are encapsulated separately in the business flow plug-in. Service upgrades only require upgrading the business flow plug-in. This significantly reduces the scope of the upgrade and minimizes resource usage during the upgrade, eliminating the need for additional backup resources. Furthermore, service updates are processed within existing coroutines, without creating new processes or threads, preventing a surge in local resource usage. Furthermore, this method encapsulates each client request within a coroutine, making each coroutine independent. When a service is updated, newly created connections use the new version of the business flow plug-in, while existing persistent connection requests continue to use the previous version of the business flow plug-in. This prevents existing connections from being affected by the upgrade, leaving the client completely unaware. Moreover, when executed on a single machine, no additional processes will be created during service upgrades, thus saving resources and avoiding the problem of soaring CPU and memory usage.

[0128] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0129] Based on the same inventive concept, embodiments of the present application also provide a service update device for implementing the aforementioned service update method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more service update device embodiments provided below can be found in the aforementioned limitations on the service update method and will not be further elaborated here.

[0130] In some embodiments, as Figure 10As shown, a service update device 1000 is provided, which is applied to an edge node in a content delivery network. The edge node is configured with at least a plug-in manager and at least one service flow plug-in. The service update device 1000 includes a detection module 1001 and a loading module 1002. The detection module 1001 is configured to detect the service flow plug-in through the plug-in manager and obtain the detection result. The service flow plug-in is used to provide content delivery network services. The loading module 1002 is configured to load the updated service flow plug-in through the plug-in manager if the detection result indicates that an update is available. The updated service flow plug-in is used to provide the updated content delivery network services.

[0131] In some embodiments, the edge node is further configured with a coroutine manager, which is used to create a coroutine in the user space of the edge node. The detection module is further configured to, when the coroutine calls the plug-in manager, detect the business flow plug-in through the plug-in manager and obtain the detection result; and / or, to detect the business flow plug-in through the plug-in manager according to a preset period and obtain the detection result.

[0132] In some embodiments, the edge node stores a plug-in library, which is used to store business flow plug-ins; wherein the detection module is also used to obtain the latest version information of the business flow plug-in from the plug-in library; when the latest version information is different from the version information stored by the plug-in manager, the detection result is determined to be that there is an update; when the latest version information is the same as the version information stored by the plug-in manager, the detection result is determined to be that there is no update.

[0133] In some embodiments, the edge node is further configured with an event scheduler. The service update device further includes a receiving module, a calling module, and a creating module. The receiving module is configured to receive a network request sent by a client via the event scheduler. The calling module is configured to call the client's coroutine via the coroutine manager. The creating module is configured to create a task entity based on the network request via the client's coroutine, thereby invoking the plugin manager within the task entity.

[0134] In some embodiments, the edge node is further configured with an event scheduler for receiving network requests sent by the client. The service update device further includes a creation module and a sending module. The creation module is configured to use the updated service flow plug-in to create a service flow based on the network request, perform service processing within the service flow, and generate a response result; the sending module is configured to send the response result to the client via the event scheduler.

[0135] In some embodiments, the service update device further includes a counting module and a recycling module. The counting module is configured to increment a service flow count of the updated service flow plug-in by one when a service flow is created using the updated service flow plug-in. The recycling module is configured to decrement the service flow count of the updated service flow plug-in by one when the service flow processing is completed and the client is disconnected from the edge node. The recycling module is configured to recycle the service flow plug-in when the service flow count of the service flow plug-in reaches 0.

[0136] In some embodiments, the edge node is further configured with a network communication agent. The service update device further includes a sending module, which is configured to send a network request to the event scheduler via the network communication agent when the service flow interacts with the content distribution network; send the network request to the content distribution network via the event scheduler, and receive a response from the content distribution network.

[0137] Each module in the above-mentioned service update device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0138] In some embodiments, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 11 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a service update method.

[0139] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0140] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the aforementioned method when executing the computer program.

[0141] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the aforementioned method are implemented.

[0142] In some embodiments, a computer program product is provided, comprising a computer program, which implements the steps of the aforementioned method when executed by a processor.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0144] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0145] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A service update method, characterized in that: The method is applied to an edge node in a content distribution network, wherein the edge node is configured with at least a plug-in manager, at least one service flow plug-in, and an event scheduler; the event scheduler is used to receive a network request sent by a client; and the method comprises: Detecting the service flow plug-in through the plug-in manager and obtaining a detection result; the service flow plug-in is used to provide a content distribution network service; If the detection result indicates that an update exists, loading an updated service flow plug-in through the plug-in manager; the updated service flow plug-in is used to provide an updated content distribution network service; Creating a service flow according to the network request through the updated service flow plug-in, performing service processing within the service flow and generating a response result; Sending the response result to the client through the event scheduler; In the case where the service flow is created by the updated service flow plug-in, increasing the service flow count value of the updated service flow plug-in by one; When the service flow processing is completed and the client is disconnected from the edge node, the service flow count value of the updated service flow plug-in is reduced by one; wherein, When the service flow count value of the service flow plug-in is 0, the service flow plug-in is recycled.

2. The method according to claim 1, characterized in that The edge node is further configured with a coroutine manager, which is used to create a coroutine in the user space of the edge node; wherein the detecting the business flow plug-in by the plug-in manager and obtaining the detection result includes: In the case where the coroutine calls the plug-in manager, the plug-in manager detects the business flow plug-in and obtains the detection result; and / or, The plug-in manager detects the service flow plug-in according to a preset period and obtains the detection result.

3. The method according to claim 2, characterized in that The edge node stores a plug-in library, which is used to store the service flow plug-in. The detecting of the service flow plug-in and obtaining the detection result includes: Obtain the latest version information of the business flow plug-in from the plug-in library; If the latest version information is different from the version information stored in the plug-in manager, determining that the detection result is that an update exists; When the latest version information is identical to the version information stored in the plug-in manager, it is determined that the detection result is that no update exists.

4. The method according to claim 2, characterized in that The edge node is further configured with an event scheduler; wherein, before the coroutine calls the plug-in manager, the method further includes: Receive a network request sent by a client through the event scheduler; Calling the client's coroutine through the coroutine manager; A task entity is created according to the network request by the client's coroutine, so as to call the plug-in manager in the task entity.

5. The method according to claim 1, wherein The edge node is further configured with a network communication agent, which performs service processing within the service flow and generates a response result, including: In a case where the service flow interacts with the content distribution network, sending the network request to the event scheduler through the network communication agent; The network request is sent to the content distribution network through the event scheduler, and a response result sent by the content distribution network is received.

6. A service updating device, characterized in that: The device is applied to an edge node in a content distribution network, wherein the edge node is configured with at least a plug-in manager, at least one service flow plug-in, and an event scheduler; the event scheduler is used to receive a network request sent by a client; the device includes: A detection module, configured to detect the service flow plug-in through the plug-in manager and obtain a detection result; the service flow plug-in is configured to provide a content distribution network service; A loading module, configured to load an updated service flow plug-in through the plug-in manager if the detection result indicates that an update exists; the updated service flow plug-in is used to provide an updated content distribution network service; A creation module, configured to create a service flow according to the network request using the updated service flow plug-in, perform service processing within the service flow, and generate a response result; A sending module, configured to send the response result to the client via the event scheduler; A counting module is configured to, when the service flow is created by the updated service flow plug-in, increase the service flow count value of the updated service flow plug-in by one; and when the service flow processing is completed and the client is disconnected from the edge node, decrease the service flow count value of the updated service flow plug-in by one; wherein, The recycling module is used to recycle the business flow plug-in when the business flow count value of the business flow plug-in is 0.

7. The device according to claim 6, characterized in that The edge node is also configured with a coroutine manager, which is used to create a coroutine in the user space of the edge node; wherein, the detection module is also used to detect the business flow plug-in through the plug-in manager when the coroutine calls the plug-in manager and obtain the detection result; and / or, detect the business flow plug-in through the plug-in manager according to a preset period and obtain the detection result.

8. The device according to claim 7, characterized in that The edge node stores a plug-in library, which is used to store the business flow plug-in; wherein the detection module is also used to obtain the latest version information of the business flow plug-in from the plug-in library; when the latest version information is different from the version information stored by the plug-in manager, it is determined that the detection result is that an update exists; when the latest version information is the same as the version information stored by the plug-in manager, it is determined that the detection result is that no update exists.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Content distribution network edge node system

    CN112511607A

  • Plug-in updating method and device, electronic equipment and computer readable storage medium

    CN115964061A

  • Application configuration updating method and device and configuration plug-in generation method and device

    CN119645443A